#Distribute objects according to heatmap

1 messages · Page 1 of 1 (latest)

real arrow
#

I'm re-working a part of my project, and I'm looking for a better way to do a particular task: I have a heatmap, and I need to generate ~10,000 objects and distribute them accordingly. Right now, the order of operations are:

    1. A list of possible positions is generated
    1. A random number is generated to determine which heat zone the object will be placed in
    1. A random position is grabbed from the earlier list, and the heatmap is checked (Raycast) to check if it's the correct zone
  • If the zone is incorrect, go back to #3
    1. The terrain is checked (Raycast) for various conditions, such as slope steepness, or if there are any other objects already there.
  • If any conditions are met, go back to #3
    1. Go back to #2 and repeat until the required number of objects have been placed
wanton creek
#

Why do you need a raycast to query the heatmap

#

Are you able to save the positions that are in a zone

real arrow
# wanton creek Are you able to save the positions that are in a zone

I've thought about that, but I have concerns about scalability. If I wanted to distribute different objects according to different heatmaps for the same area - like placing different resource nodes - then each position will exist in multiple different lists.
I could put them all in one list, but it'd contain roughly 500,000-1,000,000 entries, since the area being covered is 1km x 1km, minus places where nothing can be placed.

real arrow
wanton creek
#

image as a texture? Pixels?

real arrow
#

The heatmap is a .png file

#

I've applied it as a texture to a plane

wanton creek
#

so read the file?

real arrow
#

...because I don't know how to correlate the coordinates to world position

#

Putting it on an object in the world, raycasting to get the values at that point was the only way I could think of

wanton creek
#

isn't it just the scale x offset