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!

4 comments:

  1. That looks really good - nice work!

    In my humble opinion, I wouldn't worry about porting the 45k lines of code to another more efficient language (seeing it only takes 55 seconds to run) - life is too short to re-write complex apps, when you could be doing much more fun things like option (2) - generating the vegetation and wildlife.

    Cheers from Australia,
    Duncan

    ReplyDelete
    Replies
    1. Thank you! We'll see how it goes. I want at least to try porting it, because I'm an obsessive perfectionist, but I'm not going to make the best the enemy of the good. If it proves too difficult or arduous (as it may well) I'll go back to what I know.

      Delete
  2. Impressive work Plotinus! Procedural generation is one thing I've never dabbled in. I'd second the advice to steer away from #3, unless there's a technical limitation to justify porting it. Do you have any plans to release the tool?

    ReplyDelete
  3. Thank you! I'd like to release it. But it's nowhere near a suitable state at the moment, and I don't think it will be if don't port it to be quicker and more efficient. It really is a mess as it is. But work is progressing!

    ReplyDelete