ForgeableSum Posted December 15, 2014 Share Posted December 15, 2014 So, I'm using both the isometric plugin and the pathfinder plugin in my game. The isometric plugin doesn't use a tilemap to generate the tiles but instead sprites (extended isoSprites). Problem is that the pathfinder plugin needs a tilemap to generate a grid (with walkables and non-walkables) for pathfinding. e.g.: map = map = game.add.tilemap('desert');pathfinder.setGrid(map.layers[0].data, walkables); Does anyone know of a workaround? Is there a way to convert the isoSprites into a tilemap or, perhaps, extend them further so they can have the layer Member with data (walkable, non-walkable) on each tile? I'm completely new here so forgive me if I'm not using the right terms. I'd be grateful for any help! Link to comment Share on other sites More sharing options...
lewster32 Posted December 17, 2014 Share Posted December 17, 2014 A more generic pathfinding solution is needed - the pathfinder plug-in is specifically designed for tilemaps, whereas what you need is something like EasyStar or one of the many other a-star and similar pathfinding algorithms. Try Googling 'javascript a-star' or 'javascript pathfinding'. Link to comment Share on other sites More sharing options...
ForgeableSum Posted December 17, 2014 Author Share Posted December 17, 2014 A more generic pathfinding solution is needed - the pathfinder plug-in is specifically designed for tilemaps, whereas what you need is something like EasyStar or one of the many other a-star and similar pathfinding algorithms. Try Googling 'javascript a-star' or 'javascript pathfinding'.Thanks, I figured I would need to take measures like that. I really like your plugin btw. I'm still debating wether to use it in my game though and I'm having difficulty understanding what it actually does. I understand that it maps out tiles in the isometric diamond shape - but can't that effect be reproduced with square tiles on a traditional tilemap (without a need to create a third, z dimension)? What are the draw backs of using square tile maps and creating and "drawing in" the isometric projection? Can I achieve the same camera view angle? What is the difference between an "isoSprite" and a regular sprite? "isoArcade" physics and the physics that come with Phaser? Why wouldn't regular physics (move this object from 0,0 to 10,15) work the same way on an iso map since iso is just a different perspective (but the same game/map). Apologize if these questions sound stupid but I'm struggling to understand this whole isometric thing. Link to comment Share on other sites More sharing options...
lewster32 Posted December 17, 2014 Share Posted December 17, 2014 The thing to understand is that isometric projection is a form of 3D projection - objects exist in an x, y and z position. This means that objects can go behind one another, as well as above, below and to the side. Phaser out of the box only takes care of two dimensions, treating things in terms of 2D points and rectangles; the isometric plug-in expands this to 3D points and cubes. Probably the most succinct way to say this is that this plug-in simulates in 3D most of the features that Phaser currently simulates in 2D, and allows you to work with that simulation in a 'pseudo-3D' way with 2D sprites. It's also important to note that the plug-in does not adjust your sprites - it doesn't turn squares and rectangles into diamonds; you still have to provide the graphics already in their projected shape (i.e. diamond-shaped) and the plug-in will where possible make a 'best guess' as to the 3D bounds of the sprites you're providing based on some maths applied to their 2D bounds. Link to comment Share on other sites More sharing options...
ForgeableSum Posted December 18, 2014 Author Share Posted December 18, 2014 Can you help me understand the pros and cons of using a square-shaped tile instead of a diamond shape tile if you want the game to be in the isometric perspective? My predicament is that I want to use a normal tileset to take advantage of a lot of Phaser's core functionality for tiles and tilesets. I'm pretty sure the physics and dimensional aspects of sprites in Phaser (without the plugin) will do just fine for me, so long as I draw everything from the isometric perspective, but I want to be sure before I go down that road. What do you think? I actually *don't* want to use your plugin because I'm not familiar enough with Phaser and HTML5 game dev in general to start with something advanced (i.e. I don't want to go off the beaten path). Link to comment Share on other sites More sharing options...
lewster32 Posted December 19, 2014 Share Posted December 19, 2014 Phaser's TileMap functionality is fundamentally incompatible with the isometric plug-in unfortunately, however there is a third party TileMap implementation with isometric support on its roadmap: https://github.com/englercj/phaser-tiled Link to comment Share on other sites More sharing options...
Recommended Posts