News | Forum | People | FAQ | Links | Search | Register | Log in
Coding Help
This is a counterpart to the "Mapping Help" thread. If you need help with QuakeC coding, or questions about how to do some engine modification, this is the place for you! We've got a few coders here on the forum and hopefully someone knows the answer.
First | Previous | Next | Last
 
from gtkr def for rogue:

/*QUAKED trigger_earthquake (.5 .5 .5) ?
The Earthquake generator.

Anytime a person is in an active
field, they shake. If the trigger is a
target, it will be OFF until triggered.
It will then toggle between ON and OFF.

weapon - richter scale of movement
(default 40)

weapon - if you give a weapon value of
40, the X and Y displacement
can vary between -20 and +20, a range of 40.
*/


i don't know why modern editors other than radiant don't include the description text. it's very useful! 
Earthquake Active Field 
Ah, yes, that was the restriction that made it not as useful as I wanted, so I adapted the code to make it switchable only.

/*QUAKED trigger_mwquake (0 1 0) (-8 -8 -8) (8 8 8)
A switchable only earthquake trigger.

Keys:
"delay" - duration of the tremor
"weapon" - richter scale of movement (default 40)


(Funny how I have kept the BspEditor, the entity defs and all my map files, yet not kept the code - this is really puzzling me as I don't usually throw anything out e.g. 10,000 of my own photographs at 24meg each, half of which I will never look at again? I have to get to the bottom of this; I must have some HDDs tucked away somewhere.) 
Decompiler? 
Can anyone suggest a decent progs.dat decompiler. I realise I wont get my notes included, which may be s stumbling block for me, but I now have a bee in my bonnet about getting to look over the code I wrote.

I have tried frikdec from 2002 but it fails to retrieve all the modules and doesn't do very well with those that it does. 
Earth Quake Killer 
I tried to understand the earthquake.qc.
I extracted it from the SoA code and found client.qc and defs.qc changed as a earthq.qc.

Only using the earthq.qc is usefull but there are eight parms in use.


void() earthquake_rumble
void() start_earthquake
void() stop_earthquake
void() earthquake_touch
void() earthquake_use
void() trigger_earthquake
void() kill_earthquake
void() trigger_earthquake_kill


What I found is that the trigger_earthquake_kill is in use for the delaying the earthquake.
So when I tried to add a new one to kill the earthquake for ever doesn't work.
OK. So keep out of the area where the trigger_earthquake happens will do, but then I keep tat thunder sound throughout the level. 
Divided By 64, Multiplied By 85. What The... ? 
When checking vanilla's texture loading code, I found the following line, in both software and GL rendering:

pixels = mt->width*mt->height/64*85;

That is later used to allocate space for the incoming texture. My question: why do we need to take the amount of space needed for a texture, divide it by 64, and then multiply it by 85? What does those numbers even mean?

(Could it be that somebody was trying to cover up for a hard-to-find bug in the engine? Seriously, I have no idea...) 
 
It's not a bug.

The calculation is the formula for adding the 3 levels of mip textures that software Quake uses to determine the byte size.

main mip1 mip2 mip3
64x64 ... 32x32 ... 16x16 ... 8x8 
Embedded Mipmaps. 
assuming count is 16*16 (the minimum allowed):
count + count/4 + count/4/4 + count/4/4/4
256 + 64 + 16 + 4 = 340
giving a ratio of 256:340. simplifying that gives 64:85.

thanks to textures needing to be a multiple of 16, textures are guarenteed to be a multiple of 256 pixels, so dividing by 64 is safe.

this might not be true if you tweak your renderer to misalign the 1:16 lightmap ratio, but this sort of thing would break software rendering.
most gl engines just discard the original extra levels and use only the top-level image, so maybe you just want to nuke that part entirely. 
Ooh... 
Embedded mipmaps!

I see what you mean now. In fact, vanilla GL code actually does discard the incoming mipmaps. This happens in GL_Upload8(), which calls GL_Upload32() after copying the texture into a static defined trans[] array (ewww) containing only the bytes of mipmap 0.

Seems like they were in a hurry to deliver the game. What d'ya know? :) 
 
Seems like they were in a hurry to deliver the game

They already delivered the game. Quake was a DOS application (quake.exe).

GLQuake was an after the fact unsupported release several months later. WinQuake, the Windows version of DOS Quake, was also an after the fact unsupported release.

Quake release date: July 22 1996
GLQuake: January 22, 1997
WinQuake: March 11, 1997 
Carmack Wrote GLQuake In A Weekend 
(And it shows) 
Heh, I Wish I Could 
do that in a weekend. I spent 1+ month doing my GL ES port :) 
Fitzquake Problem 
Hoping it fits in this topic.. I have to say that all Fitzquakes do not work with Minigl 3dfx drivers .
I need that because I play Quake on a rather old pc and need those extra-frames ! 
3dfx 
try the mini-driver from quake3, it should be more complete (in that it includes support for vertex arrays). 
@komagame 
If this is that Windows 98 machine, if you upgrade it to Windows XP, your choices grow pretty substantially.

I have to assume you must have enough RAM. 
String Command 
Is there a command that will take the 1st (x) number of chars in a string and let you compare them? for example , to know if we are doing episode 1, take the 1st (2) from the mapname string (e1) ? Possible ? I am using Darkplaces and there are some new string built-in extensions but they dont sem to be able to do this afaik. 
 
if (substring(mapname, 0, 3) == "e1m")
then its probably episode 1.
float mapnum = str2chr(mapname, 3)-'0';
if (mapnum >= 1 && mapnum <= 8)
then you know which map number it is. 
Uh Oh 
Is there a limit to how many functions FTEQCC will compile?

I'm trying to compile AD but it gives me this error unless I comment out a couple files from progs.src:
********** ERROR **********
Too many types
Error in <filename near end of list>.qc on line <line number depending on which other file(s) I've commented out>  
Update 
that got fixed a while ago. hence why the code was released without those files commented out. :) 
@newhouse 
If you can actually code, you are probably mostly better off learning how QuakeC works

HOW TO USE QUAKEC

0. QuakeC tutorials ---- MAJORLY useful
1. QuakeC source code
2. FTEQCC compiler - Compiles the QuakeC source

Extract the fteqcc executable to the folder with the QuakeC source code and double click it and it will compile up a progs.dat. That is what runs and is hiding inside quake/id1/pak0.pak. You need Pakscape to open pak files.

3. Pakscape Pak Editor Open/edit pakfiles.
4. QuakeC help forum (deadish) with useful reference threads
5. QuakeC specs
6. Links and References (very useful)

The QuakeC source code for progs 1.06 is standard Quake, it isn't Arcane Dimensions, but Arcane Dimensions, for example, is open source and if you were interested would be able to compile Arcane Dimensions following similar steps. 
@baker 
Thanks, though I'm still studying, yet wanting to map more.. let's see how much time there will be left for learning this QuakeC during this year.

I will save your post for later use* 
@baker 
Was my post flagged as spam, or did I even post here anything? What was I even asking.. but anyway, yes I have experience from programming C#/C++, but I was mostly working on user interfaces. 
Zero-Length Strings 
Finally got around to writing up the killtarget bug which was plaguing Newhouse during Map Jam 7.

https://tomeofpreach.wordpress.com/2016/09/10/zero-length-strings/

It's actually something that could affect other QuakeC code as well, so worth a look if you're working on a mod at all. 
 
fteqcc -Wall
will give a warning for that (and a few other things that will just annoy people)
fteqcc -Fifstring
will just automatically treat if(str) as if(str!=""). which is fine until you need to actually distinguish (like eof vs a blank line). if((int)str) can be used in that case. 
Use Case 
Scary part is while I was writing the article I thought of an actual use case outside of extensions like eof vs blank line! For func_breakable there are are templates which if chosen will fill in default values in fields which haven't been set. In these cases, you can explicitly override a template which sets a field by setting a "" value.

Even if -wall is a bit too noisy to use permanently, it'll be a handy tool to use once and pinpoint all the instances that currently exist in the code to fix. 
1 post not shown on this page because it was spam
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.