Jump to content

EDF Weapon Progress (PM me for test builds)

Recommended Posts

Some preamble: So you may have heard me ranting on about it, but I've been gradually pegging away at EDF weapons. In the wake of a personal tragedy last week, I went to see my doc and she told me I should take a break and rest, and working on Eternity is my version of rest.


Since yesterday I've been making rapid progress, and now have some stuff that I can show off. Below is a clip showcasing EDF weapons, in which I've messed around with the attackstate and upsounds of weapons. Later on I'll make a video sf something that actually looks more like a demo of a weapon, and less like I just kinda threw stuff at the wall and wanted to see what'd stick.



  • Fix counters
  • Remove temporary hard-coding (partially done, a lot to go)
  • Remove old hard-coding (partially done)
  • Implement deltas
  • Hook weapongivers and their ammo given up to weapons (100% working, including multiple ammo given per weapon)
  • Add Heretic weapon codepointers (75% done)
  • Allow picking up of new weapons (big end-goal)
  • Implement inheritance
  • Add DECORATE state syntax support
  • Automate generation of weapon trackers (partially done, but needs tightening up)
  • Move vanilla weapons to be 100% EDF, including DECORATE states
  • Implement a functioning priority system (mostly done, gotta allow deltas)
  • Probably other stuff I'm forgetting



I'll be updating this post semi-frequently. Times are BST (hopefully we'll not see GMT before this is finished).


If you have any questions, please ask and I'll be more than happy to answer.


2017/04/10, 15:45: I might stream some development in the evening today at https://www.twitch.tv/altazimuth, depending on how long passover drags. I'll update if that's the case. I plan on making weapon tracking work with EDF, instead of the old method.


2017/04/11, 01:00: I just finished streaming, forgot to update the thread with that, but the VOD is available. I managed to gut the old tracking system (i.e. an array of bools) and replace it with tracker artefacts that are tied to the weaponinfo: https://github.com/team-eternity/eternity/commit/94aa6e2b8c9d62a9889281be70bf1d413a769e7f


2017/04/12, 14:35: IDKFA and IDFA will now give the player weapons of only their class, as opposed to ALL weapons: https://github.com/team-eternity/eternity/commit/152c96735573776bc12403cc7ab00bd3c5dd764c

You still can't switch to those weapons, but I'm hoping to get that done by the end of the day.


2017/04/12, 17:45: You should be able to define brand new weapons and cheat them in now.

Edited by Altazimuth

Share this post

Link to post

2017/04/12, 22:40: Double posting because major breakthrough: Got Heretic weapons partially working, you can see me select non-melee (melee crashes atm) and it updates the ammo image in the gif below:




Edited by Altazimuth
esselfortium likes this

Share this post

Link to post
On lundi 10 avril 2017 at 4:46 PM, Altazimuth said:

Since yesterday I've been making rapid progress, and now have some stuff that I can show off. Below is a clip showcasing EDF weapons, in which I've messed around with the attackstate and upsounds of weapons. Later on I'll make a video sf something that actually looks more like a demo of a weapon, and less like I just kinda threw stuff at the wall and wanted to see what'd stick.

This is historic: the first Eternity jokewad! :p

Share this post

Link to post

2017/04/14, 13:45: More gif goodness, just messing around with actual frame defintions, though in the end this'll be done with DECORATE state syntax.




Edited by Altazimuth
esselfortium likes this

Share this post

Link to post

2017/04/14, 23:50: Yet another doublepost, which coincides with another major breakthrough. Inheritance is semi-working! The colon syntax isn't working for a mysterious reason. Below is a weapon that inherits from the pistol, but turns into a shotgun when shot. This comes after a major overhaul of weaponinfo processing; hopefully DECORATE states should come next.




2017/04/15, 00:25: Colon syntax is working, don't work with pointers past your bed-time, kids.


2017/04/15, 13:25: Weapondeltas are now implemented.


2017/04/15, 18:15: Another major breakthrough, but I ain't tripleposting; here's DECORATE states:




2017/04/15, 20:05: Managed to define the Heretic gold wand, but the puffs aren't working for some reason. Here's the video of that:




2017/04/15, 20:20 Figured it out, but need the go-ahead from Quasar.




2017/04/16, 22:00: Hold states are implemented, and now the shells of every wimpy Heretic weapon is in.





Edited by Altazimuth
Mordeth and esselfortium like this

Share this post

Link to post

Great question, thanks for asking. Whilst I would like to get Hexen weapons in, we'll need to finish off Heretic support, remove hard-coding of actual picking up of items, and make sure all the demo compat stuff is ok, first.


What you want to know: I'd personally love to get working on Hexen weapons after the prior mentioned work, but it is something that the team will approach with caution, due to the unstable nature of some of the Hexen codepointers. There's a reason why a_hexen.cpp (the Hexen codepointers file) is #if 0'd out at the moment, and most of the functions filled with // HEXEN_TODO.

EDIT: I misread the question. I might try get in some of the codepointers before all the other stuff is done, but it will need deliberation. Some of them do seem quite useful.

Edited by Altazimuth

Share this post

Link to post

2017/04/27, 18:20: Merged weapons-branch-volatile back into weapons-branch. Going to be working more on stability, fixes, and refinement of what's already there. The Firemace and powered Blaster can be handled later.


2017/05/18, 11:20:




2017/05/24, 16:45: Working on inventory-branch-2016, and looking to wrap that up and merge it into master. After that I'll get back to weapon work.

Edited by Altazimuth
HavoX, esselfortium and Mordeth like this

Share this post

Link to post

Back in the saddle, need to get the motivation going and weapons-branch work makes me happy.


2017/07/06, 13:00: Working on DeHackEd stuff in the title props. Almost done, just need to test that it all works with actual deh files.


An example of this would be the BFG9000, dehnum 6, and not inheriting from any actual weapon (just a dummy value):

weaponinfo BFG9000 : Weapon, 6

2017/07/06, 13:30: dehnum is in and working fully (to my knowledge). Not sure what to do for Heretic weapons; will probably leave them without titleprops.


2017/07/07, 20:45: A new weapon selection system is in. The old stuff is gated behind a demo check.


2017/07/09, 14:50: Been working on alt-fire, but progress might slow as we're about to adopt a dog: as in we're not looking any more - we found one and are likely having her home in the coming week.


2017/07/10, 18:35: Alt-firing is in, with a few things to add but they're good to go at the moment.


Bigger thing, the Doom weapons are now defined with DECORATE states.


2017/07/10: 19:00: Fixed a stupid bug where I copypasted a hash lazily and that cuased the dehnum hash to use idhash values.


2017/07/11, 10:00: ammogiven in an weapongiver now works to a degree (singular is fine, multiple probably won't end well). Holy shit DEMO1, DEMO2, and DEMO3 actually play back correctly.


2017/07/11, 12:30: Heh, I forgot that actually nothing happens if you define multiple ammogiven in a weapongiver. I'll figure that one out.

   if(!(obj = getObjectKeyAndTypeEx<MetaTable>(keyIndex)))
      addMetaTable(keyIndex, newValue);

2017/07/12, 09:45: pickupitems now work properly, you can make your own weapons!


2017/07/12, 17:45: Almost everything in Heretic is now using the new pickupitem system, and a compat system for any mods that use the old "effect PFX_FOOBAR" is implemented. Also I fixed an issue where you lost weapons when changing maps.


2017/07/16, 14:45: Almost everything it Doom is now using the new pickupitem system, and I fixed DeHackEd modifying ammo given by weapons.


2017/07/18, 20:00: Don't expect any updates for a while, as our newly adopted dog arrived home today.

Edited by Altazimuth
esselfortium and HavoX like this

Share this post

Link to post

2017/08/09, 11:40: Hello player->lookdir my old friend. I've come to fucking code around you again you awful awful awful piece of shit.


2017/08/09, 12:25: Kinda got mace fire working, but I can't figure out how to get Eternity's pitch translated to Heretic's lookdir.


2017/08/09, 19:45: Done with the poxy bloody wimpy mace.


2017/08/12, 14:25: Bloody big ballistic balls to barrage baddies are brought to the table (powered Firemace is working).


2017/08/12, 19:30: You can now give multiple ammos for a single weapon pickup (previously it was permitted, but didn't work).




2017/08/16, 00:20: The answer is in trees! Maybe a red-black tree for weapon counters, or an unbalanced binary search tree if I'm feeling lazy; perhaps a regular tree to start off then move it over to a self-balancing tree once I'm sure the system works. Also a skip list might work well for priorities, though I'm not sure if I'd what I'd decide what I want to promote to being higher in the list.


2017/08/16, 11:30: An AVL tree might also work for weapon priority, as it's well-suited to lots of searching but fewer mutations.


2017/08/16, 19:40: Implemented weapon priorities using an AVL tree. Moving and removing nodes after the fact isn't there yet, but at least Heretic doesn't cause the engine to crash when you run out of ammo for any weapon.


2017/08/17, 22:10: I fixed the saving and loading of readyweapon and pendingweapon. I also turned the AVL tree into a templated class, and might make counters use it too.


2017/08/18, 15:50: Weapon deltas now correctly impact selectionorder, as deletion from the AVL tree has been successfully implemented.


2017/08/19, 16:30: Weapon counters now partially work, but saving doesn't work for them. See the below gif below for Vapordemo's random frame jumping with counters in action.




2017/08/21, 13:00: Saving/loading weapon counters is now a thing.


2017/08/24, 14:00: The Heretic spinning tome and wings now correctly display. The speed of post-use artifact flash has been corrected.


2017/08/26, 02:35: You can now execute codepointers from artifacts (Heretic-style items). You define them as such:

useaction <A_>SomeCodePointer (1, 2, three, "f o u r", ...)

2017/08/26, 13:35: I fixed a bug where useactions would cache actor and psprite references, and not end up being updated. Additionally, I semi-implemented the effect of the Chaos Device (the Heretic teleporter).


2017/08/26, 15:45: The Timebomb of the Ancients now has its useeffect working.


2017/08/31, 16:20: Added the ACS functions: GiveInventory, TakeInventory, and CheckInventory.


2017/08/31, 20:30: Oh fuck ZDoom has it so if the player is given a weapon given via GiveInventory, you get the ammo too. Fuck fuck fuck fuck fuck fuck fuck.


2017/09/05, 13:15: The pickup system has been overhauled. You can specify a reference to a new shiny pickupeffect from within a thingtype, as well as us sprites. pickupitems are still there but should be considered deprecated once I'm done.

Edited by Altazimuth

Share this post

Link to post

Well it's been a while. I did SDL2 so now it's back to the ole grindstone.


2017/11/30, 11:20: P_TouchSpecialThing is dead, long live P_TouchSpecialThing! Old P_TouchSpecialThing has been phased out, as all hard-coding has been removed (except for a single special item that can't be generalised but I've sorted that out).

You can now create a pickupeffect from within a thingtype, which makes the EDF look nicer, and is overall more sensible. pickupeffects also have a new property, "changeweapon", which lets you set the player's weapon (if they have it) when they pick up the given item (berserk changes to fist, for example). Finally, a new flag has been added, "GIVESBACKPACKAMMO", which allows any item to give backpack ammo when picked up (though the max ammo increase is handled elsewhere, and is hard-coded).


2017/11/30, 16:25: No more EDF uses pickupitem, though it is still supported. Everything has been migrated to the more modern pickupeffect, and all the underlying logic uses the pickupeffect structure.


2017/12/01, 10:15: I forgot to update the Heretic EDF yesterday. Now Eternity uses nothing but pickupitems for its own EDF. Additionally, certain Heretic pickups are now sprite-based instead of thingtype-based.


2017/12/01, 11:15: Just did some testing, Batman Doom's slot machine pickup works. That's good.


2017/12/01, 23:35: Rudimentary automatic tracker generation is in-place. Now the minimum number of things you need to define is 3. A thingtype, a weapongiver, and a weaponinfo.

Edited by Altazimuth

Share this post

Link to post
Posted (edited)

2018/03/03, 21:00: Redid the ENTIRE branch, whilst doing demo tests. I have made the first scripted weapon using EDF weaponinfo. It allows you to load and quickly fire up to 3 rockets, but has a regular fire mode which is more reliable. It's basically the rocket launcher from Unreal Tournament 4 (that's the new one).


Some point before 2018/01/26, 12:40: I implemented the tome of power, and the stuff it needs to work. The tomed skull rod and tomed blaster aren't working at the moment though. Getting the flamethrower to work was a real kludge.


2018/01/26, 12:40: Been working on documentation. Once I've done that, I can try and get some users to try it out, and then I'll know what the end-user experience is like when it comes ot creating their own weapons.

Edited by Altazimuth

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now