Page 1 of 2

TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Mon Dec 30, 2013 3:58 pm
by rob
Hi all,

As you may have already seen in the dev branch the tilemaps and pathfinding systems are a little wonky right now.

They are being overhauled.

Changes to tilemaps:

* Will now have defined width and height with proper AABB and actual set limits on the tiles they control so you can create a tilemap with a 10 horizontal tiles and 10 vertical tiles to create a grid. You can no longer create an infinite tilemap e.g. one that doesn't have any set horizontal and vertical tile counts. This change clears up a number of issues including:
1) Not being able to detect the AABB of a tilemap so the mouse events have to be captured across the whole screen and then checked against the tile positions etc.
2) Positioning of child entities mounted to the tilemap based on hacky code.

* Mouse events will only fire INSIDE the tilemap so if it's a 2d map, within the bounds of the AABB or if an iso map, within the diamond-shaped polygon that encompasses the iso-tiles.

* Mouse events are now the same for tilemaps as they are for entities so no confusing different parameters or whatever

Changes to pathfinding:

* A complete overhaul is coming that will address issues with interpolation over multiple paths messing up when the time delta is high
* Support for pathing along curves
* A path designer in the editor.

These changes are pending and currently being applied daily to the dev branch so it will likely appear a bit broken when using these features or any features that rely on them.

Re: TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Tue Dec 31, 2013 12:20 am
by rob
Pathfinding updates are complete, use of the new path component has been updated in the examples 9.6 and 9.6. Pathing with curves and steering behaviour to follow as updates soon.

Re: TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Tue Dec 31, 2013 6:56 pm
by foolmoron
rob wrote: 1) Not being able to detect the AABB of a tilemap so the mouse events have to be captured across the whole screen and then checked against the tile positions etc.

Does this mean that the mouse events for tilemaps are now fired in the IgeInputComponent update sequence like other entities, and behaves properly with stopPropagation?

Re: TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Tue Dec 31, 2013 7:02 pm
by rob
foolmoron wrote:
rob wrote: 1) Not being able to detect the AABB of a tilemap so the mouse events have to be captured across the whole screen and then checked against the tile positions etc.

Does this mean that the mouse events for tilemaps are now fired in the IgeInputComponent update sequence like other entities, and behaves properly with stopPropagation?

Yes :)

Re: TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Tue Jan 07, 2014 4:43 pm
by luke
rob wrote:* Will now have defined width and height with proper AABB and actual set limits on the tiles they control so you can create a tilemap with a 10 horizontal tiles and 10 vertical tiles to create a grid. You can no longer create an infinite tilemap e.g. one that doesn't have any set horizontal and vertical tile counts.


We currently rely on the flexible, infinite tilemaps for our world (although I'm not certain how this would affect performance at large indexes).

Will we still be able to use the old methods? Or will we need to restructure our codebase to work with the updates?

Re: TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Wed Jan 08, 2014 2:11 am
by Smileypop
Do the new TileMaps break the server side code in the examples? I am working on the dev branch.

When trying to run the server on the multiplayer examples, it's throwing an error, since the server is creating TileMaps, which in turn assign themselves a smart texture. Here is the error:

Code: Select all
IGE *log* [IgeNetIoComponent] : Network component initiated with Net.IO version: 1.0.0
IGE *log* [IgeNetIoComponent] : Starting net.io listener on port 2000
IGE *log* [IgeNetIoComponent] : Starting client/server clock sync...
IGE *log* [NetIo.Server] : Server is listening on port 2000
IGE *log* [IgeEngine:ige] : Starting engine...
IGE *log* [IgeEngine:ige] : Engine started
IGE *log* [IgeStreamComponent] : Setting delta stream interval to 30ms
IGE *log* [IgeStreamComponent] : Starting delta stream...
IGE *log* [IgeNetIoComponent] : Server now accepting connections!
IGE *error* [IgeTexture] : Error encountered, stopping engine to prevent console spamming...
Trace
IGE *log* [IgeEngine:ige] : Stopping engine...
    at IgeClass.log (/Users/Laird/Code/ige/engine/core/IgeClass.js:75:17)
    at IgeClass.IgeEventingClass.extend.init (/Users/Laird/Code/ige/engine/core/IgeTexture.js:21:9)
    at new IgeClass (/Users/Laird/Code/ige/engine/core/IgeClass.js:348:15)
    at IgeClass.IgeEntity.extend.init (/Users/Laird/Code/ige/engine/core/IgeTileMap2d.js:17:10)
    at new IgeClass (/Users/Laird/Code/ige/engine/core/IgeClass.js:348:15)
    at /Users/Laird/Code/ige/examples/24.5-multiplayer-isometric-mouse/server.js:62:28
    at IgeClass.IgeEntity.extend.start (/Users/Laird/Code/ige/engine/core/IgeEngine.js:902:6)
    at /Users/Laird/Code/ige/examples/24.5-multiplayer-isometric-mouse/server.js:23:9
    at Server.<anonymous> (/Users/Laird/Code/ige/server/node_modules/net.io-server/index.js:601:5)
    at Server.g (events.js:180:16)

/Users/Laird/Code/ige/engine/core/IgeClass.js:96
 '* [' + (this._classId || this.prototype._classId) + thisId + '] : ' + text);
                                                                      ^
IGE *error* [IgeTexture] : Cannot create a texture on the server. Textures are only client-side objects. Please alter your code so that you don't try to load a texture on the server-side using something like an if statement around your texture laoding such as "if (ige.isClient) {}".

Process finished with exit code 8

Re: TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Wed Jan 08, 2014 5:35 pm
by luke
Hi Rob,

Are the pathing and tilemap changes complete or should we wait to work with those?

Also, is pathing speed working as intended? Entities appear to move significantly faster than expected.

Re: TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Tue Jan 14, 2014 3:05 am
by JudgeX
Smileypop wrote:Do the new TileMaps break the server side code in the examples? I am working on the dev branch.

When trying to run the server on the multiplayer examples, it's throwing an error, since the server is creating TileMaps, which in turn assign themselves a smart texture. Here is the error:

Code: Select all
IGE *log* [IgeNetIoComponent] : Network component initiated with Net.IO version: 1.0.0
IGE *log* [IgeNetIoComponent] : Starting net.io listener on port 2000
IGE *log* [IgeNetIoComponent] : Starting client/server clock sync...
IGE *log* [NetIo.Server] : Server is listening on port 2000
IGE *log* [IgeEngine:ige] : Starting engine...
IGE *log* [IgeEngine:ige] : Engine started
IGE *log* [IgeStreamComponent] : Setting delta stream interval to 30ms
IGE *log* [IgeStreamComponent] : Starting delta stream...
IGE *log* [IgeNetIoComponent] : Server now accepting connections!
IGE *error* [IgeTexture] : Error encountered, stopping engine to prevent console spamming...
Trace
IGE *log* [IgeEngine:ige] : Stopping engine...
    at IgeClass.log (/Users/Laird/Code/ige/engine/core/IgeClass.js:75:17)
    at IgeClass.IgeEventingClass.extend.init (/Users/Laird/Code/ige/engine/core/IgeTexture.js:21:9)
    at new IgeClass (/Users/Laird/Code/ige/engine/core/IgeClass.js:348:15)
    at IgeClass.IgeEntity.extend.init (/Users/Laird/Code/ige/engine/core/IgeTileMap2d.js:17:10)
    at new IgeClass (/Users/Laird/Code/ige/engine/core/IgeClass.js:348:15)
    at /Users/Laird/Code/ige/examples/24.5-multiplayer-isometric-mouse/server.js:62:28
    at IgeClass.IgeEntity.extend.start (/Users/Laird/Code/ige/engine/core/IgeEngine.js:902:6)
    at /Users/Laird/Code/ige/examples/24.5-multiplayer-isometric-mouse/server.js:23:9
    at Server.<anonymous> (/Users/Laird/Code/ige/server/node_modules/net.io-server/index.js:601:5)
    at Server.g (events.js:180:16)

/Users/Laird/Code/ige/engine/core/IgeClass.js:96
 '* [' + (this._classId || this.prototype._classId) + thisId + '] : ' + text);
                                                                      ^
IGE *error* [IgeTexture] : Cannot create a texture on the server. Textures are only client-side objects. Please alter your code so that you don't try to load a texture on the server-side using something like an if statement around your texture laoding such as "if (ige.isClient) {}".

Process finished with exit code 8


I am having the same problem as smileypop and am now wondering if this is a bug or an intended change. Please get back with us.

Re: TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Sun Feb 02, 2014 5:08 pm
by alex
Hi Rob and hi all.

Rob, we need a tutorial or an explanation of the new server-side TileMaps for PathFinding, we don't know how it should be done to work! It gives always the same error.

Re: TileMaps & PathFinding Breaking Stuff in Dev

PostPosted: Tue Feb 04, 2014 11:33 pm
by Smileypop
JudgeX wrote:
Smileypop wrote:Do the new TileMaps break the server side code in the examples? I am working on the dev branch.

When trying to run the server on the multiplayer examples, it's throwing an error, since the server is creating TileMaps, which in turn assign themselves a smart texture. Here is the error:

Code: Select all
IGE *log* [IgeNetIoComponent] : Network component initiated with Net.IO version: 1.0.0
IGE *log* [IgeNetIoComponent] : Starting net.io listener on port 2000
IGE *log* [IgeNetIoComponent] : Starting client/server clock sync...
IGE *log* [NetIo.Server] : Server is listening on port 2000
IGE *log* [IgeEngine:ige] : Starting engine...
IGE *log* [IgeEngine:ige] : Engine started
IGE *log* [IgeStreamComponent] : Setting delta stream interval to 30ms
IGE *log* [IgeStreamComponent] : Starting delta stream...
IGE *log* [IgeNetIoComponent] : Server now accepting connections!
IGE *error* [IgeTexture] : Error encountered, stopping engine to prevent console spamming...
Trace
IGE *log* [IgeEngine:ige] : Stopping engine...
    at IgeClass.log (/Users/Laird/Code/ige/engine/core/IgeClass.js:75:17)
    at IgeClass.IgeEventingClass.extend.init (/Users/Laird/Code/ige/engine/core/IgeTexture.js:21:9)
    at new IgeClass (/Users/Laird/Code/ige/engine/core/IgeClass.js:348:15)
    at IgeClass.IgeEntity.extend.init (/Users/Laird/Code/ige/engine/core/IgeTileMap2d.js:17:10)
    at new IgeClass (/Users/Laird/Code/ige/engine/core/IgeClass.js:348:15)
    at /Users/Laird/Code/ige/examples/24.5-multiplayer-isometric-mouse/server.js:62:28
    at IgeClass.IgeEntity.extend.start (/Users/Laird/Code/ige/engine/core/IgeEngine.js:902:6)
    at /Users/Laird/Code/ige/examples/24.5-multiplayer-isometric-mouse/server.js:23:9
    at Server.<anonymous> (/Users/Laird/Code/ige/server/node_modules/net.io-server/index.js:601:5)
    at Server.g (events.js:180:16)

/Users/Laird/Code/ige/engine/core/IgeClass.js:96
 '* [' + (this._classId || this.prototype._classId) + thisId + '] : ' + text);
                                                                      ^
IGE *error* [IgeTexture] : Cannot create a texture on the server. Textures are only client-side objects. Please alter your code so that you don't try to load a texture on the server-side using something like an if statement around your texture laoding such as "if (ige.isClient) {}".

Process finished with exit code 8


I am having the same problem as smileypop and am now wondering if this is a bug or an intended change. Please get back with us.


Hey Rob, do you know if this will be fixed soon or is there an easy workaround? Thanks