Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
32x64 problem + graphic question
#1
Hi
I'm Polish and my English isn't very good, sorry :oops:

1. I changed sprites size from 32x32 to 32x64 and it isn't ok. It shows sprites in a good size, but upper part of the sprite doesn't fit to the lower.
This problem exist only in few position, not everytime.
Look:
[Image: bladpf1.jpg]
Sprite of Gieroes is ok, upper and lower parts fit to each other, but Styku96's sprite's parts doesnt fit.

Any sugestions to solve it?

2. Are there any functions, commands to change image? For Example to blur it or make some other effect on it.


Thanks for any reply, and again sorry for my English;]
Reply
#2
Any ideas?
Reply
#3
1.

Imageshack is blocked on my campus network so I can't see the image, but it could be a problem with positioning in sprites.bmp (or .png/.gif/.whatever-you-use). There could be an error in coding if it's just like... your top half is facing left and bottom is facing forward, or something. I can't say for sure since I can't see it nor your code.

2.

I haven't a clue. Sad
Reply
#4
Make sure the animation code in BltPlayer matches that of BltPlayerTop.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#5
I didn't change any code in blting, only changed 32x32 to 32x64.
How can I show you this image?;p

It's Like That:

+++++
+++++

It's a sprite.
Everything + should by under +, but sometimes it's like that:
+++++
+++++

Position of upper part is another than lower.

Any ideas?Big Grin
Reply
#6
Here, try this tutorial:
http://web.miragesource.com/forums/viewt...ilit=32x64
Reply
#7
Ups, I didn't say sth Big Grin
I use Elysium Diamond and I think, ekhm, Im sure that bltplayertop is there;]
Reply
#8
FIX:

It's Like That:

+++++
+++++

It's a sprite.
Everything + should by under +, but sometimes it's like that:
+++++
.+++++

Position of upper part is another than lower.
Reply
#9
Ok, I discovered sth.
This bug appears only on two frames-right walking.
It appears when char goes to right. Any ideas now?Big Grin
Reply
#10
Give us a picture of you sprite on the tilesheet, cause I don't see anything wrong with the sprite...
Reply
#11
He means one straight from the sheet, so we have something to compare to find the problem
Reply
#12
Ok, look
[Image: spriteerrorkx9.jpg]
First line is from sprites.bmp, secound is from game. Do you see it now?
Reply
#13
Gierek Wrote:Ok, look
[Image: spriteerrorkx9.jpg]
First line is from sprites.bmp, secound is from game. Do you see it now?

I've already told you how to solve your problem. Your animation code in BltPlayer and BltPlayerTop are mismatched.

Robin Wrote:Make sure the animation code in BltPlayer matches that of BltPlayerTop.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#14
Actually, now I look again it might not be the animation code but the offset lines.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#15
ED2 always had a problem with 32x64 sprites, if you mean that the top half of the player is moved a pixel to the left or right.
There was a fix on the old forum somewhere there, but its lost forever.
Reply
#16
Ok..

BltPlayer:
Code:
Sub BltPlayer(ByVal Index As Long)
Dim Anim As Byte
Dim x As Long, y As Long
Dim AttackSpeed As Long

    If GetPlayerWeaponSlot(Index) > 0 Then
        AttackSpeed = 1000 - (GetPlayerSPEED(Index) * 2)
    Else
        AttackSpeed = 1000
    End If

    ' Only used if ever want to switch to blt rather then bltfast
    ' I suggest you don't use, because custom sizes won't work any longer
    With rec_pos
        .Top = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (SIZE_Y - PIC_Y)
        .Bottom = .Top + PIC_Y
        .Left = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + ((SIZE_X - PIC_X) / 2)
        .Right = .Left + PIC_X + ((SIZE_X - PIC_X) / 2)
    End With
    
    ' Check for animation
    Anim = 0
    If Player(Index).Attacking = 0 Then
        Select Case GetPlayerDir(Index)
            Case DIR_UP
                If (Player(Index).YOffset < PIC_Y / 2) Then Anim = 1
            Case DIR_DOWN
                If (Player(Index).YOffset > PIC_Y / 2 * -1) Then Anim = 1
            Case DIR_LEFT
                If (Player(Index).XOffset < PIC_Y / 2) Then Anim = 1
            Case DIR_RIGHT
                If (Player(Index).XOffset > PIC_Y / 2 * -1) Then Anim = 1
        End Select
    Else
        If Player(Index).AttackTimer + Int(AttackSpeed / 2) > GetTickCount Then
            Anim = 2
        End If
    End If
    
    ' Check to see if we want to stop making him attack
    If Player(Index).AttackTimer + AttackSpeed < GetTickCount Then
        Player(Index).Attacking = 0
        Player(Index).AttackTimer = 0
    End If
    
    rec.Top = GetPlayerSprite(Index) * SIZE_Y + (SIZE_Y - PIC_Y)
    rec.Bottom = rec.Top + PIC_Y
    rec.Left = (GetPlayerDir(Index) * (3 * (SIZE_X / PIC_X)) + (Anim * (SIZE_X / PIC_X))) * PIC_X
    rec.Right = rec.Left + SIZE_X

    x = GetPlayerX(Index) * PIC_X - (SIZE_X - PIC_X) / 2 + sx + Player(Index).XOffset
    y = GetPlayerY(Index) * PIC_Y - (SIZE_Y - PIC_Y) + sx + Player(Index).YOffset + (SIZE_Y - PIC_Y)
    
    If SIZE_X > PIC_X Then
        If x < 0 Then
            x = Player(Index).XOffset + sx + ((SIZE_X - PIC_X) / 2)
            If GetPlayerDir(Index) = DIR_RIGHT And Player(Index).Moving > 0 Then
                rec.Left = rec.Left - Player(Index).XOffset
            Else
                rec.Left = rec.Left - Player(Index).XOffset + ((SIZE_X - PIC_X) / 2)
            End If
        End If
        
        If x > MAX_MAPX * 32 Then
            x = MAX_MAPX * 32 + sx - ((SIZE_X - PIC_X) / 2) + Player(Index).XOffset
            If GetPlayerDir(Index) = DIR_LEFT And Player(Index).Moving > 0 Then
                rec.Right = rec.Right + Player(Index).XOffset
            Else
                rec.Right = rec.Right + Player(Index).XOffset - ((SIZE_X - PIC_X) / 2)
            End If
        End If
    End If
    
    Call DD_BackBuffer.BltFast(x - (NewPlayerX * PIC_X) - NewXOffset, y - (NewPlayerY * PIC_Y) - NewYOffset, DD_SpriteSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End Sub

BltPlayerTop:
Code:
Sub BltPlayerTop(ByVal Index As Long)
Dim Anim As Byte
Dim x As Long, y As Long
Dim AttackSpeed As Long

    If GetPlayerWeaponSlot(Index) > 0 Then
        AttackSpeed = item(GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))).AttackSpeed
    Else
        AttackSpeed = 1000
    End If

    ' Only used if ever want to switch to blt rather then bltfast
    ' I suggest you don't use, because custom sizes won't work any longer
    With rec_pos
        .Top = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset - (SIZE_Y - PIC_Y)
        .Bottom = .Top + PIC_Y
        .Left = GetPlayerX(Index) * PIC_X + Player(Index).XOffset + ((SIZE_X - PIC_X) / 2)
        .Right = .Left + PIC_X + ((SIZE_X - PIC_X) / 2)
    End With
    
    ' Check for animation
    Anim = 0
    If Player(Index).Attacking = 0 Then
        Select Case GetPlayerDir(Index)
            Case DIR_UP
                If (Player(Index).YOffset < PIC_Y / 2) Then Anim = 1
            Case DIR_DOWN
                If (Player(Index).YOffset < PIC_Y / 2 * -1) Then Anim = 1
            Case DIR_LEFT
                If (Player(Index).XOffset < PIC_Y / 2) Then Anim = 1
            Case DIR_RIGHT
                If (Player(Index).XOffset < PIC_Y / 2 * -1) Then Anim = 1
        End Select
    Else
        If Player(Index).AttackTimer + Int(AttackSpeed / 2) > GetTickCount Then
            Anim = 2
        End If
    End If
    
    ' Check to see if we want to stop making him attack
    If Player(Index).AttackTimer + AttackSpeed < GetTickCount Then
        Player(Index).Attacking = 0
        Player(Index).AttackTimer = 0
    End If
    
    rec.Top = GetPlayerSprite(Index) * SIZE_Y
    rec.Bottom = rec.Top + (SIZE_Y - PIC_Y)
    rec.Left = (GetPlayerDir(Index) * (3 * (SIZE_X / PIC_X)) + (Anim * (SIZE_X / PIC_X))) * PIC_X
    rec.Right = rec.Left + SIZE_X

    x = GetPlayerX(Index) * PIC_X - (SIZE_X - PIC_X) / 2 + sx + Player(Index).XOffset
    y = GetPlayerY(Index) * PIC_Y - (SIZE_Y - PIC_Y) + sx + Player(Index).YOffset
    
    
    If y < 0 Then
        y = 0
        If GetPlayerDir(Index) = DIR_DOWN And Player(Index).Moving > 0 Then
            rec.Top = rec.Top - Player(Index).YOffset
        Else
            rec.Top = rec.Top - Player(Index).YOffset + (SIZE_Y - PIC_Y)
        End If
    End If
    
    If SIZE_X > PIC_X Then
        If x < 0 Then
            x = Player(Index).XOffset + sx + ((SIZE_X - PIC_X) / 2)
            If GetPlayerDir(Index) = DIR_RIGHT And Player(Index).Moving > 0 Then
                rec.Left = rec.Left - Player(Index).XOffset
            Else
                rec.Left = rec.Left - Player(Index).XOffset + ((SIZE_X - PIC_X) / 2)
            End If
        End If
        
        If x > MAX_MAPX * 32 Then
            x = MAX_MAPX * 32 + sx - ((SIZE_X - PIC_X) / 2) + Player(Index).XOffset
            If GetPlayerDir(Index) = DIR_LEFT And Player(Index).Moving > 0 Then
                rec.Right = rec.Right + Player(Index).XOffset
            Else
                rec.Right = rec.Right + Player(Index).XOffset - ((SIZE_X - PIC_X) / 2)
            End If
        End If
    End If
    
    Call DD_BackBuffer.BltFast(x - (NewPlayerX * PIC_X) - NewXOffset, y - (NewPlayerY * PIC_Y) - NewYOffset, DD_SpriteSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End Sub
Reply
#17
What source do you use?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#18
Elysium Diamond 2.0
Reply
#19
Right, I suggest you tell us that before hand as this is a Mirage forum, so we assume that you're using Mirage Source.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#20
Gierek Wrote:Ups, I didn't say sth Big Grin
I use Elysium Diamond and I think, ekhm, Im sure that bltplayertop is there;]

Eh.. Robin
Reply
#21
He posted that after me. Big Grin
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#22
I don't know the fix but I really like the sprites

:p
Reply
#23
There's no need to post then.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#24
Robin Wrote:There's no need to post then.

No need to be so anal towards the people you dislike/hate

but since your.. administrator I'll be the small one here and

just back off.
Reply
#25
I don't hate you >_>
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)