On 4/3/2012 9:29 PM, Miles Fidelman wrote:
BGB wrote:
On 4/3/2012 10:47 AM, Miles Fidelman wrote:
Hah. You've obviously never been involved in building a CGF
simulator (Computer Generated Forces) - absolute spaghetti code when
you have to have 4 main loops, touch 2000 objects (say 2000 tanks)
every simulation frame. Comparatively trivial if each tank is
modeled as a process or actor and you run asynchronously.
I have not encountered this term before, but does it have anything to
do with an RBDE (Rigid Body Dynamics Engine), or often called simply
a "physics engine". this would be something like Havok or ODE or
Bullet or similar.
There is some overlap, but only some - for example, when modeling
objects in flight (e.g., a plane flying at constant velocity, or an
artillery shell in flight) - but for the most part, the objects being
modeled are active, and making decisions (e.g., a plane or tank, with
a simulated pilot, and often with the option of putting a
person-in-the-loop).
So it's really impossible to model these things from the outside
(forces acting on objects), but more from the inside (run
decision-making code for each object).
fair enough...
but, yes, very often in cases where one is using a physics engine, this
may be combined with the use of internal logic and forces as well,
albeit admittedly there is a split:
technically, these forces are applied directly by whatever code is using
the physics engine, rather than by the physics engine itself.
for example: just because it is a physics engine doesn't mean that it
necessarily has to be "realistic", or that objects can't supply their
own forces.
I guess, however, that this would be closer to the main "server end" in
my case, namely the part that manages the entity system and NPC AIs and
similar (and, also, the game logic is more FPS style).
still not heard the term CGF before though.
in this case, the basic timestep update is basically to loop over all
the entities in the scene and calls their "think" methods and similar
(things like AI and animation and similar are generally handled via
think methods and similar), and maybe do things like updating physics
(if relevant), ...
this process is single threaded with a single loop though.
I guess it is arguably "event-driven" though:
handling timing is done via events ("think" being a special case);
most interactions between entities involve events as well;
...
many entities and AIs are themselves essentially finite-state-machines.
or such...
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc