|
Posted by metlslime on 2007/08/08 04:57:56 |
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. |
|
|
Monster Size
#2039 posted by Qmaster on 2016/02/11 13:51:47
No...all monsters are one of two sizes. 32x32x56 or 64x64x88. If you assign a size other than these the engine will round it to the nearest size. This is because of the way the engine handles collisions. Every level has a hull0 and a hull1 for the two sizes above. When a level gets compiled the compiler creates 3 versions of the map geometry, one for what you see and shoot, one for what you and other hull0 sized creatures collide with, and 1 for larger monsters. The hulls are all shrunk in from the walls by half the width of the bounding box so that collision only happens as if every solid object were only a point.
You can, though, make it visually different sized, but the collisions will stay the same.
Actually
#2040 posted by Kinn on 2016/02/11 13:59:32
The size with respect to the level collision can be of 3 values; the two mentioned by Qmaster, or point size.
However, for the purposes of entity/entity collision, the bbox will use its actual size, not the hull-rounded size.
WOW Why?
#2041 posted by Skiffy on 2016/02/11 15:00:58
ok that is a rather gimped limitation wow. no way to hack around that I guess without changing the engine itself?
How the heck do you do large boss monsters then?
You Can Do It Like Armagon
#2042 posted by aDaya on 2016/02/11 15:13:12
e.g Have a main model (the legs) and have a secondary model "attached" to it (the upper body)
Skiffy
#2043 posted by Kinn on 2016/02/11 15:38:06
I may be imagining things, but a very clever solution was used by necros in Altar of Storms (necros please correct me if I'm wrong) that went something like this:
1) have a fuckoff huge monster in big arena-like environment
2) build a dummy small version of the arena environment somewhere player can't reach. In this small environment there's a normal-size version of the big monster (let's say it's shambler-hull-sized) The size of this small environment relative to the shambler hull should be in proportion to the size of the big environment relative to the intended big monster size.
3) The small monster moves around the small dummy environment fighting a dummy player entity (whose position is updated based on the real player's position. Similarly, the big monster in the real environment gets its position set based on what the small monster is doing.
Hope that makes sense. The concept is simple really, it's just about setting up master/slave entities at different scales to each other.
Also Skiffy
#2044 posted by Kinn on 2016/02/11 15:48:33
the way Quake does it is for performance reasons - back in 1996 it was a big deal to make collision as cheap as possible so reducing all entity/world tests to point tests was desirable.
Of course, expanding the bsp tree on the fly was too expensive so they settled on using just 3 pre-baked versions of the tree, with the tradeoff that you only get 3 sizes of entity wrt the world.
Thanks For The Info Everyone
#2045 posted by Skiffy on 2016/02/11 16:11:35
That concept sounds like a wicked hack... and it makes sense too. If he did indeed do that then its rather amazing.
Its nice to have some quakeC coder brains to pick and ask all these questions.
Collisions
I thought the 3 hulls were point , player and shambler. Anhyow, why could not the hull limit versus world/ bsp map entity be overcome by using code like this:
(This was originally Lord Havocs Idea)
float (vector loc, entity subj) Inbounds =
{
if (loc_x <= subj.absmin_x
|| loc_y <= subj.absmin_y
|| loc_z <= subj.absmin_z
|| loc_x >= subj.absmax_x
|| loc_y >= subj.absmax_y
|| loc_z >= subj.absmax_z)
return (0);
else
return (1);
};
Where subj would be the world entity, and the loc would be a spot on the hitbox. I believe you could use the ents absmin or absmax as loc and still get it to work, or to be sure, run it on the other 2 corners of the hitbox as well.
Theres also the stock ID function EntitiesTouching ()
Which is for the doors, and since they are models with their origins hard coded, with respect to world, they use mins / maxs, however I have modified it so you can check absmax and absmin, pretty easily by defining an operating mode:
float (float mode, entity e1, entity e2) EntitiesTouching =
{
// Cobalt mode float - modifies to cover absmin/absmax, else do normal mins/maxs
local vector low1, high1, low2, high2;
low1 = e1.mins;
high1 = e1.maxs;
low2 = e2.mins;
high2 = e2.maxs;
if (mode)
{
low1 = e1.absmin;
high1 = e1.absmax;
low2 = e2.absmin;
high2 = e2.absmax;
}
if (low1_x > high2_x)
return FALSE;
if (low1_y > high2_y)
return FALSE;
if (low1_z > high2_z)
return FALSE;
if (high1_x < e2.mins_x)
return FALSE;
if (high1_y < e2.mins_y)
return FALSE;
if (high1_z < e2.mins_z)
return FALSE;
return TRUE;
};
Lord Havoc's
#2047 posted by Qmaster on 2016/02/11 18:25:52
Darkplaces allows this: mod_q1bsp_polygoncollisions 1
But it is a bit buggy, the player can get stuck sometimes on any vertical surface such as walls. I was using it for a while for my Citadel mod to do crouching and prone and to size enemies better but it was just too unpredictable. Thats why I had to chamge it to use Unity, sadly.
3 Hulls
#2048 posted by Qmaster on 2016/02/11 18:30:06
You could, I suppose, use point for your monster size, but it would look wierd whenever it ghosted halfway through walls. And of course there's the issue of you being able hit it with your point sized bullets.
#2049 posted by khreathor on 2016/02/11 18:32:01
Thats why I had to chamge it to use Unity.
What do you mean by Unity?
Cough Cough Different Engine
#2050 posted by Qmaster on 2016/02/11 18:38:02
Qmaster
#2051 posted by khreathor on 2016/02/11 18:52:00
Any link to your project?
Kind Of Off-topic But
#2052 posted by aDaya on 2016/02/11 19:36:17
Is Unity good enough as an engine to make a Q1-like that looks similar to UT99/the Half Life HD pack?
Daya
#2053 posted by Kinn on 2016/02/11 19:54:46
yes
Short Answer Is Yes
#2054 posted by khreathor on 2016/02/11 20:17:00
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
#2055 posted by aDaya on 2016/02/11 21:01:10
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
#2056 posted by necros on 2016/02/11 21:53:38
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
#2057 posted by Kinn on 2016/02/11 22:41:51
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
#2058 posted by Qmaster on 2016/02/12 01:50:32
Here Thar Be Dragons
#2059 posted by ijed on 2016/02/12 18:11:32
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
#2060 posted by necros on 2016/02/14 04:32:28
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. :(
#2061 posted by Spike on 2016/02/14 05:04:10
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
#2062 posted by necros on 2016/02/14 05:13:18
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
#2063 posted by necros on 2016/02/14 05:15:26
that mod folder had an ancient copy of fteqcc. :P
all good now, I think.. thanks!
|
|
You must be logged in to post in this thread.
|
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.
|
|