level repeat

Hey guys,

I was wondering how you program a level/landscape that repeats itself when you reach the end. (Like they did with the landscape in “Insane”)

At first I thought that I could just instantiate the level again when you reach the end. This would work, but then there is still a problem when there is multiplayer involved. (If there is one player at the beginning of a level, and another one at the beginning of the instantiated level… they can’t see each other)

Any clue how game developers do this?

Thanks,
kaaJ

I think the most straightforward way to go is to use a landscape asset as a repeatable “tile” and instantiate new copies of it whenever a player gets near enough to the edge to see over the horizon. Exactly how you manage this depends on the effect you want. If the game world is supposed to have a consistent coordinate space then you will need to keep track of which tiles have been instantiated and where. You could probably use something as simple as a hash table for this - the coordinates of instantiated tiles would be the keys and the values would be references to the tiles.

I might be able to get you started with some code if you can give a bit more detail about what you want to do and how far you have got with it.

Thanks for the reply andeeee, I managed to build al looping level through a simple character replacement.

Now, is there any way to completely clone a GameObject (not just instantiate, because that’s based on a certain timeframe). So when I change parameters of my main object, the clones adapt those changes?

I was just wondering, because you can manually change every parameter on every object off course.

Thanks!
kaaJ

There is no built-in system for having a “master” object which you can change and then see the same change in a group of clones. As you say, though, you can do this from a script just by keeping a list of the objects and setting their values as necessary.

Allright, I’ll try that, thanks for the reply