Chainlist = Findradius(origin,radius)
#1067 posted by sock on 2013/09/04 19:14:28
It is the subtle things in life that cause the most problems ...
The findradius QC command can work differently in Darkplaces compared to Fitz engines. It may not seem like much of a difference but it can cause serious problem if you are not aware of it.
The Fitz engine ignores all entities with .solid=SOLID_NOT when creating a chain list for the findradius command. This is a good thing because certain types of entities (particles, delay spawns) can be excluded from this function easily and included when needed.
Darkplaces (older versions) does not seem to have any exceptions, it will gladly find ANY entity within range and create a chain list. The problem is the findradius command will freely 'corrupt' the chain field and if you use it for anything else then those lists will start to fall apart.
I recently switched over to a chain list for my particle system because it was crazy to keep creating/deleting them all the time. So I cycle round a chain list and it works fine in Fitz. In Darkplaces the lists were getting corrupted and I did not know why and then I finally found the problem, Findradius was finding the particles (my system can use sprites or models) and changing the chain field.
It seems Preach has run into this problem (post#962) but I could not find any other forum links. Apparently there is a sv_gameplayfix_blowupfallenzombies to fix this but the naming of it is not easily recognizable as something to do with the findradius command.
I tried to find a way for Darkplaces to exclude entities from the Findradius command. I set the model field to an empty string or "null" (dp documentation) and setting the bbox and size to zero, but nothing seems to make a difference.
I assume the latest version of Darkplaces fixes this by disabling the fallenzombie gamefix, but not everyone using DP updates all the time. It certainly easy to code for this change, but it is frustrating to find out about this the hard way.
Compatibility Battles
#1068 posted by Preach on 2013/09/04 20:20:04
Yeah, the more experimental engines are a bit more of a hassle to keep combatible with. Perhaps we should try and create a little community config file which restores darkplaces etc. to standard quake compatibility. Then add it to quake.rc to execute between config.cfg and autoexec.cfg. Incidentally that's the best time to aply strongly recommended cvar defaults - it replaces whatever was autosaved in the config last time, but lets people who think they know what they're doing override them in the autoexec file.
In your specific predicament, I'd recommend creating an extra entity field, perhaps:
.entity p_chain;
...and use that to replace your code's use of chain.
Could Also Contact LordHavoc
#1069 posted by ijed on 2013/09/04 21:33:11
He's usually on the ball with these types of fixes and happy to help out.
#1070 posted by Spike on 2013/09/05 04:20:06
sv_gameplayfix_blowupfallenzombies defaults to 0 in current builds (along with other such gamecode-changing settings), but the old value might linger via configs. Probably the easiest thing to do is to detect dp at load time somehow (to avoid warning messages in other engines) and just cvar_set it to 0.
(use solid_corpse instead of solid_not if you want to be able to shoot/find zombies, I guess)
but yeah, its probably better to simply use some other field like .enemy or .owner instead of .chain
Blogging Back
#1071 posted by Preach on 2013/09/06 00:42:26
So I took the idea I posted above, along with some other thoughts which have been coagulating for the past few months, and made a blog post. It's all about the engine config system, written mostly for someone who's writing a mod and wants to know what to do - and not do!
http://tomeofpreach.wordpress.com/2013/09/05/quake-rc-and-being-a-good-citizen/
There's a nice bit of copy-paste code at the bottom for controlling darkplaces cvars, although it covers both the opting-out and opting-in cases so users may need to tweak it slightly to suit their needs.
Locals Conflicting With Func Args?
#1072 posted by jt_ on 2013/09/08 19:18:32
Is it possible for a local to conflict with arguments to a function? I noticed that with a (clean) progs106, the SpawnMeatSpray function (maybe more) takes two vectors, org and vel; but in the function itself has a local named org. SpawnMeatSpray uses org only when calling setorigin and it seems to be using the argument org, not the local (assuming, can't check atm).
Qc + Locals
#1073 posted by Spike on 2013/09/08 19:45:16
arguments ARE locals.
dupe defs are ignored.
initialising a dupe is an error (vanilla qc initialisers make it a constant).
qc doesn't support scoped locals, other than to the function. unlike C+Java+etc, blocks don't have private locals, and locals are still valid beyond the end of the block that they were defined in.
Thanks, Spike
#1074 posted by jt_ on 2013/09/08 21:07:49
Buzzsaws
#1075 posted by Qmaster on 2013/09/14 06:00:34
Does anyone have usable buzzsaw code? For some reason the buzzsaw.qc file I have doesn't work and the saws don't match up with path_corner's. I've tried rewriting the code to use SUBCalcMove but it starts moving off at an angle instead of following a path, but the "original" I have cause it to jump around in my map. I've tried custents buzzsaw.qc but it does the same thing. It'll follow the paths in r2m7 but be offset vertically from the actual path locations and do a kind of jiggle up jump.
What am I missing?
...
#1076 posted by Qmaster on 2013/09/14 06:32:53
Okay, I found the original doe_qc.zip source code online: http://www.gamers.org/pub/idgames2/more_idstuff/doe_qc.zip
Copied buzzsaw.qc into my code and ran it. Buzz saws still hovering about 16 units above the tracks they should be in the Last Bastion (r2m7). Found doe progs.dat (dated 2008 from when I copied it off the CD, verified the same size as in the pak0 under rogue directory) and it does the SAME THING!!
Is this Darkplaces only related?
Okay Yep.
#1077 posted by Qmaster on 2013/09/14 06:36:35
it's a darkplaces bug. Buzzsaws work fine in WINQUAKE.EXE. Is there a gameplay console var fix for this??
Okay...
#1078 posted by Qmaster on 2013/09/14 17:21:23
what's happening with the buzzsaws is that they behave like monsters. They change their movetarget when their bounding box touches a path_corner, not when their origin reaches the path_corner's origin. Now then...to figure out how to ignore path_corner.touch functions....
Buzzsaws Solved!
#1079 posted by Qmaster on 2013/09/14 18:24:27
No code modifications required.
Just positioned my buzzsaws outside of the tracks such that they have time to move and get inline with the path_corners. (had to bsp_to_map the r2m7 map and see what they did to make it work, the buzzsaws were about 64 units away in both x and y directions from their starting path_corner.) There are still a few glitches if the path_corner's are positioned a distance away from eachother that Quake doesn't like, or if the speed of the buzzsaw isn't just right. (10 usually works and is default)
Sounds Good!
#1080 posted by ijed on 2013/09/16 03:28:27
Keeping Score
#1081 posted by mechtech on 2013/09/30 02:10:22
Any mod out there that can count damage done in a level and give a total at intermission?
I think it would be fun. Make a replay of the original game interesting. Timing a quad damage would be very important I suspect.
Stealth Damage
#1082 posted by sock on 2013/09/30 02:13:11
I added damage done to my ITS mod, there is a stealth stats screen you can check at anytime during play of a map.
Sock
#1083 posted by mechtech on 2013/09/30 02:26:29
That's the idea. A mod that can take e1m1 and give a score at the end without modifying anything else. Vanilla Quake with a score card at the end. I'm sure it could get complex give points for health, armor and ammo and suck points off for total time.
#1084 posted by R00k on 2013/10/01 21:30:43
I've added damage given, and damage taken to my multiplayer mods. It's not difficult at all.
I then get a survival skill score by this
score = damage_given / (damage_taken+damage_given)
:D
#1085 posted by Spirit on 2013/10/01 23:28:25
I kinda hope that some day more engines will support sqlite and we could use that to track and record all kinds of things locally. FTEQW supports it.
#1086 posted by Spike on 2013/10/03 18:03:05
sql is only really useful for single player, and even then you can often get away with frik_file instead.
when it comes to deathmatch you probably want some central server recording matches in aggregate, which would likely be programmed in something more php-ey instead of qc. naturally this avoids sql in the game server, but does require some sort of communication to said server...
Extract Vertexes From .MAP/.BSP
#1087 posted by ALLCAPS on 2013/10/03 21:30:38
Is there an easy way to heist the vertex/mesh data from a Quake map? I'm trying to whip up some C# for using Q1 brushwork inside of Unity3D, and I'm hitting a wall.
Since I don't care about the lightmaps or vis data, I figured I'd try to divine the vertex data from the .map, but converting from the brush based geometry (calculating planar convergence) is beyond my skill. It'll probably be easier to let a compiler do the lifting on that and just read the data I want out of the resulting .BSP Are there any libraries available for working with Q1 .BSP?
#1088 posted by metlslime on 2013/10/03 21:33:54
i think the bsp is a better choice as it is more mesh-like, and is already cleaned of things like tjunctions, overlapping polygons, etc.
#1089 posted by Spirit on 2013/10/03 21:47:23
#1090 posted by Preach on 2013/10/03 22:27:07
when it comes to deathmatch you probably want some central server recording matches in aggregate, which would likely be programmed in something more php-ey instead of qc. naturally this avoids sql in the game server, but does require some sort of communication to said server...
The most obvious solution is to program the central server to mimic a client connection to the game server! Sure you waste a client slot on your stats bot, but who plays 16 player deathmatch anymore anyway...Of course you'd communicate directly from the QC using SVC messages to ensure your code runs on every engine. Just write, lets say byte-by-byte UTF8 encoded JSON, wrapped up as a sprint statement to the bot.
Preach goes off to write a web server in QC and is never heard from again
#1091 posted by necros on 2013/10/04 02:05:31
my inner nerd has been awakened. this sounds like such a cool idea :D
|