Novum / vkQuake

Vulkan Quake port based on QuakeSpasm
GNU General Public License v2.0
1.82k stars 222 forks source link

Question on code location #742

Open johnalanwoods opened 4 hours ago

johnalanwoods commented 4 hours ago

Hi,

Sorry to create an issue, but can't see where else to ask the question - I've looked over the code for a good 40mins and can't find where the weapon damage is defined, could anyone point me in the right direction?

alexey-lysiuk commented 2 hours ago

Such things are defined inside progs.dat. For example, search for T_Damage() function in re-release QuakeC source code.

johnalanwoods commented 2 hours ago

Gotcha thanks! But how is that code imported or included in vkQuake?

I can't see progs.dat nor weapons.qc in the repo.

sezero commented 2 hours ago

Look at e.g. pr_edict.c, pr_exec.c, pr_cmds.c to see how progs.dat is loaded, interpreted and executed.

sezero commented 2 hours ago

And no, you won't find qc (quakec) code in here: this is only the engine source.

johnalanwoods commented 1 hour ago

Thank you!

vsonnier commented 1 hour ago

I can't see progs.dat nor weapons.qc in the repo.

Neither progs.dat nor any *.qc QuakeC code is part of Quake source code written in C language.

The programming logic of Quake is done in another language called QuakeC (*.qc) compiled separatly by dedicated tools, and injected in the Quake engine in compiled form : *progs.dat.

There are plenty of resources over the Internet on how to handle and program in QuakeC.

Most of the mods (more than simple maps) you can found for Quake have their own version of modified QuakeC, derived from the one Id made for the game originally: https://github.com/id-Software/Quake/tree/master/qw-qc

If not, maps and simpler mods simply reuse the one of the original game id1 hidden in the pak0.pak file archive. Their are tools to handle *.pak archives, I personnally use PakScape: https://developer.valvesoftware.com/wiki/PakScape

johnalanwoods commented 1 hour ago

Thanks for the detail @vsonnier!