Hi construct users,
Here is my attempt to create an isometrical map editor AND engine.
There's no y or Z sorting here, I focused on these thing :
Isometric Map Editor/Engine (IM2E) v0.18 by Pumpkin_head
Basic features
---------------------------------------------------------
- painting tile directly on screen.
- custom map size (disabled here)
- save and load map on file with Array object
- dynamic tile loading while scrolling for optimisation.
---------------------------------------------------------
The last point is where I got on the wrong way.
The editor is only sprite based (I know, i know, sprite is evil :)), so i decided to make a dynamic map streaming system, to improve optimisation.
When you scroll (with mouse or arrow keys) the tiles away from a given range to a special object called the loader, are moved to the opposite position.
For example , if a tile is, let's say, 8 tiles south from the loader, then move that tile 8 tile north, from the loader.
And, it works ! We have the feeling that the map is scrolling, but there's always the same number of tiles on screen. the only thing that move is the tile XY, and the sprite animation is set by their coordinates.
You can try it and paint a few tiles, then scroll to make them dissapear. Go back, and the tiles reappear.
Could have been nice, but the performance is too slow. On my computer, it runs at 40 to 60 fps, which is not acceptable, considering we have only one type of tile.
So why is it useless, can't i make the same thing with a tiledBackground object ? Well, not really. I tried, but my system uses collisions and picking of the the sprites, so even if I made something quite similar it's not working very well. In addition to that the performance gain would be unsignificant. A huge map of 100*100 tiles made of TiledBackground Object runs at 500+ fps, so there's no need for a map streaming....
Anyway it's been a real pleasure to create this on contruct, and I learned a lot while making it ( sprite is memory consuming, not good for static elements). This experience will be helpfull on my other projects :)
You can download the .cap and use it for your own purpose:
dropbox.com/s/qprzt7lt48a4ygk/IM2E_0.18.cap
Any comments are appreciated :)
---------------------------------------------------------
Controls :
Right click : show painting menu, select one tile and paint it on the grey tiles.
R : reset your map
Space : restart layout (buggy)
Ctrl + s : save map
Ctrl + l : load map
arrow keys : scrolling
moving mouse on the application borders : scrolling