Animation driven AI (QuakeC) with IQM - how?
Animation driven AI (QuakeC) with IQM - how?
I was thinking to use Quake's AI code as an example for my AI code, as it has animation driven movement. However, I have no clue how would I do that with IQM models, as they contain framegroups (self-playing animation), not frames.
Can anyone help out with small sample code? Thanks.
Can anyone help out with small sample code? Thanks.
-
- Posts: 68
- Joined: Mon Oct 04, 2010 9:08 pm
- Location: Lincoln, California
Re: Animation driven AI (QuakeC) with IQM - how?
define animation driven o.O
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it
Re: Animation driven AI (QuakeC) with IQM - how?
its worse with regular quake models where the movement speed is dependant upon the current frame. zombies kinda lurch and all.
was trying to hack up csqctest for animating everything clientside using just 'actions' instead of frames. not gonna say its perfect in any way.
was trying to hack up csqctest for animating everything clientside using just 'actions' instead of frames. not gonna say its perfect in any way.
Re: Animation driven AI (QuakeC) with IQM - how?
Damn, I wrote it way back when I still had the explanation given to me by LordHavoc in my head
Animation driven is when AI is called after frame of interest. Since MDL/MD3/DPM are frame based, you would call AI function after particular frame to make monster shoots or be in pain, etc. So I think that is what animation driven AI is. IQM is framegroups based meaning individual frames are not exposed to qc in ssqc. You can only say "play walking anim" and walking anim will be played. That means there is no way you can call AI easily after monster makes its 5th step, for example.
So some examples of AI working with IQM models would be nice to have.
Animation driven is when AI is called after frame of interest. Since MDL/MD3/DPM are frame based, you would call AI function after particular frame to make monster shoots or be in pain, etc. So I think that is what animation driven AI is. IQM is framegroups based meaning individual frames are not exposed to qc in ssqc. You can only say "play walking anim" and walking anim will be played. That means there is no way you can call AI easily after monster makes its 5th step, for example.
So some examples of AI working with IQM models would be nice to have.
Re: Animation driven AI (QuakeC) with IQM - how?
just because you can use framegroups doesn't mean you have to.
Re: Animation driven AI (QuakeC) with IQM - how?
IQM format is superrior to other formats supported by DP. It's native exporter for Blender for once, which exports directly to IQM - no mess with intermediate formats. IQM can be used for static meshes with no bones, for static meshes with bones, and ofc for animated skeletal meshes. IQM supports vertex alpha which allows texture blending on animated models. The format is optimize for faster loading and for better performance. Why would I use something else?!
DPM requires to export into SMD first (or MD5, which currently has no Linux util to parse into DPM and exporters for Blender are broken), then convert. Plus I'd have to mess with text files to specify anims, fps, looping, etc.
And coding animation is easy - self.frame = 1 plays entire animation Very useful for animated map props.
DPM requires to export into SMD first (or MD5, which currently has no Linux util to parse into DPM and exporters for Blender are broken), then convert. Plus I'd have to mess with text files to specify anims, fps, looping, etc.
And coding animation is easy - self.frame = 1 plays entire animation Very useful for animated map props.
Re: Animation driven AI (QuakeC) with IQM - how?
I didn't say use anything else. just expand the frames into separate framegroups. one frame per group, and its directly equivelent to an .mdl for easy vertex animation.
Re: Animation driven AI (QuakeC) with IQM - how?
Yeah, we discussed that with divVerent. I'd still have to make .framegroups which would virtually separate framegroups into frames. However that's not how framegroups work, it's what you call jumping through the hoops to get the result
I am looking for clean and native to IQM solution.
I am looking for clean and native to IQM solution.
Re: Animation driven AI (QuakeC) with IQM - how?
For new models: don't create multi-frame groups in the first place (may not be desirable, though).
Modify the engine to call a qc hook when the model's frame changes. Better yet (?), make it a frame "trap point" (like debug trap points): the engine calls the hook when a specific frame is selected. This would work even for q1 mdl
Modify the engine to call a qc hook when the model's frame changes. Better yet (?), make it a frame "trap point" (like debug trap points): the engine calls the hook when a specific frame is selected. This would work even for q1 mdl
Leave others their otherness.
http://quakeforge.net/
http://quakeforge.net/
Re: Animation driven AI (QuakeC) with IQM - how?
Then you will have static mesh. Framegoup based formats have to have more than 1 frame in a framegroup. Otherwise your model will be static. There is no reason to use IQM if you want to live in a stone age.taniwha wrote:For new models: don't create multi-frame groups in the first place (may not be desirable, though).
That's counter productive. Sounds like a horrible hack.taniwha wrote:Modify the engine to call a qc hook when the model's frame changes. Better yet (?), make it a frame "trap point" (like debug trap points): the engine calls the hook when a specific frame is selected. This would work even for q1 mdl
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: Animation driven AI (QuakeC) with IQM - how?
I have absolutely ZERO experience wih IQM (note to self: we need to fix this) but doesn't the format documentation supply any hint on how to deal with this ? Sounds quite strange such feature-filled model format being so hard to work.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC (LordHavoc)
Re: Animation driven AI (QuakeC) with IQM - how?
It's not hard to work with at all. I coded player's model and first person weapon animation myself and I don't even qualify myself as a coder.frag.machine wrote:I have absolutely ZERO experience wih IQM (note to self: we need to fix this) but doesn't the format documentation supply any hint on how to deal with this ? Sounds quite strange such feature-filled model format being so hard to work.
The issue is that Quake's AI isn't designed to be used with such format. So I am looking for a way to adopt it for IQM. It's just a matter of designing a way to call AI when needed. Basically need to use timing for AI calls vs calling AI after single frame.
Re: Animation driven AI (QuakeC) with IQM - how?
Hm, to animate an IQM model in QC I do the exact same thing as with MDL. ExampleIQM is framegroups based meaning individual frames are not exposed to qc in ssqc.
http://pastebin.com/iR9XsSSB
Each frame is exposed to the QC.
But I may be misunderstanding you.
Re: Animation driven AI (QuakeC) with IQM - how?
I think you are wrong.
If you do self.frame = 1 for IQM model, you will see whole animation playing automatically. If you do the same for MDL, you will only see 1 static frame.
If you do self.frame = 1 for IQM model, you will see whole animation playing automatically. If you do the same for MDL, you will only see 1 static frame.
Re: Animation driven AI (QuakeC) with IQM - how?
Well, I think I don't understand you. The code I pasted definitely works.