#29434 - bertsnks - Sat Nov 20, 2004 12:15 am
i think you'll get into problems with using only sprites for this
#29453 - Wriggler - Sat Nov 20, 2004 11:04 am
Looks good so far, I'll be interested to see how it develops!
Ben
#29461 - keldon - Sat Nov 20, 2004 6:38 pm
Or you can mix the methods together. Render linking tiles at run time so you don't end up with 2^tiletype tiles.
What you will have for each tile is: (16x16/32x32 tile, from ROM) + (tiles for each connective drawn at run time)
The benefits for this is the removed need to have connectives in ROM that aren't going to used, and also you don't have to create connectives anymore. And your 16x16/32x32 tile can quite happily loop itself as all that is extracted from a tile when creating a connective is a diamond portion. Or you could create a tool that extracts only the pixels inside the diamond, and use that to create connected iso-tiles.
I have not tried this out, but it sounds *almost* solid and golden.
p.s. Good Work
#29589 - tepples - Mon Nov 22, 2004 5:57 am
Technically, isometric is a parallel projection, and parallel projections shouldn't have parallax. Only perspective projections should have parallax.
Or am I missing something?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#29597 - blinky465 - Mon Nov 22, 2004 12:10 pm
Ok, I think I have it sorted - almost.
The problem wasn't so much with the sorting code, but when it was called. I was only calling the update position in list code when a block moved. But then I forgot that moving one block may cause the relative position of other blocks around it to move, to keep the illusion of depth.
So now, every block checks to see if it's in the right place in the list, whether it has moved or not, and the effect is quite satisfying.
I'm in work, behind a stupid locked down firewall at the minute, but will post and updated gba file as soon as I can.
Thanks to everyone who has offered help and support.
(my iso-engine is a lot simpler than a lot of the suggestions!)
#29632 - blinky465 - Mon Nov 22, 2004 11:33 pm
Sorry about the multiple posts. But I'm off to bed in a minute and am quite excited about my new game engine. (see post above for link).
Here's my current to do list:
Types of blocks we have so far:
1. floating
2. falling
3. pushable
4. disappearing
5. collectable
6. conveyor belts
7. deadly
Type of blocks still to do:
1. auto-animate (ie baddies which are just deadly blocks that move on their own!)
Types of block that we may do but can't really be bothered:
1. objects that can act as lifts? (ie if the player is on a lift object, it will cause them to rise)
2. linked objects? (ie tie one object to the top/side of another)
3. springs?
All comments welcome.
#29636 - ScottLininger - Tue Nov 23, 2004 12:49 am
This is a really cool idea you're working on. Some possibilities that suggest themselves:
- 3-D mazes
- "pipedream" kind of interface where you have to place pipe sections before time runs out
- Burgertime kind of thing where you have to stack stuff to get points
One suggestion I'd make is to implement shadows on some kind of floor layer... might help to visualize the elevation of a given block.
-Scott
#30535 - Paradroid - Wed Dec 01, 2004 10:22 pm
Hi, I tried out your code and unfortunately it didn't cope with a complicated level (eg 40-50 blocks). If you're looking for spot-on ISO sorting use this routine. It's a 'C' version of the method used in Ultimate games on the Speccy, eg Knight Lore etc...
Oh, and sorry - the formatting went AWOL...!
struct ISOStruct {
int sprite; // Sprite graphic index
int x,y,h; // x,y,h of sprite, eg 16,16,52(height of floor is 40) - fs origin is middle,bottom of block
int xx,yy,hh; // size of block div by 2, x,y and height, eg 8,8,12
int hx,hy; // hotspot for sprite, eg -16,-20
};
// Objects in room
ISOStruct ISOObjects[] = {
{ 0x15,0x80,0xAA,0x40,0x07,0x07,0x0C,0xF0,0xF9 },
{ 0x25,0x80,0xAA,0x4C,0x07,0x07,0x0B,0xF0,0xFD },
etc...
};
ISO Sort+Draw routine as used in Knight Lore/Alien 8 etc...
ISOStruct *pObjectX,*pObjectY;
bool bSortList[256];
int nSortObjects;
int TempSortList[256];
int nTempSortList;
int Index,Plane,IndexX,IndexY,StoreIndexX,StoreIndexY;
int i,x,y;
nSortObjects = sizeof(ISOObjects)/sizeof(ISOStruct);
memset(bSortList,0x0,sizeof(bool)*256);
nTempSortList = 0;
scanobjectx:;
// Scan to find first object we haven't draw
for(Index=0; Index<nSortObjects; Index++) {
if (!bSortList[Index]) { // FALSE is yet to draw object
IndexX = StoreIndexX = Index; // Found object 'X'
goto scanobjecty;
}
}
// Return, we've drawn all objects
return;
scanobjecty:;
// Scan for next object we haven't drawn
for(; Index<nSortObjects; Index++) {
if (!bSortList[Index]) { // FALSE is yet to draw object
IndexY = StoreIndexY = Index; // Found object 'Y'
if (IndexX!=IndexY) { // Different object to 'X'? If so, check objects
Index++;
goto checkobjects;
}
}
}
IndexX = StoreIndexX;
goto drawobject; // Draw object 'X'
checkobjects:;
pObjectX = &ISOObjects[IndexX];
pObjectY = &ISOObjects[IndexY];
Plane = 0; // Set 'Plane' as result of checks with two blocks
if (pObjectX->h<(pObjectY->h+pObjectY->hh)) {
Plane++;
if (pObjectY->h>=(pObjectX->h+pObjectX->hh))
Plane++;
}
if ((pObjectX->y-pObjectX->yy)<(pObjectY->y+pObjectY->yy)) {
Plane+=3;
if ((pObjectY->y-pObjectY->yy)>=(pObjectX->y+pObjectX->yy))
Plane+=3;
}
if ((pObjectX->x-pObjectX->xx)<(pObjectY->x+pObjectY->xx)) {
Plane+=9;
if ((pObjectY->x-pObjectY->xx)>=(pObjectX->x+pObjectX->xx))
Plane+=9;
}
switch(Plane) { // Use 'Plane' to decide how to sort blocks
case 3:
case 4:
case 6:
case 7:
case 12:
case 15:
case 16:
for(i=0; i<nTempSortList; i++) { // Scan to see if 'StoreIndexY' already exists in temp sort list
if (TempSortList[i]==StoreIndexY) {
IndexX = IndexY;
goto drawobject; // Draw if find as can't draw scene correctly(objects intersect)
}
}
TempSortList[nTempSortList] = StoreIndexY;
nTempSortList++; // Add to end of temp list
IndexX = IndexY;
StoreIndexX = StoreIndexY;
Index = 0;
goto scanobjecty; // Scan object list from start
default:
goto scanobjecty;
}
drawobject:;
bSortList[IndexX] = true; // Tag as drawn
nTempSortList = 0; // Reset temp list
pObjectX = &ISOObjects[IndexX]; // Get screen coords
x = pObjectX->x+pObjectX->y-128 + (signed char)pObjectX->hx;
y = ((pObjectX->y-pObjectX->x+128)>>1)+pObjectX->h-40 + (signed char)pObjectX->hy;
// And draw at 'x,192-y-spriteheight'
//...
goto scanobjectx; // Look for next object to draw
#30584 - Paradroid - Thu Dec 02, 2004 10:07 am
It does work. If you send me a private message with your e-mail address I'll send you the complete file+levels+gfx+other goodies. I wish I had this code when I wrote my own ISO game - it would have saved a lot of time!
#32939 - blinky465 - Wed Dec 29, 2004 1:06 pm
Well that's it now for another year - hope everyone had a fantastic Christmas... I've managed to spend a bit of time on my isometric game over the holidays (though I'm back in work at the moment).
Latest developments include:
splash screen (doesn't everyone just love them?)
menu to set control/sound options
floors and walls in the main game.
Comments appreciated.
I know that the palettes are all out of synch and that the splash/menu graphics are typical stinky coder art!