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
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. 
Is My Compiler Or The Files? 
I am opening fteqccgui.exe in mac with wine, but I don't know if my problem is this compiler or are the qc files I downloaded, I can't compile fine; because all qc files have string errors and using /**/ I cannot solve my problem.
H3LP 
 
Are you able to compile standard Quake progs.dat 1.06 ok? http://www.quake-1.com/files/sourcecodes/kits/progs106.zip 
But... 
standard progs, but with some of SOA & DOE content, 1 monster of SOE also 
 
Does standard Quake progs 1.06 compile?

YES | NO

You are trying to figure out if problem is your code or compiler right? That is how to find out. 
Quake Progs 1.06 
thanks, this works fine, so the problem was my old code... 
 
See, haha. 
Step 2 
to put new monsters from doe & soa to my progs.scr, what more goes with the respective qc of monsters? 
 
This page loads slow as hell --- but it will eventually load ---

https://web.archive.org/web/20120213005405/http://www.inside3d.com/tutorials.php

It has monster tutorials at the bottom.

This page has monster mods
http://www.gamers.org/pub/idgames2/quakec/monsters/

You might look at spider21
http://www.gamers.org/pub/idgames2/quakec/monsters/spider21.zip

But ironically, I don't actually know QuakeC but rather just know where those resources are -- so I'll step out. ;-)

/Baker distracts Boa with "Hey look, a nickel!" and sneaks out the back door. 
Thanks 
thanks for helping but I don't understand jokes in english, I'm chilean

and fine... 
Hey Guys 
Is there an exhaustive list of functions that are available via quakec for vanilla quake? 
 
1) Maybe see post 2197
2) Maybe read defs.qc in the progs source
3) Maybe see bottom of pr_cmds.c in the engine 
 
try vanilla's defs.qc...
and bear in mind that a few of the args are wrong (eg: droptofloor does NOT take any args, and certainly not those of walkmove. yay copypasta bugs.). 
 
cheers guys 
Entity Naming Conventions 
Func, trigger, monster,info, you know the basics. My mod is getting...out of hand as far as multiple naming conventions go. I'm considering unifying the names of borrowed entities under Source engine's naming convention but still allowing the old entity names to keep from having to redo all my maps in progress...should I bother to nitpick this?

I'm thinking of using prop_ instead of misc_ or mapobject_; env_ instead of fx_ or misc_; logic_ instead of info_ or trigger_ (point entities where applicable of course); as examples.

Sort of thinking out loud here. I'm even tempted to go so far as to use npc...no no I'll leave them as monster_. 
Diff Program 
Anyone have a good simple diff utility for telling if files are the same or not when merging folders and keeping the different ones but renamed? 
 
WinMerge does a great job. ExamDiff is supposedly the King. WinMerge is free and awesome. ExamDiff might be available as a free trial if they still do that. 
Just Curious About This 
Every frame I need to check if a fairly small (5-15) set of entities is within a certain radius of the player.

Naive approach is to use findradius each frame and act on the results.

My current approach is to have a linked list that the entities in question add themselves to on spawn, iterate through that each frame and check for distance.

Am I prematurely optimizing with my approach or am I right in thinking that findradius will be slower? Haven't looked at engine code to see if findradius optimizes anything, but I'm just assuming it loops through all entities and checks for distance? 
Perhaps A Wash 
I guess that findradius was written because the QC is significantly slower than checking all the entities by hand. On the other hand, I can't imagine that checking just one entity in QC is slower than calling the function, so there's a question of exactly when one becomes faster than the other.

If you're using the trick from
https://tomeofpreach.wordpress.com/2012/12/26/not-using-vlen/
then I'd guess the QC method is faster over 15 entities, but it'd be pretty close, so there's an argument to just using the simplest method and calling it a day. 
 
if you're using fteqccgui, the 'annotate sourcecode' feature can be quite nice for showing you the actual instructions generated from each line of code.
combine that with what preach said, and then optimise it a bit more.

unlike engine code, qc code needs to write back each temporary to memory, it has to read each instruction, it has to do some jumps per instruction, it likely has extra bounds checks, etc.
the engine can just use hardcoded offsets etc, reads much less memory, has better cache performance, etc. on the other hand it does need to walk through every single entity...
so yes, its a tradeoff.

of course, if you're only doing it about 4 times per frame, then who gives a damn, just use the code that is the most maintainable. 
 
on the other hand it does need to walk through every single entity...

How are entities spatially partitioned in the bsp tree? Is there not a broad phase test? 
 
findradius does not walk the bsp tree.
dp does use its areagrid for it which can be a speedup, but this does change behaviour, hence why its only dp that does that. 
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.