<\/a>I’m not certain whether today’s shot is noticeably different than yesterday’s. \u00a0But regardless, I’ve made some pretty massive changes under the hood (with some more still to come).<\/p>\nThe big exciting new thing from my point of view is that I’ve flipped the switch, and made the generated ground clutter be generated in tiles, the same way that height map data is, just smaller.<\/p>\n
The upshot of this is that the game once again runs at well over 60 fps on my old laptop (it had been down to about 40), and with far more visual detail than before. \u00a0I’m quite pleased.<\/p>\n
Technical discussion follows:<\/p>\n
Previously, edge clutter (the grass that was seen in older screenshots) was being generated as part of the height map. \u00a0Each ground quad would select one of its edges and sprout another quad of surface detail there. \u00a0That surface detail quad was carefully set up to almost exactly match the shade of the ground, just to try to hide or soften the edge. \u00a0This worked great, but doubled the amount of geometry being generated whenever I needed to load up a new section of height map, and doubled the number of triangles being drawn. \u00a0Additionally, it ended up looking a little “samey”; \u00a0all grass everywhere in the world was being blown from east to west, for example.<\/p>\n
The other system present was a big list of “ground clutter” triangles, which I was checking every frame, and re-orienting to best face the camera. \u00a0This was a big time-sink for the game, moving all those vertices around every frame.<\/p>\n
Now, ground clutter and edge clutter are both being generated by a common system, which generates them in blocks around the camera. \u00a0This is a big improvement for edge clutter because it means that I can only draw the edge clutter that’s relatively close to the camera (edge clutter is currently in 64×64 meter ’tiles’), and not bother drawing the edge clutter that’s a long distance away. \u00a0I was doing this already with the old system, but the height map’s 256×256 tile size made it impossible to draw only the clutter that would really be visible.<\/p>\n
Additionally, this is a massive improvement for ground clutter because it means that I don’t need to test every piece of ground clutter each frame; \u00a0there are only nine tiles of it (32×32 meters on a side), and I can just decide for each tile whether to keep it or whether to throw it away and generate a new tile somewhere closer to the camera, instead.<\/p>\n
The best thing is that I’ve factored out the whole “generating the nearest tiles” behaviour, so a single logic engine is now driving both types of ground clutter, and it’ll be easy to add more things which get created around the player in this way.<\/p>\n
I haven’t converted the current height map tiling over to this new system; \u00a0the height map tiling works based upon using tiles to fill a circle centred on the camera, while the system powering the clutter works based on using tiles to fill a square. \u00a0The square is much, much simpler to handle, but causes the system to create things diagonally more often than straight north\/south\/east\/west. \u00a0For ground clutter this is unnoticeable. \u00a0For mountains, you really need to see mountains at a particular distance, regardless of which direction they’re in, so the height maps themselves need to stay on the old system.<\/p>\n
There’s also some exciting news in the near future. \u00a0Can’t talk about it yet, but real soon. \u00a0:)<\/p>\n","protected":false},"excerpt":{"rendered":"
I’m not certain whether today’s shot is noticeably different than yesterday’s. \u00a0But regardless, I’ve made some pretty massive changes under the hood (with some more still to come). The big exciting new thing from my point of view is that I’ve flipped the switch, and made the generated ground clutter be generated in tiles, the…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[24,25],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-yH","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2151"}],"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=2151"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2151\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=2151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=2151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=2151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}