Discussion:
Quake 2 'entities' help
Asfand Yar Qazi
2005-02-07 10:27:34 UTC
Permalink
Hi again,

I was wondering if anybody knew of any sites where I could get some
tutorials or overview into the working of Quake 2 'entities'.

What I'm really interested in is how the game allows these entities to
perform their own custom operations, and then integrates these
operations into the game world itself. E.g. a monster, a rocket and a
health pack are all entities and share some code, but also have custom
code for themselves. How is this custom code and common code linked?

Thanks,
Asfand Yar
Nick Warne
2005-02-07 16:57:13 UTC
Permalink
Post by Asfand Yar Qazi
Hi again,
I was wondering if anybody knew of any sites where I could get some
tutorials or overview into the working of Quake 2 'entities'.
What I'm really interested in is how the game allows these entities to
perform their own custom operations, and then integrates these
operations into the game world itself. E.g. a monster, a rocket and a
health pack are all entities and share some code, but also have custom
code for themselves. How is this custom code and common code linked?
Have a look here:

http://www.quakesrc.org/forums/index.php

Everything you need to know about quake2 - and if not, ask!

Nick
--
"When you're chewing on life's gristle,
Don't grumble, Give a whistle..."
Brendan Burns
2005-02-08 13:11:25 UTC
Permalink
Asfand,
All of the entities have a "think" slot that contains a function. The
"think" function is called by the game engine every time through the
game loop. It makes them do whatever it is they're supposed to do. It
also has an animation sequence attached to it that makes the characters
animate. Each entity actually has multiple functions that it uses as
the "think" function depending on its state (and the state of the game)
As an example, if you look in m_infantry.c you'll see functions like
"run" "pain" etc which implement those actions. The AI is basically a
deterministic finite automata (you may have seen that in a computer
science course sometime).

hope that helps.
--brendan
Post by Asfand Yar Qazi
Hi again,
I was wondering if anybody knew of any sites where I could get some
tutorials or overview into the working of Quake 2 'entities'.
What I'm really interested in is how the game allows these entities to
perform their own custom operations, and then integrates these
operations into the game world itself. E.g. a monster, a rocket and a
health pack are all entities and share some code, but also have custom
code for themselves. How is this custom code and common code linked?
Thanks,
Asfand Yar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2377 bytes
Desc: not available
URL: <http://icculus.org/pipermail/quake2/attachments/20050208/27c9a5c5/attachment.bin>
Asfand Yar Qazi
2005-02-08 21:28:26 UTC
Permalink
Post by Brendan Burns
Asfand,
All of the entities have a "think" slot that contains a function. The
"think" function is called by the game engine every time through the
game loop. It makes them do whatever it is they're supposed to do. It
also has an animation sequence attached to it that makes the characters
animate. Each entity actually has multiple functions that it uses as
the "think" function depending on its state (and the state of the game)
As an example, if you look in m_infantry.c you'll see functions like
"run" "pain" etc which implement those actions. The AI is basically a
deterministic finite automata (you may have seen that in a computer
science course sometime).
hope that helps.
--brendan
I was only expecting a link to a website, and I get a mini-lecture
.....wow, bless you!

That makes things a bit clear. The concept of the animation sequence
attached to it is intriguing. That means, that every 'think', the
think function tells the entity which animation to play until the next
'think'. Am I right?

Loading...