{"id":1873,"date":"2011-01-03T08:22:08","date_gmt":"2011-01-02T21:22:08","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=1873"},"modified":"2011-01-03T08:30:43","modified_gmt":"2011-01-02T21:30:43","slug":"bugs-keep-creeping-in","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2011\/01\/03\/bugs-keep-creeping-in\/","title":{"rendered":"Bugs keep creeping in…"},"content":{"rendered":"

First and foremost:\u00a0 I’ve put up another update to GoGoGo!<\/a>.\u00a0 If you were having crashes or etc, go grab that.<\/p>\n

Technical stuff follows:<\/p>\n

In computer graphics, the scarcest resource is currently (usually) communication time.\u00a0 That is, you only have a certain amount of time for the CPU to deliver data and instructions to the graphics card, if you want to maintain your frame rate.\u00a0 These days, that communication time is far more of a limiting factor than how many polygons you’re going to draw or how many pixels you’re going to be touching.<\/p>\n

Back in VectorStorm’s early days (say, up to about Game in a Week #5), I wasn’t actually drawing enough for this communication speed to be a big issue;\u00a0 it was just a few dozen lines, for the most part.\u00a0 I could just naively send them to the graphics card every frame.\u00a0 Easy.\u00a0 But as my games have started drawing more and more — triangle meshes, textures, etc.\u00a0 It has begun to become more and more important to optimise the communication.<\/p>\n

In OpenGL, the usual way to do this is with Vertex Buffer Objects (VBOs).\u00a0 Basically, these are just a way to store data directly on the graphics card.\u00a0 So instead of needing to send a hundred vertices to the graphics card each time you want to draw them, you can instead just say “Draw the hundred vertices that I already put into VBO #1.”\u00a0 Much faster to transmit, that way!<\/p>\n

The tricky problem, of course, is that OpenGL will typically need to be restarted in the new resolution, which means that all of that stored data on the graphics card needs to be sent up again.\u00a0 And I was forgetting to do that for VBOs.<\/p>\n

The funny thing is that this bug has been in the code ever since GiaW #6, and has affected several released games in the time since then.\u00a0 It’s just that none of them have actually presented an interface which allowed you to change the screen settings while the game was running.<\/p>\n

Anyhow, I have this fixed now.\u00a0 Fullscreen and changing resolutions from the Options screen should all now be working again.<\/p>\n

Similarly, the formatting issue on the Options screen was related to VectorStorm not knowing how to build a bounding radius around data which was stored inside a VBO.\u00a0 Since it didn’t know how big the different pieces of text were, it didn’t know how to keep the different pieces of text from overlapping.\u00a0 I’ve now fixed that issue as well, so the options screen is correctly formatted again.<\/p>\n

Just goes to show how adding a single new feature (VBOs, in this case) can break a whole bunch of old things that used to work properly.<\/p>\n

(Note to self:\u00a0 Must fix textures to be re-uploaded to the video card when a resolution change happens, as well.\u00a0 I’m getting away with not doing this right now because there are no textures in the game mode where you change resolution\/fullscreen, but that won’t always be the case.)<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"

First and foremost:\u00a0 I’ve put up another update to GoGoGo!.\u00a0 If you were having crashes or etc, go grab that. Technical stuff follows: In computer graphics, the scarcest resource is currently (usually) communication time.\u00a0 That is, you only have a certain amount of time for the CPU to deliver data and instructions to the graphics…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[36,17,3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-ud","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/1873"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=1873"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/1873\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=1873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=1873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=1873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}