BattleRL : Day 3 progress report

by Grungi

The third day was dedicated to a very important aspect of BattleRL : the combat. I had other commitments yesterday, so I could not devote as much time as I had hoped to the game, but I managed to get the melee combat mostly working.

The beginning of the combat system.

Working on the combat made it necessary to work on a bunch of other systems as well. First, the message log. As with most roguelikes, BattleRL will feature a region of the screen where descriptions of what is happening are displayed. Currently it writes the latest message in bright white, while the two previous ones are written in a darker gray so as not to be confusing.

Later on, and by later on I mean today, I want to hook the log to the timing system. A message would then only stay white for, say, 5 or 10 minutes in-game, before becoming grayed out. This will be a way to provide situational informartion to the player. For example, if a firearm is fired somewhat close, the player should know the rough direction the sound comes from so that he or she can plan their strategy accordingly.  Knowing that a white message is habitually still relevant will be, I think, a good thing.

Apart from the message log, I also needed to but another actual character into the game so the player could fight it. I used the opportunity to craft a fairly general ‘character’ class which is now used both by the player and the other characters. At that point, depicted on the picture above, I could bludgeon the poor guy to death without him being able to do anything about it. That was because the melee combat works in the same way it does in most roguelikes : you need to ‘bump’ into your opponent to strike him. As said opponent was not moving, he could not retaliate.

So I had to change that, and added the first ‘artificial intelligence’ to the game. It was not very smart though : the enemy now moved randomly around the map. Still, that meant he dealt blows, albeit randomly.

Managing to kill a randomly moving opponent is more difficult than you might think…

Tonight will be a very important night for the game, as I will be adding other crucial features (to be fair, they are all kinda essential…) to it. In no particular order :

  • Time will be introduced. The way I want to make it work is that each action will have a cost in time. I will be going with a base cost of 15 seconds for a basic action (moving between tiles, attacking in melee, firing a simple firearm), with some action taking more or less time, for example running will let you move faster, but probably will cost you something, like making noise or tiring you more quickly. The game will maintain a queue ordered by time, and step through that to determine who will act when. And each time any entity do something, it will be reinserted in the appropriate place in the queue. In a way, it will be similar to Final Fantasy X or most tactical RPGs.
  • Along with time, I want to put in the ‘forbidden zone’ mechanic. At each hour, a new zone of the island will be declared ‘forbidden’, and any character in it will have to get out of it before the announced time or be killed. This will hopefully make for some tension when the player realize he really is in a bad position, maybe pinned down by an enemy, and need to get moving fast. It will also serve the purpose of bringing the remaining survivors ever closer so that opportunities for fights continue to happen. Maybe your stategy will be to let the others kill each other while gathering supplies in order to pick off the last ones when they cannot hide anywhere?
  • There will be ranged weapons in the game. Since BattleRL will only let you move in 4 directions instead of 8, their range will have to be computed accordingly. It will seem a bit counter-intuitive, but I think that it will not be that big of a deal, and will preserve the balance of the game.
  • Finally, I want to make the AI less dumb by adding a new behaviour  to the enemy. For today, I simply want to make the characters move randomly, except if they see another character, in which case they will either shoot, or go towards him/her and try to use melee, depending on the weapon they have.

So as you see, that is quite the big plans for a single evening, but much of it seems pretty simple to me programming-wise. So hopefully tomorrow I can write about how it all is coming together. If that is the case, I can add win/lose conditions, and from that point on, everything will be extra polish! The rest of the week is looking bright 🙂