Skip to main content

Code Improvement Problem #1 : Virtual Task Manager

Submitted by Kezza on

for those who don't know what this is read this thread : http://www.sumea.com.au/forum/topic.asp?TOPIC_ID=558

The code I have written is a virtual task manager, meaning that you can update the game in virtual time... which allows it to go in fast forward, or run ahead/behind to compensate for latency when doing client side predictions in network games.

here's the source,
www.members.optushome.com.au/hmmklord/code/taskmanager.zip

I apologize for all the extra code I had to throw in, but i don't want to have people needing to rewrite what i've already done just to get it to work.

To use the code in its current state, simply make an implementation of Task that sets the next update time, the (update delay time to something useful) and implements Update(TimeValue t).
Then add it (and many more tasks) to a TaskManager and tell it to update to a certain point in time (must be after the last time you updated it to, and always greater that 0).

note that this code is probaby visual c++ specific cause i'm using __int64's for time values. I also wrote in on vc7 so i don't know if its gonna work for vc6 or other compilers.

If you have troubles getting it to work (which is likely given i finished it at 3am this morning) just let me know.

I'm looking forward to alot of improvements... cause this took me a while to put together so i hope people actually take the time with this thing.

-- edit
What i forgot to mention is that this code, and any changes made in this minichalenge are free to use by anyone... the aim is to create a very nice peice of code that everyone can use. Its not a competition about ability (although its a good place to show you have it)

Submitted by Kezza on Thu, 12/06/03 - 4:20 AMPermalink

.... is anyone going to try this?

Posted by Kezza on

for those who don't know what this is read this thread : http://www.sumea.com.au/forum/topic.asp?TOPIC_ID=558

The code I have written is a virtual task manager, meaning that you can update the game in virtual time... which allows it to go in fast forward, or run ahead/behind to compensate for latency when doing client side predictions in network games.

here's the source,
www.members.optushome.com.au/hmmklord/code/taskmanager.zip

I apologize for all the extra code I had to throw in, but i don't want to have people needing to rewrite what i've already done just to get it to work.

To use the code in its current state, simply make an implementation of Task that sets the next update time, the (update delay time to something useful) and implements Update(TimeValue t).
Then add it (and many more tasks) to a TaskManager and tell it to update to a certain point in time (must be after the last time you updated it to, and always greater that 0).

note that this code is probaby visual c++ specific cause i'm using __int64's for time values. I also wrote in on vc7 so i don't know if its gonna work for vc6 or other compilers.

If you have troubles getting it to work (which is likely given i finished it at 3am this morning) just let me know.

I'm looking forward to alot of improvements... cause this took me a while to put together so i hope people actually take the time with this thing.

-- edit
What i forgot to mention is that this code, and any changes made in this minichalenge are free to use by anyone... the aim is to create a very nice peice of code that everyone can use. Its not a competition about ability (although its a good place to show you have it)


Submitted by Kezza on Thu, 12/06/03 - 4:20 AMPermalink

.... is anyone going to try this?