Wednesday, July 31, 2019

On the way

Behold:


That may not look very exciting but I'm pretty pleased nonetheless. I've rewritten my fractal-generating routine in C++. For the most part it was fairly straightforward - much more so than writing the original from scratch - and as expected it's satisfyingly fast, taking approximately 1/5 seconds to generate. I've rebuilt the structure of Undiscovered Worlds in C++ using SFML for the graphical interface etc., which makes for a (to me) pleasingly old-school look. The fractal routine is the first bit of actual world-building I've reprogrammed. Obviously there's an awful lot more stuff to put in before it comes close to what I've got in the original version, even just at the world map level, but I'm happy that it seems to be working so far.

I won't keep posting all the updates I make that are just recreations of what I already have, as that doesn't sound enormously interesting, but I'm hoping to make some reasonable progress behind the scenes.


Monday, July 1, 2019

Where next?

I've been adding some minor tweaks, mainly to colder areas. I've implemented glaciers, which are basically frozen rivers. Glaciers appear where the temperature is lower than a certain threshold, and they differ from normal rivers in being wider - they fill the whole of what would, in a normal river, be just the river valley. So we get features like this:


I don't think it's completely realistic but it is at least an improvement on having actual rivers running through frozen areas like this.

I've also made the colour gradations smoother on those maps where tundra gives way to ice:


It's not ideal but it's a bit prettier than the more abrupt transitions that areas of this kind used to show.

With these additions I’ve got pretty much all of the terrain features into Undiscovered Worlds that I was planning. So what do I do now?

It could go in a number of directions:

(1) I could create a smaller-scale map level - local level - and work on that. Just as the regional map expands small areas of the global map and creates new detail, so too the local map would expand small areas of the regional map. This would allow us to explore these worlds in much finer detail, and it would take us a step closer to being in a position to create 3D renditions of these landscapes too.

(2) I could leave terrain as it is and start work on the whole next phase of Undiscovered Worlds - creating procedurally generated ecosystems of both flora and fauna to populate these worlds. As I've said before, I think this is potentially the most interesting and distinctive aspect of this project, assuming it actually gets somewhere.

(3) I could put the development of new features on hold while I convert what I’ve got now into a more efficient language.

(1) and (2) are more immediately interesting but I'm mainly inclined to focus on (3) now. I started the project purely to see how far I could get with generating vaguely plausible world maps and, as the saying goes, the tale has grown in the telling. I've got over 45,000 lines of code now, and although the results are very far from perfect, I'm really pleased with the look and feel of the maps it's making. I didn't expect to be able to get this far. But because I was doing it just for fun, I did it in a variant of BASIC because that's what I've been familiar with ever since C64 days (actually ZX81 days!). But it's really not very suitable, because this is a very calculation-heavy program that gets really slow in a language like that. For example, take the following random regional map that I just did experimentally:


That took 55 seconds, which is ridiculous really.

I'd like to turn this into something that's fit for other people to play with, not just me. So before I expand it further I want to try to take the methods I've developed and implement them in a more suitable language. I'm going to try reprogramming it in C++, probably using QT for the interface. This may well fail completely, in which case I'll go back to my slow, inefficient process that does at least work after a fashion, and move into (1) or (2) above. But it's good to try to develop new skills and stretch myself with this project, so I'll give it a go and see what happens. If it works then I hope to be able to replicate the functionality I've already got but with much greater speed and efficiency. In which case there may be some interruption to the blog (I'm guessing no-one wants to hear about me doing everything again), but whatever happens, the project is advancing one way or another, whether I'm posting or not!