GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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

RocketBrainRocketBrain Posts: 269Member, PRO

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?

Comments

  • RocketBrainRocketBrain Posts: 269Member, PRO

    Guess its a toughie

  • ArmellineArmelline Posts: 4,746Member, PRO

    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.

  • RThurmanRThurman Posts: 2,821Member, Sous Chef, PRO

    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.

  • RocketBrainRocketBrain Posts: 269Member, PRO

    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.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,913Member

    @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.

Sign In or Register to comment.