Jump to content

Tilemaps for an overhead game


Nepoxx
 Share

Recommended Posts

Hi everyone,
 
I recently started using Phaser.io and I am truly amazed by it! I studied tilemaps a little bit and read forum posts about them. I am seeking your thoughts on using them to make a "game viewed from above". Something like hotline miami (screenshot). However, the distinction in my case would be that I want to create a very large world, possibly infinite (well, limited by floating point precision and whatnot). Anyhow, I was thinking of creating a cell-based tiling system (similar to how Skyrim works). That is, the cell the player is on, as well a its neighbors would be loaded. When the player travels to a new cell, the new neighbors are loaded, and the old ones discarded.

 

For instance:

QYB1FJb.png

Assuming the player is in cell 1, and moves to cell 6, cells 2, 5 and 7 will be unloaded, and 3 new cell would be loaded.

 

Would a tilemap work for this? What if I want to start adding "levels" (e.g. going down stairs).

 

Any feedback is highly appreciated :D

 

Edit: I forgot to mention that the camera will be locked to the player, the size of a cell will be equal or larger than what fits on screen (unlike the image above).

Link to comment
Share on other sites

Will work very well!

 

I am using the same technique to achieve additional performance boost!

 

This is what i have achieved so far: (sorry for the scar it's a recording software glitch)

 

https://www.youtube.com/watch?v=K8oGU7XEHHU&feature=youtu.be

 

In this posts you will find all insights and CODE EXAMPLES:

 

 

tilemaps rendering:

http://www.html5gamedevs.com/topic/3727-spritebatch-gotchas-performance-issue/

 

loop design for a tilemap game:

http://www.html5gamedevs.com/topic/6691-how-does-pixi-deal-with-items-positioned-off-the-screen/

 

If you have questions or any ideas how to improve the design please follow me on this forum!

 

I really love to exchange knowledge with others!

 

http://www.sevenative.com

Link to comment
Share on other sites

as for adding levels it might be a little bit problematic.

 

Depends what do you mean by levels. If you want to have an illusion of levels like in browserquest there is nothing that you cant do!

 

If you want to have levels like in diablo 2 then you would have to do some additional work.

 

If you are talking about levels like digging deeper into the ground like in minecraft then you would have a ton of work.

 

Please write more about what do you want achieve so we could answer more.

 

http://www.sevenative.com

Link to comment
Share on other sites

I am talking about something like Zelda (a link to the past) when you can take stairs to go up or down. Shouldn't be too difficult.

 

The part where I'm a little bit worried is that I was thinking of "moving the world" instead of "moving the player". What I mean is that my player would be stationary, while the tilemap moves. I'm not too sure if this is possible and if so how. Are the physics still going to work?

Link to comment
Share on other sites

Another question, is it possible to have a tilemap that is not starting at (0,0). For instance, I could have 9 tilemaps, top left, top middle, top right, and so on. Is that possible? I don't see any methods/members to relocate a tilemap

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...