PlomRogue Development Blog

7DRL 2016, Day 2

/ Comments: 0

Found a little 7DRL time in the day's first hours. Added this to The Crawling Eater:

Here's a screenshot ("oo" is the player avatar):

A screenshot of "The Crawling Eater", early development version.

7DRL 2016, Day 1

/ Comments: 0

As mentioned yesterday, my 7DRL time is very limited this year. So I'll keep the blogging short. Nevertheless, here's some quick notes on the results of the first day:

I may not have any time to work on The Crawling Eater tomorrow. We'll see. Anyways, here's a first screen shot:

A screenshot of "The Crawling Eater", early development version.

Ready to start 7DRL 2016

/ Comments: 0

This blog has been silent for a year. There was not much to report. Changes in my personal life reduced my time to work on PlomRogue. But with this year's 7DRL getting closer, I got into it again.

Not that there's been much innovation beyond last year's 7DRL game Please the Island God. That game was basically a hack of the engine -- in its own branch of the repository. I tidied up that code, and integrated its core engine improvements into the master branch. I then modularized the remaining game-specific code into a Please the Island God plugin, executable by that engine. It's now the master branch's engine's default game to start into. On the way, I completely re-wrote the client (originally coded in C), in Python.

I did all this as preparation for the coming 7DRL: to have an engine that's fit to run last year's game, and yet well-defined enough to build this year's game on. We'll see how this works out. Trouble is, I got a day job now: I won't have quite as much time to spend on my 7DRL this year. But managing ambition and limited resources is part of the fun, I guess :-)

7DRL 2015, Day 7

/ Comments: 0

tl;dr: I (sort of) finished my 7DRL game Please the Island God (or PIG for short) on time. Get it here: http://files.plomlompom.de/7drl/7drl_2015_day7.tar.bz2. (See below for some problems you might encounter.)

A screenshot of "Please the Island God" version 1.0.

Last day of work

As promised, I took an evening off on Saturday for some social life. But I couldn't take my mind off the game during that time. I left the party early to continue working on PIG. On my way home, I met fellow 7DRL participant erlehmann. His 7DRL 2015 project Zoo Tycon shares topical similarities with PIG. We discussed and compared our algorithms for animal population control. He gave me nice hints and ideas for PIG.

Back home, until early morning, I kept testing and balancing the game I had so far. This was a little frustrating for one major reason: As processing-intense as my game is, it gets almost unbearably slow on my old netbook. I did some minor improvements / bugfixes. I then slept through until 2pm.

Up again, I made a list of open issues, must-have, and nice-to-have features. Time to prioritize! One major thing missing was the second half of missions I had planned. Until then, the Island God only gave the player agricultural missions. I wanted one or two missions to engage the animals directly.

Performance was another major issue, as I had experienced the night before. I decided to look for quick ways to improve my game's speed first. I reasoned that building the final two missions needed some playing, testing, balancing – something I would not be able to get done before midnight with the current game speed. So time spent on cheap optimizing now might speed up the other work, too.

Cheap optimizing, unfortunately, did not get me very far. I sped up the game by ~25% at most. So I turned to less cheap optimizing. I had some ideas on how to restructure certain complicated parts of my code to drop lots of unneeded processing. I spent much time on this endeavor. In the end, when finished, it did not do any good. That was probably a waste of time. Fortunately I set myself a time limit for working on the performance: 8pm. I did respect that deadline, and actually stopped a little earlier.

The time before 8pm was not entirely lost, however. Much of it involved the running of a testing script – to check whether code changes I made changed the game states the PIG server generated (rule of thumb: if it did, I made a mistake somewhere). Due to the slowness of my machine, these test runs took great amounts of time. I had to wait for their results before doing further server code changes. So I had some spare time for other tasks.

I used that time for lots of minor stuff: to think up log messages for certain events, to improve the client's visual interface design (as non-server code, I could harmlessly change and re-compile the client), to deactivate all window management features from the client (remember, I accidentally created a whole in-terminal window manager, with features entirely useless for my 7DRL), to update and extend the documentation, to plan the remaining two missions. I managed to implement a lot of the nice-to-have (as opposed to the still open must-have) stuff on my to-do list.

Shortly before 8pm, it was time for the must-have stuff. One major game design change: I removed the GOD_MOOD variable. During previous playing/testing, it turned out to be rather unimportant, barely affecting the player's situation. The Island God's missions define growing rewards / punishments for certain behaviors, to directly affect GOD_FAVOR. The flexibility gained by making this growth a function of GOD_MOOD, instead of hardcoding it, was minimal. No good reason to keep the player occupied with one more statistic.

I then added two more items, and the two missions I had planned. I barely had time to test those, given the slowness of my machine. But for some final tests, I came up with a short-term solution to the performance problem: a remote login on a friend's machine with much greater processing power than my netbook. This was fast enough to, in the final 30 minutes, run several automatic simulations of entire games, to test and balance plant and animal start distributions and fertilities (something that would have taken many hours on my own machine).

I kept optimizing these numbers up to the last minutes. Then I packaged the current state of my 7DRL branch, uploaded the file to my web hoster, and declared my game finished in the RogueTemple 7DRL database. Then it was midnight, and 7DRL officially over for me.

The result (how to play, likely problems)

You can download Please the Island God version 1.0 here: http://files.plomlompom.de/7drl/7drl_2015_day7.tar.bz2. To extract it, use bzip2 and tar:

$ bunzip2 7drl_2015_day7.tar.bz2 
$ tar xf 7drl_2015_day7.tar 

Then go into the directory that emerges, build the game with the ./redo script (if you lack any of the software needed, this will produce instructions on what to get), and run it:

$ cd 7drl/ 
$ ./redo 
$ ./roguelike 

If all went well, this should start the game, plus basic instructions on how to play it. More details can be found in the file ./README.

./roguelike may take a while to start up, and the game may be intolerably slow on your system. I have no easy fix for that right now (except, of course, getting a stronger machine). But rest assured I'm interested in speeding up the game, for my own machine is somewhat too weak for it. I already got some advice for further optimizations.

The game may also seem to crash when overwhelmed with processing. This is probably just the client quitting due to lack of answers from the (busy) server: ./roguelike is a wrapper to starting both ./roguelike-server and ./roguelike-client, and it's just the latter that may need re-starting. In fact, starting ./roguelike instead of ./roguelike-client in this situation will spawn a second server process. Two server processes will quickly fight it out, with one giving up, but there may still occur some race conditions I have not yet researched. So always try ./roguelike-client first after a sudden exit, not ./roguelike for a second time. (To kill off the server process for good, do "echo QUIT >> ./server/in". This command tells the server to quit. Once it's finished its current game state processing and is ready to poll for new commands, that is …)

Further plans

I'll mostly keep PIG the way it is for now. There may be some very minor bug fixes, and I may improve some log messages. It would be nice to tell the player at some point that feeding animals (by dropping food to them) gives GOD_FAVOR bonus points, for example. I may also attempt to optimize its performance – it would be lovely to play my own game on my own slow netbook!

If anyone else wants to extend the code, or re-use parts of it, they're free to do distribute the results under GPL terms.

Long-term, I may grow PIG further, but I must do something else first: expand the main branch PlomRogue engine with all the features I added to it during the 7DRL. Just copying the code over won't do in many cases: I created horrible spaghetti code (especially during the last day) that I don't want to poison my main branch with. I'll have to do lots of refactoring, and re-coding. I may find new ways to optimize the performance then. Finally, when the engine is ready to perform PIG (delivered to it as mere data input) to a satisfying speed, it will be easy to extend it further.

7DRL 2015, Day 6

/ Comments: 0

Just a few quick notes before I'm off to some social life. (I need the break.) I thoroughly revised PlomRogue's food clock, healing, and AI for Please the Island God

AI

The AI now works roughly like this for any AI-controlled actor (this evaluation is repeated each turn, if the actor is not currently performing some action that takes more than one turn to finish):

Do you see someone to flee from? Someone who might find a corpse of yours good food (see below for this evaluation), and whose species usually sports more hitpoints than you currently have? Then flee. (If cornered, attack.)

If not: Do you have food the consumption of which would make your stomach happy? (Note that not only hungering is dangerous, but also over-eating. So one may well decide against eating if one's "satiation score" – see below – is not low enough.) Then eat it.

If not: Do you stand on food to pick up? If yes, then do so, if there is space in your inventory. If you stand on food to pick up, but the inventory is full: Just keep standing there.

If you are not standing on food, then move towards the nearest piece of food known to you.

If you know about no piece of food to move towards, then look out for other actors: Any the killing of which would produce corpses to eat? They must be of a species individuals of which start out with fewer hitpoints than you currently have, or else attacking them might be too dangerous.

If there are no actors to attack, move towards areas of the map not yet explored by you, or not explored for a long time. (This will hopefully bring up food to collect, or actors to attack for their bodies' nutritional value.) (Yes, each actor has their own field of view, and memory of the map previously visited, and of all inanimate items on it. This is one of the reasons processing can get quite intensive …)

Food clock, and balancing

Note that in these considerations, only certan consumables count as food to hunt for to any actor. Different species of animals hunger to a different speed: The more hitpoints individuals of their kind start out with, the more "satiation score" points do they lose each turn. But consumption takes the same time for any actor, no matter the species. And each turn lowers the satiation score, no matter the activity. So it might be possible to be hungrier after eating something than before, if the consumable brought less satiation points than the time to consume it cost.

(What's the consequences of hungering, or over-eating? A healthy "satiation score" is around zero. The greater its absolute value, the greater the chance any turn of suffering one hitpoint loss for malnutrition. The smaller its absolute value, the greater the chance to "heal", i.e. to gain one hitpoint up to the restoration of the maximum hitpoints actors of the species may have.)

This leads to certain kinds of food being attractive to some species (whose satiation score is slower to drop), but not others. In my game, there are currently plants eaten by some insects, but of no use to greater animals. The greater animals may, however, kill and eat the insects: Their bodies can be quite nutritious. This leads to some balancing problems: I must ensure that the plants grow fast enough to not be depleted by the insects. The insects must not procreate too fast, or there will soon be no plants left. But if there are too few insects, there won't be enough food for greater animals. The insects must procreate fast enough so that the pool of insects is not depleted as a food resource by, and for, those who eat insects. Etc.

I started some of this balancing today, but I'm not finished. Some stuff to do for the last day … Only when the balancing has reached a certain quality will I be able to introduce one or two more missions by the Island God, as planned.

Download

Here's Please the Island God's state at the end of the 6th 7DRL day: http://files.plomlompom.de/7drl/7drl_2015_day6.tar.bz2