What is the best (or a good) way to implement the sprites(characters) in a isometric tile engine. I want them to move smoothly from tile to tile over time, so it looks more natural. I did this once in a topview tileengine, but in a isometric tile engine things are different.
In my engine tiles can be stacked so there is a true height. and it's a staggered engine.. the map looks like a rectangle
I remember there was once a good Iso-engine tutorial on the web, but that link has gone broken since a long time. ( a lot of info about tile engines seems to have disapeared.
Before I'm gonna implement sprites I would like to see several techniques and tutorials.
any directions ?
that link has gone broken
Have you tried archive.org ? I've found it pretty powerful to recover some tutorials.
Gamedev's programming articles
Pfuuu, my search Fu give up.
Full Allegro source code is here, along with some graphics and a couple of demos. Extract what you might need. It also include the fix for the overlapping blocks I mentioned earlier:
only drawback is the variable names/'private' functions are in Spanish.
The docs for Isomot are also online.
Another limitation is the non-commercial license, so no part of code can be used in GPL context.
I doubt he'd hold anyone to the 'non-commercial' bit, he probably just stuck it in there. But I only posted the code in case he wanted to look for the bit on moving around the grid. But I think he's using a different system anyway. Isomot uses a diamond and I think I read the OP was using staggered not diamond.
In that case, the simple maths is explained at www.tilemap.co.uk, if you download the code.
Yes I'm using a staggered tilermap.
Right now I'm trying to figure out how to convert screen coords to tilemap coords..
I saw some code but it's not documented well. I want to understand how it works so I can port it to my own engine. I know it has something to do with gettingn the square tiles and cheching wether the mouse is inside the "ground" diamond or outside and at wich side...
any tips are most welcome
If you visit here,
download the library you are familiar with and all the staggered isometric code is in there.
A quick snippet from the document:
Moving anywhere on a staggered row isometric map
This is more complex to understand than a rotated map, but you can use a function like this to make it as easy (and pretty much the same) as using a rotated style map, just copy and paste into your source:
void IsoMove (int ew, int ns, int * x, int * y)
// ew = negative is west movement, positive is east
// ns = negative is north movement, positive is south
// x and y are coords to modify
int a = ew-ns;
if (a>0) a++;
y += ew+ns;
x += a/2;
if ((y&1) && ((ew+ns)&1)) x--;
So, I can use this bit of example code to move 4 squares northward (as in the direction shown in the comparison diagram above) and 3 squares east:
int myx = 7; //start at block at 7, 7
int myy = 7;
IsoMove (3, -4, &myx, &myy); // negative values are north or west, positive south or east
Ariesln, all I can do is posting the code I use for ScreenToMap. I use a staggered map in my iso engine too.
The mousemap BITMAP is drawn like this:
/* drawing mousemap */ line( ( *map ) -> mousemap , 0 , ( TILEH >> 1 ) - 2 , ( TILEW >> 1 ) - 3 , 0 , makecol( 255, 0, 0 ) ); floodfill( ( *map ) -> mousemap , 1 , 1 , makecol( 255, 0, 0 ) ); line( ( *map ) -> mousemap , ( TILEW >> 1 ) - 3 , TILEH - 1 , 0 , ( TILEH >> 1 ) + 1 , makecol( 0 , 255 , 0 ) ); floodfill( ( *map ) -> mousemap , 1 , TILEH - 2 , makecol( 0, 255, 0 ) ); line( ( *map ) -> mousemap , ( TILEW >> 1 ) + 2 , TILEH - 1 , TILEW - 1 , ( TILEH >> 1 ) + 1 , makecol( 0, 0, 255 ) ); floodfill( ( *map ) -> mousemap , TILEW - 2 , TILEH - 1 , makecol( 0, 0, 255 ) ); line( ( *map ) -> mousemap , ( TILEW >> 1 ) + 2 , 0 , TILEW - 1 , ( TILEH >> 1 ) - 2 , makecol( 255, 255 , 0 ) ); floodfill( ( *map ) -> mousemap , TILEW - 1 , 0 , makecol( 255, 255, 0 ) );