Tables & Spawning a limited amount of actors (reusing on a big map)

Member, PRO Posts: 269

So i'm playing with using a large map that a player can explore. A very large map. I want it to seem infinite but not random. as in if the player turns back around they'll see a similar pattern but i don't want to wrap x & y.

So i'm contemplating using a large table of X&Y coordinates. I know there's got to be a way to calculate what objects to display and where when the actor is "close" but i can't figure it out.

In the object actor i've got it to move properly without moving the player actor so it seems as if the player is moving passed it.

I'd like to not have to spawn thousands and thousands of actors at the same time but rather spawn about 30 in a pattern in a certain area and when the player is moving continuously to one direction simply move the previous actors to the next position. Its complex or maybe i'm making it too complex i don't know.

anybody have any ideas or have done this type of thing?

• Member, PRO Posts: 269

Guess its a toughie

• Member, PRO Posts: 4,917

It's very doable, and would be a fun challenge, and would probably be very effective. That all said, yes, it's not going to be simple. Beyond the scope you're likely to get free help with, unfortunately.

• Member, Sous Chef, PRO Posts: 2,861

How about having each actor track how far it is away from the hero? When it is over a certain distance from the hero, change its X,Y coordinates so that it is now in front of the hero.

• Member, PRO Posts: 269

Only way i can think of doing this is to have the game spawn and fill a table with thousands of coordinates. then have the hero constantly comparing its own coordinates with those in the table. Then somehow a rule that says if your coords are close to value in table then spawn a dog, or a cat for columns 3 & 4, and so forth. that sounds like a lot of calculations that need to be run repeatedly.

• Member Posts: 9,914

@RocketBrain said:
Only way i can think of doing this is to have the game spawn and fill a table with thousands of coordinates. then have the hero constantly comparing its own coordinates with those in the table. Then somehow a rule that says if your coords are close to value in table then spawn a dog, or a cat for columns 3 & 4, and so forth. that sounds like a lot of calculations that need to be run repeatedly.

Yep. This could be a performance lag issue with lots of data. I would do some prototyping first.