<\/a>Happy holidays everyone! \u00a0I’ve had a quiet couple of days (at least, in terms of development!), but now that boxing day has come and gone, I’m back to poking around with MMORPG Tycoon. \u00a0In the screenshot here, you’re looking at a couple of mountainous districts, separated by a couple of dead flat districts.<\/p>\nAnd I’ve pretty clearly got a bug in my “terrain blending” code, which I’m pointing at in the screenshot above; precisely halfway through the blend from flat ground to mountains, there’s a steep ridge, just over the border between districts. \u00a0(You can see a similar ridge on the mountainous district in the background). \u00a0I’m kind of baffled about what’s causing this. \u00a0When things like this baffle me, I find that the best thing to do is to stop thinking about them, and work on something else instead; \u00a0the answer will eventually come, as long as I’m not banging my head against the problem.<\/p>\n
Instead, I worked on my main concern; \u00a0editable terrain. \u00a0Here’s the problem: \u00a0MMORPG Tycoon’s terrain is handled in chunks; \u00a0basically large squares of terrain, each currently about a hundred meters on a side. \u00a0The problem is that regenerating terrain is extremely computationally expensive, especially with the new blending between districts; \u00a0regenerating just one of them currently takes about 60 milliseconds; \u00a0enough to make the frame rate stutter quite noticably (basically a frame rate drop from 60fps to about 15 fps). \u00a0If that happened every time a player made a terrain modification, then crafting your world would quickly become extremely unpleasant.<\/p>\n
So what I did today was to set up terrain calculations as a background process, more like how regular video game streaming works; \u00a0the game registers a request for a bit of terrain to be generated, and then several frames later, the terrain generation process informs the game that the data has been generated and can now be used. \u00a0This makes the code a good deal more complicated, but it does smooth out those jumps in frame rate. \u00a0(In fact, on my computer, I’m now able to hold 60fps, even when regenerating terrain, even in unoptimised debugging builds of the game..)<\/p>\n
Anyhow, that’s all for me for today. \u00a0I’m going to distract my brain a bit with a book, and hopefully it’ll work out the weird terrain blending problem on its own. \u00a0:)<\/p>\n","protected":false},"excerpt":{"rendered":"
Happy holidays everyone! \u00a0I’ve had a quiet couple of days (at least, in terms of development!), but now that boxing day has come and gone, I’m back to poking around with MMORPG Tycoon. \u00a0In the screenshot here, you’re looking at a couple of mountainous districts, separated by a couple of dead flat districts. And I’ve…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-gd","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/1005"}],"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=1005"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/1005\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=1005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=1005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=1005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}