|
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. |
|
|
#186 posted by JneeraZ on 2009/01/22 16:34:21
To be honest, pain skins don't really excite me in Quake because how often is a monster in pain? You see the monster and it's generally dead within seconds. Would you even see the pain skin kick in?
Its Just A Daft Thing I Wanna See Really
#187 posted by RickyT33 on 2009/01/22 16:58:51
Monsters are all a bit bruised/bloody anyway, but brown grunt stood up, 2 seconds later red and bloodied grunt on floor. I mean I know that the pain skins would be non-locational, but for monster like a Shambler or a Vore you could have three or four increments of pain, relative to HP, and it would show how close that Shambler you've been picking away at with an SG or SSG for five minutes is to death!
I just think it looks cool. I also wanna see a mod with pain skins and zombie-gib blood splats dribbling down walls from when mosters are shot.
I know its meant to be easy in Quake C, theres a tutorial on Inside3d. Maybe this will be my first Quake C project . . .
(I had it working once when I was about 15, but I cant remember how it worked now, and haven't tried yet)
#188 posted by JneeraZ on 2009/01/22 17:11:35
Dead skins might be a decent idea. The corpse on the ground could be all fucked up and bloody. That might make more sense...
Ok, Pain Skins In 5 Minutes
#189 posted by Preach on 2009/01/22 20:01:52
Lets say we work with the grunt, and give him a second skin which is bloody and beaten up. Now open up soldier.qc and look for the function
army_pain
Right at the bottom of this function, add
if(self.health < 15) //if we are below half health
self.skin = 1;//turn on the pain skin
This will work a lot of the time, but there's a chance that the grunt goes from above 30hp to dead without going into pain. Also, if the grunt is dead, we should check if he gets gibbed, and set the skin back to 0 if so, because the grunt head only has 1 skin. So find army_die
and put
self.skin = 0;
just after
if (self.health < -35)
{
Then put
self.skin = 1;
after the closing } bracket of that gib section of the function.
You can do a similar thing with pretty much any monster, find the pain function and use that to add the pain skin. Remember that some monsters don't automatically go into pain animations, and may return near the top of the function. This means that you have to think about where to add the line. You could put it right at the top, so that it always gets checked. Or you might decide that the skin should only change if the monster goes into pain, and so put it at the bottom.
Pain Skins
#190 posted by necros on 2009/01/22 21:17:09
could have a practical purpose...
assuming your were consistent and always used pain skins for, let's arbitrarily decide 50% hp.
you could make like a monster that 'heals' wounded monsters if they are below 50%. you'd have a visual indicator for what's happening and it could be a cool new mechanic.
well, maybe something more complex would be in order like 'heals the monster to 90% of maximum health.' so each time it heals, the max health goes down and you could put in a check where it wouldn't be able to heal if the current max health is less than half of the actual max health.
#191 posted by JneeraZ on 2009/01/23 01:37:41
Oh duhr ... I can't use the health packs as a test case for skin groups in MDLs because those aren't MDLs (they're BSPs). Heh. Oh well...
After Giving It Some Thought
#192 posted by HeadThump on 2009/01/23 08:55:59
I think I know what Willem's next project is: Iron Man Arena, and he needs the effects on the player models to simulate the repulsor beam socket, and the jet flames coming from the boots. Imagine hovering around firing missiles and repulsor beams at one another with Twig or Gyro2 physics to both impede and improve our navigation. Oh, this is going to be sweet.
Am I close?
Dead Skins
#193 posted by ijed on 2009/01/23 13:27:21
Is interesting - pain skins doesn't really do it for me since most monsters are bloody anyway, and shooting a fiend in the back for some bloody mess to appear on, say, it's face is counter to what you're trying to achieve with the effect.
You could paint a handful of skins per monster and have them directional, but that misses the point of multiple damages - you'd only be able to have one active skins since you can't apply decals.
Dead skins is more interesting idea - you have the creature vomiting blood and caked in dirt. Problem is it started bloody, will anyone notice?
You could go whole hog and have a Mancubi style death - for example the Shambler's stomach could rupture when he dies, but then it probably wouldn't look very good with a single frame change and no 3d animation.
Healing enemies is good, like a Q2 medic form, but in order to show that monsters are injured I'd prefer to have them bleeding; particles dripping from them.
#194 posted by JneeraZ on 2009/01/23 15:05:16
"Dead skins is more interesting idea - you have the creature vomiting blood and caked in dirt. Problem is it started bloody, will anyone notice?"
On some you would. You would definitely notice a change in a shambler, enforcer or grunt. Creatures like ogres would be tougher but it might still be worthwhile.
Pins Skins Pain Skins Pain Skins
#195 posted by RickyT33 on 2009/01/23 15:17:40
monster <70 %
Some more blood around the chest and a little on the back, face and arms, some dripping down upper legs
monster <30 %
Big hole in chest, large exit wounds on back (i.e. gored up) more drippind down arms and legs
monster dead
Some blood particles flowing from the monsters midrift and maybe neck/face
monster -howevermuch it might be %
Gibbed!
It makes sense, you know it does. In a game so abstract that you can gib monsters in the style you can already, it would only add pleasure to my experience :D
Dead
#196 posted by necros on 2009/01/23 19:25:43
You could go whole hog and have a Mancubi style death - for example the Shambler's stomach could rupture when he dies, but then it probably wouldn't look very good with a single frame change and no 3d animation.
for the zdoom md2 models, they did seperate models for the monster deaths. the 3d mancubus death looks pretty good, as does the cacodemon.
i think if someone wanted to take the time, they could revamp the old death animations in that same sort of style for quake with new models.
Willem And Bsp
#197 posted by Preach on 2009/01/23 19:29:05
There's a mdl version of the health box (and indeed all the ammo pickups at the same time) included in quoth, which would be suitable for your testing. You'll have to extract it from pak1.pak, and it's called pickup.mdl.
#198 posted by JneeraZ on 2009/01/23 19:40:26
Sweet, will do! Thanks for the heads up, Preach.
#199 posted by JneeraZ on 2009/01/23 19:41:25
Oh, and it just occurred to me ... so THAT'S how you supported rotated pickups then. Neat!
Rotated Pickups
#200 posted by Preach on 2009/01/23 21:40:09
You can rotate pickups in their regular quake form. The only problem is that the bounding box doesn't change when you do that, which is compounded by the fact that the ammo boxes rotate about one of their corners, and not their centre. If you rotate them 180 degrees, the model entirely escapes the bounding box!
The quoth fix is just to put the bounding box in the right place relative to where the model get rotated to. The advantage of using the .mdl version of the ammo is that it saves you up to 10 model precaches, which can be helpful if you're pushing the limit(Stark Monstrosity showcases this feature).
The side effect of the .mdl version is that the crate is lit according to the ground below, rather than the baked in light levels of the regular ones. In order to stop crates getting lost in the dark, we a: disabled it by default and b: added small fullbright markings to all of the ammo. The shells and nails had these already, so it was natural to extend the idea to the other ammo.
I Drew The Line At Cutting Out Monster Head Gibs
#201 posted by RickyT33 on 2009/01/23 21:52:51
you can cut those out too.
I did however use the combined ammo .mdl flag at the same time as the one preach described. I like the fact that you add the two flags together, seems like a smart system.
Heheh
#202 posted by Preach on 2009/01/23 22:43:52
If it's a smart system, it was invented by a smarter person than myself. It is in fact the same system that spawnflags use - the spawnflag for "not in easy" is 256, "not in medium" is 512, and so "not in easy or medium" is the sum of the two.
In both cases, the values you have to set are chosen to by successive powers of 2( 1, 2 , 4, 8, 16, 32...)
These numbers are chosen because the sum of the first n-1 numbers is always 1 less than the nth number. That way, the sum of any subset of them is unique, and any number you chose corresponds to some combination of them.
There's also a connection with how binary numbers are stored as integers. So if you know about that, you can think of the nth 0 or 1 digit in the binary representation being on or off according to whether the nth option has been selected.
Preach
#203 posted by ijed on 2009/01/27 01:18:29
Did seeting them fullbright look bad?
$frame Question
#204 posted by JneeraZ on 2009/01/27 14:08:24
OK, so I'm trying to get MDLEd fully functional and I have questions about QuakeC and MDL files...
Do you have to have a "$frame blah1 blah2 etc" for every animation frame in the MDL?
Do they have to match the internal structure of the MDL (do the frames have to be stored in the same order as the $frame lines in your QC file)?
What I'm getting at is this ... will I have to allow the user to have full control over the ordering of the frames in the MDL file or can I safely/automatically sort them alphabetically? Does it make a difference?
Afaik
#205 posted by necros on 2009/01/27 19:36:20
the $frame walk1 walk2 at the beginning just macros those strings to a number, and that number starts at 0 on the first $frame declaration and increments by 1.
so walk1 actually means frame 0, so frame 0 needs to be your walk1 frame.
in other words, the order of those $frame declarations are important and so can't be re-ordered without re-ordering the frames too.
Fullbright$ And $frames
#206 posted by Preach on 2009/01/27 19:41:58
ijed: as far as I know, there is no standard way to make a .mdl fullbright. It's just one of the differences in the way the two types of model get rendered, bsp have their own lighting info, and mdl use the map's light levels. I do think that medpacks looks pretty cool in .mdl format when placed in dark corners, it makes the lights blinking away on them really stand out.
Willem: You must at least make sure that you don't alter the order in which the frames occur without giving the user control over it. The actual names given to the frames in the .mdl aren't used by the engine/qc. It relies entirely on the enumeration of them in the order that they occur.
The $frame macros are simply a way of defining recognisable constant names for the numbers 0....n in a quick manner which only lasts for one qc file. The qc compiler has no knowledge of what the actual model file contains, so it just substitutes a frame number for each instance of $stand4 with a 3 - assuming that $stand4 is the 4th $frame that it encounters in the header.
So if your program loaded in ogre.mdl, reordered the frames into alphabetical order and then saved them again, the animations would no longer match up, so that would be bad. As long as you ensured that frames were exported in the same order they were imported, you would probably get away with it. But I suspect it would still be a desired feature...
(As a possible side note, people making qc files don't have to define the $frame things for every frame, they can just use the numerical indexes, or a mixture of the two. But just using the numbers can mean a lot of code has to be changed if you extend your first animation loop from 6 to 8 frames, so it's not encouraged to do that for anything with multiple sequences)
#207 posted by JneeraZ on 2009/01/27 21:08:07
"You must at least make sure that you don't alter the order in which the frames occur without giving the user control over it. The actual names given to the frames in the .mdl aren't used by the engine/qc. It relies entirely on the enumeration of them in the order that they occur. "
Beautiful. OK, that settles that then! Thanks.
Hmm
#208 posted by nonentity on 2009/01/28 07:38:41
Hey coding thread.
Very sorry about this, never post in here since I'm not a coder, so tend to skim read and leave you guys to your scary quote text fun ;p
Just wanted to bump stuff above the flame thread again (I suggest anyone else reading this does same and avoids bumping again pls ;)
Kiss
MDL Hell...
#209 posted by JneeraZ on 2009/02/05 14:08:57
Man, this file format is fairly jacked up.
Anyway... Quick question:
Is the "onseam" stuff entirely necessary for texture coordinates or is that some sort of concession that was made to allow for easy skin creation back in the day? If I store all texture coordinates as full 0-1 values and set onseam to zero for them all, will Quake throw a fit?
Onseam Bowling
#210 posted by Preach on 2009/02/05 17:39:00
When making new skins, it's no longer really necessary. If you're trying to do anything more complicated that 2-sided planar then you pretty much have to ignore it, and just eat the extra vertices on the model. The md3tomdl converter does exactly this.
However, it's very important that you keep them for existing models, as it tells you which vertices need to be duplicated on the skin. I think if your program didn't preserve the original quake models like that, people would get confused to say the least.
If you changed models to duplicate vertices which were onseam, and then removed the onseam flag, there could problems in other editors. For example, if you saved one like that, then loaded it and saved it with QMe, then the vertex normals along the seams would be altered compared to the original, which might make the seam more obvious.
|
|
You must be logged in to post in this thread.
|
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.
|
|