krasov's bloghttps://ideosyncrasov.github.io/2017-11-19T17:00:00+01:00A Belated Post-Mortem2017-11-19T15:26:00+01:002017-11-19T17:00:00+01:00krasovtag:ideosyncrasov.github.io,2017-11-19:/a-belated-post-mortem.html<p>Whereupon it is reflected on what worked and what didn't, and what comes next.</p><h1>Against All Odds</h1>
<p>Welcome back world! I'm finally doing the post-mortem for the 'game'
I submitted to the Lisp Game Jam 2017 that happened in October. And what do you
know, my submission came in first place (as unlikely as that sounds)!
More precisely, the ratings were as follows:</p>
<table>
<thead>
<tr>
<th>Game</th>
<th>Overall score</th>
<th>Creativity score</th>
<th>Presentation score</th>
<th>Entertainment score</th>
<th>Theme integration score</th>
<th># Votes</th>
</tr>
</thead>
<tbody>
<tr>
<td>In the Realm of Dark Forces</td>
<td>3.083</td>
<td>3.333</td>
<td>3.667</td>
<td>2.667</td>
<td>2.667</td>
<td>3</td>
</tr>
<tr>
<td>NOTALONE</td>
<td>2.875</td>
<td>3.000</td>
<td>2.500</td>
<td>2.000</td>
<td>4.000</td>
<td>2</td>
</tr>
<tr>
<td>Dark Planets</td>
<td>2.750</td>
<td>3.500</td>
<td>3.000</td>
<td>1.500</td>
<td>1.500</td>
<td>2</td>
</tr>
<tr>
<td>B@TTY</td>
<td>2.298</td>
<td>2.121</td>
<td>2.828</td>
<td>1.414</td>
<td>2.828</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>As you can see, the ratings have to be taken with a big grain of salt since
there were so few of them. Also note that the above scores are not the <em>raw</em>
scores but scores that take into account the number of ratings. The winner in
terms of raw scores would actually be the game that is last in the above
ranking.</p>
<p>But if there is at least one thing I can deduce from this table, then it is
that my entry succeeded in terms of presentation.</p>
<h1>What Went Right</h1>
<p>So the decision to spend time on implementing a tile-based renderer did pay off
in the end, because it allowed me to make use of some well-made assets done by
other people. It's really worth stressing the fact that my game contained <em>no
gameplay whatsoever</em> and still was relatively well received. A good
presentation can go a long way!</p>
<p>Having something decent to look at was also something that motivated me
<em>during</em> development. Also, writing this blog really helped me order my ideas,
even though it took away a little bit of development time. In particular,
I really recommend writing about what you want to do on a particular day
<em>before</em> you do it, for the very same reason that it orders the ideas in your
head and makes you more focused.</p>
<h1>What Went Wrong</h1>
<p>It is very tempting to look at your own creations with rose-tinted glasses and
evaluate them with too much forgiveness because they are 'your own children'.
At the same time, it is also very tempting to be overly critical of yourself
<em>in hindsight</em> (especially if you are doing that self-criticism in public,
because it allows you to think of yourself as a righteous person); in a sense,
the 'later I' that evaluates the work of the 'former I' is a kind
of <em>arm chair expert</em>. And so, one must be very cautious with judgements after
the facts.</p>
<p>One should also make a distinction between 'mistakes' and 'things you should
not have done', i.e. between mistakes that were <em>worth making</em> and those that
<em>weren't</em>. For example, here are some mistakes that I don't regret making:</p>
<ul>
<li>I focused on developing the graphics instead of the gameplay. Developing the
tile-based renderer turned out to be way more time-consuming than I thought,
because it resulted in several new sub-tasks (understanding the .tmx file
format, creating extra tiles for the tilesets).</li>
<li>Spend the last few hours of the game jam with polishing the look and feel.
For example, during that time I implemented a simulation of night/daytime
colour changes.</li>
<li>I went with a slightly unorthodoxic game idea that I was interested in,
instead of sticking with something more traditional and realistic.</li>
</ul>
<p>The reason why I don't regret the first two mistakes follows from the above
discussion: even I had no gameplay to show for at all, at least it succeeded in
the area of visuals. The reason I don't regret the third mistake is that
I doubt I would have had the motivation to work much at all on the game had it
been something my heart was not in.</p>
<p>How about mistakes I regret? Well, ...</p>
<ul>
<li>Staying up 'just a little bit more' to get things done is a stupid idea <em>in
general</em> because a) spending two more hours on game development when you are
tired and exhausted is less efficient than spending those same two hours when
you are fresh and awake, and b) disrupting your sleep schedule really lowers
your creativity and productivity on the next day. However, this does <em>not</em>
apply to the very last day before the deadline: if I hadn't 'crunched',
I would not have been able to submit anything at all.</li>
<li>Sacrificing things you normally do for game development. Again, this comes
with the same caveat as the mistake above, in the sense that it doesn't apply
to the day before the deadline. Otherwise, I wouldn't recommend that you miss
events or activities you would do normally in order to have more time for
development. What good does a few more hours do if you spend those hours
feeling miserable because you denied yourself an accustomed source of
pleasure?</li>
</ul>
<h1>The Real Challenge Lies Ahead</h1>
<p>Okay, so the game jam is now well over, and technically it even was a success.
Now what? Well, now comes the hardest part, because now the task of completing
the game presents itself to me, and I have no energy-spending deadline ahead of
me that pushes me to work, no people to compete with and compare myself with.
Rather, what lies ahead of me the long, slow, and lonely crawl to completion.</p>
<p>Wish me luck!</p>Day 102017-10-22T14:20:00+02:002017-10-22T03:23:00+02:00krasovtag:ideosyncrasov.github.io,2017-10-22:/day-10.html<p>I'm not gonna make it.</p><h1>Last-Minute-Effort</h1>
<p>There are officially 15 hours 38 minutes and 23 seconds left. Not a whole lot,
but let's try anyway.</p>
<p>First thing to do, implement animations/state transitions. As I mentioned
yesterday, I find it generally hard to conceptualize such things (despite or
maybe because of a strong tendency to conceptual thinking). My momentary
solutions is to maintain a list <code>active-animations</code> in my game state, which is
a list of subclasses of an abstract base class <code>animation</code>.
This base class defines three generic methods:</p>
<div class="highlight"><pre><span></span>(defgeneric animate (animation state))
(defgeneric draw (animation state))
(defgeneric post-animation (animation state))
</pre></div>
<p>Here <code>state</code> is a variable holding the game state. The first method is called
in <code>update-world</code> and does some actions depending on the subclass, so there's
one subclass for every kind of animation. The <code>animate</code> method return a boolean
that indicates whether the animation is finished or not. If it is finished it
is removed from <code>active-animations</code> and the method <code>post-animation</code> is called.
Note that the <code>animate</code> method can itself push new animations to the front of
<code>active-animations</code>, so that one animation can trigger another animation.
Finally, <code>draw</code> is called on each rendering step.</p>
<p>In this way I hope to be able to piece together the logic of the game, without
having to write one huge game logic function.</p>
<h1>It Didn't End Well</h1>
<p>I did manage to submit something that <em>looks</em> like a game just five minutes
before the deadline. There is no game play, and it is not a game. Also, because
I was running out of time, I had to adopt a 'whatever-works mentality'. That
produced some truly horrible code. But I don't care. It's very later (or rather
very early). I failed. I don't care. Good night.</p>Day 92017-10-21T23:41:00+02:002017-10-22T03:23:00+02:00krasovtag:ideosyncrasov.github.io,2017-10-21:/day-9.html<p>Getting more skeptical by the minute.</p><h1>Organizing Complexity</h1>
<p>It's the second last day before submission (or what's left of it). I started
working on the game about three hours ago. Most of this time was spent
reorganizing code. Having everything crammed into one huge main files with
dozens of global variables is never a good thing, time pressure or not.</p>
<p>There is now much more separation between the individual parts of the game
(updating game state, drawing game state, etc.), which helps me figuring out
how to implement the game logic. I've always found organizing code (i.e.
figuring out "what goes where") difficult. What helps me reduce the cognitive
dissonance induced by this problem is to work iteratively: just put in anything
that works; you'll figure out soon enough if it sucks.</p>
<h1>Other Problems</h1>
<p>I've run into another problem: I don't know how to play sound in loops! The
engine I'm using doesn't expose this capability. Guess I'll have to worry about
other problems (of which there are plenty). But this will have to wait for
tomororrow, for it is very late already.</p>Day 82017-10-20T17:46:00+02:002017-10-21T00:28:00+02:00krasovtag:ideosyncrasov.github.io,2017-10-20:/day-8.html<p>Trying anyway.</p><h1>Putting Yourself Together</h1>
<p>Alrighty. It's still quite early in the day, plenty time to finish that tile
renderer, don't you think? ;-)
All I need is some coffee and a nice soundtrack to get me in the mood:
<em>Halloween III: Season of the Witch</em>. Hell yeah!</p>
<h1>A Good Scare</h1>
<p>It seems like that the package <code>cxml</code> I'm relying on to parse the <code>.tmx</code> files
is incomplete. :-( I guess that's the appropriate punishment for trying to
write a game in LISP. Of course it goes without saying, that <code>cxml</code> barely has
any documentation besides the source code itself. This is really bad.</p>
<p>Okay, it's not actually bad. The functionality I was looking for is actually
implemented (despite some comments within the code saying otherwise), and
I know how to use it now. That was a good scare!</p>
<h1>The Moment of Truth</h1>
<p>Alright, the tile renderer is basically done now. Let's see if it still works
... Of course it doesn't. Will humans ever be able to write correct computer
programs?</p>
<p>About half an hour later, all (of the apparent) bugs seem to have been weeded
out. The "game" looks now just as before, which is a good sign. This deserves
a commit!</p>
<h1>The Torture Never Stops</h1>
<p>Of course there were more bugs. There are always more bugs. At least I learned
some more tidbits of Common Lisp knowledge (for example that make-tash-table
compares keys with <code>eql</code> by default, even if these keys are strings). It also
taught me that seemingly simple things like parsing CSV can be complicated,
given the right circumstances, for example if the file you're reading was
encoded with the Windows convention of using CRLF as an indicator of a line
break, but the package you are using to parse the CSV file just assumes it is
encoded with unix conventions.</p>
<h1>It's Alive!</h1>
<p>Weeding out the remaining bugs took way longer than I thought, but eventually
I managed to complete the tile renderer. There's probably room for
optimizations (I'm not very happy with the performance), but at least I've got
something resembling a game, at least visually. The map I created is renderer
faithfully (except for the "collision" layer which I still need to treat
differently), and the character is rendered in the appropriate layer, so that
it gets obscured when it moves behind a wall etc.</p>
<p>I initially hoped to be able to complete the tile renderer and the map. At
least I achieved one of the two, so I'm quite happy. But now I must go to bed
and not repeat the mistakes of previous nights!</p>Day 72017-10-19T22:28:00+02:002017-10-20T03:54:00+02:00krasovtag:ideosyncrasov.github.io,2017-10-19:/day-7.html<p>I'm far behind.</p><h1>Trying Anyway</h1>
<p>Dear reader,</p>
<p>you may be wondering what's happened to Day 6. Well, I didn't get to do any
work on my game, because I had to work on something else I couldn't afford not
to work on. I also went to the movies with an old friend, so that's enough
excuses I think. With what little remains of this day (it's 10 pm right now),
I hope to at least be able to rewrite the renderer to be able to handle .tmx
files. Let's put on the <em>System Shock soundtrack</em>, and let's go!</p>
<h1>Old Mistakes Done Anew</h1>
<p>I didn't manage to finish my tile renderer; I made barely any progress the
last two hours because I was very tired. Why didn't I just go to bed? Oh, why?</p>Day 52017-10-18T03:54:00+02:002017-10-18T03:54:00+02:00krasovtag:ideosyncrasov.github.io,2017-10-18:/day-5.html<p>I'm stuck in a vicious circle.</p><h1>Why am I doing this to me?</h1>
<p>I didn't get a whole lot done today; I really should not have gone to bed so
late yesterday, and today I repeated my mistake. I didn't implement a UI or an
animation/scripting system. I only got to work on the map (about halfway done).
Tomorrow I'll hopefully be able to complete the map and improve my renderer, so
that it can read .tmx files and render several layers.</p>Day 42017-10-17T03:24:00+02:002017-10-17T03:36:00+02:00krasovtag:ideosyncrasov.github.io,2017-10-17:/day-4.html<p>I need to make a <em>game</em>.</p><h1>A Myriad Little Details</h1>
<p>Okay, this time I'll keep this very short, since it's already <em>very</em> late and
I'm quite tired. I didn't get to work on my game until about 8 pm, and I (of
course) didn't manage to get as far as I intended, but at least I've now got
a player character that can walk around with animations.
Getting even such a simple thing to work took <em>way</em> longer than it should have,
but the devil's in the detail, and of course there were some bugs that needed
to be weeded out. I'm not very happy that I didn't get to spend any time on
working on the gameplay, but at least I was able to do a fair bit of cleaning.
Tomorrow I plan to code some basic UI and a way to script things, and I hope
I'll finally able to work on gameplay too.</p>
<p>Good night.</p>Day 32017-10-15T14:35:00+02:002017-10-16T03:51:00+02:00krasovtag:ideosyncrasov.github.io,2017-10-15:/day-3.html<p>I need to produce code.</p><h1>From Fiction to Fact</h1>
<p>Okay, day 3. Enough idle thinking, now I need to produce some code. My idea is
to get at least a proof of concept of a character walking around in a 2d top
down perspective room. Since I haven't aquainted myself with the engine I'm
using before this game jam, I'll do that now.</p>
<p><em>Two hours later.</em> At last, some code (even if it's only the trivial-gamekit
tutorial)! But I feel more confident now that I can pull this off. Just a quick
shower and a little bit of worldly chores, then I'll try to get that
proof-of-concept up and running.</p>
<h1>... Or Something In Between</h1>
<p>Okay, I got <em>something</em> running at least. I didn't get as far as I wanted (no
animated player character), but at least I have code that can draw a tile-based
map (even if it's very hacky). But I wouldn't even have gotten that far would
<a href="http://www.mapeditor.org/" title="Tiled Map Editor">Tile</a> or <a href="https://www.opengameart.org/" title="OpenGameArt.org">OpenGameArt.org</a> not exist. Also, being able to edit and
re-evaluate code to have the change immediately effect a running process was
<em>super helpful</em>.</p>
<p>Tomorrow I'll hope to be able to implement character animation, and implement
some gameplay mechanics.</p>Day 22017-10-14T16:24:00+02:002017-10-14T19:30:00+02:00krasovtag:ideosyncrasov.github.io,2017-10-14:/day-2.html<p>A new day, a new hope.</p><h1>A New Day, a New Start</h1>
<p>Alright, next day. Bad news: I wasted the night trying to fix a stupid bug in
my iOS app (turned out to be an AutoLayout issue), and after doing a bit of
necessary shopping it's already 4 pm. Good news: Borodust has already fixed the
issue that prevented me from using his <code>trivial-gamekit</code> yesterday. Time for
some prototyping!</p>
<h1>Pen and Paper Prototyping</h1>
<p>I figured it would be more productive to develop the gameplay idea using pen
and paper; coding (and typing) just takes <em>so much</em> longer than scribbling
something one a piece of paper.</p>
<p>A few hours and two A4 papers densely covered in writing later, I have a rough
idea of how the gameplay mechanics should look. Basically, the internal state
of the game is represented by a graph together with a set of internal variables
of the player, representing his emotional and mental state. So, the graph
represents the externally visible state, whereas the "hidden variables" the
subjective one.</p>
<p>Each vertex of said graph represents a situation/scene (e.g. <code>player lies on
bed</code>, <code>player sits on bed</code>), and where each edge presents an "action"
(visualized by an appropriate animation). Such an action can lead from one
situation to a different one (e.g. action <code>get up</code> transitions
from <code>player lies in bed</code> to <code>player sits on bed</code>) or lead back to the same
situation (e.g. <code>keep dozing</code>), only affecting the internal state.</p>
<p>The internal variables are:</p>
<ul>
<li>Awareness/Consciousness</li>
<li>Arousal/Calmness</li>
<li>Mood</li>
<li>Wants (hunger, thirst)</li>
</ul>
<p>With the exception of the last variable, which is discrete, all these variables
are continuous and one-dimensional (i.e. real numbers), and they effect the
gameplay in different ways.</p>
<p>For example, <em>Awareness</em> has two effects. First, a sufficient level of awareness
is necessary to even make decisions. Otherwise, these "decisions" (i.e. actions)
are solely determined by habits and wants, i.e. which edge transition is chosen
is determined randomly, with pre-set proabilities that are influenced by the
<code>wants</code>. Higher levels of awareness dampen the influes of wants, and increase
the probability that the players choice coincides with the action his character
takes.
Second, awareness allows the player to recognize the emotional state (internal
variables) of his character, and open up more, less stereotypical choices.</p>
<p>The effect of <em>Mood</em> is that a positive mood makes it more likely to be able to
take an action that is perceived as unpleasant (e.g. cleaning up your room).</p>
<p>The effect of the <em>Calmness</em> variable is that it influences the influence (yes,
that's meta) of the mood variable. To wit, having a good mood in a state of
extreme excitation is ecstasy, whereas having a bad mood in the same state is
insanity.</p>
<h1>The Sketch of a Sketch</h1>
<p>As I said <a href="https://ideosyncrasov.github.io/day-1">Yesterday</a>, I envision this game to be the movie <em>Groundhog
Day</em> turned into a roguelike (if this roguelike was a text adventure). More
concretely, the game should take place in the apartment of someone who is
continually kept in a vicious circle of unhealthy decisions, and should focus
on his daily routine.
Of course the goal of this game (if it will ever exist) is to gain control of
one's life, that is of the actions of the player character, by making
appropriate choices that lead to more internal freedom and less addiction.</p>
<p>That's the rough idea at least. We'll see whether it will stay one.</p>Day 12017-10-13T10:20:00+02:002017-10-13T19:30:00+02:00krasovtag:ideosyncrasov.github.io,2017-10-13:/day-1.html<p>Aller Anfang ist schwer.</p><h1>A Simple Idea</h1>
<p>Okay, so I've decided to join the Lisp Game Jam Fall 2017, and now I'm sitting here with
my morning coffee trying to come up with an idea for a game. The theme for this
jam is <em>darkness</em>, which actually not that dull and generic of a theme as it
sounds. Indeed the word 'dark' has several distinct but closely related
meaning (taken from Merriam-Webster):</p>
<blockquote>
<ol>
<li>devoid or partially devoid of light</li>
<li>wholly or partially black</li>
<li>a) arising from or showing evil traits or desires
b) dismal, gloomy
c) lacking knowledge or culture</li>
<li>a) not clear to the understanding
b) not known or explored because of remoteness</li>
</ol>
</blockquote>
<p>The esoteric wisdom preserved in this semantic cluster is that evil can only
exist in darkness, i.e. in a state of ignorance, and that light (consciouness)
dissolves darkness. Further, 4b) points to the fact that to gain awareness of
ourselves means <em>exploring</em> ourselves, for our behaviour is ruled for the most
part not by the processes of 'conscious' thoughts (thoughts are often automatic
and not conscious) but by other, more obscure forces.</p>
<p>This actually connects with an idea for a game I had a while ago, which
revolved around making the player's consciousness the main focus of the game.
In the above terms, the idea was to let the player bring light into a dark
unenlightened world, whose inhabitants are suffering under their actions they
inflict upon themselves in their ignorance. So, it would be some kind of 'god
game' where the goal is not to rule but to enlighten and heal people.
Such a game might even just focus on one person (e.g. someone suffering
from depression/addiction), and in a sense, such a game already exists with
<em>Depression Quest</em>.</p>
<p>Unfortunately, this idea seems too vague and certainly too ambitious for a game
dev n00b taking part in a ten day game jam in an obscure ancient programming
language. Or is it? Anyway, I guess it's more productive if I try coming up
with the <em>gameplay first</em>.</p>
<p>Well whadda ya know, one shower later and I've come up with some barebones
gameplay and a tentative title for the game, which embodies the principle upon
which said gameplay rests: <em>Hidden Variables</em>. The idea is that you're
controlling but not really controlling the actions of the protagonist, through
multiple choice selection screens, each choice triggering a pre-defined 'cut
scene' sequence. More precisely, the player selects a choice he would like to
make, but which choice the protagonist realizes depends upon his inner mental
and emotional states (the 'hidden variables' aluded to in the title).
The player starts out with little control over his character, and must make the
right decisions that lead his character on a healthier path and out of the
slavery of unconscious emotions, out of the 'realms of dark forces', so that
he gains more and more free will, disproving the saying that 'man can do what
he wants but not want what he wants'.</p>
<p>In a nutshell, <em>Hidden Variables</em> should be the move <em>Groundhog Day</em> turned
into a roguelike. What I need to do next is come up with a functional system of
hidden variables, i.e. emotional/mental dimensions like
<em>irritation</em><-><em>concentration</em>, <em>discontent</em><-><em>pleasure</em>, etc. that at least
somewhat faithfully reflects human behaviour, make some kind of 'hello world'
demonstrating this idea. Even though my idea is that this should be a top-down
2d game, if worst comes to worst I could simply turn this into a text
adventure.</p>
<p>Enough talking, let's code!</p>
<h1>First Problems</h1>
<p>Okay, a few hours later and I still haven't made any headway at all.
I planned on using <a href="https://borodust.org/projects/trivial-gamekit/">borodust's engine</a>, but I couldn't get it to work
on either windows (SBCL and CCL) or Debian (SBCL). Luckily, borodust offered
quick and generous help on #lispgames, and even updated his quicklisp dist the
very same evening, so I'm hopeful this will be sorted out soon.
Anyway, I should probably concentrate on getting done a prototype demonstrating
the core gameplay. This will have to wait till tomorrow however.</p>