PDA

Click to See Complete Forum and Search --> : Isometric Engine


git
Sep 30th, 2000, 07:46 AM
Has anyone got any example code for a tile based isometric engine? I've looked around, but could only find C++ examples (and I only know VB).

I've got a basic engine running, it BitBlt's the map and everything is in place perfectly, but I'm not really sure how to scroll them - I know I do it like a normal tile game, by BitBlt-ing the tiles as it moves, but I don't know how to program all the code for the offset and the scrolling code.

I want my maps to be diamond shaped on screen, so if you get to the edge of a map it has to scroll diagonally... I know this will probably be harder than to make a square shaped map (with jagged map edges), but I'd prefer it this way.

Any help here would be appreciated!

Thanks,

-Git

/\/\isanThr0p
Sep 30th, 2000, 03:42 PM
no time sorry

http://www.ur.co.nz

git
Oct 4th, 2000, 05:08 AM
Umm, can anyone else help me?

I've got the offset code written (aka the behind the scenes stuff), but I'm not sure how to implement them into graphical code.

Basically, the very center of the map is 0,0. As you scroll left the X decreases, right X increases, up Y increases, and down Y decreases.

It can fit 20 tiles high (20 pixels) by 14 tiles wide (38 pixels).

The offsets can go 5 tiles past the border of the map, into the blackness. So if you have a 30 x 30 map, it can scroll out to 15 + 5, although the edge will be black.

I want the map to be a squished diamond shape on screen, like this: (not a big square shape like Starcraft)

ooooo__oo|oo__ooooo
oo__ooooooooooo__oo
__ooooooooooooooo__
oo__ooooooooooo__oo
ooooo__ooooo__ooooo
ooooooooo|ooooooooo

(Very bad ascii, hope someone understands it ok! =)).

I'm just not sure how to implement it into BitBlt though - I've got to somehow convert a 3D array of tile information (MapID(x,y)) to the isometrics on screen.

If *anyone* can help me in any way I'll be very happy!

Thanks!

-Git

[Edited by git on 10-04-2000 at 06:11 AM]

Fox
Oct 4th, 2000, 02:36 PM
Hm, BitBlt's probably too slow coz you lose 50% performance when drawing such tiles (50% is always transparent)... well, would recommend a squared-tile engine ;)

/\/\isanThr0p
Oct 5th, 2000, 05:48 PM
Hey!

I'm really interested in a way to program a tile game with different hights!

If you find it out how to do it, please post it!

git
Oct 6th, 2000, 12:39 AM
Depends on what is it - birds eye view style, or isometric.

I was going to use height in the game I'm currently working on, but I figured out it wouldn't look realistic (it's like Yoda Stories, but not... best way to describe it), and it would be unrealistic for weapons fire, eg. weapons fire going north would be longer than say south... hard to explain.

However, isometric... that's another story. XCom is an excellent example of an iso. game which uses height. All you do is have a value for the current selected level, and when you move, fire weapons, etc., it will do it, taking that level into mind. It'd be a bit harder to do than an iso. like Syndicate, which only uses some height, but it would be worth it.

Of course, I know that XCom wasn't as basic as it looked - it has advanced stats for each tile, specical line of fire data (can hit some places on a tile, not others), etc.

It'd be quite a big job for VB if you want to use height.

-Git

kedaman
Oct 6th, 2000, 06:58 AM
There's 3 types of isometric maps

slash (The easiest one, but a bad minimap, calculations aren't quite easy but i don't like scrolling the map, maybe good for round worlds)
___
\ \
\ \
\ \
\__\
Z (This is what i've used most of the time, worst in case of calculating positions, not to recommend for non math-heads, but minimap is rectangular and easy scrolling. great for doughnut world maps)
__
\ \
/ /
\ \
/_/
diamond (the actual isometric map, easieat to calculate position calculation, but the minimap would have to be <> and i hate diagonal scrolling)

/\
/ \
\ /
\/

Also do you have any elevations in the map like in tiberian sun or transport tycoon? Now this is not an option either for non math heads :eek:

/\/\isanThr0p
Oct 7th, 2000, 10:49 PM
Hey what's wrong with the page I gave you?there are so many
good tile examples!
Or do you want to use hights?
Actually that is why I'm writing here.
I'm still searching a Hightmap sample!
Like Transport tycoon! or Xcom! The problem isn't how to store it, but how to draw it!

Thanks cu
(I really hate those long lines of code that make the normal text irreadable!)

git
Oct 7th, 2000, 10:57 PM
Ah, I thought it was part of your sig. and you meant you had no time to post code at the moment...oops.

Found it on the page now, thanks. =)

-Git

/\/\isanThr0p
Oct 7th, 2000, 11:10 PM
Hahahaha That's funny. What Kind of a55Hole do you think I am? That would make me even worse than I am.
like:
Haha I got the answer, but I got no time, just wanted to let you know that.
Mann I would be pissed by someone doing this! I guess I would have written me (in your place) at least one hatemail! (after trying to get the answer out of me!)

git
Oct 8th, 2000, 12:02 AM
Hehehe. =)

I found the example, think I can make something of it. =))

Thanks!

Cya.

-Git

kedaman
Oct 9th, 2000, 04:30 AM
isanThr0p, elevated terrain, thats what you need right?
The problem with elevated terrain, is not usually to render the map with them but to generate the tiles. I've done a tile generator with square tiles -> 2 digit isometric elevated tile generator but it works only for 32*32 tiles and 8 pixel elevation.

Plotting the map is simpler, the map Z dimension is drawn in the opposite direction to Y with a 1/3 or 1/4 of the Y height of a tile per elevation. The top vertex of a isometric tile should be the one specifying the elevation and the others should give the shape of the tile. By summing the 2^cornerindex you will have the shape index and with 3 digit elevation, 3^cornerindex...
Ah this topic is huge!

/\/\isanThr0p
Oct 9th, 2000, 05:30 PM
Thanks! Is your editor available for download or something like this, or don't you want to give it away?
32*32 is a real good size, I always use 20 up to 48. only in few cases 64.

btw: I'm Misanthrop!! not Isanthrop!
Wasn't it you who had this 'please spell my name right' in your signature? lol

kedaman
Oct 10th, 2000, 07:44 AM
Sorry about the M, i thought it was something you just added there to have a cool name :)
Now my game is still under the heaviest construction and when the core engine + script is ready i'll think about making a Dll for anyone to use :) I'm using Directdraw of course so you may have to learn Ddraw on your own.
Still my iso-tiles are 32*64, and the z angle is bad. Next thing to do is to implement overall iso-tile sizes and well 40*64 or 48*64 would be more reasonable for iso-tiles.

/\/\isanThr0p
Oct 10th, 2000, 11:04 PM
Hm' I don't want to use a dll, so I'll do it on my own. I programmed a lot of tileengines, so why shouldn't i get how to do the 3d one, (thinking about using d3d, cause it is only a little harder than ddraw)

kedaman
Oct 12th, 2000, 04:20 AM
d3d's a lot harder i think, i've read the documentation,or a 1/5 of it once and it seemed like it would take ages to learn all that. DDraw's lot easier.
WEll, if you don't want a dll, i could as well teach you how to do it, but why don't we discuss this by ICQ or something, this is a huge topic :)

Oct 12th, 2000, 12:22 PM
d3d is not hard if you have good enough understanding of 3D math, If u've already done trignometry or calculus, then 3d would be like 2d for you, because u've already learned how to think in 3D, how to think in more than 2 co-ordinates. The benefit for making something in D3D is that you don't have to mess around with writing your own ways of moving the map and all that other crap. Once your map is loaded onto the screen, you can have fog and all this other cool stuff to make it look realistic, not to mention, that you can zoom in and out of, or move around the 3D objects, just load a 3D object instead of drawing 16 different positions of the sprite and hogging up memory. Need movement? no problem, move the camera around, or make it stuck to a model, and then just change model's 3d co-ordinates. I mean there are so many possibilities of d3d, But starting off with it is hard. If you have good knowledge in 'highlevel' math, then d3d is a piece of cake. Learn 3D Matrices and 3D vectors and stuff like that, if u don't have education in trig or calculus then there are a lot of websites out there which try to teach you some 3D math, which would benefit you with 3d programming. But you have to look for it yourself.

/\/\isanThr0p
Oct 12th, 2000, 05:17 PM
I'm only in Trig/Precalculus, but I'm from Germany and did already many of this stuff. I also programmed some 3D stuff, but you never stop learning, so can you give some of those maths pages?

kedaman
Oct 12th, 2000, 05:31 PM
I could send you the tutorial i think i got it once from WG :) IT's about 5 megs

/\/\isanThr0p
Oct 15th, 2000, 06:20 PM
Hey Keda!

What's up with the tutorial? Still interested in it!

cu

kedaman
Oct 15th, 2000, 06:40 PM
Oh yeah, well i forgot, and i think maybe you forgot too, well next time we chat on icq i'll send you :)