This project is read-only.

UpdateFrequency bug in 1.4?

Jan 15, 2009 at 3:41 AM
Edited Jan 15, 2009 at 3:41 AM
I've written a class that implements IUpdate. When I return PartialUpdate1hz from the Update method, I only get a callback every 60 seconds. When I change that to PartialUpdate5hz, I only get the callback every 2.6 seconds. Makes no sense to me, but that's what I'm seeing.

My constructor calls: updateManager.Add(this);
Full text of my Update method:
public Xen.UpdateFrequency Update(Xen.UpdateState state)
{
    timeDisplay.Text.Clear(); 
    timeDisplay.Text.AppendLine( "Loading Screen: " + state.TotalTimeSeconds );
     return Xen.UpdateFrequency.PartialUpdate5hz;
}
 
( updateManager is the UpdateManager, of course, and timeDisplay is a TextElement )

Any ideas what's going on?
Jan 15, 2009 at 3:47 AM
Edited Jan 15, 2009 at 8:55 PM

Yes I know about this one. It's getting fixed in 1.5.

The fix is quite simple,
Open the main Xen project, Xen.sln, open Update.cs (in the root directory), goto line 543. Remove these two lines:

if (index % (interval + this.index) != 0)
return;

Reompile and you should be set. Don't forget to recompile the x360 project too if you are using that.

The bug is a bit silly. Here I'd implemented 'offset updates' where objects are updated in groups per frame. However I later implemented it in a much smarter and less 'wtf' way, but forgetting to remove this code (it still works for objects added on the very first frame... So it didn't show up in my tests - ops).
Sorry about that, hope this fixes it for you.

Jan 15, 2009 at 5:13 AM
That's the ticket.  Works fine now.  Thanks!