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
 
The expansion had electric eels. Scrags look OK underwater. Zombies don't need to breathe ;) 
 
spawns... at least underwater you won't get quite so annoyed at them.

if you're jumping out of water, you need to move at least far enough to get your monster's bbox to leave the water and then progress past any ledge above the water surface too. and after all of this, it then needs to also go forwards if it somehow managed to avoid impacting the wall and losing its sideways momentum...
which is why the quake player keeps trying to move forwards while waterjumping, regardless of what the player wants or really anything else. the player must a: be next to the side. b: far enough up that a tracebox can go up, leave the water, move sideways slightly, then move down again and hit ground that is actually viable (ie: somewhat flat). c: then the upwards velocity is set, a teleport_time flag is set, the player looses control of their sideways velocity. d: that upwards velocity takes the player out of the water, the forced sideways velocity that ignores walls takes the player sideways once he's far enough out of the water, and when the player gets control of their velocity again then they've successfully left the water.

because, quite frankly, teleporting out of the water is stupid.

if its a monster, be careful about FL_PARTIALGROUND, if your monster didn't get fully onto land, the monster will be able to casually walk over the ledge and fall straight back into the water.

the problem with just casually hopping out of the water like the player does it is that it lacks presence or menace, its just another monster to kill. you might as well just teleport them in if you don't have that.
some sound effects or cool animations might do the job.
slowing the transition down so the player gets a chance to panic at 10 of them getting out of the water while he's got no ammo. that's the way to do it.

alternatively you could have fish that move fairly fast and spit, which means they'll keep sniping the player while being impossible to see/shoot thanks to the opaque water surface.
the player then has the option of either trying to ignore/dodge said spit/whatever, or jump in and get eaten by the fishies. 
Underwater Monsters 
There is def a lack of them, the Eels in Rogue were neat. As for spawns, you could put them inside a secret door of sorts that they exit out of, on the walls or the floor, or a tunnel that leads inside the wall to their home.

I always thought movetype_fly was better for swimming monsters...simulates no gravity. flymissile will make em bounce off the wall for more accurate physics with the right velocity calcs. Just have to make sure you dont break the surface and are in empty air. Air pockets could pose a challenge tho... 
Can Models Change Size? 
because a spawn that is really thin and wide on the ceiling, and then drips down into a blob on the ground would be cool. 
Monster Size 
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 
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? 
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 
e.g Have a main model (the legs) and have a secondary model "attached" to it (the upper body) 
Skiffy 
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 
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 
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 
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 
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. 
 
Thats why I had to chamge it to use Unity.

What do you mean by Unity? 
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. 
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.