Notgames Forum

Creation => Technology => : ghostwheel August 18, 2010, 12:20:03 AM

: Endless Forest/The Path Map Question
: ghostwheel August 18, 2010, 12:20:03 AM
Michaël, I'm curious how you managed the "looping" map. You know how if you go far enough, you come back around on the opposite side of the map, thus giving the impression the forest is "endless?" I can't recall the technical term for it right this moment but it's a great way to avoid having the player bump into an invisible wall. I've been curious about this for a while as it's a trick I'd like to incorporate in my own game.

: Re: Endless Forest/The Path Map Question
: Kjell August 18, 2010, 03:53:28 AM
Assuming your level is at least 4 times as big as your viewing distance, you can use the following technique.

- Split your level in at least 4 pieces*
- Loop the position of your player / camera at the level' dimensions.
- When a level piece is more then half the level size away, move it a "level size" closer ( per axis ).

So for example .. the red player starts moving towards a edge of the level.

Now that he's gotten closer to the edge of the level then the center, the level pieces jump to the other side.

After passing through the level boundary ( green rectangle ) the player ends up on the other side, which makes the level pieces move back into place.

*It is recommended to make each piece slightly bigger then your viewing distance, this will allow you to do some very cheap & efficient clipping.

: Re: Endless Forest/The Path Map Question
: Michaël Samyn August 18, 2010, 10:13:50 AM
We simply zap the player character to the opposite edge of the game world.
And the game world is made up of tiles. To show the first tile when you're on the last one, we use a second camera that is positioned at the other end of the world, relative to the player's position.

For performance, make your tile size as small as possible (meaning, I guess, as small as your viewing distance -with some margin, depending on the scenery). And make sure you never draw more tiles than are visible. This is a bit tricky to figure out, but in a first pass, simply check if the tile is within a certain distance of the player. Later you can refine so that tiles that are behind the camera are not drawn.

In The Endless Forest, we used to have very big tiles. Four tiles for the entire world as it is now. But after research done for The Path, we realized that smaller tiles were much faster. So we cut each tile in four. The forest in The Path is made up of 32 tiles, I think, of which only a maximum of 9 is visible at any moment.

Hope this helps.

: Re: Endless Forest/The Path Map Question
: Pierrec September 03, 2010, 01:32:38 PM
Michaël, I just discovered The Endless Forest (where have I been these paset 5 years?) and this (not)game is astonishing! I wrote a review in french on it, maybe you are interested : (

I'm sorry if this isn't really the subject of the topic, but i didn't want to create one for it, and this was the only one talking about endless forest.


: Re: Endless Forest/The Path Map Question
: Michaël Samyn September 03, 2010, 05:11:17 PM
Thank you!  :)

Sorry, the copyright must be in the template.
Please notify this forum's administrator that this site is missing the copyright message for SMF so they can rectify the situation. Display of copyright is a legal requirement. For more information on this please visit the Simple Machines website.