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
Richard Davey
106e32a4f5
Removed un-used imports
2018-07-19 13:26:11 +01:00
Richard Davey
de4428ac52
Added willRender override and start of event handling
2018-07-19 13:22:13 +01:00
Richard Davey
6a3274b483
Removed redundant code
2018-07-19 13:21:59 +01:00
Richard Davey
2a008e6713
FileType.HTML
is a new file type loader that will load an HTML snippet and store it in the new html
cache. Access it via load.html
(this method was previously used to load html to textures, please see load.htmlTexture
for this feature now)
2018-07-19 13:21:51 +01:00
Richard Davey
675cb3b59a
Added HTML Cache
2018-07-19 13:19:24 +01:00
Richard Davey
0ac877be0b
Removed z-index and tidied up style
2018-07-19 13:19:14 +01:00
Richard Davey
ec5bd1912e
GameObject.willRender
now takes a Camera as its only argument and uses it within the check. This has allowed me to remove 23 duplicate checks spread across the various Game Objects, all of which did the same thing, saving both KB and CPU time as the flags were being checked twice in most cases.
2018-07-19 13:19:02 +01:00
Richard Davey
1d697b1371
Updated log
2018-07-19 00:42:37 +01:00
Richard Davey
e2dbbcdbb0
Inline and added create methods
2018-07-19 00:42:28 +01:00
Richard Davey
ceb466748a
Updated DOM Element to fix transforms
2018-07-19 00:22:38 +01:00
Richard Davey
d6fb66789f
Added getCSSMatrix
2018-07-19 00:22:10 +01:00
Richard Davey
ab35dfab95
The setCrop
method stored its crop object on the prototype chain by mistake, causing all Images or Sprites that were cropped to display the same frame. The crop data has been moved to the Game Object instance, where it should be, fixing this issue
2018-07-19 00:18:09 +01:00
Richard Davey
0ed4766fe3
Added start of the new DOM Element Game Object
2018-07-18 17:23:04 +01:00
Richard Davey
c741469894
Added optional DOM Container parent and config values
2018-07-18 17:22:52 +01:00
Richard Davey
20f1b37256
eslint fix and log update
2018-07-18 15:06:56 +01:00
Richard Davey
b6a1033dbd
Fixed Camera FX for scaled camera sizes
2018-07-18 15:03:06 +01:00
Richard Davey
14ba51d928
Added Text.setResolution methods.
2018-07-18 14:45:10 +01:00
Richard Davey
1b9f5dc76d
Updated change log
2018-07-18 14:32:55 +01:00
Richard Davey
25e4993e6f
Added x and y getters and new scaled viewport values
2018-07-18 14:32:47 +01:00
Richard Davey
0db16889e6
Use new Camera viewport values
2018-07-18 14:32:06 +01:00
Richard Davey
3bc6eba718
Removed incorrect resolution multiplication and used updated camera viewport
2018-07-18 14:31:45 +01:00
Richard Davey
fb4f28bb01
Testing resolution input
2018-07-17 23:26:40 +01:00
Richard Davey
1c473afa84
Cameras draw their backgrounds correctly at higher resolutions
2018-07-17 23:26:30 +01:00
Richard Davey
e29671282b
Updated change log
2018-07-17 22:44:28 +01:00
Richard Davey
e0fdc33928
SM mock
2018-07-17 22:44:21 +01:00
Richard Davey
94540e112e
Text supports high dpi resolution for its internal canvas
2018-07-17 22:44:12 +01:00
Richard Davey
6ddd1644f2
Canvas now uses game config resolution
2018-07-17 22:43:52 +01:00
Richard Davey
16d597c983
Fixed jsdoc references
2018-07-17 11:43:09 +01:00
Richard Davey
5ada70409e
Modified tile sizes.
2018-07-16 15:20:46 +01:00
Richard Davey
8f3de12f69
Merge branch 'master' of https://github.com/photonstorm/phaser
2018-07-16 15:16:32 +01:00
Richard Davey
73292c892a
Updated change log
2018-07-16 15:16:29 +01:00
Richard Davey
7ec36752dc
Merge pull request #3830 from kelostrada/master
...
Update AudioFile.js
2018-07-16 14:57:36 +01:00
Richard Davey
0cc52f6002
Swapped 4 ternaries for a single conditional #3834
2018-07-16 14:55:51 +01:00
Richard Davey
f723d0e18a
Merge pull request #3834 from tarsupin/patch-2
...
Major Optimization for Culling Tilemaps
2018-07-16 14:44:35 +01:00
Richard Davey
c8b058c26a
Renamed object to avoid TS defs conflict
2018-07-16 10:28:28 +01:00
tarsupin
ad24a0b8ec
Removed repetative code.
2018-07-14 20:09:36 -05:00
tarsupin
00a38f744a
Switching tabs to spaces
2018-07-14 14:41:13 -05:00
tarsupin
9ac505d5cc
Build is requiring me to pre-declare x, y, tile.
2018-07-14 14:38:19 -05:00
tarsupin
4fa3dc7159
Update CullTiles.js
2018-07-14 14:30:15 -05:00
tarsupin
e3d64c63b3
Major Optimization for Culling Tilemaps
...
Refine the loop to only scan through the drawn boundaries that are being tested against (except when skipping cull). This eliminates a huge bottleneck / lookup time from the original loop each frame.
The update should affect tilemaps exponentially based on their size. It reduced my culling time to 1/70th for 1000x1000 tilemaps, and by about 1/20th on 250x250 tilemaps. It also reduced my requestAnimationFrame time from over 16ms per frame to ~1ms for the larger map.
2018-07-14 14:14:55 -05:00
Bartosz Kalinowski
264c82fbcb
Update AudioFile.js
...
fix error
2018-07-14 07:50:00 +02:00
Richard Davey
41f9277803
Preparing for 3.12 development
2018-07-13 17:28:08 +01:00
Richard Davey
05e6f65d51
3.11 Release
2018-07-13 11:37:57 +01:00
Richard Davey
9a82bd33e5
Updated change log
2018-07-13 11:14:29 +01:00
Richard Davey
42c3fc5f6b
Better normal map handling
2018-07-13 11:14:22 +01:00
Richard Davey
66ee2ac973
Bumped version
2018-07-13 11:14:13 +01:00
Richard Davey
eee96cd2d3
setPipeline
returns the Game Object, not the pipeline, to be consistent.
2018-07-13 11:14:08 +01:00
Richard Davey
4843d7eefe
Pipelines have a boot handler now.
2018-07-13 11:13:46 +01:00
Richard Davey
61954dedcb
Added checkDown
method and related properties.
2018-07-13 11:13:32 +01:00