speculative thinking about parms...
Moderator: InsideQC Admins
8 posts
• Page 1 of 1
speculative thinking about parms...
one of the biggest plagues with quake are parms. 16 may seem like enough. the game uses about 9, so you have 7. these extra 7 parms are never enough. so i got to thinking about ways to increase the parms. i know that adding something like parm17, parm18 would never work...... for some reason. im not really sure why this wont work. i think it's bitfield crap or smthing.
but how about using parms to store vectors instead of floats? this way you have 3 numbers stored for every parm. 3 * 7 = 21. so 21 numbers are saved. you can use one specific number for a certain case (ie .vector ammotype1, when you use shotgun, self.ammotype1_x = self.ammotype1_x - 1;)(when you use the grenade launcher: self.ammotype1_y = self.ammotype1_y - 1:) catch my drift?
i dont have access to my computer now so it's possible this idea might not work.
but how about using parms to store vectors instead of floats? this way you have 3 numbers stored for every parm. 3 * 7 = 21. so 21 numbers are saved. you can use one specific number for a certain case (ie .vector ammotype1, when you use shotgun, self.ammotype1_x = self.ammotype1_x - 1;)(when you use the grenade launcher: self.ammotype1_y = self.ammotype1_y - 1:) catch my drift?
i dont have access to my computer now so it's possible this idea might not work.
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
The params are defined in the engine as so (progdefs.h, globalvars_t struct):
So as they're explicitly floats only.
There's also NUM_SPAWN_PARMS #define'd as 16 in the engine, and reading/writing them is done like so (adjust as appropriate for writing):
So you're stuck at 16 and stuck with floats.
Easier to just use something like FRIK_FILE and do your own reading/writing of your own data if you really need to go beyond 16.
- Code: Select all
float parm1;
float parm2;
float parm3;
float parm4;
float parm5;
float parm6;
float parm7;
float parm8;
float parm9;
float parm10;
float parm11;
float parm12;
float parm13;
float parm14;
float parm15;
float parm16;
So as they're explicitly floats only.
There's also NUM_SPAWN_PARMS #define'd as 16 in the engine, and reading/writing them is done like so (adjust as appropriate for writing):
- Code: Select all
for (i = 0; i < NUM_SPAWN_PARMS; i++)
fscanf (f, "%f\n", &spawn_parms[i]);
So you're stuck at 16 and stuck with floats.
Easier to just use something like FRIK_FILE and do your own reading/writing of your own data if you really need to go beyond 16.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
ha...ha....
shot down.
well, thanks for the explanation. but how does frik file work? its really strange...
well, thanks for the explanation. but how does frik file work? its really strange...
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
behind_you wrote:ha...ha....shot down.
![]()
well, thanks for the explanation. but how does frik file work? its really strange...
check the source code from this great mod of wazat!
http://www.moddb.com/mods/conquest
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
if you're using FTE...
Create a function:
void(float timediff) ClientReEnter = {foo();}
Once defined, instead of ClientConnect/PutClientInServer, that function will be called instead. All player fields will be as they were on the previous map. All floats, all vectors, all strings, everything. Actually even ents and timers, which can be annoying. You need to add timediff to each of your timers to correct the timer to cope with the map change. So you can get quads to persist over map changes and stuff. Other than that, you just need to setorigin the player to the location of a spawnspot, and set their angles.
Then you can totally ignore parms (which FTE supports 32 of, anyway).
Create a function:
void(float timediff) ClientReEnter = {foo();}
Once defined, instead of ClientConnect/PutClientInServer, that function will be called instead. All player fields will be as they were on the previous map. All floats, all vectors, all strings, everything. Actually even ents and timers, which can be annoying. You need to add timediff to each of your timers to correct the timer to cope with the map change. So you can get quads to persist over map changes and stuff. Other than that, you just need to setorigin the player to the location of a spawnspot, and set their angles.
Then you can totally ignore parms (which FTE supports 32 of, anyway).
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: speculative thinking about parms...
behind_you wrote:...the game uses about 9...
You can actually trim this down to 8 as stock id1 QC "wastes" a spawnparm to store self.armortype between level changes, when it could just as easily figure the defensive value to apply by checking to see what IT_ARMOR is stored in self.items...
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Re: speculative thinking about parms...
Dr. Shadowborg wrote:behind_you wrote:...the game uses about 9...
You can actually trim this down to 8 as stock id1 QC "wastes" a spawnparm to store self.armortype between level changes, when it could just as easily figure the defensive value to apply by checking to see what IT_ARMOR is stored in self.items...
FrikaC wrote:If you need a bit more than 10-16, I should note that parm9's use in Quake is kinda pointless. It stores the "armortype" variable, a variable with only 4 possible values all of which are already flagged in .items.
So all you need to do to free up parm9 is add this to the bottom of DecodeLevelParms:
if (self.items & IT_ARMOR1)
self.armortype = 0.3;
else if (self.items & IT_ARMOR2)
self.armortype = 0.6;
else if (self.items & IT_ARMOR3)
self.armortype = 0.8;
else
self.armortype = 0;
Is it possible to create a list of id1 qc "wastes"?
now it occurs to me
"float IT_SUPERHEALTH = 65536;"
(128 it is left freely therefore I do not believe that it is a real waste)
It would be good to create a list like that to obtain a clean code (compatible with all the engines)
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest