I am looking to see what would be a good choice for a game engine for this style of game. Basically a game where I am going to want to generate and save random maps, make a lot of the world destructible (trees, rocks, etc.), allow the player to modify the map, fight monsters and such, and probably a bunch of other smaller mechanics (food / water, health, maybe NPCs, etc.). Bounding volume collision detection with THREE.So I am looking to play around with the idea of building a top down (maybe with isometric styled graphics) 2D survival / crafting / adventure style game (think Terreria / Starbound but top down or Forsaken Isle which would be a much closer example).Building up a basic demo with Pla圜anvas.Building up a basic demo with Babylon.js.Using WebRTC peer-to-peer data channels.
Unreal engine 4 2d top down full#
An alternative method would be to split the tilemap into big sections (like a full map split into 10 x 10 chunks of tiles), pre-render each one off-canvas and then treat each rendered section as a "big tile" in combination with one of the algorithms discussed above. In fast games that might still not be enough. That means that the map only needs to be redrawn on canvas when the scrolling has advanced one full tile - instead of every frame - while scrolling. A better way would be to create a canvas that is 2x2 tiles bigger than the visible area, so there is one tile of "bleeding" around the edges.
One way consists of drawing the section that will be visible off-canvas (instead of the entire map.) That means that as long as there is no scrolling, the map doesn't need to be rendered.Ī caveat of that approach is that when there is a scrolling, that technique is not very efficient. Of course, if the map is large this doesn't really solve the problem - and some systems don't have a very generous limit on how big a texture can be. One simple technique consists of pre-rendering the map in a canvas on its own (when using the Canvas API) or on a texture (when using WebGL), so tiles don't need to be re-drawn every frame and rendering can be done in just one blitting operation. The first approach, as discussed above, is to only draw tiles that will be visible. Usually, some techniques need to be implemented so scrolling can be smooth. The tile atlasĭrawing scrolling tile maps can take a toll on performance. Think about any game that uses regularly repeating squares of background, and you'll probably find it uses tilemaps. Some popular games that use this technique are Super Mario Bros, Pacman, Zelda: Link's Awakening, Starcraft, and Sim City 2000. This set of articles covers the basics of creating tile maps using JavaScript and Canvas (although the same high level techniques could be used in any programming language.)īesides the performance gains, tilemaps can also be mapped to a logical grid, which can be used in other ways inside the game logic (for example creating a path-finding graph, or handling collisions) or to create a level editor. This results in performance and memory usage gains - big image files containing entire level maps are not needed, as they are constructed by small images or image fragments multiple times. Tilemaps are a very popular technique in 2D game development, consisting of building the game world or level map out of small, regular-shaped images called tiles.