Hello friends!

Welcome back to the second half in the recent and critically-acclaimed halting the sprawl series, in which I try to resist the urge to keep adding new features while the other features are only 95% done, and instead take the time to ensure that new features I’ve been working on this year and last are actually completely finished before I move onto the next exciting, shiny bauble. I will fully admit that this is one of my most significant weaknesses as a designer / programmer – I get excited to create all these extremely complex systems, and then often find myself drawn to the next exciting thing before they are completely finished. Nevertheless, actually finishing features is (I’m told) very important, and just as I did in the first blog post a month and a half ago with this title, I’ve been going back and finishing off a large number of things which have been left “hanging” for, honestly, far too long. A lot of progress again, here, and I’m really happy with the game now feeling less like there’s this vast range of mostly-finished strands I’ve left slightly incomplete while moving onto other things. I think there’s a lot of cool finishes and polishes here, and a lot of gaps and omissions filled in – so, without further ado:

Religious donations

Firstly, we come to making sure all possible religious donations are implemented. This wasn’t fully in place when I released the previous religion post – some were, but some were not – simply because there are just so many possibilities here (once more I curse myself with the level of variation and difference I am determined to consistently add into the game). The code for donating alcohols to religions that want to collect alcohols was there – the example I used in that update – as well as the code for a whole bunch of other possible donations, but it wasn’t all there simply because there are so darned many. So, for starters, here’s a complete list of all possible donations that a religion might want:

And I am pleased to say that every single one of these now works correctly! Regardless of what it is, how many of that item type the religion wants, whether there are any other specific requirements for the donation – e.g. a certain quality, or a certain religion origin or nation origin or whatever – it all now works out correctly. Religions can accept all kinds of donations, can check you aren’t just donating the same thing twice (nobody likes to be scammed), and can give you the appropriate promotions or whatever it might be in that religious hierarchy. This was a lot of work, and I’m sure that I’ll be adding in more variations as we go on and things continue to develop, but for the time being, all religions can correctly accept the right donations! Just as a side note, it is pure coincidence in the screenshot below that I am donating an axe to a god called the Queen of the Axe, but hey, it works:

More donation options will be added soon, but this is plenty for now! I’m excited about all the different variables at play here and how they will all interact, and intersect with all other things like trade, national policies and the availability of various items, what religions offer, what they demand, their interactions with other religions, and everything else. This should yield a huge number of possible permutations and interesting strategic decisions – I hope! – and it’s really cool to see this all now coming together.

And, urgh, I’ve just noticed a one-tile mistake in the axe image generator. I’ll fix that.

Religious rewards

Next, I’ve got all the religious donations going through, so now the same needed to be done for the religions’ rewards. This was honestly a lot harder, but I’m pleased to say that all possible rewards are now being correctly and logically given to the player when they join, or rise up in rank, in a religion. So, for starters again, here’s the list of all possible rewards a religion might give out, aside from knowledge, which is “taken for granted” in this regard (i.e. they will always give you a note or notes, a page or pages from a journal, a map or maps, things of this sort):

And now the game will correctly create the required thing, and in the required amount, and generate text to describe what you’re being given, and correctly put these into the right part of your inventory! This took quite some effort to ensure it was all working how it should, although reusing some of the code from shops and things of this sort, which have to also be able to describe any possible item, was a really big help here. In most cases

So here, for example, this religion gives me a weapon and a book!

Or, a watch, and a grenade!

Or a book, and some large bolts!

Or a cuirass, and a bow!

The other part of this, however, was ensuring that the right amounts and qualities are also being given. So, right now, when you join a religion you are guaranteed to get (a) low-quality thing(s); when you move from acolyte to disciple you will generally get (a) medium-quality thing(s) but rarely low-quality instead; when you then move from disciple to priest you will generally get (a) medium-quality thing(s) but rarely high-quality instead; and when you move from priest to high priest, the reward(s) will be high quality. This applies regardless of the reward type, so it’s as true of arrows as books, as true of whale oil as throwing stars, and as true of hats as necklaces. This was pretty easy to ensure as the rank progressions are very simple in coding terms, but slightly more demanding was ensuring that qualities are correctly distributed. For example, look at these two religions…

…and you can see that not just will the qualities be going up with each rank, but the volume of stuff you’re getting it also going up each rank (quite a reward!). This is, indeed, now correctly handled in all cases, although this took quite a bit of effort to ensure the text and the reward generators completely matched up (though once I got into the swing of it the thing only took a few hours, albeit a pretty demanding and focus-demanding hours). To demonstrate this, here’s an example of a much higher-level religious promotion, and its rewards:

Such histories!! Anyway, this is now all sorted and good to go, and I look forward to seeing what I hope will be lots of interesting strategic decisions in terms of religions to be loyal to, those to betray, religions that like or dislike each other, religious rewards and requests, and of course the fact that each promotion will also give you a hint towards that religion’s main riddle thread, too (more on that to come).

Naming oases

Next, friends, my obsession with generating a name for everything continues – and now all oases (i.e. “forest” tiles in deserts, which spawn differently from most desert areas, as they do indeed contain a lake and a lot more trees than are usually found in desert areas) have custom names. Here’s a bunch of them…

…and here’s how that looks on the world map:

And here’s one in person – what a nice spot! Seems like the kind of place people might sometimes leave important things, to return to later?

Improving chests

During the process of implementing chest generation into the world, it became clear that the visual quality of chests is, to put it kindly, mixed. I feel the chests for the circular, octagonal and diamond shapes look pretty sharp (obviously the colours vary massively, I just used this chest because it was the first one I could find in the world I’m currently using for testing, and this happens to be a religious chest, so that’s the symbol on the front of these):

…but the chests for the square and cross shapes, unfortunately, do not:

I think these really don’t look that great, especially as they just don’t seem to evoke the same 3D-ness that the above three manage to achieve. The cross one is just about okay but the square one just looks entirely flat, and that’s not acceptable. So firstly on the cross one, I’ve added some new shading to emphasise the depth, and added some code to make the silver outlines (or whatever colour it might be on the specific chest) a bit darker on the right-most third of the image, and I think both these changes have improved them markedly:

This then brought us to the square chests, and gosh, these were hard. Squares are very simple shapes (I know you all come here for the deep geometric and mathematical knowledge I impart) and it’s very hard with the particular perspective I’ve chosen for chests to give the square shape any, well, depth. As such, I decided to go with a “lesser” version of the cross style, i.e. with smaller corners, and also to add the same shading effect that I was using on the cross chests. I think this is, again, a big improvement:

The square and cross chests are still the “weakest” but I think I’ve brought them much more fully in line with the others, and I no longer internally cringe when I look at them. This is, I would say, a win.

Additional face generation

I’ve also done a lot of work in the past couple of weeks adding more variation to faces, which is something I’ve been half-working-on for ages, and like everything else here really needed finishing. The first is in eye height – I found that varying the eye height on female faces looked weird but varying eye height on male faces actually worked really well (I wonder why this is?). Regardless though, each civilization now flips a coin between having mid-level eyes (the current detail) and one-tile-higher eyes, or mid-level eyes and one-tile-lower eyes. These make for some really nice facial differences on some of the male faces, and all three look distinct and give a real sense of slightly different ethnicities across different civilizations. As part of this, I’ve also gone and adjusted the width of the eyes, and there are now a host of extra options for slightly more narrow eyes, or slightly wider eyes. This kind of minutiae is sometimes very challenging when we’re dealing with ANSI characters, and each character can only have two colours, but I’m really pleased with the extra variation here. On top of that I’ve also added a few new and different ear shapes, rather than essentially just one ear shape that every single character had. These might seem like small changes, but they actually add up to quite a lot of additional variety in faces. Here are some examples:

I hope to add even more in the future, but for now, all of these have added just a little bit more variety to the faces, especially those within a given civ, which inevitably can look a bit samey. Again, though, more is planned here – but just not quite yet…

Finishing off throwing

Next, I have properly finished off all the remaining mechanics required for throwing to work. This meant implementing a number of other animation types, making sure that throwing and items landing in some rare circumstances all worked correctly, and ensuring that a sensible message in the text box is always generated, no matter what the player is actually doing. It turned out that there were far more edge cases here than I had first appreciated, but for now at least, I think I’ve resolved them all. I also wrote some new code into the “select a target” function to properly show what items block a throw, i.e. the thrown object will hit them, and what objects do not block a throw, i.e. a thrown object will sail over them. There’s a surprising amount of complexity here, but I think it’s pretty much all done now. This is really neat mechanic, and in 0.12 I’m looking forward to this also of course being an element of combat – not just from thrown weapons, but also throwing things at people may well induce them to be violent towards you. Everything that should burst upon impact also now bursts, everything which shouldn’t doesn’t, everything that burns up in a fire does, everything which sinks into water does, everything that comes apart in water (e.g. books, notes, scrolls) does, etc etc. It is very possible a few remaining niggles remain here, but if they do, I honestly can’t find them, and I’ve done some pretty damned comprehensive testing here. Hooray for throwing!

And, also, you can now destroy all destroy-able objects, which currently are chairs, vases, candle stands, and tables – you need to chuck something sufficiently heavy to break them, but they also have a nice animation for when they are destroyed:

And if you throw something which smashes on impact, against something else which smashes on impact, you get something like this:

Which I think looks super cool! I did have the animations playing at once, but I actually like this a lot more. And, if you chuck stuff into water or lava, or something which burns (book, scroll, note, map, any wooden thing, etc) you throw into fire, you get a lovely little animation there, too:

These aren’t just nice little things, but also might have quest value (“Cast three hearts into the great pool of fire above where the orange deer roam”…), and should soon elicit NPC responses (as an aside, if the colours look slightly muted on the lava, that’s because there was fog at the moment I recorded this gif – normally it’s a lot more vibrant). But yes, chucking someone’s holy book into a fountain next to them? Maybe not a great idea – unless you want to goad them, of course. And, if something is in a fire or a fountain but it isn’t something which melts / dissolves, you also get a little extra message if you pick it up again:

Which is totally incidental, but just a nice bit of flavour text (it is not only the NetHack dev team who try their hardest to “think of everything”!). So with that, I think throwing is done, and I can say I have tested every permutation, every item, every form of landing, and made sure not just is the text correct, but also that an appropriate animation (if any) plays (explosion, shattering, sinking, whatever), and the item is deleted if it should be deleted – I don’t think there’s anything else to do here, and I’m really pleased with how the whole thing has come together.

And then, very closely related to throwing…

Firing

I’ve been doing all this stuff with throwing, but I’ve missed out a crucial closely related element. Specifically, you can now load, and fire, bows and crossbows, and pistols and rifles. Very exciting! In each case you require the weapon and some ammunition that will fit in it, so for bows that means any kind of arrow, for crossbows either bolts (for crossbow or repeating crossbow) or large bolts (for the arbalest or siege crossbow), and for gunpowder weapons that means some gunpowder and an appropriate either pistol ball for pistols, or – shockingly – a rifle ball for rifles. One of the many tradeoffs for firearms, given that I think we can reasonably expect them to be the most powerful weapons in the game, will be the slower reload speed, i.e. one needs to do two things (powder and ammo) instead of just one thing (ammo) to reload them.

Anyway, the first step is having equipped a weapon, and then going to the ammunition you want or the powder you want, and using it, after which looking at the weapon will show its loaded or not status. Once it’s all loaded you’re ready to fire, and the “fire” option appears when you look at the item (you’ll also shortly be able to use ‘f’ to fire a weapon, much like ‘d’ to drop and ‘t’ to throw and the like). Take aim, and fire! There’s also then a little animation, quite like the ones that play when you smash something which can be smashed by using the throwing function, which plays upon impact. Of course, in the actually quite near future, some more of this animation might be red if you, y’know, hit someone with it, but for now it just shows the bullet or the arrow or the bolt bursting apart. As a side note, when the image for bolts or arrows or balls is sufficiently low in number, the image updates when you actually put the projectile in / on your weapon, which is an absolutely tiny detail, but I like it a lot, and you can see it in the first of these two gifs. But yes, firing is now working nicely, the game can understand what ammo goes where, give you a choice of which weapon to load if you’re holding two, and basically everything I can think of here. Combat inches closer once more!

Missing items (partially)

Handling the throwing and firing stuff was pretty damned complicated and while doing so I realised that -ideally – I really don’t want to have to come back to this in the future! So what this means is that a whole bunch of items which currently have no specifics, details, information, use, or images – but which will be appearing soon / later – are sort of in the game now, but only in a debugging sense. It made a lot of sense to implement every single item that I knew was coming before I did the comprehensive testing of throwing, so here we have, for instance, a scroll (the nomadic equivalent of books)…

…a tablet (the tribal equivalent of scrolls or books)…

…a musical instrument…

…a key (whose generator is of course finished, but is not yet integrated into the game, and the name of the item (“Key”) will be updated for a given key once you discover what lock it opens)…

…and a dye (a forthcoming trade good)…

…which all now have correct names, colours, characters, animations and interactions for throwing (e.g. do they smash, if so what does the smashing animation look like, do they explode, do they burn in fire, do they dissolve in water, etc etc etc) and other things as well (how long do they take to be destroyed, etc), even if the items aren’t yet implemented into the game itself in the sense of having generated images, having interactions, and all that stuff. I’m sure that I will have missed out on some future items, I think that’s pretty inevitable, but it made sense right now to at least implement all the near-future stuff that I can confidently predict will appear within the coming months / year, in order to prevent myself having to come back to this very complex code for a little while. That said, though, the dye image generator is coming along well so that’s approaching being ready to be implemented as another trade good; the key image generator is entirely finished, but the key / lock mechanics are going to be wildly complex given the number of doors / chests / etc in the game world, and so that needs more work before they come into being; and musical instruments are on my generation list, as the game does actually already generate the names for instruments, even if the pictures are presently missing; so actually I would expect these to all make it into the game before too long, especially the dyes and instruments. Either way though, this brings throwing and shooting to a finish for the foreseeable future!

World generation

Finally, chasms were one of the new additions to the world map in 0.10, specifically designed to make sure that the polar regions have a bit more interesting stuff in them. I’ve gone back and improved the generator to make chasms more varied and more interesting, and I’ve also added more mines to the game world especially in emptier parts of the world, and I’ve added in a load of marshland which generates in areas that doesn’t have any important structures…

…again to keep filling up the remaining space in a game world (and I have more plans for this as well). Here’s an example of a map generated before all those edits…

…and here we have a map after all the edits!

I think it really shows that the map is denser, the polar regions are less devoid of stuff (there’s more stuff coming there soon…), and overall I’m really happy with these changes. I’m now also thinking about other structures we can have spawning in the world – I think I want to have abandoned towns, ruins, maybe some extremely ancient buildings… maybe garrisons / forts in more militaristic nations, maybe old battlefields could be marked… we’ll see. I’ve also now added the generation of a few inland seas into the game world, again only generating in areas that are otherwise quite open, and I really like again the denser feeling these bring to the world! You can see them in the polar regions.

At the same time, though, you’ll notice the new presence of ISLANDS!! The world generation has always been very continent-y and there are lots of good reasons for that, but I realised that if we want back into the world generation towards the end of world generation rather than the very start, we wouldn’t run the risk of civilizations just being stuck on tiny islands with single territories or one town surrounded by nothingness (some of the issues with having islands generate earlier on), but we could generate interesting and secret locations to seek out throughout the game. As such, the world generator – after doing all the civilizations and histories and cultures and the rest of it – then places some secret islands, and integrates them into the world (both geographically and culturally) which already exists. Some are single islands, some are pairs, and some are sets of three or four islands. They all naturally have their own dedicated name generators, as well, which produce some really cool outcomes…

…and soon you’ll be able to locate maps which tell the locations of these hidden islands, and charter ships to get you to them. As for what might be there, well, I think there are many many possibilities – unique animals and plants which might be important, secret buildings, secret caves, forgotten ruins (I continue to debate whether I want to totally generate ancient, long-forgotten civilizations, but it is tempting), all manner of cool things. For now, though, it adds a lot of nice variety to the world map and a lot of continued potential for exploration and secret-finding. Overall I think the map is much richer now, generating far fewer areas of blank terrain (although this can still be even further improved, and I do intend to continue working this) and far more for the player to explore, to be integrated into history, into riddles, into quests, and into everything else. The islands need much more work and detail when I really come to focus on them, but at least they’re now here, and that means I can take a pause on updating the map at least for a little while.

What next?

Well, the sprawl has been thoroughly halted! There are still a few minor things that need adding to new features to get them fully implemented, or handle all possible edge cases, or things of this sort, but overall this three weeks’ work has done a lot to finish off a lot of things I’d been working on and reduce the number of active development tasks to a far more manageable level. As for the next update, given that this is being published on June 30th, so you can expect the next post on July 21st (and I have to say, it’s an incredibly exciting one, there’s so much to show off)! As ever, please do post any thoughts you have (I always love to hear everyone’s feedback), share it with other roguelike-likers if you think they’ll be interested, and with all said and done, I’ll see you all next month!

Thanks so much for reading, everyone :). Happy middle of the year!

2 Comments

  • Very exciting updates as always! I like the improved chests and faces, and the names that are generated for oases and islands are evocative. I also really like the idea of having ancient ruins and old battlefields to explore and search as part of the main quest. Perhaps you have to dig in a particular place (don’t forget to bring a shovel!) in a centuries-old battlefield looking for the remains of a fallen hero who had something you need for a quest. Generating entire lost cities from fallen civilizations would be amazing, but I can see that possibly being too much to include.

    The improved system for religious transactions will add depth, but I think it may run the risk of making religions in the game to be a bit too transactional; i.e., you can become a high-ranking disciple in religion X simply by donating a pile of spears or whatever. While this might be entirely appropriate for some religions, you may want to consider either skewing the donations more in favor of deeds, or requiring a mix of donations AND deeds to advance to higher levels. I see that some donations include things like “mercy” or “kill cultists” — it would make more sense that in order to reach the highest levels of a religion, you have to prove yourself and not simply be rich…unless of course the religion is all about simply being rich.

    Nice work halting the sprawl! Those maps at the end are just begging to be explored. I’m looking forward to what you will reveal in the next update.

Leave a Reply

Your email address will not be published. Required fields are marked *