phaser/src/tilemaps/components
Skysteed 5cd60b3378 Major Optimization for Tilemap Collision Indexing
This update optimizes an existing feature (Tilemap Collision Indexing).

This optimization will apply to [nearly] everyone using procedural generation tilemaps, infinite tilemaps, multiplayer tilemaps, particularly large tilemaps (especially those dyanmic in nature) or who otherwise intend to index collisions before the tiles are loaded.

Benchmarking:

Using the standard approach, indexing collisions for a 500x450 tileset took 2530ms. By pre-building the collision index array in its entirety, I was able to reduce that to 259ms. However, this implementation reduces it to 8 ms. Larger tilemaps would be exponentially affected.

There are some considerations to make here since there are better implementations, but it would require deprecating some existing code. The advantage would be that the standard approach itself would be optimized, (thus avoiding the sort of 2500+ms costs here), rather than fairly obscured as it is with this implementation.
2018-07-19 10:59:35 -05:00
..
CalculateFacesAt.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
CalculateFacesWithin.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
Copy.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
CreateFromTiles.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
CullTiles.js eslint fix and log update 2018-07-18 15:06:56 +01:00
Fill.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
FilterTiles.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
FindByIndex.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
FindTile.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
ForEachTile.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
GetTileAt.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
GetTileAtWorldXY.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
GetTilesWithin.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
GetTilesWithinShape.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
GetTilesWithinWorldXY.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
HasTileAt.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
HasTileAtWorldXY.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
index.js Added jsdocs 2018-02-12 16:01:21 +00:00
IsInLayerBounds.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
PutTileAt.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
PutTileAtWorldXY.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
PutTilesAt.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
Randomize.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
RemoveTileAt.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
RemoveTileAtWorldXY.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
RenderDebug.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
ReplaceByIndex.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
SetCollision.js Major Optimization for Tilemap Collision Indexing 2018-07-19 10:59:35 -05:00
SetCollisionBetween.js Major Optimization for Tilemap Collision Indexing 2018-07-19 10:59:35 -05:00
SetCollisionByExclusion.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
SetCollisionByProperty.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
SetCollisionFromCollisionGroup.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
SetLayerCollisionIndex.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
SetTileCollision.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
SetTileIndexCallback.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
SetTileLocationCallback.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
Shuffle.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
SwapByIndex.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
TileToWorldX.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
TileToWorldXY.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
TileToWorldY.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
WeightedRandomize.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
WorldToTileX.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
WorldToTileXY.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00
WorldToTileY.js Marked all Tilemap components as private 2018-04-16 15:25:22 +01:00