Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => Topic started by: mustang60348 on November 28, 2012, 10:16:06 am

Title: Rule of Thumb
Post by: mustang60348 on November 28, 2012, 10:16:06 am
For the DEVS: What would a 'good' time be to spend inside the game loop or HOW LONG IS TOO LONG

I put in some code in my OV10 to monitor the time spent in the loop and it is still very short (which is good) I wonder though , at what point does it become 'bad'
Title: Re: Rule of Thumb
Post by: Chaoz on November 28, 2012, 01:18:04 pm
i'd say at maximum the time it takes to render a frame, but what do I know :D
Title: Re: Rule of Thumb
Post by: cameni on November 28, 2012, 03:00:10 pm
It's kind of hard to say. The timing is determined by how fast the renderer can render the frame. There are two main threads - application thread and renderer. The application thread prepares the scene and then waits. Scripts run in this thread, so the key thing is to finish with them sooner than the next frame is going to be prepared.

Actually, we should be able to tell how much time is there, need to add some statistics for that.

Anyway, the script code is normally fast, it's optimized at runtime by JIT, which can make it only 2-4x slower than native code (which is quite good for short scripts like that).
Title: Re: Rule of Thumb
Post by: mustang60348 on November 28, 2012, 03:31:12 pm
Thanks