Download

BLOG       DOWNLOAD/ABOUT         LINKS         CONTACT

7 March 2016

sense of place (part i)

One of the features I'm working on right now, is map building. There is a lot to be done here. I need locations, starting with a small frontier settlement. I need the different biotopes to stay more distinct, as well as blending more seamlessly together. I need a map that makes sense, which can be used to tell a story.

So to clear my mind, perhaps, throw out some ideas, I'm going to write a bit about map generation in LoSt. I'll be covering some of the game's principal design decisions as I go along. In this series started in the midst of the 2016 7drl frenzy, let's hope for a modest first article, just to lay out some basics and get the ball rolling.

Kitting up

The data is stored in homebrew module files of what I call kits. Each defined kit can spit out an instance of a certain class (eg. a critter or a place template). An important feature of kits is that they can look up and invoke other kits semi-randomly.

On the implementation part of things, most classes share certain functions and features, by inheriting a basic class that I call FlagThing. I suck at OOP, so bear with me. FlagThings are used to keep track of everything, store things like variables (a house may store a $dweller1 and $dweller2, its inhabitants, who in turn know that house as their $home). "Everything" is a FlagThing, from place templates to skills to critters, and even kits in themselves. They make up a kind of network of parents and children, emanating from a "world" FlagThing at the root of it all.

What's in a place?

Regarding the grid, suffice to say that it's hexagonal, and that, in addition to single coordinates, I keep track of "superhexes" (clusters of ~16 hexes; and then of course you get your hyperhexes and ultrahexes).

Speaking to world generation more specifically, the world consists of layers of places: The map as a whole is treated as a single place, containing several smaller places, called landscapes. Each landscape is a continuous field of hexes which share one climate and one name. They in turn contain smaller places: a house, a cluster of plants, a circle of totem stones, an animal or human encounter … Some of these places even contain within themselves subplaces or encounters (a wandering desert animal, a family seated to dinner in a house). Basically anything that spawns a being on the map when it is generated, is understood to be a place.

When a new place is generated, the first thing it does is to find and occupy some open space within the confines of its mother place. While some places use blueprints, most places are circular at the moment. Upon generation, they can fill parts of their interior to percentage values, like a basic house or a lake, put instances of inhabitants and subplaces, and do other interesting stuff.


   place bungalow template
shape "circle"
size (4,6)
get $wall ['dirt wall']
get $gate ['closed door']
room_fill {'wood tile':100}
edge_fill {'$wall':100}
edge_put {'window'(0,2)}
edge_put {'$gate':(1,1)}
end

   place salt pond
shape "circle"
size (2,5)
edge_fill {'water tile':50}
core_fill {'water tile':99}
brim_fill {'water tile':75}
end




   place hermit house
inherit "bungalow template"
get $hermit (['cri'],['persons'])
get $thing (['prop'],['loot','tools'])
core_put {'$hermit':(1,1)}
core_put {'$thing':(0,2)}
end


The routines for place generation are sound enough. Next steps include establishing more meaningful relations between places. That's a topic I hope to cover in my next post.

As always,
Minotauros

Some experiments are
just pure failures

29 February 2016

slow shot

With a phantom gun in an empty hand he has bluffed Mike into violating a basic rule of gunfighting. TYT. Take Your Time. Every gunfighter has his time. The time it takes him to draw aim fire and hit. If he tries to beat his time the result is almost invariably a miss. …
– William Burroughs, The Place of Dead Roads

not a release candidate
I'm tinkering on and off with LoSt. Release #10 will probably take a while to arrive, though. I received enough helpful comments to the last few versions that it doesn't seem necessary with another desert pastoral. Instead, I will wait until I have something more gamey before I publish the next snapshot. I'm envisioning something light, with a temporary win condition (like versions 5-7 had), at least in time for ARRP 2016.

The basics are still being laid down, both engine-wise and game-wise. I'm humaning up to adding hovering text for speech bubbles and other messages (maybe sound effects like "BANG" and "click", maybe status updates and the like). That also has me finalizing other parts of the graphics engine, and so the process meanders its way on.

Game development (like so many creative endeavors) is an activity where meticulous planning is necessary – not because you're likely to execute your original plan in the intended order, but because it will help you tackle the unplannable, which is sure to crop up.

Content-wise, I've begun work on a starting settlement. It will probably just be a few houses of different builds and a dirt road, but at least a place for restocking and getting ahead on the latest news. I'm thinking of a main story revolving around 3-4 semirandom bosses located around the map. But there may (should) also be other minor quests (let's rather call them "missions" or "bounties"). Something like a robbery might be an interesting example: The player should be able to choose sides and form alliances.

I already have the bare bones of a faction system. Each critter adhers to certain Causes, which affect behavior/goals, reactions, and initial bias towards other critters. When I should add NPC templates like "lynchin' judge" (with law as a major Cause) and "livestcok rustler" (with a criminal Cause), they will automatically be hostile to each other, because of their opposed Causes. As I fine-tune this, I can add a reputation system where the Player gains fame/infamy with followers of different Causes. Building a reputation must be a central part of a screaming wild frontier RPG as LoSt is aimed to become. I'm still spawning ideas on exactly how and how much to track the Player's behavior, and I guess I'll be implementing a little of that in upcoming releases.

For LoSt #10, I'm concentrating more on making the map itself more interesting. It's mostly a question of adding and balancing content, and tweaking the world building engine a bit as I go along. There will still be exploring around the landscape to reach the different locations, but focus will probably lie with a few major shootouts/fights, which the player has to prepare for. Combat (especially with guns) is very deadly in LoSt, so people and animals will be nudged towards neutral/shy behavior, with possible interactions other than fighting. Of course, you'll still run afoul with the occasional angry ursine or get ambushed by renegade soldiers or a crazy lead digger. Encounters should be generated to be interesting in themselves. An ambush shouldn't be completely random, but occur at a strategic position in the map (eg. shooting from the hills or a barricade). And of course there must be gambling, learning skills, hearing rumors, taming/riding/herding animals, digging for lead to get by … I'm still considering if and how it could be cool to implement survivalist mechanics (including food) and item crafting, further down the road … Hah, it's easy to think big, but the devil is in the details. Let's just hope the final version of LoSt is released sometime before the singularity/rapture/what-you-will.

In the interim, I already mentioned that speech is the next big feature to add. It's a prerequisite of "making the map interesting". In addition to tactically interesting positions, we need goals and paths for the player to explore the map. Collecting bounties/reputation and trading will be important, and are to be added in the next release (at least the basics). I often find conversation trees to be a big turnoff, so I'll start with simple lines of dialogue, printed in the message log and as speech bubbles on the map. The player should largely be able to react by performing actions (for your fetch quest: drop the item you were sent to get, pick up the reward). Maybe there'll be the occasional Y/N prompt.

Bounties ("quests") can be set up as wanted-posters anywhere semi-official, or through NPCs offering odd jobs and favors. Instead of traditional experience points, I'm planning for bounties to play a role in pacing character development and the passage of time. There must be an option to resting, since lost health levels don't regenerate by waiting in the map, and I don't want "med kits" that instaheal you between battles (but maybe something like adrenaline syringes to use in the heat of it). Maybe resting will take several weeks in-game, and also be the game phase where you digest your recent experiences, and so to speak level up. If you're forced back with the tail between your legs after being stabbed over an animal baiting contest, you'll have to pay for housing and medical bills, and maybe all you get out of it is a pesky war wound, a minor skill advancement, or the news that Slim Jim Bonney, who you were out to get, has slipped town. On the other hand, returning with the head* of Slim Jim nets you loot and fame and other auspices. (* I do mean the head, by the way. In The Land, it is customary to decapitate one's victims to prove their identities. It provides an easy interface to collect a bounty on someone, by literally carrying the head back in your inventory.)

For trade, I'm thinking of "traveling saleskids" wandering the map as well as permanent shops at different locations. Shops will definitely be nethack-like, with items that can be picked up, and paying by interacting with the shop keeper. Traveling saleskids will probably carry an inventory of up to 6 items for sale, which they drop in a circle around them when bumped. Currency will be lead (♄), the same with which you load your iron.

So the next release will have a bit more direction: some people to talk to, places to go to and missions to perform, some character development, hopefully some stuff like that …

As always,
Minotauros

14 December 2015

how to make a windows exe in linux with python and wine

Kat loves Mouse as Windows Linux
Since a few releases back, I've been able to pack the Windows executables of LoSt natively in Linux, with no need to dual-boot any longer. For my own reference, and to the benefit of other unhappy dual-booters who might be searching for a more sustainable solution, I figured I'd outline the steps I had to take to make this magic happen.

I'm using Wine to make the exe with Pyinstaller. In addition to these, you'll have to install some tools to Wine's folder c_drive, in particular: Python, Pywin32, setuptools, and MS Visual C++. I'm using the pygame module myself, so that had to be put on there as well. Obviously, you want to download the tools which are compatible with Windows, and with the version of Python you're using. Use wine to install everything. Depending on the file extension, use the following commands to install all the components:
wine filename.exe
wine msiexec /i filename.msi
wine python filename.py

Due to the fact that Windows isn't case sensitive, Pyinstaller may be throwing the following warning at you: "WARNING: file already exists but should not: C:\Users\<name>\AppData\Local\Temp\_MEI34922\Include\pyconfig.h" You can bypass this by editing the file build.py, situated somewhere like: ~/.wine/drive_c/Python27/Lib/site-packages/PyInstaller-2.1-py2.7.egg/PyInstaller/build.py. Search for the function named "append" and change the line:
if tpl[2] == "BINARY:"
to
if tpl[2] in ["BINARY","DATA"]:

At this point, you should be good to go. Once you've went through these steps once, whenever you need to chug out an exe, just cd to the directory where your main script is situated, and type:
wine pyinstaller --onefile main.py

This will put the executable in a folder named dist. You can safely rename this file and delete the build folder along with all python scripts before distributing your application.

A final note: Depending on your program, you may need to make small changes to the script to make everything work. In my own case, I'm using os.chdir() to access data files, starting from a "code" directory which I conveniently delete before distributing the exe. I worked around this by adding the following line at the top of my "main.py" script before running pyinstaller:
os.chdir(os.path.dirname(os.path.realpath(__file__))+'/graphics/')
Happy hunting!

As always,
Minotauros

11 December 2015

Released: LoSt v.9 «Broken Windows»

spread the glorious news!
Version 9 is out. Links to the archives are the same as ever:
Windows (exe)
Linux (deb)
Sources (python)

This version mostly fixes some bugs and adds a few more things to do. Now you can blow up stuff with dynamite and shoot stray cats with elephant guns. Here's the changelog:
  • Bug: Game would sometimes crash when unloading gun in hand
  • Bug: Chainhook critical hits could cause a crash
  • Bug: Chainhooks could drag victims over/onto obstacles
  • Bug: Crash when actions executed without a proper target/tool
  • Bug: Spirit stone displayed false tile when carried
  • Bug: Items would sometimes be generated in water
  • Bug: Windows version warned about duplicate files
  • Bug: Holy site animals would sometimes get "prickly plant" AI
  • Props and features: Dynamite, rubble, smithereens, sledge hammer, elephant gun, sniper rifle, gun slits, windows
  • Place template: pillbox bunkers
  • Game: Inventory items can grant flags/intrinsics
  • Game: Stackable inventory items
  • Game: Simplified day/night cycle
  • Game: Carrying heavy items encumbers the player
  • Game: Demolishing house walls
  • Game: Beings can trigger actions upon destruction/death
  • Game: Worked on corpses and rubble
  • Kits: Each animal species gets a random disposition (ornery, shy, docile)
  • Kits: (Some) animal families now have set special abilities (cats sprint, dogs charge, horns penetrate, bears deal more damage, etc.)
  • UI: Placement of text log now configurable to center, top or bottom
  • UI: Status line in menu displays timer for temporary flags
  • UI: Menu displays current place and time
  • UI: File structure for prop tiles now much more orderly
  • UI: Testing out another style for prop tiles
  • System: Game now keeps a log file
  • System: Config and save files now track release version, tries to repair obsolete options 

Is it right to have left left for right?
I've also been taking the visual style in a more abstract direction. The changes do reflect my experimenting towards a vague plan I have for the visual design of the game. Frankly, it'll also be easier to add content once I don't have to hand draw/steal tiles for each new prop. I'm hoping to get some visual snazz whilst maintaining the flexibility and low maintenance of traditional Roguelike displays. Let's see where it may end. Here's a picture showing some simple examples: To the left, props as they were displayed in version 8. To the right, how I'm displaying the same objects now. Similar items use similar icons, only differently colored. So even encountering a new object, you'd be able to instantly classify it as a whip, bomb, medicine, etc.

Barring any glaring bugs, this'll probably be the last release of the year.

In any case, I'm sorry for spamming you with release notes. The next entry will surely be some piece of text pertaining to game design. I hope to turn my attention towards NPCs now, evolving the AI a bit and adding some more content and features.

As always,
Minotauros

1 December 2015

Released: LoSt v.8 «Still Life»

I decided to release the game in its current state, This is version 8, titled «Still Life». Hopefully, someone might have interest in trying it, just to stifle their own curiosity, and perhaps to leave a comment or two.

Get your fresh bloodshed here:
Windows executable
Python sources

(Linux users: Apologies for delayed Deb package this time. I'll put it up shortly; in the meantime, Linux and Mac users can quite easily run the game from source, by following the readme inside the archive.)

Save files are not backwards compatible. This even goes for the configuration file, so if you're reinstalling LoSt, your safest bet is just to delete your old configuration folder (named ".LoSt" and contained in your home directory).

«Still Life» is very much a pre-alpha release. Compared to the last version, which featured a dungeon and a win condition, I've rolled back to something even less reminiscent of a real game! Let's hope the one step backwards precedes a leap onwards … Highlights of «Still Life» include randomized species of plants and animals, basic overworld generation, and snazzier graphics (with configurable resolution and animation options).

There have been a lot of changes behind the scenes, which will make it easier to add more content to the game from now on. I guess the basic setting will take shape within a release or two, and hope to start working on humans in the next release. Implementing NPCs will entail getting more or the basic engine in place, including speech, trade and bounties (quests).

Comments welcome

I'd be happy for any comments, even (especially) if it's just that someone didn't get the game to work or didn't understand how to play it. At the current point, I'm curious as to how people find the interface and combat system, both of which are quite unconventional.

Ideas and requests for content and features will be given high priority, as a carrot for those interested in the further development of LoSt. At the current point, the game is a bit lacking in theme. There are not many objects to find, and practically no lore. Also, the random animal species doesn't yet yield really memorable creatures. I'm sure the animals will get some more personality once text descriptions are added, but I'll also need some inspired ideas for how to take this feature a bit further. In general, I'm looking forward to getting the setting more or less in place. So if anyone want to see telescopes implemented before lassos, or would love to play a travelling quack in the next release, make your voice heard, and I'll try to accomodate.

As always, Minotauros

6 November 2015

procrastination

I think making a Roguelike is one of the best forms of procrastination imaginable. For one thing, it feels a hell of a lot more productive than playing RLs.

Meanwhile, I haven't been coding a lot on LoSt the last couple of weeks. Too busy with work and real life, which ironically turn into forms of procrastination in themselves, seen from the perspective of developing a RL game!

It's all part of the Slow Application Development methodology. Which is to say LoSt is continuing its slow death march towards abandonment. Random animal generation is soon done, after which I might turn to random plant species, or some other part of world generation. The next release is planned as a (bare-bones) presentation of the overworld, and might theoretically come in a few weeks or months.

Anyway, I just wanted to divert your attention to my latest, awesome RL-themed procrastination project, namely a fanfic comic about Caves of Qud. Each page represents about an hour of complete idleness, so it's not as bad as it may seem :P

(Edit: Hideous Comics of Qud was originally posted to a comment thread on Freedhold's forums, before the forum was closed. The comic isn't complete (yet?), but I might find another place to host it. In the meantime, you can download it here.)


As always,
Minotauros

8 October 2015

fearsome critters

I'm working on random animal species for LoSt. I figured this is a good place to start, before adding (randomized) NPCs, which will be a lot more complex. The basic engine has been tested with a quite bland "foo beast" and a "monstrum biformis". The foo beast gets a very simple random name and shape that each member inherits, whilst each individual monstrum biformis is a unique mixture of two animal parts. I might keep these genotypes in the game, just for the hell of it, although they'll have to be refined and renamed (in particular the monstrum biformis, which I don't even know how to decline in plural).

Genotypes are distinguished at least by their morphology (including health and main attack form), habitat (how and where it's encountered), and behaviour (simple AI plug-ins like "flock mentality" and "self-preservation" apply goals and tactics), as well as special quirks (stuff like poison, spinnerets and tunneling fall under this category). Just working with these four basic parameters makes a wide range of beasts possible: Consider that if I hobbled together ten templates for each of them, the engine would support 10 000 different kinds of animals.


However, it also becomes clear that a completely random bestiary won't work. The results would too often be ridiculously unbalanced, or simply uninteresting. There must be some method to the madness, and it's worth considering which functions encounters serve in the first place.

1. They might provide a challenge to the player: Encounters which are aggressive or otherwise have to be overcome create a tension in the game. We're making a Roguelike here, so the player should always be wary of suddenly coming under attack. Even if not generated hostile, NPCs and neutral entities can provide challenges in the form of missions, puzzles and other tasks.

2. They might advance the character: The basic form of this in most Roguelikes and rpgs is killing the next guy to steal his cash or other stuff. Another classic RL trope is experience points. There'll be no xp in LoSt, nor will dumb beast go about carrying various treasures. (But there might come some survivalist mechanics that include hunting later on.) Again, neutral/friendly critters can also advance the character. Shopkeepers ("travelling saleskids" in LoSt) spring to mind, as do missions with rewards.

3. They should provide mood or story: Not least, and this goes for friendly as well as malicious critters, they should speak to the mood and setting of the game. Whether pilfering booze off a mad prospector, barely escaping a crazed bear, saving a small reptile from the claws of a feral cat, or just observing a flock of birds taking off from a far away field, the player should experience that the animals and persons s/he encounters form a greater whole, some kind of game world.

There's a lot to consider here, especially when expanding a randomized system. The first two points directly point to gameplay aspects, and must be balanced in relation to each other. But they also tie in with the third point: If a game world contains only vile predators, the engine has failed on all points – the game would probably be too hard, and in addition such a setting makes no sense (what would they eat, apart from the player?). The same goes for a world with nothing but docile prey – which might bore the player in so many ways, unless (who knows?) a freak accident transforms our Roguelike, for a single session, into some kind of pastoral simulator.

In that sense, consistency of mood and story is useful as a kind of measuring stick to get an intuitive feel for whether the game world is properly balanced. But for LoSt, it's no less important in and of itself. Frankly, I'd rather make a game with an evocative game world than one that is superbly balanced. And I certainly hope in the long run to implement some features and content that will borderline on procedurally generated literature, randomizing things like dialogue, monologue (including folk songs), monster memory, item descriptions and mission details.


Some words about the actual design: On the technical side, I have defined a bunch of critter templates and traits that can be combined to spawn actual beings (I call these data templates kits). Most of these kits describe very simple qualities, like "beaked", "small" and "avian", which combined gives the outline of some random bird. A slightly bigger bird, like a buzzard, could be specified as "medium" and attacking with an improved beak. And of course there is room for things like giant dogs with antlers and airborne mini-aligators!

What I'm doing at the moment, is bundling kits together into bigger packages and specifying templates which are more picky about which kits they choose. This enables me to steer what kinds of animals are generated, whilst still retaining a degree of randomness. For instance, the basic kit "flocking bird I" inherits subkits like "small avian template" (basic morphology, including attack and defense stats) and "flock mentality" (currently a very crude set of behaviours, just trying to approach as well as defend critters of the same species). This basic kit can be patched with further traits (specifying for instance that the species sports a special attack, or that it's a flightless fowl). Another basic template I have in place is called "royal predator I". It is always a solitary beast with good combat stats and a penchant for attacking critters tagged as "prey" (which in turn are programmed to flee anything tagged as a "predator"). Other than that, the royal predator can turn out a mammal, a reptile, or even a giant bird.

During world generation, each climate type randomly generates its encounter table by spawning a few species types. Again, the tables are weighted: A certain climate might demand to get one predator, one prey, one carrion eater, and one completely random animal. The system should be smart enough to be able to pick for instance "flocking bird I" as its carrion eater, and then patch it with the appropriate kits to make it go after corpses and eat them. I'll also have to implement filters to make sure that the same species template isn't picked over and over again. I'm considering emulating something like decks of cards – lists containing one or more references to each appropriate kit, removing referances as they are picked and used.

Be that as it may, I'm currently less concerned with balancing than just getting the engine to spit out some interesting beasts. I'm of course reviewing Borges' entry on American cryptozoology in The Book of Imaginary Beings, and trying to dig up some other sources of inspiration. One thing that is becoming clear to me, is that I need to differentiate between the different groups/families of species. Right now, there is little difference between a giant lizard and a cow, except for slightly different attack forms. Making each type more distinct will not only make the bestiary more varied, but will also strengthen the kind of learning curve that is typically associated with Roguelikes. I don't really want a game where experienced players share a standardized knowledge of "which resistances to stack up on" before engaging which critters. But it'd add some depth and predictability if certain patterns are true for every game. Maybe cats are inherently fast and reptiles inherently tough, for instance. That way, a knowledgeable player will be prepared to draw some information just from seeing a critter for the first time, and yet not be sure what to expect from every new playthrough. A world full of raging bulls will probably require different tactics to handle than one stalked by man-eating lizards. And the mark of an experienced player would be that s/he's able to deduce facts about the generated world, and react accordingly.

As the bestiary starts falling into place, I'll be picking up my old plant life generator and migrate it from python sources into files containing kit definitions. At which point we're looking at an upcoming release to see if I can harvest some comments on the basic workings of the biotope generator. Never mind if it's going to be badly balanced and utterly crazy – there will be due time to reflect and refine later on.

As always,
Minotauros