 |

04-04-2002, 08:10 PM
|
|
Junior Contributor
|
|
Join Date: Feb 2002
Location: They call me nowhere man.
Posts: 351
|
|
Working Isometric DD engine... well, except for one little thing. Help!
|
Alright, this is just the graphics portion of a game engine which I've been working on for a week. All the art resources included should be fairly familiar to y'all. =)
Here's my problem (and this is why I included the pillars - you can see it much easier with them). Whenever I tell the program to draw a tile, it draws it twice - once where its supposed to, and once to the right and below it.
But for some darn reason, I can't figure out what is going on! Could I get some help, please? =/
|
|

04-06-2002, 12:18 AM
|
|
Junior Contributor
|
|
Join Date: Feb 2002
Location: They call me nowhere man.
Posts: 351
|
|
*sighs* Please?
|
Awww.. c'mon. Downloaded five times, but no one is willing to help. Code vultures! *makes weird cawing noises*
|
|

04-06-2002, 04:31 AM
|
 |
Gaming God
Retired Leader * Expert *
|
|
Join Date: Feb 2002
Location: Brisbane, Australia
Posts: 2,363
|
|
Well I did look at it before and saw how confusing it was so gave up.
I'm actually writing a major game in my spare time at the moment which uses the isometric view for a map as well, but I use the coordinates on a 45 Degree shift to the right...
It's a bit hard to explain so this is my iso map routine if you are interested...
Code:
Private Sub DrawMap(Xposition As Long, Yposition As Long)
Dim x As Long ' Loop Var
Dim y As Long ' Loop Var
Dim XMap As Long ' X Co-ordinate of tile
Dim YMap As Long ' Y Co-ordinate of tile
Dim XIndent As Long ' Indent every 2nd line down
Dim XOffset As Long ' X offset of map tiles (-30 is half a tile's width)
Dim Yoffset As Long ' Y offset of map tiles (-15 is half a tile's height)
Dim XSize As Long ' How many tiles across the page
XMap = Xposition
YMap = Yposition
XOffset = -30
Yoffset = -15
XSize = 15
For y = 0 To 41
For x = 0 To XSize
BitBlt pctMain.hDC, XOffset + x * 60 + XIndent, Yoffset + y * 15, _
60, 30, pctSprites.hDC, 180, 105, RasterOps.SRCAND
BitBlt pctMain.hDC, XOffset + x * 60 + XIndent, Yoffset + y * 15, _
60, 30, pctSprites.hDC, 120, 105, RasterOps.SRCPAINT
If MAP(XMap, YMap).Wall(0) = 1 Then
BitBlt pctMain.hDC, XOffset + x * 60 + XIndent, Yoffset + y * 15 - 120 - 30, _
30, 135, pctSprites.hDC, 30, 0, RasterOps.SRCAND
BitBlt pctMain.hDC, XOffset + x * 60 + XIndent, Yoffset + y * 15 - 120 - 30, _
30, 135, pctSprites.hDC, 0, 0, RasterOps.SRCPAINT
End If
If MAP(XMap, YMap).Wall(1) = 1 Then
BitBlt pctMain.hDC, XOffset + x * 60 + XIndent + 30, Yoffset + y * 15 - 120 - 30, _
30, 135, pctSprites.hDC, 90, 0, RasterOps.SRCAND
BitBlt pctMain.hDC, XOffset + x * 60 + XIndent + 30, Yoffset + y * 15 - 120 - 30, _
30, 135, pctSprites.hDC, 60, 0, RasterOps.SRCPAINT
End If
XMap = XMap + 1
YMap = YMap - 1
Next x
XMap = XMap - XSize - 1
YMap = YMap + XSize + 1
If XIndent = 0 Then
XMap = XMap + 1
Else
YMap = YMap + 1
End If
XIndent = 30 - XIndent
Next y
pctMain.Refresh
End Sub
It is no way near finished by any means and I will port it over to directdraw later when I'm happy with all the objects on the map appearing correctly as well as the 'smart draw' routine I will write which will only draw items which are visible incase there is a wall in front of them....
Hope this helps... 
|
|

04-07-2002, 08:15 PM
|
 |
Centurion
|
|
Join Date: Jan 2002
Location: Philippines
Posts: 129
|
|
Re: *sighs* Please?
Quote:
Originally posted by Mithrandel
Awww.. c'mon. Downloaded five times, but no one is willing to help. Code vultures! *makes weird cawing noises*
|
Maybe they downloaded your file, checked it out, but can't offer any solutions. That's possible, man.
Anyway, I'll download it to check it out myself. If I can't reply back, maybe because I can't formulate a solution, NOT because I'm stealing your code.
Hope Pookie's suggestion helped.
Later.
|
|

04-07-2002, 09:50 PM
|
|
Junior Contributor
|
|
Join Date: Feb 2002
Location: They call me nowhere man.
Posts: 351
|
|
*flaps arms up and down*
|
((I'm a bat. What are you staring at?))
I was just kidding! Honestly, I don't make weird bird-noises in polite conversation! Seriously!
((Durn nose growing... gives me away every time!))
|
|

04-14-2002, 08:27 PM
|
|
Contributor
|
|
Join Date: Jan 2002
Posts: 489
|
|
Look here:
Code:
For i = 0 To CInt(SCREEN_WIDTH / TILE_WIDTH) + 1
I would presume it would be:
Code:
For i = 0 To CInt(SCREEN_WIDTH / TILE_WIDTH)
It seems to cut down the amount of pillars drawn
|
|

04-14-2002, 11:10 PM
|
|
Junior Contributor
|
|
Join Date: Feb 2002
Location: They call me nowhere man.
Posts: 351
|
|
Well, I thought so too at first. But...
|
Actually, the added 1 in there is neccesary to prevent 'pop-in'... where pillars on the far right of the screen suddenly pop into view. This is neccesary because when the center of your screen is halfway between tiles, you need to draw in one extra layer of pillars on the far right side or else they'll pop in once you're stationary once more (and the pillars on the far left are no longer on the screen).
Heh. Good point though. Maybe I should write some sort of loop so that it only displays those extra pillars when you're moving? Save a few fps. =P
Ah, but I have a more interesting announcement. =/ Next post, please...
|
|

04-14-2002, 11:23 PM
|
|
Junior Contributor
|
|
Join Date: Feb 2002
Location: They call me nowhere man.
Posts: 351
|
|
Well, looks like isometric is out.
|
Well, thanks to everyone who downloaded the code and gave it a shot, but it looks like I'm going to be doing a traditional rectangle-based system, since I can't get the durn isometric tiles to give me the proper values.
And rectangles will make the art a bit easier to produce. A little harder to program, though, to make sure they still look 'right' (since I still hope to make it *look* isometric, even though its rectangle-based. I think StarCraft did this, too...).
|
|

04-17-2002, 10:41 PM
|
|
Contributor
|
|
Join Date: Jan 2002
Posts: 489
|
|
|
This might help you, it's an isometric map example I downloaded a while ago.
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|