You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my son had an idea for a 2D game, a kind like RPG, where we can create a world scenario (~1600x900px) by using Tiled editor, tiled layers and tiled maps. So far so good.
Now the idea is to modify the scenario during the game, not only some pixel or small areas which could be done by objects and object layers, but in wide areas, e.g. an animated change of the basic ground floor with 10.000s of pixels on the tiled layer and, save it back to the tmx-file (or another format to load it back later again).
Game situation:
Players can occupy and take over the opponent's lands; this should be indicated in the first step by changing the color of the occupied tiled elements. The development of the lands is represented by other surfaces, hurricans might destroy land and turn into ocean, etc.
How can I access directly to the Tiled Layer and its corresponding Tile Set?
Instead I first tried to create 1600 x 900 single objects to spawn each of them individually, but this is in my opinion not to handle, isn't it?
In other words,
I want to load a world which is generated by using Tiled editor and render it to the gameworld (this can be easily done right now)
Modify the tiled layers (modify the corresponding tilemap element and modify colors and tilemap image at runtime) and draw it back to screen
Save this modification back to disk into a new tmx file
Is this too crazy or to complicated? Or do I missed a simple way to achieve this right now?
Thanks so much.
clas
The text was updated successfully, but these errors were encountered:
This sounds like more of a serialization question, rather than an asset loading one.
Once a .tmx is loaded as entities (game objects), each entity possesses a set of default properties, for example the player to which the tile belongs, the unit placed on that tile, etc. As the game progresses these properties get modified. At the end of the game, these properties can be saved to disk and reloaded as needed.
The algorithm overview might look like this:
load the game level from .tmx
generate entities with default properties
overwrite properties from a game save file if present
Yes I agree fully with yout aproach and I am familliar with handling and creating entities, assigning entities to objects that has been placed on the object layers in Tiled and handling and expanding their properties.
What I now want or beeter need to do is to manipulate the pixels or their tile set that is on the 'tilemap Layer'.
Do I have access directly to the Tiled Layer pixels and its corresponding Tile Set?
Hi, when a .tmx is loaded, it provides a Level object, which stores entities. Each tiled layer that is not an object layer will have an entity associated with it. These entities have their type set to "TiledMapLayer", so you should be able to grab them once loaded.
Their ViewComponent should have only 1 object, which is ImageView, whose image stores your pixels. ImagesKt class gives you the ability to manipulate pixels of any image as needed.
I don't think the tile set information is stored anywhere at runtime after parsing.
Hi Almas, hi everybody,
my son had an idea for a 2D game, a kind like RPG, where we can create a world scenario (~1600x900px) by using Tiled editor, tiled layers and tiled maps. So far so good.
Now the idea is to modify the scenario during the game, not only some pixel or small areas which could be done by objects and object layers, but in wide areas, e.g. an animated change of the basic ground floor with 10.000s of pixels on the tiled layer and, save it back to the tmx-file (or another format to load it back later again).
Game situation:
Players can occupy and take over the opponent's lands; this should be indicated in the first step by changing the color of the occupied tiled elements. The development of the lands is represented by other surfaces, hurricans might destroy land and turn into ocean, etc.
How can I access directly to the Tiled Layer and its corresponding Tile Set?
Instead I first tried to create 1600 x 900 single objects to spawn each of them individually, but this is in my opinion not to handle, isn't it?
In other words,
Is this too crazy or to complicated? Or do I missed a simple way to achieve this right now?
Thanks so much.
clas
The text was updated successfully, but these errors were encountered: