vchelaru / FlatRedBall

Cross-platform 2D game engine focused on ultimate productivity built in .NET
http://flatredball.com
MIT License
403 stars 64 forks source link

Look into supporting Tiled Map Editor .World Files #1439

Open HeadClot opened 3 months ago

HeadClot commented 3 months ago

The Tiled Map Editor Manual should explain what it is better than what I can.

https://doc.mapeditor.org/en/stable/manual/worlds/

vchelaru commented 3 months ago

Practical Discussion

What exactly does supporting world maps mean? Of course, we could recognize the .world extension and load it at runtime, but how should it behave in game? Any specific implementation would require flexibility to support multiple game types. For example, do we want world maps to be similar to sections of the map in a game like Link to the Past and Super Metroid? If so, how should transitions work?

If we do create one large map, then we will likely run into floating point accuracy issues. How do we deal with this?

How does the user interact with the World runtime object? Do the enable and disable chunks? Do they set the camera controlling entity's Map to certain areas to result in transitions?

Technical Discussion

This is a very big issue. Actually reading in .world files is not too complicated because it's a .json file, but there are additional considerations here.

First, should all of the files result in the maps sitting in the world next to each other? Or should this result in some kind of level setup.

If they sit next to each other, should the map scroll freely? Or should we have the CameraControllingEntity set its "Map" bounds to the current map.

If we do have all maps loaded, do we want to have the MapDrawableBatches in memory? If so, we need to support culling an entire map drawable batch when it is off screen so it doesn't cost anything during rendering. If not, does it get loaded and unloaded dynamically? What level of load/unload is acceptable? Removal of the vertex buffer? Removal of the IDRawableBatch?