Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

Diagonal Movement Problem - Please Help

Recommended Posts

From your code, I assume you are using isometric tiles? While ease to visualize, it is simply inefficient.

I personally started out with isometric tiles (and isometric blitting) for my engine, but ultimately decided to blit square tiles from a square map and then simply transform isometric coordinates to the 2D square map, when reading map data for collision detection etc....

/NJ

/NJ

Share this post


Link to post
Share on other sites
Niels, are you saying that the isometric look of your game is done through the artwork, and that the tiles you blit are square with no transparent clipping to make up for the 'diamond' isometric tiles? Can you give me a sample of some of your artwork, or a URL where I could see one or two of your tiles?

Share this post


Link to post
Share on other sites
Square tile maps that look isometric aren't new. Starcraft does just that. All of it's graphics are squares that are drawn so that they look isometric.

------------------
Dino M. Gambone
http://www.xyphus.com/users/dino

Good judgement is gained through experience. Experience, however, is gained through bad judgement.


Share this post


Link to post
Share on other sites
Sphet: Yes, that is exactly what I am saying... I'll post some screenshots on "some" site sometime soon. Right now the game is on hold due to lack of motivation (The multiplayer part is 90+% done, though, so I might do a multiplayer-only sharware release, who knows !!)...

/NJ

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yo, Niels. I saw your game and it looks amazing. I made an isometric engine and then changed to a rectangle tile engine since there easier to work with for an Real-time strategy game.

I noticed that in the screenshot the minimap and map is a diamond shape, and you said that use used a normal rectangle engine and just blted rectangle tiles with isometric drawing. How did you make the diamond map?

Also, if you used an normal rectangle tile engine wouldn't you be wasting alot of array space.
eg.
this is the array of the map -
1 = used tiles
0 = black(not used tiles)
{ 0 0 0 0 1 1 0 0 0 0
0 0 0 1 1 1 1 0 0 0
0 0 1 1 1 1 1 1 0 0
0 1 1 1 1 1 1 1 1 0
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1 1 0
0 0 1 1 1 1 1 1 0 0
0 0 0 1 1 1 1 0 0 0
0 0 0 0 1 1 0 0 0 0
}

This is if you used a "NORMAL" rectangle tile engine.
Did you blt the tiles in a special way?
Could you please tell me, if you did blt the tiles in a special way how???

Thanks alot,


email - datisme@notme.com
Da_KiD

Share this post


Link to post
Share on other sites
DAPsycho:

Eh, how I do what exactly? The tile rendering makes little sense out of context, and no, I'm not going to distribute the full source, sorry... If what you are asking for is the actual mapping formulas, I'll try to post them tonight...

Da_Kid:

Yes, there's a certain waste of space, but all things considered, we are talking <1K here....

The only 2 special things about the tiling are these:

1) Odd rows are offset by half a tile to compensate for the differences in isometric/square mapping. (If I remember, I'll post a drawing of this on the site tonight).
2) There's an isometric "collision map" behind the square tile map.

/NJ

(What is it with you guys and the "Da"-word anyway? =) )...

Share this post


Link to post
Share on other sites
Niels,

The screen shots look good. What is the screen resolution, bitdepth and average tile size you use? Also, the artwork looks nice - is it done in a 3d program, and if so, what sort of camera settings / angle are you using the maintain the isometrics. The 1-bit alpha-channel as collision detection works really well. Your scheme must be similiar to StarCraft, where you can't build things too close to overhangs since the ground tiles are all blitted with no transperency. Good job.

Share this post


Link to post
Share on other sites
Thank you very much!

It's running 640x480 16-bit (the pic's are jpeg'ed so the colors are a bit screwed up here and there).

Tiles are 42x24 pixels (Rendered, and then cut out using image composer (ANo1 )...

I'm not sure what you mean by "The 1-bit alpha-channel as collision detection works really well" ?? I use bounding spheres for colision detection between entities and an isometric grid for the map collisions.

Your are partly correct about the "overhangs". The engine supports both. (The walls visible on one of the desert screen shots are rendered with transparency. The indoor walls are not.)


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hey, it's me again.

Ok now I understand how use did the diamond map, but why did u say u offseted on odd rows, isn't that only done on staggered isometric maps???
_
Are the tiles |_| rectangles?? and if they are why would you need to offset the odd rows??

Are u using a true rectangle engine or a isometric engine?? Right now it seems like your using a staggered isometric map.


Thanks ,

Da_KiD

Da_KiD is standing for Billy_Da_KiD, hehehe
Da is slang for Tha in Canada and America

Share this post


Link to post
Share on other sites
Hehe, I just checked - the offset thing was an experiment I did at some point. The tiles ARE square and placed exactly above and beside each other (Phew, I must be way too long since I looked at that code, damn!)...

The engine IS isometric. All coords internally are 3D (x,y,z) and then mapped to 2D (x,y) using isometric mapping. It's just the ground map thats a bit special (performance reasons exclusively)..

--

Da is slang for tha? (which is slang for the) Yes, I figured that much !!

Am I the only one slightly annoyed with the inability to read previous posts while writing an answer? (Yeah, I know open another browser, but really?)..

/NJ

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hey, me AGAIN!

You said u mapped the tiles like a regular tile engine, but everything has 3d(x,y,z) coordinates and u map everything besides the tiles in isometric coords 2d(x,y), could u give me an example of the code to map isometric units or objects?? plz

Thanks alot,
Later,

Da_KiD

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi,

this is my tile ploting code:

int MapX, MapY, i, j;
int X_Overlap, Y_Overlap;

MapX = x;
MapY = y;
X_Overlap = 22;
Y_Overlap = 22;

for(i=0; i<22; i++)
{
for(j=0; j<11; j++)
{
masked_blit(data[MAP[0][MAPx+j][MAPy+i].tileimage].dat, display, 0, 0, 2*X_Overlap*j+(X_Overlap)*(i & 1), +Y_Overlap*i, TILESIZE, TILESIZE);
MapX++;
}
MapX=x;
MapY++;
}

the problem is that when i move the map in diagonals (NE, NW, SE, SW), the tiles do not redraw in the right places when on odd rows, if i move diagonal again to an even row, they sort themselves out.

N, W, S, E all work ok.

please help

Share this post


Link to post
Share on other sites
Great, thanxx !!

Now that we are at it , I think there's a bug in the ASP code on you main page that -sometimes- cause an ASP115 error (yup, that's the generic MS error code). Some times it just cause the browser to hang... (A wild guess would be an uninitialized variable )

/NJ

Share this post


Link to post
Share on other sites