T2D isometric tile rendering and picking in C++ (nxIsoTileMap, nxIsoTileLayer)
by Neo Binedell · 09/02/2005 (5:23 pm) · 19 comments
This is a quick and dirty version to allow interleaved tile rendering, picking and editing
for isometric views.
Note that this is simply an early experimental version to share some of the
stuff I've done, so lets not hear anything about what it doesn't do, right? ;p
I will add some other stuff I've been working on as I get the time, in the meantime
See following url for my ongoing plan on my experiments with this.
[update] 2005/10/18
Added map loading as fxTileMap2D does not call createTileLayer() that is overridden by calls new fxTileLayer2d()
directly. Just created a copy of loadFromStream() to fix it without touching underlaying T2D stuff.
[/update]
the updated code you can find here
[update] 2006/03/07
I am busy updating it for T2D beta 1.1 with new naming convention and new additions and changes
like serialization, comma delimeted (normal) parameters instead of one string, etc.
Once I have updated the code to 1.1 I will update this resource descriptions to reflect that as well.
Will hopefully have it up soon.
NOTE: I will not be doing any new dev on this as it was just an example. If/when I do get back to iso stuff
in the future I will create an entirely new iso sub system from the ground up and not based on t2dTileMap.
[/update]
=========================
Just extract the zip file into your T2D engine source dir and rebuild. The code is seperated
into a sub dir (NX) so won't overwrite anything.
See source for descriptions and explanations, etc.
Usage example:
That's it ;p
=========================
To use in tile editor:
in "~/tileeditor/client/editorScreen.cs"
around line 16 (under "editor state global vars"):
add:
around line 432 [ function loadMap() ]:
replace
with
do the same around line 737 [ function initializeTileMap() ]
replace
with
finally, in "~tileeditor/client/newTileDlg.gui"
around line 191 (after last control) add:
Usage:
Run T2D, start the tile editor, create a new tile map (make sure 'isometric map' is checked) and
start placing isometric tiles ;p
Remember to use a 2 to 1 ratio for tile width/height to get the right view angle as well as
2 to 1 ratio for your rows/columns as you move by half in Y so will need double the tiles
to cover the same space.
~neo
for isometric views.
Note that this is simply an early experimental version to share some of the
stuff I've done, so lets not hear anything about what it doesn't do, right? ;p
I will add some other stuff I've been working on as I get the time, in the meantime
See following url for my ongoing plan on my experiments with this.
[update] 2005/10/18
Added map loading as fxTileMap2D does not call createTileLayer() that is overridden by calls new fxTileLayer2d()
directly. Just created a copy of loadFromStream() to fix it without touching underlaying T2D stuff.
[/update]
the updated code you can find here
[update] 2006/03/07
I am busy updating it for T2D beta 1.1 with new naming convention and new additions and changes
like serialization, comma delimeted (normal) parameters instead of one string, etc.
Once I have updated the code to 1.1 I will update this resource descriptions to reflect that as well.
Will hopefully have it up soon.
NOTE: I will not be doing any new dev on this as it was just an example. If/when I do get back to iso stuff
in the future I will create an entirely new iso sub system from the ground up and not based on t2dTileMap.
[/update]
=========================
Just extract the zip file into your T2D engine source dir and rebuild. The code is seperated
into a sub dir (NX) so won't overwrite anything.
See source for descriptions and explanations, etc.
Usage example:
%map = new nxIsoTileMap(){ scenegraph = t2dSceneGraph };That's it ;p
=========================
To use in tile editor:
in "~/tileeditor/client/editorScreen.cs"
around line 16 (under "editor state global vars"):
add:
$loadIsoMap = false;
around line 432 [ function loadMap() ]:
replace
// Create new Tile-Map.
$editorTileMap = new fxTileMap2D(){ scenegraph = tileEditorSceneGraph2D; };with
// Create new Tile-Map.
if( $loadIsoMap )
$editorTileMap = new nxIsoTileMap(){ scenegraph = tileEditorSceneGraph2D; }
else
$editorTileMap = new fxTileMap2D(){ scenegraph = tileEditorSceneGraph2D; };do the same around line 737 [ function initializeTileMap() ]
replace
// Create new Tile-Map.
$editorTileMap = new fxTileMap2D(){ scenegraph = tileEditorSceneGraph2D; };with
// Create new Tile-Map.
if( $loadIsoMap )
$editorTileMap = new nxIsoTileMap(){ scenegraph = tileEditorSceneGraph2D; }
else
$editorTileMap = new fxTileMap2D(){ scenegraph = tileEditorSceneGraph2D; };finally, in "~tileeditor/client/newTileDlg.gui"
around line 191 (after last control) add:
new GuiRadioCtrl(IsoMapRB) {
profile = "GuiRadioProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "112 134";
extent = "92 26";
minExtent = "8 2";
visible = "1";
text = "Isometric map";
groupNum = "-1";
buttonType = "ToggleButton";
};Usage:
Run T2D, start the tile editor, create a new tile map (make sure 'isometric map' is checked) and
start placing isometric tiles ;p
Remember to use a 2 to 1 ratio for tile width/height to get the right view angle as well as
2 to 1 ratio for your rows/columns as you move by half in Y so will need double the tiles
to cover the same space.
~neo
#2
09/02/2005 (5:23 pm)
Thanks Neo!
#3
09/02/2005 (6:40 pm)
interesting! i havent been able to take a look-see yet, but i definatly will .. isometrics are t2d's best friend.
#4
09/02/2005 (8:44 pm)
Very cool, thanks for releasing this Neo :)
#5
http://www.garagegames.com/"http://neo.bzoned.com/gg/NXIsoTiles_0_1.zip"
and, of course, when I click it takes me to the GG homepage.
And thanks for posting the code, Neo! I'm anxious to have a look.
09/02/2005 (11:17 pm)
Looks like the link for the code is messed up. I'm shoing it as:http://www.garagegames.com/"http://neo.bzoned.com/gg/NXIsoTiles_0_1.zip"
and, of course, when I click it takes me to the GG homepage.
And thanks for posting the code, Neo! I'm anxious to have a look.
#6
09/02/2005 (11:43 pm)
@Chris: i think it's becuase he surrounded the url by quotes. i guess you cant do that.
#7
(edit: OK I found your .plan and love the visuals and screenshots on there. Good deal!)
09/03/2005 (1:00 am)
@Neo- the shortcut to your .plan is broken also. Interesting sounding resource. Got some some screenshots or more description about what it does?(edit: OK I found your .plan and love the visuals and screenshots on there. Good deal!)
#8
Perhaps it kept a copy of the original while it was waiting to be approved?
~neo
09/03/2005 (4:01 am)
Hmmm, thought I had fixed that, edited again and should be working now. Perhaps it kept a copy of the original while it was waiting to be approved?
~neo
#9
09/05/2005 (7:54 am)
Looking forward to seeing some demos and what people can come up with this. Not an owner of T2D but this is definately something that makes me consider it a lot more.
#10
Thanks a lot !!
09/11/2005 (9:01 am)
I donot find the resource of "createTileDlg.gui". Where is the resource ? Thanks a lot !!
#11
Not createTileDlg.gui.
~neo
09/11/2005 (5:04 pm)
Doh, seems I was napping, it is in fact newTileDlg.gui under /examples/tileeditor/client.Not createTileDlg.gui.
~neo
#12
I thank you at first, that you provide the package.
I have some questions about it's usage:
(1) I modified the project following your direction. I can edit the isometric tilemap. But I cannot display the same tilemap when I close the T2D program and open it again.
(2)Do you need to extend the class of "nxIsoTileMap", functions for "loadTileMap(...),saveTileMap(...)" to realize the isometric effect.
(3)I use the class following this:
%map = new nxIsoTileMap(){ scenegraph = t2dSceneGraph };
But I failed to draw the isometric tilemap.
Can you try it again follwing my questions ?
Please give me a help, thanks a lot.
10/17/2005 (7:41 pm)
@neoI thank you at first, that you provide the package.
I have some questions about it's usage:
(1) I modified the project following your direction. I can edit the isometric tilemap. But I cannot display the same tilemap when I close the T2D program and open it again.
(2)Do you need to extend the class of "nxIsoTileMap", functions for "loadTileMap(...),saveTileMap(...)" to realize the isometric effect.
(3)I use the class following this:
%map = new nxIsoTileMap(){ scenegraph = t2dSceneGraph };
But I failed to draw the isometric tilemap.
Can you try it again follwing my questions ?
Please give me a help, thanks a lot.
#13
Redownload the resource and recompile and you will be in bussiness ;p
~neo
10/18/2005 (11:28 am)
Ok, updated it and it loads maps fine nowRedownload the resource and recompile and you will be in bussiness ;p
~neo
#14
I have some questions about the isometric tilemap. Please go to read it .
The link is:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8379.
Thanks.
10/30/2005 (1:06 am)
@NeoI have some questions about the isometric tilemap. Please go to read it .
The link is:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8379.
Thanks.
#16
is up again (moved hosting).
~neo
03/07/2006 (6:42 am)
@Matt: yeah updating it as I find the time, will upload when done. In the meantime, the link for the old oneis up again (moved hosting).
~neo
#17
this totally rocks dude, and you saved me like a million hours running down the wrong avenue. I was able to compile, apply the changes, and get the tile editor updated and displaying like in your examples, although a few tweaks were necessary for me, not sure if its because I use vc6 or what.. But in either regard I have the basic stuff in place in a development sandbox. I was hoping they would include native iso into the engine, but I don't know if that will ever happen? A few things that concern me are collision detection and the tile picking aspects during resizing, zooms, and such, and was wondering what your thoughts were on these subjects, or exactly how far your going to take this iso thing :-) It would be interesting to know what your full plan for the engine is, and what pieces you have planned. Or where others could help ya out if at all. I certainly appreciate the hard work, thinking, and early release of this to allow me to start wrapping my brain around how to implement iso w/ t2d. I think your well on track now, with not interfering with native classes and aligning the drop in for the tools to be fairly seamless. Althought the tile editor looses it focus on which tile its on, and in large map can crash, I'm really interested in seeing what the next rev of this can do, or how others might be able to help out....
Thanks A Ton,
Rodney
04/06/2006 (5:52 pm)
neo, this totally rocks dude, and you saved me like a million hours running down the wrong avenue. I was able to compile, apply the changes, and get the tile editor updated and displaying like in your examples, although a few tweaks were necessary for me, not sure if its because I use vc6 or what.. But in either regard I have the basic stuff in place in a development sandbox. I was hoping they would include native iso into the engine, but I don't know if that will ever happen? A few things that concern me are collision detection and the tile picking aspects during resizing, zooms, and such, and was wondering what your thoughts were on these subjects, or exactly how far your going to take this iso thing :-) It would be interesting to know what your full plan for the engine is, and what pieces you have planned. Or where others could help ya out if at all. I certainly appreciate the hard work, thinking, and early release of this to allow me to start wrapping my brain around how to implement iso w/ t2d. I think your well on track now, with not interfering with native classes and aligning the drop in for the tools to be fairly seamless. Althought the tile editor looses it focus on which tile its on, and in large map can crash, I'm really interested in seeing what the next rev of this can do, or how others might be able to help out....
Thanks A Ton,
Rodney
#18
I've updated it to beta 1.1 and want to track down one or two issues before I upload it tho.
The example was just supposed to show how to render the tiles and does not cater
for moving the map, etc (tiles disappear, etc). I will go through everything from scratch and
clean it up more making it more robust, etc.
As for how far I am going to take it, I've decided to spend some more time on it and perhaps develop and entire code pack with all the bells and whistles. That's our secret tho ;p
~neo
04/06/2006 (6:14 pm)
Glad it helped you Rodney ;pI've updated it to beta 1.1 and want to track down one or two issues before I upload it tho.
The example was just supposed to show how to render the tiles and does not cater
for moving the map, etc (tiles disappear, etc). I will go through everything from scratch and
clean it up more making it more robust, etc.
As for how far I am going to take it, I've decided to spend some more time on it and perhaps develop and entire code pack with all the bells and whistles. That's our secret tho ;p
~neo
#19
thanks!
08/30/2006 (11:30 pm)
Neo,thanks for your great resource! But when will you upload the version which updated to beta1.1?thanks!

Torque Owner Neo Binedell
[edit]Ah a couple of refreshes and my edit button showed up again[/edit]
~neo