Sonic and Sega Retro Message Board: SonAni2Gif - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

SonAni2Gif Convert animation scripts to GIF

#1 User is offline MainMemory 

Posted 05 April 2012 - 07:35 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4179
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Posted Image
Posted Image
Download
OK so here's how you use this:
On the left click the Add button to load an art file (a dialog will ask the compression type). The rest of the stuff is changing the order art files are used in and what address it's loaded at, allowing you to create a virtual VRAM space. The bottom of the form allows you to view the loaded tiles (you can scroll through it with arrow keys).
Click "Import Palette" to load a palette file and tell it what offset to load it at. Do this as many times as you need.
Then in the File menu, you can load Mappings, DPLC and Animations. Each item will have a check mark when it is loaded. For all three, you can specify Binary or ASM and a starting address or label.
For mappings, you can choose the game and the starting palette line.
For DPLCs, you can choose the game. Note that S3K's player objects use S2 format, while other objects use a different format.
On the right you can select an animation, with labels if you loaded ASM mappings, or hex offsets otherwise, and then click "GIF Export".

Animations which have the speed value set to $FD, $FE or $FF will use a value of 4 instead.

Animations which are set to loop indefinitely ($FF) will produce infinitely looping GIFs. Animations which jump back a number of frames ($FE) will be split into _intro and _loop GIFs. Animations which change to a different animation ($FD) will go through each animation until it finds a non-FD animation, then it will stop; if the last animation ends with $FE it will be split into _intro and _loop GIFs. All other types will play once, then stop.

KNOWN BUG: The two pixels on the bottom right are always black. I have no explanation for this.

Edit: Bugfix, now opens S1 Mappings and DPLC correctly.
This post has been edited by MainMemory: 06 April 2012 - 07:52 PM

#2 User is offline KingofHarts 

Posted 05 April 2012 - 09:07 PM

  • Posts: 1609
  • Joined: 07-August 10
  • Gender:Male
  • Project:Project Sonic 8x16
  • Wiki edits:1
Well this isn't quite what you were going with before, but nonetheless it is still looking pretty sweet. I'm downloading it now, can't wait to try it out!

#3 User is offline MainMemory 

Posted 06 April 2012 - 02:42 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4179
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I've updated it to change the handling of $FE animations: it now produces _intro and _loop GIFs.
Posted Image

#4 User is offline E-122-Psi 

Posted 06 April 2012 - 07:46 PM

  • Posts: 1740
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41
Like the complex looping programming, didn't know you could do that with GiFs. I could have a lot of fun with this. :D

#5 User is offline Hitaxas 

Posted 06 April 2012 - 08:12 PM

  • Pokemon and Sonic themed Twich streamer
  • Posts: 1437
  • Joined: 30-September 07
  • Gender:Male
  • Location:Litchfield,CT
  • Project:Becoming a Twitch partner, and getting my life back together
  • Wiki edits:196
This will make it easier to sprite, in it's own way. I've used photoshop many times to see if an animation would look well, this seems to be much easier to use for such a purpose. Awesome work!

Edit: there seems to be a slight problem though.

I loaded everything, and for the most part it works fine, however the animations don't all read, it stops at animation $1E, which is SonAni_Balance4 for me. I have around 18 more animations than that.

Edit2: This is Sonic 2 I am talking about, as always.
This post has been edited by Hitaxas: 06 April 2012 - 08:21 PM

#6 User is offline MainMemory 

Posted 06 April 2012 - 08:43 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4179
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
The only reasons I can think of for it to stop is if it reached the address that matches the lowest offset in the table, or an instruction that isn't dc.X, offsetTable, offsetTableEntry.X, align, or even.

#7 User is offline Hitaxas 

Posted 06 April 2012 - 10:54 PM

  • Pokemon and Sonic themed Twich streamer
  • Posts: 1437
  • Joined: 30-September 07
  • Gender:Male
  • Location:Litchfield,CT
  • Project:Becoming a Twitch partner, and getting my life back together
  • Wiki edits:196
I realized that there was a line calling for an animation that is part of the super form animations that was causing some of the trouble, as it isn't in the animation file I made. However, after correcting that I still couldn't get all animations to load.

SonicAniData:
	dc.w SonAni_Walk - SonicAniData		; 0
	dc.w SonAni_Run - SonicAniData		; 1
	dc.w SonAni_Roll - SonicAniData		; 2
	dc.w SonAni_Roll2 - SonicAniData	; 3
	dc.w SonAni_Push - SonicAniData		; 4
	dc.w SonAni_Wait - SonicAniData		; 5
	dc.w SonAni_Balance - SonicAniData	; 6
	dc.w SonAni_LookUp - SonicAniData	; 7
	dc.w SonAni_Duck - SonicAniData		; 8
	dc.w SonAni_Spindash - SonicAniData	; 9
	dc.w SonAni_Blink - SonicAniData	; 10 ; $A
	dc.w SonAni_GetUp - SonicAniData	; 11 ; $B
	dc.w SonAni_Balance2 - SonicAniData	; 12 ; $C
	dc.w SonAni_Stop - SonicAniData		; 13 ; $D
	dc.w SonAni_Float - SonicAniData	; 14 ; $E
	dc.w SonAni_Float2 - SonicAniData	; 15 ; $F
	dc.w SonAni_Spring - SonicAniData	; 16 ; $10
	dc.w SonAni_Hang - SonicAniData		; 17 ; $11
	dc.w SonAni_Dash2 - SonicAniData	; 18 ; $12
	dc.w SonAni_Dash3 - SonicAniData	; 19 ; $13
	dc.w SonAni_Hang2 - SonicAniData	; 20 ; $14
	dc.w SonAni_Bubble - SonicAniData	; 21 ; $15
	dc.w SonAni_DeathBW - SonicAniData	; 22 ; $16
	dc.w SonAni_Drown - SonicAniData	; 23 ; $17
	dc.w SonAni_Death - SonicAniData	; 24 ; $18
	dc.w SonAni_Hurt - SonicAniData		; 25 ; $19
	dc.w SonAni_Hurt - SonicAniData		; 26 ; $1A
	dc.w SonAni_Slide - SonicAniData	; 27 ; $1B
	dc.w SonAni_Blank - SonicAniData	; 28 ; $1C
	dc.w SonAni_Balance3 - SonicAniData	; 29 ; $1D
	dc.w SonAni_Balance4 - SonicAniData	; 30 ; $1E
	dc.w SupSonAni_Transform - SonicAniData	; 31 ; $1F
	dc.w SonAni_Lying - SonicAniData	; 32 ; $20
	dc.w SonAni_LieDown - SonicAniData	; 33 ; $21
	dc.w SonAni_Peel - SonicAniData         ; 34 ; $22
	dc.w SonAni_PeelCharge - SonicAniData   ; 35 ; $23
	dc.w SonAni_PeelCharge2 - SonicAniData  ; 36 ; $24
	dc.w SonAni_dash - SonicAniData         ; 37 ; $25
	dc.w SonAni_pose - SonicAniData         ; 38 ; $26
        dc.w SonAni_spindashcharge - SonicAniData        ; $27
        dc.w SonAni_spindashcharge2 - SonicAniData        ; $28
        dc.w SonAni_jumpdash - SonicAniData               ; $29
        dc.w SonAni_jump - SonicAniData                   ; $2A ???
        dc.w SonAni_Wallgrab - SonicAniData               ; 2B
        dc.w SonAni_Duck2 - SonicAniData                  ; 2C
        dc.w SonAni_SpindashRev - SonicAniData            ; 2D
        dc.w SonAni_stompfall - SonicAniData
        dc.w SonAni_Stand - SonicAniData
SonAni_Walk:	dc.b $FF, $C,$D,$E,$F,$10,$11, $12, $13,$FF
SonAni_Run:	dc.b $FF,$2C,$2D,$2E,$2F,$FF,$FF,$FF,$FF,$FF
SonAni_Roll:	dc.b $FE,$3C,$40,$3D,$40,$3E,$40,$3F,$40,$FF
SonAni_Roll2:	dc.b $FE,$3C,$40,$3D,$40,$3E,$40,$3F,$40,$FF
SonAni_Push:	dc.b $FD,$48,$49,$4A,$4B,$FF,$FF,$FF,$FF,$FF
SonAni_Wait:
	dc.b   5,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1
	dc.b   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2
	dc.b   3,  3,  3,  3,  3,  4,  4,  4,  5,  5,  5,  4,  4,  4,  5,  5
	dc.b   5,  4,  4,  4,  5,  5,  5,  4,  4,  4,  5,  5,  5,  6,  6,  6
	dc.b   6,  6,  6,  6,  6,  6,  6,  4,  4,  4,  5,  5,  5,  4,  4,  4
	dc.b   5,  5,  5,  4,  4,  4,  5,  5,  5,  4,  4,  4,  5,  5,  5,  6
	dc.b   6,  6,  6,  6,  6,  6,  6,  6,  6,  4,  4,  4,  5,  5,  5,  4
	dc.b   4,  4,  5,  5,  5,  4,  4,  4,  5,  5,  5,  4,  4,  4,  5,  5
	dc.b   5,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  4,  4,  4,  5,  5
	dc.b   5,  4,  4,  4,  5,  5,  5,  4,  4,  4,  5,  5,  5,  4,  4,  4
	dc.b   5,  5,  5,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  7,  8,  8
	dc.b   8,  9,  9,  9,$FE,  6
SonAni_Balance:	dc.b   9,$CC,$CD,$CE,$CD,$FF
SonAni_LookUp:	dc.b   5,$B,$FE,  1  ; 5, $B, $C,$FE,  1
SonAni_Duck:	dc.b   5,$4C,$FE,  1
SonAni_Spindash:dc.b   7,$41,$42,$43,$44,$FF   ; new spindash animation, uses 2 less frames than the original, and unlike the original does not use a frame between each
SonAni_Blink:	dc.b   1,  2,$FD,  0
SonAni_GetUp:	dc.b   3, $A,$FD,  0
SonAni_Balance2:dc.b   3,$C8,$C9,$CA,$CB,$FF
SonAni_Stop:	dc.b   5,$D1,$D2,$D3,$D4,$FD,  0 ; halt/skidding animation
SonAni_Float:	dc.b   7,$54,$59,$FF
SonAni_Float2:	dc.b   7,$54,$55,$56,$57,$58,$FF
SonAni_Spring:	dc.b $2F,$5A,$FD,  2
SonAni_Hang:	dc.b   1,$50,$51,$FF
SonAni_Dash2:	dc.b  $F,$43,$43,$43,$FE,  1
SonAni_Dash3:	dc.b  $F,$43,$44,$FE,  1
SonAni_Hang2:	dc.b $13,$6B,$6C,$FF
SonAni_Bubble:	dc.b  $B,$5A,$5A,$11,$12,$FD,  0 ; breathe
SonAni_DeathBW:	dc.b $20,$5E,$FF
SonAni_Drown:	dc.b $20,$5D,$FF
SonAni_Death:	dc.b $20,$5B,$FF
SonAni_Hurt:	dc.b $40,$4E,$FF
SonAni_Slide:	dc.b   9,$4E,$4F,$FF
SonAni_Blank:	dc.b $77,  0,$FD,  0
SonAni_Balance3: dc.b $13,$D0,$D1,$FF
SonAni_Balance4: dc.b   3,$CF,$C8,$C9,$CA,$CB,$FE,  4
SonAni_Lying:	dc.b   9,  8,  9,$FF
SonAni_LieDown:	dc.b   3,  7,$FD,  0
SonAni_Peel:	dc.b $FF,$D7,$D8,$D9,$DA,$D7,$D8,$D9,$DA,$FF
SonAni_PeelCharge:	dc.b 2, $E,$F,$10,$11,$2C,$2D,$2E,$2F,$FD,$24 ;3
SonAni_PeelCharge2:dc.b   0,$D6,$D7,$D8,$D9,$D6,$D7,$D6,$D9,$FF
SonAni_dash:    dc.b $20, $E7, $FD, 2
Sonani_pose:    dc.b 0,$5D,$FF
SonAni_spindashcharge:	dc.b 5,$3C,$40,$3D,$40,$3E,$40,$3F,$40,$FD,$28
SonAni_spindashcharge2:	dc.b 0,$3C,$40,$3D,$40,$3E,$40,$3F,$40,$FF
SonAni_jumpdash:	dc.b 0,$E7,$E8,$FD,2
SonAni_jump:	dc.b $FE,$3C,$40,$3D,$40,$3E,$40,$3F,$40,$FF
SonAni_Wallgrab:        dc.b 0,$4B,$FF
SonAni_Duck2:	dc.b   $2F,$4C,$FD,  0
SonAni_SpindashRev:    dc.b 7,$E9,$EA,$EB,$EC,$FD, 9
SonAni_stompfall:	dc.b   $2,$4C,$FD, $2F
SonAni_Stand:	dc.b 0, $1,$FF
	even


SuperSonicAniData:
	dc.w SupSonAni_Walk - SuperSonicAniData		; 0
	dc.w SupSonAni_Run - SuperSonicAniData          ; 1
	dc.w SonAni_Roll - SuperSonicAniData            ; 2
	dc.w SonAni_Roll2 - SuperSonicAniData           ; 3
	dc.w SupSonAni_Push - SuperSonicAniData         ; 4
	dc.w SupSonAni_Stand - SuperSonicAniData        ; 5
	dc.w SupSonAni_Balance - SuperSonicAniData      ; 6
	dc.w SonAni_LookUp - SuperSonicAniData          ; 7
	dc.w SupSonAni_Duck - SuperSonicAniData         ; 8
	dc.w SonAni_Spindash - SuperSonicAniData        ; 9
	dc.w SonAni_Blink - SuperSonicAniData           ; 10 ; $A
	dc.w SonAni_GetUp - SuperSonicAniData           ; 11 ; $B
	dc.w SonAni_Balance2 - SuperSonicAniData        ; 12 ; $C
	dc.w SonAni_Stop - SuperSonicAniData            ; 13 ; $D
	dc.w SonAni_Float - SuperSonicAniData           ; 14 ; $E
	dc.w SonAni_Float2 - SuperSonicAniData          ; 15 ; $F
	dc.w SonAni_Spring - SuperSonicAniData          ; 16 ; $10
	dc.w SonAni_Hang - SuperSonicAniData            ; 17 ; $11
	dc.w SonAni_Dash2 - SuperSonicAniData           ; 18 ; $12
	dc.w SonAni_Dash3 - SuperSonicAniData           ; 19 ; $13
	dc.w SonAni_Hang2 - SuperSonicAniData           ; 20 ; $14
	dc.w SonAni_Bubble - SuperSonicAniData          ; 21 ; $15
	dc.w SonAni_DeathBW - SuperSonicAniData         ; 22 ; $16
	dc.w SonAni_Drown - SuperSonicAniData           ; 23 ; $17
	dc.w SonAni_Death - SuperSonicAniData           ; 24 ; $18
	dc.w SonAni_Hurt - SuperSonicAniData            ; 25 ; $19
	dc.w SonAni_Hurt - SuperSonicAniData            ; 26 ; $1A
	dc.w SonAni_Slide - SuperSonicAniData           ; 27 ; $1B
	dc.w SonAni_Blank - SuperSonicAniData           ; 28 ; $1C
	dc.w SonAni_Balance3 - SuperSonicAniData        ; 29 ; $1D
	dc.w SonAni_Balance4 - SuperSonicAniData        ; 30 ; $1E
	dc.w SupSonAni_Transform - SuperSonicAniData    ; 31 ; $1F
	dc.w SupSonAni_Peel - SuperSonicAniData         ; 32 ; 20
	dc.w SupSonAni_PeelCharge - SuperSonicAniData   ; 33 ; 21
	dc.w SupSonAni_PeelCharge2 - SuperSonicAniData  ; 34 ; 22

SupSonAni_Walk:		dc.b $FF,$77,$78,$79,$7A,$7B,$7C,$75,$76,$FF
SupSonAni_Run:		dc.b $FF,$B5,$B9,$FF,$FF,$FF,$FF,$FF,$FF,$FF
SupSonAni_Push:		dc.b $FD,$BD,$BE,$BF,$C0,$FF,$FF,$FF,$FF,$FF
SupSonAni_Stand:	dc.b   7,$72,$73,$72,$73,$FF
SupSonAni_Balance:	dc.b   9,$C2,$C3,$C4,$C3,$C5,$C6,$C7,$C6,$FF
SupSonAni_Duck:		dc.b   5,$C1,$FF
SupSonAni_Transform:	dc.b   2,$6D,$6D,$6E,$6E,$6F,$70,$71,$70,$71,$70,$71,$70,$71,$FD,  0
SupSonAni_Peel:         dc.b   $FF,$B5,$B9,$B5,$B9,$B5,$B9,$B5,$B9,$FF
SupSonAni_PeelCharge:   dc.b   2, $F,$77,$78,$79,$B5,$B9,$B5,$B9,$FD,$22 ;3
SupSonAni_PeelCharge2:  dc.b   0,$B5,$B9,$B5,$B9,$B5,$B9,$B5,$B9,$FF
	even


That is the animation file, now however this is what I get in SonAni2Gif: Posted Image

#8 User is offline MainMemory 

Posted 06 April 2012 - 11:04 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4179
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
SonAni2Gif is case sensitive with labels. In the table, you have "SonAni_pose", but in the mappings you have "Sonani_pose". It can't find the label, so it assumes a value of zero. 0 - 0 = 0, so 0 becomes the new "end of list/start of data" point, which causes the loop to end.

#9 User is offline Hitaxas 

Posted 06 April 2012 - 11:06 PM

  • Pokemon and Sonic themed Twich streamer
  • Posts: 1437
  • Joined: 30-September 07
  • Gender:Male
  • Location:Litchfield,CT
  • Project:Becoming a Twitch partner, and getting my life back together
  • Wiki edits:196
Ah alrighty, so it's me being lazy. Got it. >.<


Edit: I got the animations to show up in the program, but when exported they show nothing at all...

SonAni_PeelCharge: dc.b 2, $E,$F,$10,$11,$2C,$2D,$2E,$2F,$FD,$24 ;3
SonAni_PeelCharge2: dc.b 0,$D6,$D7,$D8,$D9,$D6,$D7,$D6,$D9,$FF
SonAni_dash: dc.b $20, $E7, $FD, 2
SonAni_jumpdash: dc.b 0,$E7,$E8,$FD,2
SonAni_SpindashRev: dc.b 7,$E9,$EA,$EB,$EC,$FD, 9
SonAni_stompfall: dc.b $2,$4C,$FD, $2F


Those animations do not export correctly.
This post has been edited by Hitaxas: 06 April 2012 - 11:16 PM

#10 User is offline MainMemory 

Posted 06 April 2012 - 11:30 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4179
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
...Okay, most of those are because I have it stop processing when it reaches a negative (> $7F) value, which is what Sonic 2's AnimateSprite does... but not Sonic_Animate. I have no idea what's up with SonAni_PeelCharge or SonAni_stompfall.

Edit: frame values between $80 and $EF are now usable.
This post has been edited by MainMemory: 06 April 2012 - 11:38 PM

#11 User is offline Hitaxas 

Posted 06 April 2012 - 11:48 PM

  • Pokemon and Sonic themed Twich streamer
  • Posts: 1437
  • Joined: 30-September 07
  • Gender:Male
  • Location:Litchfield,CT
  • Project:Becoming a Twitch partner, and getting my life back together
  • Wiki edits:196
Edit: Nevermind, error was my fault.

Program now seems to work without any problems. Nice work. :)
This post has been edited by Hitaxas: 06 April 2012 - 11:50 PM

#12 User is offline MainMemory 

Posted 05 May 2012 - 01:46 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4179
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
A bugfix, and a new feature: S3K objects with DPLCs now display properly, and rather than simply rounding the frame delay to the nearest centisecond, it keeps track of the fractional remainder and adds one to the delay when it reaches one.

#13 User is offline KingofHarts 

Posted 06 May 2012 - 05:47 AM

  • Posts: 1609
  • Joined: 07-August 10
  • Gender:Male
  • Project:Project Sonic 8x16
  • Wiki edits:1
A question MainMemory. Is it possible to get it to be able to export to .png?

Not a big deal really... just curious. (Really just a question of personal preference.)

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users