TMX Isometric

  ... the case you feel the need for a new feature or want to submit one.

TMX Isometric

Postby Niffy » Mon Apr 23, 2012 2:44 am

https://github.com/Niffy/AndEngineTMXTi ... /isometric

https://github.com/Niffy/TMXIsometricExample

https://github.com/Niffy/TMXIsometricExample/wiki

I've got an Isometric branch which works ok, a few bugs here and there but workable for people to play with.

There is no isometric object support (not even looked at it) so collisions most likely won't work
An example will be up by the end of the week, hopefully.
The reason for pushing this out now is that I know some people are interested in this and may want to make there own branch which does it better.
My coding is more of a hack and mishmash, so there is most likely bugs if you start to get down and dirty with it.
Its not pretty and is no way good enough to go into the master branch.

As for retrieving this branch with egit.... I've yet to work out, hopefully someone will figure it out and post it here, I'm too tired too.
update
To do this, I'm guessing you need to add a remote, so in eclipse you need the git repositories view, right click the TMX extension, create new remote, give it a name then see where you can add my repo .git.
Now as for pulling or fetch... I really should look at doing it command line mostly, egit seems to confuse me.


26th April 2012
I strongly recommend people learn the git command line,
http://help.github.com/win-set-up-git/
http://progit.org/book/ <I've learnt from this, didn't take too long.

cd to the working directory of AndEngineTMXExtension
git add remote niffyGithub https://github.com/Niffy/AndEngineTMXTi ... ension.git
^This adds a remote repo to the extension called niffyGithub and the url is how to access it
git fetch niffyGithub
OR
git fetch niffyGithub isometric
^The first downloads everything, the second should just download the isometric branch
At this stage you can't do anything, not even use it, you need to check it out into a local branch
git checkout -b isometric niffyGithub/isometric
^This creates a new branch called isometric based on the niffyGithub isometric branch (we fetched this earlier). It then checkouts this branch, so the working directory becomes the isometric branch files.

To update you should be able to do
(First make sure you're on your isometric branch, git checkout isometric)
git pull niffyGithub isometric

Tada! < Hopefully!


Isometric Branch
Updated the isometric branch so that the draw origin changes, its now zero, it doesn't really matter if any part of the map goes into negative on the x axis, the getTileAt methods are fine.

Example
It now correctly sets the camera bounds.

For any information on any what has been done, I strongly suggest you look through the commits.

27th/28th April 2012
Isometric Branch
Tiled 0.7.2 java source isometric draw method implemented.

Example
New large map, default to Tiled culling method. New menu for selecting the draw method.

29th April 2012
Isometric Branch
Can now parse polygon and polyline points. Stored in TMXObject, but in pixel space (as Tiled) stores them.

03rd Mayl 2012
Isometric Branch
Tile objects can now be drawn on a map (only if they exist on a whole tile)

Example
A new example to show isometric tile objects being drawn (5x5Object)
Cleaned up the example and manage the menus in new classes as the main example was getting long winded.

10th May 2012
Isometric Branch
Can now convert poly point pixels into scene coordinates. WIki updated to explain pixel points.
ISOMETRIC ONLY!

Example
Can now draw the poly points and objects, just to demonstrate to getting the scene coordinates. You can probably use them for physics.

25 March 2013
Now based on GLES2-AnchorCenter.
TMXLayer is supported. Other functions such as drawing polylines and objectsare currently not working due to change of branch, code is still there, but changes should be minimal, I do not need them currently and I don't have time to test them.
Last edited by Niffy on Mon Mar 25, 2013 8:48 pm, edited 8 times in total.
Niffy
 
Posts: 284
Joined: Sat Sep 17, 2011 8:39 pm

Re: TMX Isometric

Postby Niffy » Mon Apr 23, 2012 11:02 pm

Main post updated, now contains link the example project.
Niffy
 
Posts: 284
Joined: Sat Sep 17, 2011 8:39 pm

Re: TMX Isometric

Postby ynnmnm » Wed Apr 25, 2012 8:59 am

I have run it successful. Very good!
ynnmnm
 
Posts: 2
Joined: Tue Apr 24, 2012 10:09 am

Re: TMX Isometric

Postby Niffy » Thu Apr 26, 2012 9:25 pm

one or two minor updates,
Original post now has some help on using git.
Niffy
 
Posts: 284
Joined: Sat Sep 17, 2011 8:39 pm

Re: TMX Isometric

Postby darklord » Sat Apr 28, 2012 8:37 pm

Smart one! Using the culling method from Tiled! What kind of percentage performance improvement did you get?
darklord
 
Posts: 121
Joined: Thu Aug 12, 2010 2:48 pm

Re: TMX Isometric

Postby Niffy » Sat Apr 28, 2012 9:33 pm

darklord wrote:Smart one! Using the culling method from Tiled! What kind of percentage performance improvement did you get?


To be honest not too much, they seem to be quite similar on the large map.
The draw all function is well slow, like 4fps. The slim is probably the best, but it skips tiles if its not in the whole of the camera. But default Tiled_Source is probably the best bet to pick.
Niffy
 
Posts: 284
Joined: Sat Sep 17, 2011 8:39 pm

Re: TMX Isometric

Postby Niffy » Sun Apr 29, 2012 2:04 am

I've had a look at objects, I understand what is going on.
Polylines and Polygons could be implemented, but would come down to quite a bit of maths, well I'm guessing mostly geometry if I wanted a more logic approach. I could just implement reading objects and use the physics libraries for collisions.

The physics stuff might be the easiest way, but would surely have an impact on FPS. A tablet or dual core might have the processing power to do it, but implementing with something like path finding surely must be a nightmare (Never used physics myself)

So my current plan would be to just read in these from the XML and be done with it, they seem quite complicated and time consuming just to implement working on a logic basis, for me I don't envision needing polygons or polylines.

As for simple old square objects, I've not got to do anything other than demonstrate how to do it on an isometric map. Which in theory seems easy.

Current plan
Extend example to demonstrate simple checking if a tile is blocked.
Read in the XML for poly lines and 'gons.
Implement object tile (the one with the image, might be very very handy!) - Although I'd draw them if they occupy a tile and not a random point (ie freehand placement using the Ctrl key in Tiled)
Niffy
 
Posts: 284
Joined: Sat Sep 17, 2011 8:39 pm

Re: TMX Isometric

Postby Niffy » Sun Apr 29, 2012 2:07 am

Oh and if people do use my Isometric branch, I'd love to hear feedback about the FPS.
If you could provide me with your phone model and android OS (even more grateful if you say what sort of processor such as single, dual or quad core, screen size) The draw method and the map you're viewing.
Niffy
 
Posts: 284
Joined: Sat Sep 17, 2011 8:39 pm

Re: TMX Isometric

Postby Niffy » Thu May 03, 2012 10:56 pm

Another small update. See first post and git hub commits.

The isometric branch can now draw isometric tile objects. These are objects but using images :D
TileObjects.png
Isometric TMX with Tile Objects
TileObjects.png (18.41 KiB) Viewed 5724 times


There a bit useless as in the current state of the branch as you can't really use them if you wish to have like someone walk between them. Perhaps in future I'd implement this....
Niffy
 
Posts: 284
Joined: Sat Sep 17, 2011 8:39 pm

Re: TMX Isometric

Postby Molkobain » Fri May 04, 2012 10:09 am

Nice job ! I didn't had time to give it a try yet, but definitivly will. :)
Molkobain
 
Posts: 106
Joined: Wed Apr 18, 2012 4:16 pm
Location: France

Next

Return to Features

Who is online

Users browsing this forum: No registered users and 7 guests