The current issue involves co-operative multitasking. I am working on a task manager that will be accessible to any system that needs it.
In essence, a task is any action that needs to be updated either continually, or on a basis determined by an interval in milliseconds. A task can start a new task, or kill another task. It can even kill itself. Due to this, intricate sequences of tasks can be woven together in order to produce very interesting results.
An example would be a rocket launcher in a shooter. When the user clicks the mouse button, the game responds by performing some tasks, such as a gun recoil animation, a rocket movement task, a particle emitter task, and probably quite a few more. The rocket movement task would be written in such a way that when the rocket collides with an obstacle, it kills the rocket movement task, and starts an explosion task. This would progress, and as the explosion volume increases, a test for collision would be performed on objects in the scene. As those objects are destroyed, so are any tasks associated with them.
Of course, all of this is simple enough to explain in the abstract, but the implementation is somewhat tricky. If anyone has any experience with this kind of system and can lend some advice, or can point me to an article that explains a potential solution, I would be very grateful.
Thanks,
Ross.
EDIT:
I have been up all night designing this, and just finished implementing it. It completely rocks. I can now do rendering and logic completely asynchronously. In fact, I can do logic itself asynchronously, and decrease the interval for more important tests. For example, in Regalia, a MoveCharacter task will be updated fairly regularly, as it does character and tile collision detection. However, if I want to add some AI pathfinding, the path generation task could run faster or slower than the movement. Hmm... I see potential multi-threading in the future.






--
Clubs I'm in: [link] < DesertPrinceQuatre [link] < yaoi-empire ~kyoukaramaou [link] < sunsets
--
too-wit too-woo
--
Aim high. Work hard. Achieve often.
why not put up your game character vector things? They were really good ^^
--
too-wit too-woo
--
Aim high. Work hard. Achieve often.
Hi
Thanks for the watch
--
...in my panties
--
Aim high. Work hard. Achieve often.
[link]
--
I'm never serious. Seriously.
hahaha
--
super_cow_license ()
{
insert_object_name$ = "signature"
You may use this insert_object_name$ for any purpose, even if said purpose is beyond the capabilities of said insert_object_name$ (i.e. give you super cow powers)
}
Previous Page12345...Next Page