4 ms·
Cool stuff! Perhaps one could have even written some routines to kinda abstract that?
by sasaf5 8y ago
Cool stuff! Perhaps one could have even written some routines to kinda abstract that?
- HelloNurse 8y agoAn "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.
- ddingus 8y agoFor 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.
- shoo 8y agothere'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 https://www.youtube.com/watch?v=VscdPA6sUkc along with a whole lot of other fascinating stuff
- ddingus 8y agoThat 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!