Help Needed for adding animation sprites

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
BlueFireZ88
Posts: 1087
Joined: Tue Jan 18, 2011 9:04 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Tallon IV
Contact:

Re: Help Needed for adding animation sprites

Post by BlueFireZ88 »

Allow me to elaborate. I am attempting to recreate the sprites from the Beautiful Doom wad using the original BFG sprites. I have made some progress, and I have done what I can. Mainly coding is what will make these sprites I made work. Though, it may not entirely be necessary, I'll explain in a bit.

I'm afraid my internet is having serious issues at the moment, so I can't send you the wads. But when things are working properly again, I will not hesitate to post them here. The closest thing I suggest is that there are download links to both wads at the top of this discussion. B-Doom should be easy to obtain, but the other is trickier, but you should find it on page 5 of the discussion, I cannot remember which person posted it, it should be "enhanced.wad"
FDARI wrote:I think, if I am to be of any more use to you, I will need the wads you are working with. A note on graphics lumps though: They might be understood differently depending on their location in the wad or pk3. In wads, marker lumps such as S_START|S_END (or SS_START|SS_END) inform the game that graphics have a specific purpose. Folders provide similar information in the pk3-structure. It might be possible for the graphics to be misplaced and therefore not used for your weapon. Graphics lumps might also contain offsets and perhaps other data that I have little knowledge of.

Actually, when working with graphics you should hope for a better helper than me. I'm primarily good at locating the code-line that fails and guessing the reason.
No helper, I think you just about figured it out. :)

The sprites were not where they should have been, in between the markers like you said. I tested the was on it's own and to my surprise, BFGFA and BFGFB (the sprites that I wish to use) both appeared. Also that bit of code you gave me for the "Select" state also seems to work now. It appears only briefly though. To be sure it was working, I added a Ready state to the mix using the same sprite as Select, and it showed up.

I think we may have it my friend. But one challenge remains: getting the code to incorporate all of the sprites for the animation, cause copying over the code from the B-Doom wad doesn't seem to work. It has to be entered manually.
User avatar
BlueFireZ88
Posts: 1087
Joined: Tue Jan 18, 2011 9:04 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Tallon IV
Contact:

Re: Help Needed for adding animation sprites

Post by BlueFireZ88 »

I think I got it. I have a working animation that I like.

Here are the sprites I used:
BFG Alt.rar
(72.09 KiB) Downloaded 50 times
And of course, the code:

//**********
// BFG 9000
//**********


Actor BFG9000 : DoomWeapon 2006
{
Game Doom
Height 20
SpawnID 31
Weapon.SlotNumber 7
Weapon.SelectionOrder 2800
Weapon.AmmoUse 40
Weapon.AmmoGive 40
Weapon.AmmoType "Cell"
+WEAPON.NOAUTOFIRE
Inventory.PickupMessage "$GOTBFG9000"
States
{
Select:
BFGN A 1 A_Raise
loop
Deselect:
BFGN A 0 A_PlaySound("weapons/select")
BFGN A 1 A_lower
goto Deselect+1
Ready:
BFGN A 1 A_Weaponready
loop
Fire:
TNT1 A 0
TNT1 A 0 A_BFGsound
BFGN AB 8
BFGF ABCDE 4 A_GunFlash
BFGF F 10 bright A_FireBFG
BFGF EDCBA 4
TNT1 A 0 A_ReFire
goto ready
Flash:
TNT1 A 10 Bright A_Light1
TNT1 A 4 Bright A_Light2
Goto LightDone
Spawn:
BFUG A -1
Stop
}
}

It took a bit of cut and paste work, but it looks great. There's one more issue i have to go over with you though. The gun's firing rate is slowed down in order for it to match up with the BFG sound. I was hoping to find a way to make it fire at the same rate of the normal non-animated BFG.

Also, I just found out that I can't attach anything over 256k to send you here, and those files are way over that number. So I couldn't send them to you, even if I wanted to, but those download links are still there if you want to look at them.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Help Needed for adding animation sprites

Post by FDARI »

Progress is good. By the way: "So I couldn't send them to you, even if I wanted to," has a funny ring to it. I believe you did want to, but you say it as if you didn't!

A few useful words:

You should probably not name your weapon "BFG9000". It isn't critical, but it generates unnecessary warnings in the console, making useful warnings harder to find, and it might cause some trouble if others try to inherit from your actor, or the real/original BFG9000. I recommend changing the actor name to BFG9000plus or any other unique name.

Regarding the firing rate:

Where is the challenge in increasing the firing rate? Is it in coding the weapon so that it fires more frequently? Or is it matching animation and sounds at the desired firing rate that causes the problem?

The first challenge seems easy: Reduce the duration of overly slow frames, remove unwanted idling frames.

The second challenge might require modification of sounds, or recording of new sounds. That is, if the real problem is that the sounds imply a lower firing rate than what you want.
User avatar
BlueFireZ88
Posts: 1087
Joined: Tue Jan 18, 2011 9:04 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Tallon IV
Contact:

Re: Help Needed for adding animation sprites

Post by BlueFireZ88 »

FDARI wrote:Progress is good. By the way: "So I couldn't send them to you, even if I wanted to," has a funny ring to it. I believe you did want to, but you say it as if you didn't!
I meant to say that the file load limit is 256k and the reason I said that is because both wads exceed that limit. Yeah, my sentence structure sucks, I know.

Renamed: BFG9001.wad

About the firing rate: even the firing rate's been slowed down slightly, the weapon doesn't seem affected by it when it comes to effectiveness. It more has to do with the animations syncing with the BFG sound more than anything. Though if you want, you can judge for yourself.
Attachments
BFG9001.wad
(183.22 KiB) Downloaded 49 times
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Help Needed for adding animation sprites

Post by FDARI »

It's easiest not to touch the sound, of course, so what can we do about the fire state?

Code: Select all

	Fire:
		TNT1 A 0
		TNT1 A 0 A_BFGsound
		BFGN AB 8
		BFGF ABCDE 4 A_GunFlash
		BFGF F 10 bright A_FireBFG
		BFGF EDCBA 4
		TNT1 A 0 A_ReFire
		goto ready
I've just tested what looks, sounds and synchs reasonably well, to my senses. The overall time from calling A_BFGSound and to firing cannot change by much. We cannot start the sound any earlier. But we can probably spend less time on the firing frame and the frames after that.

The orginal animation felt a little slow to me.

Code: Select all

	Fire:
		TNT1 A 0
		TNT1 A 0 A_BFGsound
		BFGN AB 7 // reduced by 1, losing 1 tick per state
		BFGF ABCDE 4 A_GunFlash // not reduced
		BFGF F 8 bright A_FireBFG // firing two ticks earlier in sound than original. Cutting another 2 ticks in this state.
		BFGF EDCBA 3 // cutting 1 tick per frame (5) here.
		TNT1 A 0 A_ReFire // refire is called 9 ticks earlier than it was originally, and the weapon feels a bit faster.
		goto ready
Is this something like what you want?

EDIT:
Spoiler: Comparing with standard BFG
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Help Needed for adding animation sprites

Post by FDARI »

There is also this version

Code: Select all

	Fire:
		BFGN A 7  A_BFGsound
		BFGN B 7
	RepeatFire:
		BFGF ABCDE 4 A_GunFlash
		BFGF F 8 bright A_FireBFG
		BFGF ED 3
		BFGF C 3 A_Refire
		BFGF BA 3
		goto ready
		
	Hold:
		BFGF C 4 A_BFGsound
		BFGF BA 3
		BFGN AB 3
		goto RepeatFire
It defines the "hold" state, which is the default target for A_Refire if it exists. If you hold attack, it jumps to "Hold" instead of showing frame BFGF-C after firing. I take advantage of this to start playing the BFG-sound for the next shot before the animation is completed. The hold state begins with the end of a shot (slightly tweaked), continues with the beginning of another, and finally jumps back in at GunFlash, repeating the normal shooting process from there.

EDIT: Problem. A_BFGsound ends the current sound before starting a new one. The duration between two sounds should be at least the full duration of the sound; or you could try some custom sound tricks to have them overlap.
User avatar
BlueFireZ88
Posts: 1087
Joined: Tue Jan 18, 2011 9:04 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Tallon IV
Contact:

Re: Help Needed for adding animation sprites

Post by BlueFireZ88 »

That did it. :)

I can honestly say that it's now ready for official use to the public.

I really don't know how to express my gratitude for what you've helped me accomplished.

Simply saying thank you can't justify my gratitude for your help. But ironically, nothing can say it better.

Thank you.
Last edited by BlueFireZ88 on Fri Jan 28, 2011 11:38 pm, edited 1 time in total.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Help Needed for adding animation sprites

Post by FDARI »

I'm glad to have been of assistance. Once you get the hang of it, you won't need me to accomplish what you just did, though. A bit of experience with the formats and some familiarity with the wiki will work wonders on your abilities.

Some articles will contain much text. Some code lines and tricks will not make sense until the first time you see them in action. Give yourself time, look at the work others have done.

I'm appending a little review of the changes we have made from start to finish, hoping that it will help you connect your experiences with the methods used, and with the wiki.
Spoiler: Summary in lesson format
User avatar
BlueFireZ88
Posts: 1087
Joined: Tue Jan 18, 2011 9:04 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Tallon IV
Contact:

Re: Help Needed for adding animation sprites

Post by BlueFireZ88 »

Thanks for the recap, it did get all the facts straight, and I'm sure it will be helpful for other people as it was for me.

I'm still unsure if I'm going to release it on here on the forums. You think I should? If so, do you want to be credited for your help?
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Help Needed for adding animation sprites

Post by FDARI »

If you feel that my help merits credit, by all means credit it.

When it comes to releasing this on the forums:
  • Are the resources licensed for reuse in other projects? (If yes, proceed)
  • Are the resources you have used in your project properly credited? (When yes, proceed)
  • What is the difference between what you have made and what exists already? (In the case of the BFG9001 it seems to be: Combining the firepower/rate of the original with the detail of one or two mods.)
For our sake: Release it if you think this mod provides something that is not otherwise readily available.
For your sake: Release it with information on the work you have done/changes you have made; request feedback. (If you release it only for the feedback/advice, editing forum might be as appropriate as project forum. Maybe you could put it in this thread, and create a project or resource thread later. I don't really know, never posted a real project myself.)

Read project posting guidelines if you have not already, and ask if in doubt about anything.
User avatar
BlueFireZ88
Posts: 1087
Joined: Tue Jan 18, 2011 9:04 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Tallon IV
Contact:

Re: Help Needed for adding animation sprites

Post by BlueFireZ88 »

Please check the first post of this discussion for official release!
Locked

Return to “Editing (Archive)”