Wednesday, February 28, 2018

architecture - Implementing a 3d tile engine


I have a pretty decent experience with tile based 2d games and I would like to try to create a mixed 3d-2d game. To 3d elements will be very simple (ground, walls and water), all other elements will be 2d sprites drawn onto this 3d map. (I am envisioning something similar to Final Fantasy III for iPad, top down view, always the same angle)


Now, here is my question: What are the technical aspects of implementing a 3d tile engine? Are there some good examples on how to do this? Basically I would like to create the maps the same way that I would do in a 2d tile based game.



Answer



It's actually quite similar to a 2D tile engine. You need to create the level somehow (i.e.: procedural generation or a map saved into a file that you created in an editor). Then you need to read that data, create the tiles and transform them to the appropriate locations and rotations. Draw only the tiles or polygons that are visible on screen (frustum culling) to keep the performance snappy.



Depending on whether your play area includes tiles at varying heights, you will need to find a solution for defining the collision bounds of the floor, walls, and platforms. Include collision data in each tile or, better yet, simplify that data and store it elsewhere to enjoy both memory and performance savings.


I hope this answered your question!


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...