informa
2 min read
article

Newsletter #56 - Clock Problem

A problem between the clock system and fixed timestep updates, new sketches, a suggestion for SAO.


News

There is no news to report this week.


From the Programmer
Written by Invisible

Earlier this week I realized that there was a problem with the clock system in the engine. In order to time various events, the game uses a "clock". The state update code would use either GetTickCount() or QueryPerformanceCounter() (indirectly through a system that wrapped them). This in itself works fine, but the problem occurs due to the way the state is updated. I use a fixed timestep, which means that when the state is updated, it is being updated for a specific point in time which is most likely in the past. So the counter provided by the previously mentioned functions will be slightly incorrect for the time that the state is updating for. The problem gets worse after a "lag" spike (the program freezes for a certain amount of time for whatever reason), since the main loop will attempt to catch up and update all of those missed states at once.

The problem has been fixed by using a 0 based counter that is set to the correct time for the update that is currently being performed. The counter represents how many milliseconds are between the start of the program and the current update. The update code can access this counter using a function supplied by the core system. This also ensures that there is only one counter value throughout the update, which was not true before.


Artist's Easel
Written by GreyKnight

iScribble Sketches #14

(Click to enlarge)

(Click to enlarge)

 


Community Spotlight
Written by Jay

This week, an SAO player known as RageMan1990 suggested that a boss-like monster be added to SAO in the next update. Though it's not an original idea, the thought of having a boss brought along a discussion of what a boss would be like. Whether or not a strong boss creature is added in the future, many players will always have hopes that one will one day appear.

Latest Jobs

Treyarch

Playa Vista, California
6.20.22
Audio Engineer

Digital Extremes

London, Ontario, Canada
6.20.22
Communications Director

High Moon Studios

Carlsbad, California
6.20.22
Senior Producer

Build a Rocket Boy Games

Edinburgh, Scotland
6.20.22
Lead UI Programmer
More Jobs   

CONNECT WITH US

Register for a
Subscribe to
Follow us

Game Developer Account

Game Developer Newsletter

@gamedevdotcom

Register for a

Game Developer Account

Gain full access to resources (events, white paper, webinars, reports, etc)
Single sign-on to all Informa products

Register
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more