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
Cough Cough Different Engine 
 
Qmaster 
Any link to your project? 
Kind Of Off-topic But 
Is Unity good enough as an engine to make a Q1-like that looks similar to UT99/the Half Life HD pack? 
Daya 
yes 
Short Answer Is Yes 
I'm currently "preparing for"/designing a game inspired by Blade Runner with Quake-like graphics.

Most problematic is non skeletal animation and making game modable.
First problem you can solve with blendshape animation, or by writing your own animation system (just loading vertices states).
Second problem is more challenging... Easiest way is to let people create and script maps in Unity and export them as Asset Bundle, then load them in your game. This delivers few problems:
1) You have to open part of your source so people can use and modify logic - for example adding some functionality to existing door script;
2) C# Scripts must be compiled into assembly - not a big problem, but pain in the ass when you test stuff;
3) If you give people access to C#, you have no control what is executed in your game - I can create a map that will delete or acquire some important data from your hard drive.

But... few days ago I have discovered nice Lua integration for Unity and .Net in overall. It's opensource, easy to use etc.
So instead of C# we can use Lua scripts = much easier editing and testing, easier to avoid malware behavior.

For mapping you can use free version of Pro Builder: https://www.youtube.com/watch?v=0yB_Q7yECwk
So all your mod tools stay free.

Rest is piece of cake... 
I Planned On Using Skeleton Animation For Smoother Animations 
As well as ragdolls in tandems with actual death animation for avoiding flat lifeless bodies hanging on ledges and whatnots (and also for doing high-impact on deaths a bit more convincing). Half Life did skeletal animations on low-poly models right and Metroid Prime did the animation/ragdoll tandem well, so it's possible.

It's also a relief modding is possible, it's one of the thing I was looking forward when developping my game.
And as long as that Pro-Builder has a grid and surface texturing I'm fine. 
Kinn 
That's a cool idea, but not how I do huge monsters.

I make 1 bmodel that becomes the clip brush for huge monsters, I basically pad the walls out with it.
Then at level start it is non-solid.
Everytime the huge monster moves, it sets it's bbox to shambler size, makes the clip model solid and then walks. 
Necros 
Aha! So I was kinda imagining things :) Or, I half-remembered it and tried to fill in the blanks myself or something.

I guess the problem with the method I mentioned is that it could get messy when you have more than just the boss and the player moving around in the environment - you need a master/slave setup for every entity that the boss's movement needs to know about. 
Citadel 
Here Thar Be Dragons 
Patrick Martin had a special trick for large BBOXs in his Drake mod and the Dragons patch.

http://www.quakewiki.net/quake-1/mods/dragons/

I love his code - so many interesting and creative monster improvements. 
Fteqcc.exe 
Any way to disable this: warning: Model progs/clutter/bookclos.mdl was used but not precached
I'm using Preach's wrapper that magically fixes this problem, but now fteqcc yells at me for being clever. :( 
 
you mean other than this?
precache_model("progs/clutter/bookclos.mdl");

Note that you can also use this, for instance:
precache_model((self.mdl = "progs/clutter/bookclos.mdl"));
yup, assignments in function calls are evil, but it will do the right thing, and only need the mdl named once (you could also make some macro, eg preset_mdl).

And of course, if you just want to hit it with a sledgehammer instead of playing whackamole:
#pragma warning disable F210
note that doing so will of course hide any other instances (which may be more significant).
you can use this method to disable any warning that fteqcc gives a code for, but you run the risk of shooting yourself in the foot if you just disable everything, so use with caution. 
Thanks 
doesn't seem to work though? where do I put the #pragma line? I tried in defs.qc (the first file in progs.src) and also in one of the files where I get this warning, but neither had any effect. I also tried #pragma warning off F210 from here: http://fte.triptohell.info/wiki/index.php?title=Precompiler_definitions&action=edit

btw, preach's trick is thus:
void(entity e, string m) setmodel_builtin = #3;
//preach's wrapper function for setmodel!
void(entity e, string m) setmodel =
{
if(framecount == 0)
{
if(m != "")
precache_model(m);
}
setmodel_builtin(e, m);
};


which neatly stops you from ever having the problem! 
Ahhh Pardon Me 
that mod folder had an ancient copy of fteqcc. :P
all good now, I think.. thanks! 
 
oh... btw, warning F304: unary-not applies to non-unary expression
I liked the warning in the old version where it just told you warning: You may wish to add brackets after that ! operator
 
seems that warning only got a code in revision in july, hence why its not present in the warning message you gave.
you'll need to update your copy of fteqcc if you want to blanket-disable that warning.
alternatively, because the warning is generated regardless of whether setmodel is a builtin or a qc wrapper, you can just do:
#define setmodel setmodel_spanishinquisition
#define precache_model precache_model_omgninja
before your builtin/wrapper definitions.

of course, that hack won't stop you from ever having the problem, and implies that you'll be lazy and forget the cases where it won't work as expected - ie: outside of initial spawn functions.
even fte+dp will display a warning if you setmodel without precaching first, despite them both supporting precaches any time (there may be some edge cases in dp regarding bsp models, iiuc).
either way, triggering auto-downloads mid-map is bad. hurrah for PREcaching. 
 
regarding unary-not, !a&b always looked wrong to me, as a C programmer. The brackets don't change anything, but they do clarify things for people more familiar with C operator precendence. :P 
Cache Miss 
of course, that hack won't stop you from ever having the problem, and implies that you'll be lazy and forget the cases where it won't work as expected - ie: outside of initial spawn functions.

If you've forgotten to precache a model you need, you're screwed either way. What it does is threefold:

1) Allows for external model files in e.g. func_wall (and since you can't know from the QC if the model will be "*10" or "progs/cog_lrg1.bsp", precaching everything that comes through just in case is the only safe way).

2) Permits you to reuse a spawn function which you've already called at the start of the map to create a fresh instance of e.g. a monster mid-game. This is a Don't Repeat Yourself principle thing.

3) Makes spawn function code a little bit shorter and tidier

The part 3 on the end there is more of a bonus, not the point of the code. 
 
thanks, spike! just picked up the most recent version (feb 11 2016)! 
 
note: suppressed 262 more warnings about unreferenced variables, as you clearly don't care about the first 10.

too funny. i need to go clean up this code... 
 
@preach
1) yes, it avoids going through each func+trigger spawn function to ensure that there's a precache_model(self.model) line. I guess it depends how lazy you are.
it'd be nice if engines supported precaches any time, but this implies mid-game downloads and possible reliable-vs-datagram races and things (which would crash vanilla before any illegible server messages), both of which are nasty enough that the qcc(+maybe engine) should still warn if something isn't explicitly precached.

2) by all means wrap precache_model so that it doesn't crash outside spawn functions. wrapping setmodel will just hide things so that compilers cannot reliably detect it.
Ideally the server would only error if the precache is actually new... but considering how many people use crippleware engines, this ideal is admittedly laughable.

3) it would be better to make a 'presetmodel' function that does both, or something. at least then the compiler won't see either the precache or the set.
you'd still need a precache_model if you do an explicit setmodel elsewhere.

4) qcc trying to detect missing precaches is a nice idea, but also still a hack that can only see immediates, with hardcoded function names.
I fully admit that I'm biased towards one of those hacks. :P

@necros
you can use the verbose(aka: -v) option if you want a list of all of them instead of just the first ten.
or you can use #pragma noref 1 and #pragma noref 0 around them if you want the qcc to (mostly) ignore any unimportant defs, like unused builtins etc that you might find in dpextensions.qc (note that this is the mechanism used by fteextensions.qc to silence warnings about all that unused stuff).
Of course, you should only really use this if its meant to be maintained by someone else. 
 
thanks spike! yeah, i was doing them 10 at a time... this is much faster.

also, thanks for the noref pragma... where is the documentation for all these little tricks? the wiki i linked to earlier doesn't seem to have any other pages? 
 
Is there some good article describing how Quake's Lightmapping works? I tried to understand it from BSP format docs, but it looks like some black magic. 
 
lightmaps are basically just textures.

there are 64 'styles'

each face in a map can have at most 4 styles on it.

typically there's only one style, style 0 which is always on.

then there are 11 other styles that flicker and pulse and such. these are the ones you can select in the editor.

each time you make a target/targetname switchable light, the light utility reserves a new style number.
qc then changes the style via lightstyle function. these numbers start at 12.

it's important to note that the target/targetname has nothing to do with anything other than letter the QC pick up the style value that light.exe has added to the entity after compiling. 
I Think He Means Lightmapping 
not light styles.

e.g. the lightmap visualization of dm2 for instance:
http://scampie.net/etc/lit2compare/dm2_1_lit_lm.jpg

This article maybe? http://latchup.blogspot.com/2015/06/quake-lightmaps.html?m=1 
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.