Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Missing ticks when in tracing mode?
 

Missing ticks when in tracing mode?


I noticed that my herbivores sometimes don't get called every tick. Especially when they are attacked by a quick carnivore (e.g. Beast), they stay paralized and miss sometimes more than 5 ticks!!!
I've put a WriteTrace command at the start of every LoadEvent, so this isn't about my animal thinking too long. It seems that animal is just not called for more than 5 ticks.

However, when I compile my herbivore in Release mode (thereby removing all the WriteTrace lines), my herbivores don't have any problems anymore.... strange...

Is there maybe something fishy about the WriteTrace command? It seems my animals sometimes get stuck when calling WriteTrace.
MigrationUser 1  Thursday, January 29, 2004 2:34 PM
It sounds like you may be taking too much time per Tick and thus are having some turns skipped by the game.  If you pull up the Trace window, it should tell you how much time you are taking to think, how much time you are allowed and whether you are getting skipped.
MigrationUser 1  Thursday, January 29, 2004 5:32 PM
I think Mitch is correct.  One way around the problem would be to always run through / attach a debugger.  Terrarium detects when it's being debugged and will not penalize your bug for taking too long.  

BTW, WriteTrace is VERY slow, so if you are using it a lot your bug will not perform well.  
MigrationUser 1  Thursday, January 29, 2004 7:16 PM

So if I take too much time in the current Tick, as a penalty I get skipped in the next couple of turns? Doesn't sound very fair to me. I assumed Terrarium was just skipping the current turn if an animal is taking too much time.

B.t.w.: I'm indeed using a lot of WriteTrace statements, and using an external debugger to trace my animal. ( I use DebugView by SysInternals, which works simular to DBMon) .
To me it seemed that Terrarium was just not able to do the WriteTrace, so my animal's execution stopped there. But maybe it's a problem of DebugView not being able to handle all trace writes.
MigrationUser 1  Friday, January 30, 2004 4:44 AM
I also use DebugView, and trace all creatues in my test Terrarium (i.e. DBMon Trace Logging 'Full' == a LOT of WriteTraces). 

I've notice that unless the Terrarium debug window is also open ALL of the output from an individual creature sometimes never makes it into DebugView for one or more ticks at a time. However if the Terrariums built-in debug window is also open I never miss a beat.

This could this be what you are experiencing as usually if your creature thinks too long you get a message along the lines of 'a <your creature> was destroyed because it thought too long'.

Cheers,

Alan
MigrationUser 1  Wednesday, February 04, 2004 12:19 PM

You can use google to search for other answers

Custom Search

More Threads

• Do you need "Microsoft Visual Studio .NET 2003"?
• How to serialize your target
• Assembly Cache
• Can't add new animals ..
• NO BussinesRules Separation!
• Working with Created Property of Text Box
• version of terrarium already running. if u are connected via terminal server u can shut down any instances of terrarium by using task manager
• Problem updating Manifest-file.
• PocketVision - Date problems
• User Interface Guide