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
When loading large maps (let's say 256x256 tiles), the number of entities to handle becomes huge, which cause poor performances.
A solution to this would be to chunk the loading of such a large map and only spawn tiles entities for the subset that we actually use. Fortunatelly, Tiled have a feature called "worlds" which is basically that: a huge map that have been split in smaller ones.
From an implementation point of view, the .world file would be loaded by a dedicated AssetLoader. The Asset would store the path to the maps (.tmx file) as well as their positionning information (which is available in the .world file).
Upon spawning a world, we would then load the maps it contains but only spawn maps that are currently "in use". By moving the camera, we would change which maps are used or not, and spawn / despawn maps accordingly.
When loading large maps (let's say 256x256 tiles), the number of entities to handle becomes huge, which cause poor performances.
A solution to this would be to chunk the loading of such a large map and only spawn tiles entities for the subset that we actually use. Fortunatelly, Tiled have a feature called "worlds" which is basically that: a huge map that have been split in smaller ones.
From an implementation point of view, the
.world
file would be loaded by a dedicatedAssetLoader
. TheAsset
would store the path to the maps (.tmx
file) as well as their positionning information (which is available in the.world
file).Upon spawning a world, we would then load the maps it contains but only spawn maps that are currently "in use". By moving the camera, we would change which maps are used or not, and spawn / despawn maps accordingly.
Dev branch for this feature = https://github.com/adrien-bon/bevy_ecs_tiled/tree/feat/world
(original idea from @JtotheThree)
The text was updated successfully, but these errors were encountered: