Mirage Source
http://web.miragesource.net/forums/

Problem loading Tiles
http://web.miragesource.net/forums/viewtopic.php?f=201&t=1411
Page 1 of 12

Author:  Vega [ Mon Feb 26, 2007 1:25 am ]
Post subject:  Problem loading Tiles

Where to start... I recently download the Mirage Source and started on my programming adventure.. Everything I have attempted works well except loading more tiles than it was originally set to load. It loads the tiles in the map editor and when you select a tile lower than where it was normally set to load, it loads the tile in the picture box set to preview the tile. However any tile lower than the normal number comes up as a light blue tile on the map. I thought to myself "Hm... The tile sheet height was originally set to 255 as well as the scroll bar for viewing the tiles.. Perhaps they Dimmed something to a Byte instead of an Integer seeing as a Byte is only whole numbers 1 - 255" However, I cannot find such a line of coding to prove this theory. My fiance has the files I have worked on as well, but the tiles show up fine on her screen. I am just curious as if anyone would know what to caused this problem on my end and perhaps a way to fix it. Much thanks to those whom email me or message me about the problem. I am on msn more than Yahoo so try MSN first. Thanks again. ~Vega~

Author:  Lea [ Mon Feb 26, 2007 2:32 am ]
Post subject: 

I don't suppose you use windows 98?

Author:  Vega [ Mon Feb 26, 2007 2:47 am ]
Post subject:  Reply

Negitive. I use Windows XP Pro with a Windows Vista Transformation pack, same as my girlfriend actually. My mom runs Windows XP Media edition and the tile problem is on her computer as well, just not my girlfriends.

Author:  Lea [ Mon Feb 26, 2007 2:50 am ]
Post subject: 

Then it's probably something with configuration. No idea, really.

Maybe it's the video card? What kind do you have, and what kind does she have?

Author:  Vega [ Mon Feb 26, 2007 2:54 am ]
Post subject: 

Not sure what Video Card I use right now to be honest. Like I said, the first half of the tiles work perfect, the second half only shows up as blue tiles. The last tile that works is the last tile that was available before I changed it to load more tiles and the scroll bar.

Author:  Lea [ Mon Feb 26, 2007 3:18 am ]
Post subject: 

Try forcing the surface memory to be in the System instead of the video...

I'm lead to believe that either your video card can't support surfaces that big, or that you don't have enough video memory to hold it all.

Author:  Vega [ Mon Feb 26, 2007 3:20 am ]
Post subject: 

That would be odd considering I used all these tiles on Player Worlds and it worked perfectly though.

Author:  Lea [ Mon Feb 26, 2007 3:33 am ]
Post subject: 

In that case....

You messed up something coding, or Playerworlds does it a different way... I don't know what else to say, sorry.

Author:  Vega [ Mon Feb 26, 2007 3:36 am ]
Post subject: 

o_O.. Dude.. I know I messed up coding somewhere.. wait.. you let me sit here.. and talk about problems i know it isnt, just to get to the conclusion yourself that I messed up some coding? WTH? I had to answer questions that if you had just read in my first post, you would have known already except for the operating system. And the video card thing? Real good... Seriously. Mission accomplished o_O

Author:  Vega [ Mon Feb 26, 2007 3:38 am ]
Post subject: 

Oh and just in case you were wondering, the ignore it and it will go away method does not work here. Kthnx ~Vega~

Author:  Lea [ Mon Feb 26, 2007 3:54 am ]
Post subject: 

If you had given relevant information in your first post, I wouldn't have needed to ask questions to further understand your problem.


You have as little clue as I do about your problem. We don't know that it's a coding issue. It could be a hardware issue, it could be a configuration issue, it could be a driver issue, it could be a windows issue, and then, finally, it could be your program's issue.

One of the difficulties of programming is that everyone's computer is different. Things will work on my computer that don't work on yours, and things will work on your computer that don't on mine. It's life

I made an attempt to help, and I am sad that it was met with such disrespect.

Author:  Vega [ Mon Feb 26, 2007 4:00 am ]
Post subject: 

Aye you are correct in stating all computers is different. However.. the possibility of the video hardware not being good enough is very unlikely, even though half the tiles work. I know the problem is in the code somewhere, but I was asking for help as to where that may be.. Such as.. "Hm... The tile sheet height was originally set to 255 as well as the scroll bar for viewing the tiles.. Perhaps they Dimmed something to a Byte instead of an Integer seeing as a Byte is only whole numbers 1 - 255" Correct me if I am wrong.. But I am pretty sure computers do not act on coincidence.. considering the height of the last tile able to be used is 255 and that the normal height of the tile sheet loaded in was 255 and yet a Byte is only a whole number through 1- 255.. That says something to me.. Maybe not to you, but heh what can I say.. Forgive me for flaming you but your act of helping was more of like.. "Is your computer plugged in?"

Author:  Vega [ Mon Feb 26, 2007 4:06 am ]
Post subject: 

Image[/img]

Bingo.. There is the problem right there. Have fun with this one.

Author:  Lea [ Mon Feb 26, 2007 4:10 am ]
Post subject: 

Some video cards can only support surfaces that are sized in the powers of 2. If your surface is smaller than 512, it may trim it down... or up. It's different for each video card.

If your video card is older, it may not even support surfaces bigger than 256 square.

My act of helping is nothing like "Is your computer plugged in?" I know it's plugged in, because if it wasn't plugged in you wouldn't be here.

Bytes hold numbers 0-255.

Computers act on logic, and you told me that you already checked data types. I ruled that out as soon as you said that.

Are you sure the Tiles.bmp file isn't just blue after that tile? It may seem stupid, but it happens more than you think.
If no,
Do the tiles show up correctly in the mapeditor window?
If yes, do they show up correct in the preview window?
Do you have any blue tiles the exact same as what you see elsewhere in your tileset?
Tile 0, perhaps?

Author:  Vega [ Mon Feb 26, 2007 4:13 am ]
Post subject: 

Understood your concept. The tiles are not blue after that tile, they do show up correctly in the mapeditor window, and they do show up correctly in the preview window, and I do not have any tiles the same as the one showing up. I have been working on this problem for 4 days straight, 14 hours a day so forgive me for being grumpy.

Author:  Lea [ Mon Feb 26, 2007 4:19 am ]
Post subject: 

Tile sheet height being 255, are we talking pixels or tiles?

If it's pixels, you would only have 56 tiiles total.
If it's tiles, then you have 1792 tiles total.

Author:  Vega [ Mon Feb 26, 2007 4:27 am ]
Post subject: 

With frmMirage.picBackSelect
.Width = 7 * PIC_X
.Height = 1000 * PIC_Y
.Picture = LoadPicture(App.Path + GFX2_PATH + "tiles" + GFX_EXT)
End With

The .Height property was 255. It only loaded a certain amount of tiles. The last tile loaded with the .height property at 255 is the last tile that works when I set it to 1000. I have tried different numbers and it doesnt change the fact nothing works past that one tile. I am not sure what that number is such as pixel wize.

' Image constants
Public Const PIC_X = 32
Public Const PIC_Y = 32

that is the image constants so maybe that would help you out as well.

Author:  Lea [ Mon Feb 26, 2007 4:34 am ]
Post subject: 

I've got a few ideas.

Make sure the tile data is saving correctly server side. Use a hex editor... I'll go through how tomorrow if you can't get it. It's probably not this but it only takes a minute to check.

How tall is your tiles.bmp compared to the height of picBackSelect in pixels please?
What happens if you pick a tile on picBackSelect that isn't in tiles.bmp?
Is it just black, or does it turn blue aswell?

I am going to bed, i will continue bickering with you tomorrow,

ta~

Author:  Vega [ Mon Feb 26, 2007 4:43 am ]
Post subject: 

Picking a tile that is not on the tile sheet is black.

It does this before making it to the server side. While in mapeditor it shows up right on preview box but on the map where you draw the tile, it turns blue before you send the data. Thus it shouldnt be going to server side yet. I thought so myself before I realized that.

Author:  Verrigan [ Mon Feb 26, 2007 5:19 am ]
Post subject: 

Can you show us your Blt functions, please?

Author:  Vega [ Mon Feb 26, 2007 5:23 am ]
Post subject: 

Code:
Public Sub BltTile(ByVal x As Long, ByVal y As Long)

Dim Ground As Long
Dim Anim1 As Long
Dim Anim2 As Long

    With Map.Tile(x, y)
        Ground = .Ground
        Anim1 = .Mask
        Anim2 = .Anim
    End With
   
    ' Only used if ever want to switch to blt rather then bltfast
    With rec_pos
        .top = y * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = x * PIC_X
        .Right = .Left + PIC_X
    End With
   
    With rec
        .top = Int(Ground / 7) * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = (Ground - Int(Ground / 7) * 7) * PIC_X
        .Right = .Left + PIC_X
    End With
    Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT)
   
    If (MapAnim = 0) Or (Anim2 <= 0) Then
        ' Is there an animation tile to plot?
        If Anim1 > 0 And TempTile(x, y).DoorOpen = NO Then
            With rec
                .top = Int(Anim1 / 7) * PIC_Y
                .Bottom = .top + PIC_Y
                .Left = (Anim1 - Int(Anim1 / 7) * 7) * PIC_X
                .Right = .Left + PIC_X
            End With
            Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
        End If
    Else
        ' Is there a second animation tile to plot?
        If Anim2 > 0 Then
            With rec
                .top = Int(Anim2 / 7) * PIC_Y
                .Bottom = .top + PIC_Y
                .Left = (Anim2 - Int(Anim2 / 7) * 7) * PIC_X
                .Right = .Left + PIC_X
            End With
            Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
        End If
    End If
End Sub

Public Sub BltItem(ByVal ItemNum As Long)
'****************************************************************
'* WHEN        WHO        WHAT
'* ----        ---        ----
'* 07/12/2005  Shannara   Optimized function.
'****************************************************************
   
    ' Only used if ever want to switch to blt rather then bltfast
    With rec_pos
        .top = MapItem(ItemNum).y * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = MapItem(ItemNum).x * PIC_X
        .Right = .Left + PIC_X
    End With

    With rec
        .top = Item(MapItem(ItemNum).Num).Pic * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = 0
        .Right = .Left + PIC_X
    End With
   
    Call DD_BackBuffer.BltFast(MapItem(ItemNum).x * PIC_X, MapItem(ItemNum).y * PIC_Y, DD_ItemSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End Sub


That is the bltTile Sub

Code:
Public Sub BltFringeTile(ByVal x As Long, ByVal y As Long)
Dim Fringe As Long

    ' Only used if ever want to switch to blt rather then bltfast
    With rec_pos
        .top = y * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = x * PIC_X
        .Right = .Left + PIC_X
    End With
   
    Fringe = Map.Tile(x, y).Fringe
       
    If Fringe > 0 Then
        With rec
            .top = Int(Fringe / 7) * PIC_Y
            .Bottom = .top + PIC_Y
            .Left = (Fringe - Int(Fringe / 7) * 7) * PIC_X
            .Right = .Left + PIC_X
        End With
        Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
    End If
End Sub


That is the blt Fringe Tile sub. Anything else needed for review?

Author:  Verrigan [ Mon Feb 26, 2007 5:31 am ]
Post subject: 

What surface is the tile that isn't functioning properly?

Author:  Vega [ Mon Feb 26, 2007 5:33 am ]
Post subject: 

The Picture I posted is the fringe surface, however mask, animate, and ground turns out the exact same way.

Author:  Verrigan [ Mon Feb 26, 2007 5:45 am ]
Post subject: 

Would you be willing to give me the source code for the client so I can login and debug this for you? (And possibly see if it does it to me)

Author:  Vega [ Mon Feb 26, 2007 5:52 am ]
Post subject: 

Fine with me how would you like to get the files?

Image

This is the result of the tile problem while using the map editor. If it worked right, the map on the game would have the exact same thing in the exact same order as the shown part of the tile sheet in the mapeditor.

Page 1 of 12 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/