Forum

CSQC Enhanced GLQuake Attempt #1

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

CSQC Enhanced GLQuake Attempt #1

Postby Baker » Fri Jan 22, 2010 6:53 pm

Ok ... I got side tracked from this for a couple of weeks. Considering the strong similarity between Enhanced GLQuake/WinQuake and original, I'm doing Spike's CSQCWinQuake modifications to this engine first ...

Stage #1

Take all the files with 10 changes or less and work through them ...

Image

Making notes of issues/speed bumps as I go along ...

I guess I've hit one early in Enhanced GLQuake there is a difference in world.h with SV_RecursiveHullCheck, which I'll have to eventually poke around and see what is different.

Code: Select all
qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace);


sv_phys.c - PlayerPreThink difference in Enhanced GLQuake (probably for better debugging or something).

Code: Select all
PR_ExecuteProgram (pr_global_struct->PlayerPreThink, "PlayerPreThink");


svc_fog

Enhanced GLQuake, Qrack, ProQuake 4: #define svc_fog 51
FitzQuake 0.85: #define svc_fog 41
DarkPlaces: "svc_updatestatubyte", // 51 // [byte] stat [byte] value (41 is unused) and svc_fog isn't specified

Answer: svc_fog has to be 41 because svc_updatestat_byte is 51 in DarkPlaces / FTEQW
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby avirox » Fri Jan 22, 2010 8:25 pm

This would be a very worthy project IMO. You should also look at the FTE source for some of the GL-specific bits.

I have a semi-integrated version of EZQuake with CSQC if you're interested in tackling it.

Either way, keep doin' yo thang!
avirox
 
Posts: 137
Joined: Wed Aug 16, 2006 3:25 pm

Postby Baker » Fri Jan 22, 2010 8:32 pm

avirox wrote:This would be a very worthy project IMO. You should also look at the FTE source for some of the GL-specific bits.

I have a semi-integrated version of EZQuake with CSQC if you're interested in tackling it.

Either way, keep doin' yo thang!


Stage #1 complete

Going to Stage #2. The few remaining files with a larger quantity of changes (did a lot of changes in the progs interpreter sections, you know pr_<whatever>) and engines like FitzQuake and ProQuake generally have no changes of that sort.

So now I remember why I initially skipped over aguirReQuake, but it's going good. Assuming no road blocks, I'll probably next do JoeQuake.

/But I actually have no way of giving it any sort of quality testing when done since I lack a compiled csprogs.dat that works with, well, I don't even have one that works with FTEQW. Either way, when I have the Enhanced CSQC GLQuake compiled I'll upload the binary and source so more CSQC-knowledgeable hands have this available.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Baker » Fri Jan 22, 2010 9:19 pm

sv_main.c in Enhanced GLQuake, this is going to need some more attention:

Code: Select all
   if (bits & SU_WEAPON)
      SV_WriteByteShort (msg, SV_ModelIndex(pr_String("SV_WriteClientdataToMessage", ent->v.weaponmodel)));


CSQCWinQuake does ...

Code: Select all
      if (bits & SU_WEAPON)
         MSG_WriteByte (msg, newstatfloat[STAT_WEAPON]);
      STATCACHEB(STAT_WEAPON);


My quick guess is that aguirReQuake allows more ammo than 255.

Strike that, guess #2: more than 255 model frames for viewmodel?

Strike that too, guess #3: looks like it's support for more than 255 total models so it needs to be able to change the view weapon model to a model index greater than 255. So it needs to send a short int instead of a byte.
Last edited by Baker on Fri Jan 22, 2010 10:12 pm, edited 4 times in total.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Baker » Fri Jan 22, 2010 9:28 pm

Code merge with Enhanced GLQuake is completed (but entirely untested) (source)

Project file is not modified and I haven't double checked my work. Uploading for safe-keeping.

Now modify the project file, address the issues listed above and attempt to compile it to reconcile anything that I may have skipped and then re-examine everything vs. unmodified Enhanced GLQuake and check for any issues; then test with standard id1 Quake.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Baker » Sat Jan 23, 2010 12:14 am

Completed: Yet Not Testable because I have no working csqc progs! (Standard Quake appears to function just fine).

Download: CSQC GL "BengtQuake" - 1.5 MB +/-

Contains both the CSQC Enhanced GLQuake and a straight compile "spikeglquake_csqc.exe" from the CSQCWinQuake project.

Source code + project for Enhanced GLQuake version = here.

I've never been able to get self-compiled CSQC to run for me personally, not even with FTEQW.

I need a sample quake\<csqc mod> folder complete with csprogs.dat, progs.dat and whatever supporting files so I can test this. [I've tried self-compiling CSQC Test and Avirox's stuff and I have never been able to make it work for me.]

Now that I have done this once and have a good feel for the changes, doing it for any other normalish NQ engine should be a straightforward process.

But I really a sample csprog project already compiled that works with either the Enhanced GLQuake one OR the "Spike CSQC GLQuake" and both of those are supplied in the first download. I can't do any quality testing without it. And if I have that, I can assist documenting the basics CSQC far better (as I like writing tutorials, especially newbie level ones).
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Spike » Sat Jan 23, 2010 1:34 am

in pr_csqc you can find the value 17105.
replace it with a proper define and change it to whatever csqc header crc you want it to run. mneh.
fteqcc currently claims 22390 to be the one for EXT_CSQC_1...
Which is also the one required for my csqctest mod, naturally.
I don't really remember how it got an old value, but that zip wasn't entirely complete in a few other ways.
Use 0 and it'll accept any, tbh, for the most part.

Your server is missing a few bits. clc_qcrequest isn't accepted, svc_csqcentities doesn't look like it can be generated, though I suppose that's wip. csqctest is generally happy enough with neither of those, so long as deltalisten works properly :)
I've not really looked at the client changes in detail. Mostly because I don't remember them.
Again I apologise, that original csqcwinquake build wasn't quite complete - avirox kinda released it for me when I got bored of porting stuff over. :)
From what I remember, sound control is also incomplete. I'm sure there were a few other bits.. but its too long ago for me to remember off hand without studying line by line.

svc_updatestat_byte and svc_csqcentities match the svc number and protocol in DP7. DP doesn't support stat floats or strings (at least not the same way), and DP7 has a superior svc_clientdata built in, hence why those svcs have other numbers in a range not claimed by LH.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Spike » Sat Jan 23, 2010 1:52 am

CSQC_LocateCSProgs calls COM_WriteFile in an attempt to make a persistant copy of the csprogs.
You need to make sure the directory exists, or modify the function to not sys_error if it doesn't exist or is read-only.
(its copied so as to allow connecting to different servers with different versions of csprogs, without the user having to dig up the correct one each time).

csqctest's 'cg_hudtype 2' correctly gives a transparent hud.
'cg_hudtype 3' crashes it with a pic-not-found message.
note: if the view that is set is the entire screen, the hud should not draw an opaque back... I suppose.
cg_thirdperson kinda works... investigating....

player_localnum isn't set, it should be the 0-based player number (the very first svc_setview packet sub 1, which is tied to the scoreboard)
Last edited by Spike on Sat Jan 23, 2010 2:33 am, edited 1 time in total.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Baker » Sat Jan 23, 2010 2:29 am

I'll make a FitzQuake 0.85 and a JoeQuake with this here in the next couple of hours.

There might as well be a few clients with this available. Even a subset of CSQC functionality would be a welcomed change.

Then I'll take a harder look at trying to get csqctest to work and look at that "non-existing" directory problem you pointed out above and plug COM_MakeFolder where ever that is.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Spike » Sat Jan 23, 2010 2:41 am

well, hud rendering works fine if all the images are actually present, so yeah, its definitely useable as is even if not complete.
The directory in question is quake/$gamedir/csprogsvers - once created that error message isn't a problem, its just awkward. Otherwise it dies any time you connect to a server (even localhost).

I just noticed, you don't provide the mechanism to set up custom stats. The builtin isn't present, but you do have the code to actually send it, its just not filling in the source arrays for the deltaing.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Baker » Sat Jan 23, 2010 2:45 am

I wasn't able to get any CSQC to run with the CSQCWinQuake (or FTEQW!) so I don't even have a basis for testing. Yet.

(Does the csqc that you are using work with your prototype CSQCWinQuake and not with the Enhanced GLQuake WinQuake, I assume?)
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Baker » Sat Jan 23, 2010 3:08 am

I guess I need to locate these or make them for CSQCTest.

cs\hud.qc(239): "gfx/2d/numbers/zero_32b.tga",
cs\hud.qc(240): "gfx/2d/numbers/one_32b.tga",
cs\hud.qc(241): "gfx/2d/numbers/two_32b.tga",
cs\hud.qc(242): "gfx/2d/numbers/three_32b.tga",
cs\hud.qc(243): "gfx/2d/numbers/four_32b.tga",
cs\hud.qc(244): "gfx/2d/numbers/five_32b.tga",
cs\hud.qc(245): "gfx/2d/numbers/six_32b.tga",
cs\hud.qc(246): "gfx/2d/numbers/seven_32b.tga",
cs\hud.qc(247): "gfx/2d/numbers/eight_32b.tga",
cs\hud.qc(248): "gfx/2d/numbers/nine_32b.tga"


Status = found. Open Arena gfx.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Spike » Sat Jan 23, 2010 3:18 am

those are only needed for cg_hudtype 3 (q3-esque hud, 3d icons... well, player heads if using q3 player models in fte or dp, you might need to change the code to use q1 pickup names instead of q3 ones).
They won't stop it from loading, just missing images.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Baker » Sat Jan 23, 2010 3:51 am

Ever since zeroing out the 17905, I can run the csqctest in the CSQCWinQuake. Sort of. But I get the idea of what it is supposed to do.

I can't run in it in FTE. What else do I need, here is the whole folder containing the CSQCTest folder off the SVN, compiled, plus the gfx folder with the needed images.

But FTEGLQW (3343) crashes when I try to run it.

But looking through the source, it is easy to see the beauty of CSQC, being able to design menus and make settings without any engine coding (aside from the client-side temp entities and client-side sounds).
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Spike » Sat Jan 23, 2010 4:21 am

set cg_hudtype 2
you should now have a mostly transparent hud instead of the regular one.
This works. Basic functionality works. You can draw 2d stuff. Yay.
qcevents and stats and you have a nice usable system to send info back and forth.

set cg_thirdPerson 1
set cg_thirdPersonRange 32
set cg_thirdPersonHeight 16
you should now have a csqc-specified chasecam active.
in order for this to work, you'll need to modify csqctest slightly. There's a test in entrypoints for EXT_CSQC_1 before calling DeltaListen once or twice. Basically comment out the test but keep the block.
This is buggy in weird ways. Just so you know.
Using the DeltaListen code, the csqc is able to snoop upon entities sent from the server using the regular deltaing code. Your engine of choice has some interpolation differences, and they wreck havoc upon csqc ents. The easiest way to do it is probably just to tell the rendering code 'yes this is where I want it'. The changes here will vary from one engine to the next.
So don't be too surprised if you end up with ents using frame 0 all the time.
You can either snoop upon only players, or you can grab all. Both should work (although only players is really useful for the mod itself).
For me, it seems very juddery

set cg_hudtype 3
you should have a q3-esque hud (you will need to get the q3/openarena content to get it to render properly, and heads won't work as they're md3s).
But none of this should crash it (just give a warning once per model/texture, or start downloading them from the server of course).
md3s, jpgs/tgas, are engine-specific. The main thing to test here is the models as hud images, to show that second viewpoints work, and ones without the world drawn.

2d/3d transformations should be tested, but I don't have any code to test just that.

+showscores does nothing. eep. its meant to forward the command to the csprogs as a console command.
it looks like your registercommand builtin doesn't work either.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Next

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest