News | Forum | People | FAQ | Links | Search | Register | Log in
Enabling Impulse 12 In Old Mods
After releasing QuakeEx I found out there a developers who can adapt and\or port existing progs.dat to common engine (I’m not programmer at all, so excuse me please for imprecise definitions). My interest (and I think not only my) is someone can implement "MWHEELDOWN" "impulse 12" into progs.dat of this map packs:
Backwards compatible mappack
BAD Pack
Or it is able to force it direct into Quakespasm engine?
I don't understand a lot of what you said, but the questions:

is someone can implement "MWHEELDOWN" "impulse 12" into progs.dat of this map packs:

The two choices here are to get access to the source code and add the feature, then recompile, or, decompile the progs and add the feature, then recompile.

Or it is able to force it direct into Quakespasm engine?

An interesting idea, but I'm not sure it's worth it. The engine doesn't know if impulse 12 is already implemented in the progs.dat. And you don't want the engine overriding that impulse on all mods, because then the mods that support it will get the engine version of the feature, which doesn't know about any new guns added by the mod.

Might be less problematic to add it to the engine but with a new command name. Then the user would have to rebind their mousewheel to "new command" instead of "impulse 12". Also it would be somewhat hacky in the engine (starting with the necessary assumption that weapons are unchanged from id1.) 
I don't know if the source code for all the addons mentioned above is available, but as someone who update Beyond Belief's progs.dat from QC v1.01 to v1.06, I can tell you it's a LOT easier to recompile existing source files than having to decompile everything first.

As regrettable as it is that some older addons are based on outdated QC code, I doubt all of them can be updated. 
Interestingly, the not-completely-finished and not-currently-under-development reQuiem engine did provide an engine supported fallback for handling impulse 12. (Among some other nice things.)


I'm sure reQuiem wouldn't be able to handle big modern maps but it might run those older packs mentioned in the OP. 
How reliable are QC decompilers?

If their output is always reliable, we could simply write a tutorial for this specific case (adding impulse 12 to old mods).

Some compilers have options to remove a lot of info from the compiled progs.dat (I remember using that to compile Dreamcast Quake mods), so a decompiler would have to provide dummy info where needed. Here are some FrikQCC examples:

/Ot - Eliminate temporary variables
This is one of JP Grossman's optimizations it flattens store opcodes into one line. This optimization can cause decompilers to choke, if they don't recognize the improved generated code.

/Ol - Eliminate local names
The names of local, static and immediates are stripped from the progs.dat upon write time. This saves some space, and does not affect the usability of the compiled code. This also makes it harder to be decompiled.

/Or - Recycle temps
This optimization will make the compiler use only a few new temps for each function. After each line, it will allow itself to re-use the temps from previous lines, saving huge amounts on numpr_globals. This may cause decompilers to choke.
Progs To Assembly 
I was pondering this problem yesterday, and I figured that you might be able to hack it into a progs without actually decompiling to QC. Plan would be

1) Append a function to the progs which checks for and handles impulse 12, then passes control to ImpulseCommands
2) Patch all existing calls for ImpulseCommands to the added function instead

I think it would be slightly awkward to purely make those changes in a hex editor, accurately identifying the calls to edit in step 2 isn't easy. The function in step 1 wouldn't be a direct copy-paste job either because it needs to call two functions, and the function numbers wouldn't be transferable between progs.

FTEQCC had a great feature where it could dump "assembly" while it was compiling QC, and you could also include asm segments in functions to directly specify bytecode sequences. I wondered if anyone ever took that a bit further, and made it possible to extract the assembly-style code directly from a progs.dat file without decompiling? I reckon from there, patching in specially prepared bytecode to do this would be a quick job... 
Injecting code into the progs.dat would still require knowledge about extra weapons, ammo types and other mod-specific behavior.

For example, Operation Urth Majik has extra weapons such as a chainsaw and a plasma gun, but doesn't have impulse 12 backward cycling. To implement impulse 12 in it, the coder must know what extra variables to look for, new bitflags, etc.

You can't simply inject vanilla Quake's impulse 12 and expect it to work properly. The coder must know how the mod's code works. 
Yeah, Totally 
I didn't want to make that post too long, but the assumptions going into that plan were:
- the mods had vanilla weapons only
- the mod has the same weapon bookkeeping as vanilla
- the mod still handles impulse commands using ImpulseCommands
- the mod doesn't use impulse 12 for anything
- The mod still uses W_SetCurrentAmmo to set display of a selected weapon

It's not something that an engine could safely inject into every mod it saw. 
To Opening Post 
Hi CV,
I do not understand all the abbreviations of the mod names.
What is OUM, COE, etc.?

I did understand mexx9 though.
That is Penumbra of Domination :)

You can find the progs.dat to this mod with extended "impulse 12" support in download link below.

And because the author of this mod is unfair and deleted the impulse 9 cheat, I added "impulse 13" cheat to do what impulse 9 normally does. 
OUM = Operation Urth Magik

COE = Coven of Ebony 
Thank you meltslime.

I could find the Coven of Ebony episode. :)

There was a patch with a improved model and its code for the fragwizard monster. Done in 2001. I used that for the base (its included).

This is the impulse 12 support progs.dat for Coven of Ebony: 
Great! It Works. Thanks Unknown Santa! 
For this incredible mods

BAD Pack

question still open. 
I've tested decompiling the OUM progs.dat with FTEQCCGUI, and it seems to work. Already added impulse 12 to it. 
Here you go: Operation Urth Majik with impulse 12

The source is in the PAK file. Switching backwards from the shotgun and from the chainsaw doesn't work properly for some reason, it never selects the axe. From the other weapons it works fine.

The tracing explosion gun seems to be buggy, it often kills the player.

I've added additive rendering to lasers, explosions and plasma. Also, fixed most warnings. 
Thank You Mankrip! 
It's just a holiday today! 
... And The Last One 
Hi CV,

To make it complete, here is impulse 12 support for: BadPak (included M3enforcer fix from Yhe1)

And a fixed version for: Coven Of Ebony (ammo count was borked):

Hello mankrip,

Great Team Work :)
Unfortunately you have the same ammo count bug in your impulse 12 extension for Operation Urth Majik.

To fix it:
Replace all self.currentammo and its self.ammo_xxxxx type calls inside weapons.qc (for all weapons) with the combined code (just like it is in original Quake).

Example for shotgun:
This will lead to ammo count bug in game:
self.ammo_shells = (self.ammo_shells - 1);
self.currentammo = (self.ammo_shells - 1);

And this will fix it:
self.currentammo = self.ammo_shells = self.ammo_shells - 1;

With this fix the ammo count in the HUD will not change when you switch weapons of the same ammo type.

Root cause:
Decompiling progs.dat will produce these 2 lines instead of the combined. Resulting in not correct ammo calc.
But only in very old progs.dat´s.
Decompiling newer ones will not have this bug. 
Great Work! 
almost done!
Only first string in list remains:
Backwards compatible mappack by The Lieutenant.
This five-maps pack bundled with progs.dat on each map. And obviously final fifth progs backwards compatible and patching required. 
Ammo Count Fixed 
in CoE
but in mexx9 still present 
Hi CV,
I did the mexx9 progs.dat in 2016 and do not have the source anymore. Decompiling again brings lots off issues, so you will have to live with it. Its not a big deal breaker anyhow.
Enjoy your weekend. 
Thanks One More Time! 
I've fixed those ammo count bugs now, and couldn't resist the temptation of adding Retroquad-specific effects flags to improve its visual effects.

But if I keep fixing all bugs in this mod's code, I'll keep updating it forever.

Will upload it later. 
Operation Urth Majik - impulse 12 patch updated

The axe selection also works properly now, and documentation is included. 
You must be logged in to post in this thread.
Website copyright © 2002-2021 John Fitzgibbons. All posts are copyright their respective authors.