News for hackers. Stuff that matters.
Re:Game Programming Patterns: Double Buffer (2014) by sasaf5 on Monday August 27, 2018 @01:24AM (#17849601)
Cool stuff! Perhaps one could have even written some routines to kinda abstract that?
Re:Game Programming Patterns: Double Buffer (2014) by HelloNurse on Monday August 27, 2018 @03:36AM (#17849996)
An "engine" could take care of synchronizing rendering with reading, but the difficult part is application specific: ensuring that rendering fits in the specified number of CPU cycles.
Re:Game Programming Patterns: Double Buffer (2014) by ddingus on Monday August 27, 2018 @01:05PM (#17852700)
For many cases, one ends up writing a little kernel that manages the display.

Break the display into whatever elements make sense, and insure timing is all sorted. Run tests to get maximums.

Once it is running, the rest feeds it with pointers to objects, and lists or the objects get generated dynamically at display time.

Various schemes apply to overtime requirements. In old Williams arcade games, one method was to just move baddies to a non displayed region. Aggresive players would fire off a ton of shots to trigger this.

Another is to delay animation or movement.

The kernel can do that, but it gets more complex and slow. Dumber kernels are faster. Higher level code can manage what the kernel has to do.

One thing is smart to do though, and that is to have the display kernel fail gracefully. Use hardware timers, or loop counters to prevent overdraw and the loss of display sync normally associated with that condition.

Re:Game Programming Patterns: Double Buffer (2014) by shoo on Monday August 27, 2018 @04:56AM (#17850261)
there's a bit of discussion about isometric tile rendering nonsense, although not specific to vsync, in David Brevik's diablo postmortem https://www.youtube.com/watch?v=VscdPA6sUkc

along with a whole lot of other fascinating stuff

Re:Game Programming Patterns: Double Buffer (2014) by ddingus on Tuesday August 28, 2018 @02:12AM (#17856875)
That was a great video. Enjoyable talk.

At one point, they were drawing tiles, the walls associated with them, objects, etc...

Moving objects would end up between tiles and the sprite would be cut off by a different tile draw. Worse, there was no sort order that worked for all cases. They ended up creating, what the speaker called "an ai" to move the object away from the draw conflict, get it all drawn, then move the player back, just ahead of the actual motion...

In hindsight, they could have just decoupled the walls from the tiles and it all could have been a lot simpler!