Isometric tile engine..

NoMoreSecrets
02-19-2002, 04:42 AM
Hi guys,
i'm tring to write a small RPG game using isometric tiling.
Right now i've coded some classes to manage NPCs, Chars, Skills ,and stats and i'm moving to the graphic part.
But i've some problem to figure out how is possible to draw correctly the map and how to scroll it around using mouse.

Managing standard tiles is really easy but what about isometric ones?

Can someone help me ?

Take Ultima online as example of the tiling engine that i've in my maind.


-------------------------SOME WORLD CODE--------------------------

Type WLD_MAP
Base(MAX_TILES) As Byte ' (Grass Sand)
Fringe(MAX_TILES) As Byte '(Trees, Transitions tiles)
Object(MAX_TILES) As Byte '(Player,NPC,Swords,..)
End Type


This is a three layered map

Player view is a 10x10 square (of 32x16 tiles)
World is a 200x200 matrix of 32x16 tiles

--------------------------------------

Squirm
02-19-2002, 06:10 AM
Wel, you have two main methods available to you here.


Using Windows API
From the sound of it, you know something about this, using BitBlt to draw tiles. This method is great for simple tile engines, but s you mention, for isometric style can be a pain. You would have to use a mask for the tiles and of course the characters and world objects (tutorial here (http://www.rookscape.com/vbgaming/GBeebe/bitblt.php)).


Using DirectDraw 7
The reason I say DirectDraw is because isometric games are essentially 2D and so no real need to go into Direct3D. This is preferrable in that once you have the basic initialization routines down it gets much easier from there. And its fast ;). If you click here (http://64.23.12.52//TUT_DX7_DD.asp) theres a bunch of tutorials on DD7 ranging from Easy to Hard. You might also want to check out Lucky's VB (http://www.rookscape.com/vbgaming/tutorials.php).

Good luck ;)

NoMoreSecrets
02-19-2002, 06:27 AM
[QUOTE]Originally posted by Squirm


Hi Squirm , i'm sorry i forgot to tell you all that i'm currently using directX7 for surface rendering.

I'm not using directX8 couse ther's no support for DirectDraw and the only chance to render a 2d sprite is to use texturing.

My porblem is not strictly connected to the rendering method:

my first issue is to find the loop algorithm to place the rigth tile in the right place
:p

I'll try to explain..

Normal tiles map are rendered from left to rigth and from up to down spacing each block using tile width and heigth ..
To render isometric tiles you have to use some different method cause tiles are angled and you can't just put one tile next another
:(


(i'm really sorry for my written english but i hope u understand my problem)


Lorenzo

AcidBoot
02-20-2002, 05:50 PM
Hiya,

You can consider each tile a diamond in the center of a rectangular box. You then overlap the rectangles to make the tiles line up.


*****************************
* * *
* * *
* #############################
* # * # * #
* # * # * #
***************************** #
# # #
# # #
#############################

OK... Iv'e used the code tags to help with spacing... obviously it's not code!

The corner of each isometric graphic will line up with the middle of the square it's in, hence the corner of each square will locate the center of a different tile.

Do you follow me?

This will also work if your graphics resources are flat squares that you are arithmetically shearing into isometric shapes, but that is a daft and unpredictable method.

NoMoreSecrets
02-22-2002, 08:55 AM
Ok tnx a lot,
but what about scrolling?

have i to use the same code that i use for normall tilemap scolling?



Byez

Lorenzo

AcidBoot
02-22-2002, 09:25 AM
Originally posted by NoMoreSecrets
have i to use the same code that i use for normall tilemap scolling?

It works in pretty much the same way, except that when scrolling "up" on an isometric map you are infact moving the view diagonally up, and vice versa.

It's just part of the tricky nature of displaying a diamond shaped play area on a square screen. ;)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum