Other stuff to readBefore we start this week’s entry, I have some other stuff you might all like to read! This week I had a piece published at First Person Scholar about the intriguing player-AI dialogue which develops in the danmaku game “Warning Forever” (
http://www.firstpersonscholar.com/warning-forever/), and a piece in Memory Insufficient about the alternate history aesthetics of the Red Alert series (
http://meminsf.silverstringmedia.com/art/alternate-history-aesthetics-in-red-alert/). If you’re interested, do give them a read and support those other two sites!
Now, on to this week’s many attractions:
Clothes as Items, and Inventory ChangesClothes have now been transported out of the file I use for working on the game’s graphics and added into the game itself, and turned into items (with a horrifyingly large number of variables – it took me much longer to integrate them than I expected). When you look at an item of clothing, it tells you nothing except the quality of the tailoring – “ornate”, “well-made” or “poorly made” – and what type of thing it is – “shirt”, “pair of trousers”, etc, and tells you nothing about the nation it is from, as that’s part of the learning/discovery process. Along side this implementation, the inventory system has been changed. Previously there were different keys for each action, so one would press ‘d’ to ‘drop’, ‘D’ to ‘drop several’, ‘t’ to throw’, and so forth; they’d then bring up your inventory, you’d select the item you wanted to perform the action with, and go ahead and do it. However, this meant you only saw the picture of the item when you pressed ‘i’ to simply look at your inventory, and that meant the images were (to an extent) being wasted. I’ve now changed it so that there are only two inventory functions: ‘i’ brings up your inventory, and ‘D’ allows you to drop many items at once (without looking at them). When you now press ‘i’, therefore, and choose an item, a line of text at the bottom of that item lists everything you can do with that item, so you always get to see the graphics, and the range of possibilities for each item is made a lot clearer (so things you can wear, or things you can use in some way, or eat, or whatever). I think this is a lot better, makes more use of the graphics, and tidies up the UI a little (given how many roguelikes use every damned letter on the keyboard). An example of a piece of clothing currently un-worn, and one being worn:
Character look-upThe look-up window for any character (player or NPC) has now been significantly changed and upgraded, and faces have also been moved out of the graphical-testing file and fully integrated into the game’s code. The first page currently shows the face of the NPC you’re looking at (or your own), and lists everything that person is currently wearing (which is visible; rings are “invisible” if they have gauntlets/gloves). The second page will soon show health, but I’m still working (yet again!) on thinking through how health is going to work, so we’ll have to see, and for now it has been removed (and will probably stay removed for 0.8 unless I finally figure out how health will work, even though I know how combat is going to work). So here’s a shot of me (without a first name, so the name up there is my family name), and this time I happened to be in the “scarification” civ. You’ll also notice I’ve made all eyes into a light grey instead of white! The reduced contrast is far less jarring.
Browsing clothesThe coolest thing about the new look-up? You can now hit Enter and browse through all the things a character is wearing, using the arrow keys. As you move around the “grid” of things the character has on them, each image then appears on the right-hand side (the first time the right side of the screen has ever been specially used!). For now, therefore, you can look over the upper- and lower-body garments, and boots, but I’ll be working on all non-armour garments in this release, meaning that we’ll be adding gloves, and probably cloaks too, but armour will come next time, and necklaces and rings will come… whenever. Either way, here are some nice illustrative screenshots of this! (With some placeholder first names and surnames…)
NPCs are now spawningThis speaks for itself, really, given the above screenshot. They don’t move, think, react, converse or do anything yet, but they are there, and the game can handle them and draw them correctly, and the player can ‘l’ook at them and browse what they’re wearing. My objective for this coming week before the IRDC is to really crunch and try to get crowd mechanics working to the point that NPCs will spawn and despawn out of the player’s line of sight. As for line of sight and field of view, there’s something cool on that point later down this entry…
Genetics, Culture, etcI’m pleased to say (and one might extrapolate this from the integration of the facial images) that we’ve now got a model for genetics and cultures spreading around the globe. Genetically the game now chooses large chunks of land for eye and hair colours (they bleed out around the edge, but these screenshots show only the dominant colour in each region; equally, although these are very geometric and unsmooth, that doesn’t ultimately matter, since populations of NPCs in-game will always blend and travel). The first picture shows eye colour variation, the second hair colour, in a generated world:
As for how these work for individual NPCs, basically, each nation has a “core” set of values for their skin tones, eye colour, etc, and that’s based on what values are present in their capital city specifically. Equally, they can also spawn NPCs who might have been born hundreds of miles from the capital, but are still within the same nation. The further you get from a nation’s capital, therefore, the more and more people you’ll see who are born according to the demographics of that particular area, and the closer you get to the capital, the more you’ll see people who look like the people of that capital city. Cultural norms will be maintained however far you go – so people in the capital and a distant colony have the same hairstyles – but visual/genetic markers (eyes, skin, hair colour, etc) will vary as you move around. So if you have a capital city on the far, far east, and a colony of that nation on the far west, and in that colony you might expect 25% to “look like” they came from the capital in terms of eyes/skin/hair colour, most to look “native” to that colony in eyes/skin/hair etc, but they will be visually unified according to their hair styles, other cultural markers, beard styles, clothing, etc etc. So we basically have two layers – the “genetic” and the “cultural” – and these blend and intertwine as you move around the world. Also, different types of civilization have different levels of cultural variety – the open and well-traveled nomads have the most variation within a nation, the small tribal societies have the least, and the feudal civilizations are somewhere in the middle.
Field of View Optimization (at last!)People have been asking for this for years, so I have finally put some time into optimizing the field of view algorithm, and now you can see basically everything on-screen at one time. Buildings will still have a reduced field of view, and it’ll reduce at night, too, but here’s a screenshot and a gif of wandering outside in the daytime:
Next WeekWell, the IRDC is in a week’s time, and I’m crunching like mad to get some kind of NPC pathfinding/crowd mechanic simulation going there. It’s going reasonably well, and I think I’ll have something good to show off, but I’ve been running into some fundamental design questions – can NPCs push past each other, for instance, if one occupies a tile the other wants to get past – which have surprisingly far-reaching algorithmic implications for how pathfinding and gameplay will actually play out in the longer run.