Forum

Difference between progs and qwprogs?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Difference between progs and qwprogs?

Postby JasonX » Thu May 04, 2017 11:39 pm

I'm starting a new mod and i'm using the following QuakeC project as a base:

https://gitlab.com/quakec-v1-01-clean/q ... 1-01-clean

Unfortunately, i can only run this with Quakespasm and not FTEQW. What is the difference between progs and qwprogs?
JasonX
 
Posts: 407
Joined: Tue Apr 21, 2009 2:08 pm

Re: Difference between progs and qwprogs?

Postby Spike » Fri May 05, 2017 12:49 am

[nq]progs.dat and qwprogs.dat differ in:
1) system globals are different, which gives you loadtime errors (at least in vanilla).
2) builtins differ a little - or at least bprint+sprint got a few extra args. particle( got removed, and multicast+stof+infokey+logfrag got added, or something.
3) all the writebytes that your mod makes must match the underlaying protocol, with illegible server messages appearing you most of the times you screwed up.
4) qw clients use the 'team' infokey to decide teams, so if a mod doesn't use it then it ends up with screwed scoreboards.
5) typical filename of the dat. side note: even vanilla qwsv will try to load progs.dat, it'll fail because of the headers thing, but it'll try if qwprogs.dat doesn't exist.

its that 3rd one that's the pain. the first can be fixed by just copying over the top of defs.qc. the second one can be fixed by copying over the builtins too. the third requires that you actually test each and every bit of code that might use writebytes. one solution is to depend upon engine builtins for those.


regarding fte, it checks filesystem depth of various files in order to guess whether it should load progs.dat or qwprogs.dat - if they're in the same gamedir then it uses qwprogs.dat if deathmatch is set, and progs.dat if not (imho that usually does the right thing, at least until you install a qwprogs.dat into the qw subdir, anyway).
once its decided which one to load, it autodetects what sort of mod it is based upon the progs crc (generated by the qcc based upon the defs before end_sys_fields), which can be one of many possibilities (nq, qw, h2/h2demo/h2mp, quake prerelease, telebrae, or 'UNKNOWN'... or none...).
it also incorporates network protocol translation (for the writebytes that the mod makes) so that qw clients can connect to nq mods, or nq clients with qw mods. this also includes some server-side workarounds eg for svc_setview.


if you want fte to run nq mods as an nq server and an nq client, then "progs progs; cl_loopbackprotocol nq; dpcompat_nopreparse 1; sv_listen_nq 1; sv_listen_qw 0; sv_port 26000; sv_nqplayerphysics 1"
that combination of cvars will force it to load the nq mod, disable the network protocol translation (while blocking qw clients so they don't get illegible server messages), switches to only nq's default port number (vanilla can be fussy), and disables player prediction giving player physics that follows nq behaviour (although I'd argue that most mods that actually need that are buggy - headhunters being one example).

basically, what I'm saying is that other than the choice of which .dat file to load, fte will run nq mods fine. if there's bugs then either dp will have them too, you can work around them with the cvars above, or the mod is (ab)using stuffcmds that work differently in qw engines.
(side note: network translation to other qw clients including ezquake is an inexact match, and might result in more/less particles appearing etc, but fte clients will be sent something equivelent).

so, urm, in what way does it 'not run' in fteqw?
Spike
 
Posts: 2878
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Difference between progs and qwprogs?

Postby JasonX » Fri May 05, 2017 1:35 am

Thank you for the rich information!
JasonX
 
Posts: 407
Joined: Tue Apr 21, 2009 2:08 pm

Re: Difference between progs and qwprogs?

Postby JasonX » Fri May 05, 2017 10:22 pm

BTW:

so, urm, in what way does it 'not run' in fteqw?


When i tried to run the compiled quakec-v1-01-clean progs.dat in FTE, it got an error saying that it could not find qwprogs.dat. After renaming the file, it worked. :smile:
JasonX
 
Posts: 407
Joined: Tue Apr 21, 2009 2:08 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest