mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 03:23:42 +00:00
5cd60b3378
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. |
||
---|---|---|
.. | ||
CalculateFacesAt.js | ||
CalculateFacesWithin.js | ||
Copy.js | ||
CreateFromTiles.js | ||
CullTiles.js | ||
Fill.js | ||
FilterTiles.js | ||
FindByIndex.js | ||
FindTile.js | ||
ForEachTile.js | ||
GetTileAt.js | ||
GetTileAtWorldXY.js | ||
GetTilesWithin.js | ||
GetTilesWithinShape.js | ||
GetTilesWithinWorldXY.js | ||
HasTileAt.js | ||
HasTileAtWorldXY.js | ||
index.js | ||
IsInLayerBounds.js | ||
PutTileAt.js | ||
PutTileAtWorldXY.js | ||
PutTilesAt.js | ||
Randomize.js | ||
RemoveTileAt.js | ||
RemoveTileAtWorldXY.js | ||
RenderDebug.js | ||
ReplaceByIndex.js | ||
SetCollision.js | ||
SetCollisionBetween.js | ||
SetCollisionByExclusion.js | ||
SetCollisionByProperty.js | ||
SetCollisionFromCollisionGroup.js | ||
SetLayerCollisionIndex.js | ||
SetTileCollision.js | ||
SetTileIndexCallback.js | ||
SetTileLocationCallback.js | ||
Shuffle.js | ||
SwapByIndex.js | ||
TileToWorldX.js | ||
TileToWorldXY.js | ||
TileToWorldY.js | ||
WeightedRandomize.js | ||
WorldToTileX.js | ||
WorldToTileXY.js | ||
WorldToTileY.js |