Archive for 'Game Theory'

Remakes – How Laser Squad Works (Part 3)

Oooh, now this is where it gets quite interesting. I’m going to discuss the AI of the game. To some people, the AI seemed quite fiendish. In truth, it isn’t that fiendish at all. The difficulty levels were mainly due to less resources for the player and more units for the AI team. So… how does the AI work?

Ok, let’s start with movement. Each game map has a set of location nodes. Two of these will generally indicate straight lines between locations. Duh! You may say. But this is important. Think of “Moonbase Assault” where you have to navigate corridors. Not trying to walk through a wall would be helpful there! Anyway, each unit has a patrol route. This patrol route is made up of a set of nodes which, each turn, the unit must make their way to the next node. Combine this with the fact that the units start within a ‘start area’ and you have a small element of randomness in the locations of the AI units each game. This also allows an element of unpredictability in when you expect a unit to turn the corner. For example, in Moonbase Assault, if a unit started in the same location each game, you can predict which turn they come around a particular corner and wait there with opportunity fire. You can still do that if you wish but you could be waiting a few turns which could be better used to complete objectives. Especially if another of your units distracts the AI unit in the mean time…

Which leads onto what happens with the AI unit itself? The unit will have its line of sight checked to ensure that any units that are visible to the unit are recorded accordingly. Then the unit moves and after each action, the AI will assess whether it should carry on with the route or do something else. Fatigue and Automatic Fire is updated and checked after each move to see if they are valid. Automataic Fire being for the non-team units, naturally. If Opportunity Fire has been triggered, the opposing team is given the opportunity to fire at the unit.

Now what happens when your AI unit is distracted by something happening? Well, They turn to face the distraction and are given a short period of time to remember something has happened. The AI unit then reserves action points so they can pop a shot at you if you decide to come into view. Otherwise they will happily pop a few shots off at you anyway. Fairly straightforward and simple really. If you don’t reappear after the timer has run down, they happily go back to their patrol route as if nothing has happened.

So there we have it. Once you know this, the AI doesn’t seem so smart does it? Nicely implemented but not that smart really. Bearing in mind the effort and capacity to fit the game into 48k and you realise that it’s more than adequate AI for the old 8-bit machines.

VN:F [1.9.22_1171]
Rating: 10.0/10 (2 votes cast)
VN:F [1.9.22_1171]
Rating: +2 (from 2 votes)

Remakes – How Laser Squad Works (Part 2)

Well, here’s the second part in the er… multi-part series of my analyses of how Laser Squad works. This time around, we’re going to look at the player stats and how they’re calculated and used within the gaming engine.

As you may realise, Laser Squad is pretty much a number cruncher with a nice gaming front end. In real terms, you could probably get a board for the map, counters and the like for the teams, weapons, etc. and work out the moves based on rolling dice and calculating scores. Fortunately, the computer does all that for you (with the added bonus of not showing you the ‘unseen’ opposing player’s pieces when you make your move). This reduces the tedium and increased the fun!

Let’s take ‘The Assassins’ as our example scenario. Corporal Jonlan has the following stats:

Constitution: 36
Stamina: 244
Morale: 250
Weapon Skill: 70
Close Combat Damage: 10
Strength: 56
Agility: 52
Toughness: 6
Morale Value: 40
Victory Points for Killing: 24
Size: 5
Action Points: 131

There are also some other stats that are worth noting but aren’t involved in calculation so much:

Can’t Pick up/Drop: false
Can’t Change/Drop/Pickup: false
Items lost with unit: false
Immune to morale loss from damage: false
Dead: false
Can be equipped: true
Manually deployable: true
Always reserve APs: false
Cautious Movement: false
Ignore threats: false
Infinite Ammo: false
Target Terrains: false
Target visible enemies only: false
Ignore items: false
Ignore 0 threat units: false
Total item size limit: 90
Item held: none

As you can imagine, there is a lot to take into account there but there is an obvious ‘one size fits all’ approach to the game pieces. So let’s get to business. How are in-game Action Points calculated?

Ok, we have the initial action points value of 131 (for Jonlan). Then we take away Jonlan’s burden (i.e. whatever he is carrying) which is calculated as (action points*weight carried)/(2*unit strength). We then remove Action Points based on wounding. Wounding is based on max constitution-current constitution)/toughness rounded to the nearest whole number. Naturally, this would be 0 at the start.

We then remove the weight of the armour and that should be your current Action Points for the turn.

Now Stamina is affected by fatigue (i.e. you have been carrying a lot of weight over a period of time). Fatigue is a counter that is incremented each turn if burden-adjusted Action Points (Action Points – Burden total) divided by 2 is greater than the current fatigue value (starting at 0). If this is the case, a calculation is made ((burden adjusted APs/2) – fatigue) and stamina is reduced if this value is less than the current fatigue count. Otherwise, the stamina value is increased and the fatigue count is reset to 0.

Other conditions that come into play are that if stamina is less than 32, your calculated action points are halved. Also, the game ensures you can never have less than 10% of your maximum action points (i.e. 10% of 131 or 13 in Jonlan’s case here).

I’ve not investigated the long-term effects of these calculations but over a game lasting 25-30 turns, I think the calculations are robust enough.

Opportunity Fire is basically calculated from your final action points less the burden. So if you had 41 action points for the turn and you have a burden score of 20, you would need to leave 21 Action Points to allow Opportunity Fire during the opponents turn.

Morale gets decreased by (Current Morale / (max constitution / damage)) when damage is done to a unit. I’ve been unable to find the level where panic kicks in but suspect it is something like 30% of the max Morale value.

Ok, I’ve bored for my country now. I suspect there are a number of mistakes in my calculations above so anyone who can confirm/correct what I said would be most appreciated. Also, anyone who can confirm how panicking works will be a star!

What’s next? How about a little about how the AI works?

Credit is due to the following:

Julian Gollop: Author and mighty fine game designer
William Fraser: Generously allowed me access to his commented reverse-engineered source code.

VN:F [1.9.22_1171]
Rating: 10.0/10 (3 votes cast)
VN:F [1.9.22_1171]
Rating: +3 (from 3 votes)

Remakes – How Laser Squad Works (Part 1)

For those who aren’t the three people interested in my Laser Squad dissection and attempted remake, I’ll give you a brief summary of the current plan and situation…

Laser Squad is a one or two player strategy game set in the future. The Laser Squad are similar to the Rebels from Star Wars and set about doing missions in order to achieve a specific objective. The themes of the game can be seen in various shows or movies. A simple example being ‘Moonbase Assault’ is a base that is storing data and well guarded. Such a computer system was a core focus of Season 2 of Blake’s 7 where Blake set the objective of destroying central control (*spoiler* which was then found to be somewhere known as Star One *spoiler*).

The game itself basically sets two teams against each other. One or both teams can be human controlled. Sadly, single player only allowed the player to be the Laser Squad. Each mission started by the player equipping the team with weapons, ammunition and armour. They then deployed the team into the deployment squares on the map and, once both teams have deployed, they have a number of turns to complete their given objectives.

The ultimate objective was to score 100 victory points. These points were allocated depending on what the mission objective was. For example, killing Sterner Regnix on ‘The Assassins’ scored 100 victory points for the Laser Squad. The Droid Squad scored points for each Laser Squad member they killed (generally calculated as (number of dead LS members / total LS members) * 100).

How you played the missions was completely up to the player. You could use the (in)famous Assassins tactic of arming Jonlan with a rocket launcher and many missiles and just have him keep shooting until he blows enough of the house away to reveal Regnix and take him down. Alternately, you could split the squad into 2 and attack both sides of the house together until you reveal regnix or encounter a droid. That was the beauty of the game. It didn’t really care how you played it too much which meant you can come up with your own strategies for winning.

Naturally it isn’t as easy as all that. You could run out of ammo. You could miss a target 3 feet away from you. You could panic and drop your weapon. You could be fatigued from carrying too much over a long distance. Julian Gollop implemented some really neat features.

This first article will focus on the sprite and map details.

With it being available on 8-bit systems, the graphics were very basic compared to today’s flashy 3D effects. They maps were a pseudo 3d/isometric style giving a basic 3D appearance but clearly only being 2D. Each sprite consisted of 4 x 8 byte pairs of information. In laymans terms, a byte pair can be used to represent the values between 0 and 255 by converting from hex (base 16) to binary (base 2). This in itself means you can create a simple sprite shape consisting of two colours. An example of this in action (for those not really too well versed in the detail of how a computer works) would be:

base 16 is represented by the numbers 0-9 then the letters A-F to represent 10-15
base 2 is represented by the numbers 0 and 1

8 is represented by the binary number 00001000 using 8 bits
F is represented by the binary number 11111111 using 8 bits

This means that the binary pair 8F is equal to 0000100011111111

As an aside, it also means that the byte pair 8F represents the decimal (base 10) number 143.

Using an actual 4 x 8 byte pairs from the game:


we have

00 00 01 03 03 03 01 00, 00 80 C0 60 FC E0 C0 00, 02 01 02 01 06 08 00 00, A0 C0 20 C0 30 88 80 00

Each of the 8 byte pairs represents a quarter of the sprite and take the form:

Top Left, Top Right, Bottom Left, Bottom Right

Using the knowledge from the previous example, the first 8 byte pairs will be


in binary. Now, putting them all together as they would look in the game:

00000000 00000000
00000000 01110000
00000001 11000000
00000011 01100000
00000011 11111100
00000011 11100000
00000001 11000000
00000000 00000000

00000010 10100000
00000001 11000000
00000010 00100000
00000001 11000000
00000110 00110000
00001000 10001000
00000000 10000000
00000000 00000000

A better (clearer) representation being:


Which some may recognise as the Dalek-a-like robot from Cyber Hordes walking (?) right.

The game map was a 2D grid 80 squares by 50 squares consisting of one sprite per square. A simple mapping of sprite 0 = value 0, sprite 1 = value 1, etc. in the map grid manages to build a fairly complete picture of the maps. For some reason I’ve yet to determine, many sprites match up but others don’t. I’m assuming a mapping table exists indicating which sprites map to which map value. My concern is that it would seem an additional effort to add this extra mapping so why bother? Why not just use the exact sprite values? It can either mean I have messed up and got the wrong numbering or I’ve missed something important. Fortunately, by running the game, I can build a mapping by checking the live map with the one I have generated and make any necessary changes to my mapping lists.

Ok, I’ve waffled on enough. Next time I’ll go through the gaming system and explain how stamina, damage, etc. are calculated.

Credit is due to the following:

Julian Gollop: Author and mighty fine game designer
William Fraser: Generously allowed me access to his commented reverse-engineered source code.

VN:F [1.9.22_1171]
Rating: 9.5/10 (2 votes cast)
VN:F [1.9.22_1171]
Rating: +3 (from 3 votes)

I love a good first person shooter (FPS) but really enjoy pitting my wits against another mind in a strategy game. It’s no secret that I’ve been wanting to remake a strategy favourite of mine for a considerable time (Laser Squad). I feel that one of its main attractions is that you are pitted against an opponent with similar strengths and gaming units meaning it is a true battle of wits to beat your opponent. Chess is probably the ultimate game in this respect.

Over the years, companies have released games with various themes, styles and additional elements requiring planning and strategic thought giving us a rich and varied choice of gaming experiences. Sadly, whether it be by design, accident or just inevitable conclusion, a lot of these games end up with the ‘brute force’ conclusion.

So what is ‘brute force’? A simple example is simply banging against a barrier until it gives way. Not elegant or skilled, just a war of attrition and willpower. Another example would be unlocking your briefcase when you’ve forgotten the combination. There are 1000 possible combinations of digits and trying each one in sequential order will get you the answer eventually. Great if the code is 0000, a pain if it’s 9999! Again, not skilled or elegant, just a war of attrition and willpower.

So how does this occur in strategy gaming? Well, generally the ‘pieces’ you are given have strengths and weaknesses which seem to follow a ‘scissors-paper-stone’ pattern. Your infantry unit can walk around land mines but are vulnerable to tanks squishing them, tanks go boom over landmines but can pretty much squish or boom infantry but infantry can manoeveur around fixed placements and tanks quite easily. Yes, it can get complicated very quickly and this is where doing your homework pays off when playing other players. Some ‘pieces’ are ‘super pieces’. Nuclear weapons, laser satellites and so on. They seem to have the upper hand over most of the other pieces on the board. So what does every player do? Keep banging away against the opposition until they have reached a point where they have these ‘super pieces’ and then brute force their way to victory! Add to this the fact that on higher gaming difficulty levels, you tend to see the same things being done to you (i.e. pump out resources until you have an unbeatable army then march onto the enemy base) and the game gets rather predictable.

Is that even a strategy? Well, in the broadest definition of ‘strategy’, yes. Yes it is. Sadly it seems to be the common strategy your average gamer opts for. No skill or specialist knowledge required. Get your big guns and shoot at will. Saying that, your true strategist will absolutely annihilate such a player in online play. How? Using knowledge as a weapon!

I recall playing Dune 2000 a decade ago (strange that) and I was using some brute force against the AI. I was making slow headway but could see the game taking a couple of hours, by which time all the spice will have dried up and we’ll end up with a ‘last man standing’ scenario. I decided to get clever and sent a couple of scouts to er… scout the AIs base. I found that there was a gaping hole right at the back of the base where the wind traps, construction yard and storage silos were guarded by a few tanks. A brainiac idea came to me. I built up a fairly sizeable force and a small, building-busting force of about 6 tanks. I carefully moved the tanks to within spitting distance of the hole. Moved my massive army to the front of the base and let rip. Suddenly, all the guardians of the special buildings moved to the front of the base to fight off the invaders leaving me a free run in destroying all their production buildings. Conclusion? They repelled the invading force but had no means of replacing the lost buildings or replacing the lost units. My next attack took out the base and victory to me. Success in 15 minutes instead of 2+ hours. Brains over brawn. A big thanks to Arnold J. Rimmer for an adjustment of his original tactic. Any mention of ‘Risk’ stories will be dealt with severely!

So back to the question… Can we counter ‘brute force’ wins? Sadly, I don’t think we can. If we only had games like Laser Squad and Chess, we’d lose a massive audience of players who enjoy such games but either can’t grasp or can’t be bothered to grasp the intricacies of the game. No interest means no games get made. Disaster!

The only way I can see of reducing the opportunity to ‘brute force’ is:

    – Reduce availability of ‘super pieces’
    – Improve the AI to intelligently counter opposing pieces properly
    – Put a cap on player pieces
    – Limit resources thus forcing tough decisions to be made

Some of these seem to have been implemented in many games already whether it be because of machine/application limitations or a conscious decision to make things fairer. Let’s read these in more depth:

Reduce availability of ‘super pieces’

Only being allowed to have one or two of a ‘super piece’ and/or forcing a long period of time between iterations of such a piece will limit the player in what they do and how they use it. i.e. forces them to use it strategically! Building a force of 10-15 ‘super pieces’ and marching onto the enemy base is textbook ‘brute force’.

Improve the AI to intelligently counter opposing pieces properly

AI is still relatively infantile in the world of research but in limited-scope applications it can be quite brilliant. A strategy game is a limited-scope application and even the poorest of strategists would know to use kryptonite against Superman and if they see the wicked witch of the west, they know they should be off to the kitchen to get a bucket of water. AI in games doesn’t seem to think of the defensive/counter approach very much. If the player is throwing horsemen at you, start generating pikemen to counter! The same if the player is using tanks to defend their base, use missile-carrying soldiers to take them out! Force the player to use their guile and skill!

Put a cap on player pieces

In all fairness, a lot of games use this anyway. It’s included as a point of note. It’s either that or you get an army of thousands marching onto the enemy base.

Limit resources thus forcing tough decisions to be made

Isn’t Tiberium wonderful? Constantly available but refreshing itself over a period of time. A big part of decent strategy is making the most effective use of your resources! Having a neverending supply doesn’t make it any kind of disadvantage. Limiting the resources forces the player to spend wisely.

This list is probably not conclusive but I feel that a stronger implementation of those features will make the modern strategy game more er… strategic.

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Remakes – What makes a good remake?

Over the years we’ve seen many classic games appear on our favourite platforms. They’ve fitted into all kinds of gaming genres, various backdrops and at appropriate times in the world’s history. Looking back at some of these games, they tend the all fall into three categories.

    1. The game itself is as great as ever but looks dated
    2. Streets ahead for its day but is now old hat after a replay
    3. What on earth did I play that load of rubbish for?

Whatever the reasons are that we liked a particular game, we decide to remake it so we can reminisce about ‘the good ole days’, to add or improve the original to how we’d like to see it, to enhance the whole game experience for the 21st century or just because we can! But what exactly makes a good remake?

The announcement of the new XCom game by 2K Games has been met with both excitement and disappointment. This is for many different reasons but what I feel is the biggest reason people are a little disappointed is that it seems as if the development company are breaking the golden rule of a much-loved mythos, that being DON’T MESS WITH THE HISTORY!

There are great examples of where the Mythos has been messed around with and actually improved the whole thing. “Battlestar Galactica” is something I was totally against when the ‘re-imagining’ was announced a few years ago. It is now one of my all-time favourite shows. Why? They improved it! Gave it more of an edge. Fleshed out the stories, added depth to the characters and made it very tense and exciting. Saying that, there are other examples where messing with the mythos actually made things worse. My example being Rob Zombie’s “Halloween” movie remake. Yes, it is interesting to know the background to Michael Myers and what happened to send him over the edge. The thing is… you just removed a major ‘fear factor’ from the movie. That being the fact that you don’t know what happened or why he is doing this. Is there a pattern to his killing or is it totally random? Random or a hidden agenda is far more scary than knowing he won’t kill character x because of a well known reason. So there are arguments both for and against. Personally, I prefer to keep the mythos unchanged – espeically one so well established and loved as you’re effectively alienating your core market.

So, back to gaming and the question at the top of the page. What makes a good remake? In all honesty there is no definite answer. One man’s passion is another man’s hate. Remaking a game with retro-style graphics is something someone may love but is probably a pet hate of someone else. Making a perfect one-to-one remake of an original game may be job done for some but a missed opportunity for others.

This means there are no hard and fast rules but I think I have come up with a general set of guidelines to follow to maximise your audience:

    1. Keep what made the game fun in the first place!
    2. Remember it is YOUR remake and YOU have final say in what is implemented.
    3. Feedback is important, listen to it!
    4. Don’t be afraid to ask for help or suggestions.
    5. Set reachable targets and meet them.

Confused? Don’t be. Let’s summarise each point:

1. Keep what made the game fun in the first place!

When all is said and done, you loved a particular game because it gave you hours of entertainment. “Head Over Heels” was an isometric game, would making it 3D add, detract or keep the same level of fun? Would adding more enemies in “Space Invaders” improve the experience? Why did you keep coming back to the game time and time again? Don’t implement features for the sake of it. Change or add something ONLY if it will add something to the gaming experience.

2. Remember it is YOUR remake and YOU have final say in what is implemented.

YOU are remaking this game. If you get help, you’re part of a team remaking this game. This means that you are going to have to fulfil every promise you make. If you think the ghosts in Pac Man being resurrected before the pill timer ran out was unfair, don’t implement it. If you think that once eaten, resurrecting the ghosts where they stand 3 seconds later would add something to the game, implement it. (as a side note, I think they are lousy suggestions, I’m just giving examples). This leads back to point 1 – the game must be fun or you wouldn’t play it!!

3. Feedback is important, listen to it!

There was a recent debate on RR regarding feedback. If you don’t want to hear negative comments about your remake, don’t ask for feedback. At the same time, don’t expect many people to want to keep playing your game either. The people on RR are gaming veterans of 20+ years. They know what is enjoyable and what isn’t. A subset of them have remade games too and know what the pitfalls are and can make great suggestions regarding what to fix or add to your game. Their suggestions could mean the difference between having an average game and a classic remake! Of course we don’t like being criticised but if we don’t embrace and learn from our mistakes, we don’t move forward and keep making the same mistakes time and time again. Again, this points back to the previous point, it is up to you as it’s YOUR remake but these guys want to help you. Let them!

4. Don’t be afraid to ask for help or suggestions.

This is an extension of the previous point. As well as asking what you can fix, you can also ask people what they’d like to see in the game too. Personally, I know I just can’t draw to save my life. I asked for help with Monty and got the talented LoBo pumping out sprites and screens at will. I still need to come back to that project but his work allowed me to concentrate on what I am good at – coding! Admittedly, people won’t just pop out with offers of help if they think their efforts will be wasted. Put together some code. Rip the original sprites and sound effects and knock together a small demo. It only needs to be a room with some of the gaming features working. If people see things are progressing, they’ll be more inclined to offer their help. I also got many suggestions for new features and fun things to add to the game. Things I just didn’t think of. It may be YOUR remake but it doesn’t mean you have exclusive access to all the best ideas out there.

5. Set reachable targets and meet them.

When writing any application, you need to plan and set targets. More importantly they need to be realistic. While building Monty, I set the main objectives to be things like:

    – Implement collision detection with Monty and enemy
    – Animate Monty
    – Make screen drawing routine more generic
    – Add sound effect when Monty jumps

These are simple things you can probably implement in a few lines of code in most cases. Sitting down and achieving 3 or 4 of your objectives in one sitting is a great ego boost and encourages you to do more. You can then set more objectives for next time. Before you know it, you’ll be ready to write a room/level editor and throwing out a small demo for the community to try out, review and give feedback on.

I hope I’ve allowed a few of you to think more about what is involved with remaking games and given you all a few ideas as to how to make the most of your time.

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)