UpdateFrequency bug in 1.4?

Jan 15, 2009 at 2:41 AM
Edited Jan 15, 2009 at 2: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.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 2:47 AM
Edited Jan 15, 2009 at 7: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)

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 4:13 AM
That's the ticket.  Works fine now.  Thanks!