Showing posts with label GameDesign. Show all posts
Showing posts with label GameDesign. Show all posts

Saturday, September 17, 2022

Mass Combat with Surprise

 It's easy to just have armies with one number (combat strength) and smash them together. A common strategic element is that of "surprise". In Atlantis, a force with higher tactics skill gains one round of attacks with no counter-attack. This is actually pretty devastating, which has led to attempts to scale it back.

GURPS Mass Combat deals with surprise by giving the losing side a penalty to their strategy skill (they are "confused" until they can pass a strategy check). My previous post showed how critical strategy skill is to combat outcome.

I decided to measure the effect of surprise using two simple forces:

  1. Force 1: One unit of medium infantry (TS 3, cost $30k)
  2. Force 2: One unit of light infantry (TS 2, cost $40k)
Force 1 is stronger and cheaper. This is because light infantry have the "recon" class, which allows them to participate in the surprise calculation.

Because force 1 has zero recon, they effectively never have surprise. Force 2 will gain surprise about 60% of the time (it's random based on a quick contest of skill including strategy and intelligence gathering - 40% of the time there is no surprise).


As-is, the recon boost is clearly overpriced. Force 1 is winning about 99% of the time. Using a scaled sum, force 1 takes about $23k damage, and force 2 loses almost $40k.

I'll wait to try and balance costs until I run some more mixed force battles.

This graph shows the damage from surprise better. There is a slight shift upward in damage when surprise is gained. There's also a slight tick up in cases where force 2 can win (with heavy losses).

Or, if we just show cases where force 1 wins (and scale by the total number of battles of each case):


Saturday, March 19, 2022

GURPS Mass Combat

 I am somewhat of a collector of game system rules. There are many cases where I have read rulebooks and never played the game. I have played a little GURPS, but I have read far more rules than I have ever used.

One of these is GURPS Mass Combat. GURPS is oriented towards individual action - each player has one character (PC), and is making the decisions for that character. Mass Combat is for dealing with situations where the PCs get caught up in a larger battle. It is making trade-offs between player decisions and the larger scope of army action.

As I work on a replacement for Atlantis, I wonder if the Mass Combat rules can provide a framework I can use...

I have the basic elements coded. It's interesting that force composition has probably the smallest impact on outcome - every force is reduced to one number ("troop strength"). And the ratio of the two strengths produces a modifier to the leader's strategy skill (outnumbering your opponent 1.5 to 1 gives +1 to strategy).

The biggest driver is your strategy skill. A higher strategy will allow you to dominate your opponent.

One of the nice things about making it a computer program is I can run thousands of battles in a second. I can then look at the statistics to see what is having an impact.

This is the probability distribution using the rules as written (actually, it's missing the position bonus, which will skew the numbers even worse). The forces are equally sized, with equal strategy skill levels, and choosing "simple attack" each round.

The losing force fights until elimination (100% casualties). This graph shows the damage done to the winner. The blue bars are the probability at a particular level, the red is the cumulative percentage.

The red line shows that about 50% of battles will have the winner come away with maybe 60% damage or less. And 80% of battles will give them 85% damage or less.

There is only a 5% chance of mutual annihilation.



I made one change for this graph. The rules include a -1 penalty for each 5% damage. This means that a lucky win early in the battle will cause the battle to skew rapidly toward one side. I simply removed it.

Now we see 50% of battles will result in 90% casualties for the winner. 26.5% of battles will result in mutual annihilation. No battles result with less than 60% casualties for the winner.

The rules also apply a recover of 50% casualties to the winning side. This is probably heartening for PCs who are happy to see their side win and recover - but it would be devastating in a strategy war game. A battle with equal forces could result in the utter annihilation of one side, with the winner taking 30% losses!

More data to come as I add firepower and cavalry...

Thursday, October 04, 2018

An AI for Atlantis

I've been working on an AI for Atlantis for a while now. Finally have something to show for it!





I created a game with four players (all AIs). The nexus has no exits, so there are random jumps out. They are using pretty much the same strategy - find good hexes and ramp them as quickly as possible.

Monday, October 12, 2015

libHexPlanet: Sphere 7

I got sphere 6 working using a texture for the vertexes and sending position indices (I didn't get a chance to post the screen shot).

However, both my machines have limits of 256 KB for textures, this works out to 16384 vertexes, which is sphere 6.

I'm going to give up on indirection, and just spam all the vertices.  It took a little doing, but it's working.

Sphere 7:

And I can now do sphere 10, which is so detailed, the individual hexes are turning into pixels:

Thursday, October 01, 2015

libHexPlanet: Shading!

I figured there should be a way to have the shader do the triangle/hex reprojection, and I found it!

The shader calculates the nearest point, and uses the terrain type (one byte) to pick a color.

Thursday, September 10, 2015

Plates in libHexPlanet

I finished this a while back, but forgot to post an update...
This is sphere 9 (200k) hexes.  I've also significantly sped up generation so sphere 10 and 11 are pretty quick.

Now I need to figure out the math for plate collisions...

Friday, April 24, 2015

libHexPlanet

I'm always interested in world building, and I saw some talk about generating entire spheres of hexes.  This is not straight forward, since you can't make a sphere entirely out of hexes (you usually get twelve pentagons).

I saw one guy who embraced the variation, and would randomly make more pentagons (with a septagon to balance each past twelve).  He also moved the points around, so the whole map is a little irregular.

There is another project - HexPlanet, which just has the twelve pentagons.  I've found that code a lot easier to work with, and when you have 100k+ hexes, twelve pentagons is hardly noticeable...

I've finally got it into a state where I can easily generate some map data.  Here is sphere 9, which is nearly 200k hexes.  I should be able to get sphere 10 working (nearly 600k hexes), with an stretch goal of sphere 11 (should be over 1.5M hexes).

The terrain is a little hard to see, since it is entirely random.  But you can see how small the hexes are in sphere 9.

Saturday, September 14, 2013

Voxel Worlds

I think I need to work on some sort of voxel world building game (aka Minecraft - or should I say, NedCraft, MiNed?)

Some numbers:
Figure 1 GB allocated for the world (which should fit nicely into memory on modern machines - you could go to 2 or 4, but not 10 or 20 yet).  One byte per block gives 255 active textures (plus empty).  That should be plenty (Minecraft has a ton of items and creatures, but those can be handled separately).

1e9 blocks sounds like a lot, until you start trying to fill a globe with them...

That's 1000 blocks cube, if each block is one meter, that's only a 1km cube (which is a pretty small planet).

You might use a lazy system for allocating, but that opens the possibility of the total storage growing enormous over time.

It seems better to limit the depth, and spread the blocks over a greater area...

Of course, you need some volume above the surface as well...

500 m high, 500 m deep... 1 GB goes fast!

Sunday, September 23, 2012

Light of Nova

I finally found a Stars-like that people are playing (and it was even on Facebook!)

The mechanics are pretty straightforward (build, build, build), and politics plays a pretty important part.  There is even a story that is not entirely terrible.

And I've got a spreadsheet!

Wednesday, August 22, 2012

Manic Digger

Been having a blast in Manic Digger.

It's an open source clone of Minecraft.  One of the cool features is seasons; in the winter, the top layer of water freezes, and you can pick up "water" blocks.

Then, you can take those blocks and drop them somewhere, and create waterfalls.

The mountain on the left has already been covered, and you can see the water starting to flow on the mountain in the distant center.

I was working in a mine when the water hit the bottom, and found myself having to fight a flood in!

Monday, November 07, 2011

Time to Play

(continuing my review of Facebook games)

It's ironic that the two best games, Robot Builder and Nitrous Racing have both come to (bitter) ends.  While the terrible games continue unslowed.

As I've looked for a game to replace NR, I uncovered a new failure mode for FB games: limited time to play.

The amount of time it takes to play a game is a continuum.  You have minesweeper or solitaire which take just a few minutes, to RPG's which take tens of hours.  The nice thing about a short game, you can string the games together to play for an hour or two.

Unless they are Facebook games.


I'll mention two by name, but I'm sure they are not unique in this regard (indeed you see  it in the Frontierville model, where you only have so much energy, and then you have nothing to do).

Diamond Dash
This is a typical matching game like Dr. Mario or Bejeweled.  Game play is typical, and it tracks level (a sort of function of number of games played).  But it only lets you play 1 game every 8 minutes (games are fixed at 1 minute).  And you can only accumulate ~5 games.  So, you play for 5 minutes, then you have to go away for an hour.

Triple Town
This actually has some promise.  It is a twist on the typical matching game, in that matches are "upgraded" instead of removed (I feel like I have played this style before, but I cannot place it).  Successful play is rewarded with coins, which can assist in future games.
Except, you only get one move per minute, and can only bank 75 moves.  So again, you play for a few minutes, then you're forced to move on.

What is the reasoning behind this?  I cannot imagine.  It cannot be server load, because these are Flash games which run locally.  Worse, leaving and returning forces a re-download of the app, which must spike their bandwidth usage (although Triple Town seems a lot smarter about caching).

Saturday, July 23, 2011

D20

(continuing discussion of game characteristics)

There is a subtle but important element into how you generate random numbers for your game (I'm assuming most games will have a random element).

There actually is a game system called "D20" (where all decisions are made by rolling one twenty sided die). I prefer the GURPS system, which uses (mostly) 3d6.

The two systems are superficially similar. The range is about 20, and the average is around 10.

These are the probability (PDF, blue) and cumulative (CDF, orange) distribution functions for a d20. Totally flat. This means that any number from one to twenty is equally likely, similarly going from N or lower to N+1 or lower is always a 5% increase in probability.

So, a bonus which gives +1 is always worth 5%, whether your an expert or a novice.


These are the PDF and CDF for 3d6. Notice the distinct bell curve for the PDF, and the CDF resembles a sigmoid (which has characteristics similar to an exponential curve at the bottom, and logarithmic at the top).
This captures ideas like "diminishing returns". It also means that an "expert" (someone who could make a roll at 16 or lower) is less affected by difficulties (say, -1 on the roll) - going from 16 to 15 is a drop of ~3%. The same -1 is a 12.5% drop for an average person (10 or lower).

GURPS is limited by the human element. People must roll and count the dice, and increasing the number makes it more likely that one will go off the table, etc. A computerized system can generate any curve we like, with any range we like.

I'm thinking either 1-100, or 1-1000 - with this same bell shape. Something like 17d6.

Wednesday, June 29, 2011

Game Characteristics

Games can be characterized as having "perfect" or "limited" knowledge. Also, they can be "deterministic" or "random".

Another important aspect of a game is what sort of "models" one must build for your opponents (and what is the cooperation model).

Chess is a deterministic game of perfect knowledge. So are: tic-tac-toe, checkers, and go. These games are of limited interest to me, because they are effectively searches of a state space. This limits the opponent model to estimating how well they can search the state space. The simplest being, "assume they can search the space as well as I can". This makes the game no different from playing oneself.

Most games include a random element (usually dice, cards, or a spinner). The simplest games are entirely random (they could be reduced to a coin toss to determine the winner). Examples of these are Candyland and Chutes and Ladders, which are really just tools for teaching game mechanics to children.

The only example that comes to mind of a deterministic game of limited knowledge is Stratego.

Also worth mention is Poker, which is often entirely random (stud vs. draw) and may have zero public information (a counter example is Texas Hold'em). Here the outcome of a player model is boolean (bluffing or not bluffing), but coming to that decision requires great skill.


A complex game will include all of these elements: combinations of public and private information, randomness and certainty, complex models of player behavior (driven by a wide choice of possible moves at any point) and player cooperation.

A good game can be built from a simpler set, but this space tends to be better explored (will you make a chess analogue?)

Monday, February 07, 2011

I say

we take off - nuke the site from orbit. It's the only way to be sure.

I just read something at Ars that makes me physically sick. Farmville for Dummies.

At least the interview with the author is good for a laugh:
"The first time Orland played Farmville he had to give himself a goal to maintain interest: to recreate the first level of Super Mario Bros. out of haybales. After that, his interest waned and he left the game."

Friday, January 14, 2011

Failville

(continuing my review of Facebook games)
I don't know why I keep giving Frontierville another chance... I keep thinking it has to get better at some point...

There is an interesting correlation between games I enjoy and games that allow non-paying players access to the for pay item. For example, Robot Builder and Nitrous Racing (which needs its own reviews) are my two favorites - both allow you to get the bonus items without paying (of course you can pay to get more).

Frontierville gives you 1 per level (called "horseshoes"). Stupid decorations cost 10 or more (the treehouse is 100). You might need 4 or 5 just to finish some building that all your friends are done with (so they stop sending you the materials).

When I signed in last week to help some friends with items they needed, I was notified of a chance to win 50 horseshoes by completing 6 missions.

So, I churned hard on those missions - harassing my friends like never before. As the deadline approached, I was starting to finish!

Then, what do I see?

The missions are multi-part! Each one I finish gets backed by "Phase 2". Yea, no chance of success.

Friday, October 01, 2010

Slope

(continuing my review of Facebook games, particularly the phenomenon of "open ended" games)

Most people think of games in terms of winning and losing. Even the longest games, like Axis and Allies or the Russian Campaign, eventually end. There are objectives along the way, by which one can measure progress.

In an open ended game, these objectives are illusory. People might complain about some group receiving a special item, or even getting it first.

However, in the long run this is irrelevant.

The most important aspect of an open ended game is your "slope". Slope is the rate of change.

As long as your slope is higher than your opponents, you will eventually get ahead (there is no winning or losing, only ahead or behind). If your slope is lower, even if you are currently ahead, you will (eventually) always be behind.

Even special items have only temporary value. Inflation will eventually degrade them. As long as your slope of acquiring new items is good, you will have new and better items.

Monday, July 19, 2010

Robot Builder

(continuing my review of Facebook games)

I previously mentioned a group that made several good games. The best of these is Robot Builder.

Robot Builder originally suffered from the same Add Me effect that most games have. Then some sort of bug caused them to remove it (this was before I started). They never did re-enable it, which turned out to be a great decision.

Game play is pretty simple. You have several resources to manage: energy, money, and robot tokens (RT, this is how they raise money, you can buy RT - although you can also find them in the game).

Energy is refilled at 10 per 15 minutes (as opposed to the typical 1/4 or 1/5). This is somewhat irritating early in the game, when you only have 10 or 11 max.

Your goal is to build robots. There are many different areas to salvage through (which take energy and money, sometimes RT). You can also do different "fights" in the arena - but these are basically different areas which can only be explored once per hour (or four hours, I forget).

You mainly raise money by selling parts, energy refills automatically, and you find RT. Different robots allow access to different arena fights, new areas, or give you additional energy storage.

Not a lot to see.

The hidden gem in this game is the market system.

The market allows players to trade items for RT. You can sell your rare parts (any parts really) for RT, and buy the parts you need. Or buy parts to sell for cash (giving RT a value in cash).

Being a market, there are tidal effects (as players sign off for the night, or sign on in the morning). This creates timing opportunities. You can buy parts when there are many players online as an investment, then sell them off when the market is short. You can also try to corner the market (by buying all the parts others supply, and holding out for higher prices).

This gives the game a lot of playability - even when there is no new content. It does require a large number of players to support the market. Sadly, total abandonment by the developers has pretty much killed this game.

Monday, July 05, 2010

Frontierville

(continuing my review of Facebook games)
A quick word of warning about Zynga games (Mafia Wars, Farmville, Frontierville, among others). They are pretty public about how evil they are. They will sell you email to spammers, and do anything to spread to your friends and install toolbars on your browser. If you play their games (and I can't recommend any of them), make sure to use NoScript, Adblock, etc. and don't give them your email, make sure you block them from your wall and friends, etc...

So, continuing on the massive failure that is Farmville, there is now Frontierville.

The game mechanics (and engine) are basically the same - you have a set of land, on which you place buildings, crops, trees, and animals.

There are a number of changes, most of them bad: energy, wilderness, varmints.

Energy
In Farmville, you could plant your whole board in a 4 hour crop, come back in 4 hours and harvest it all (assuming you had the money). In Frontierville, every action takes 1 energy (like the energy in Mafia Wars). Of course, in Mafia Wars I have 1900 energy (at 1 energy per 5 minutes, that is 8 days). In Frontierville, I have 15 energy.

This does introduce some interesting strategy changes.

Now, you must pipeline out some crops in order to maximize experience. You can't just look at xp/hr, you must include energy as well (since all actions are 1 energy, this amounts to xp/crop). So, 3 day crops are the best, but you can't just fill the board with them. You have to stage them out, say 1 hour apart, 9 at a time (not 12, more later). This creates some interesting effects, when you start with a blank board, and want to scale up to a big harvest in 2 or 3 days (say over a long weekend). You lay down 9 of the 3 day jobs, and 9 one hour jobs (for when you come back). Then, in an hour, harvest and lay down 9 more of the 3-days. Rinse and repeat.

Wilderness
The wilderness is a huge pain. Your board is not open like in Farmville. It starts covered with all sorts of junk, which you have to expend energy to clear. Worse, the stuff grows back.

Varmints
This is probably the worst feature of all (especially when compounded with the other two). Every action has a chance to spawn a varmint (different ones for different actions). The varmint will block the 8 adjacent squares, forcing you to deal with it or pay 2 energy for actions. It takes 3 or 4 energy to remove a varmint (hence the 9 crops for a 12 energy period). If you luck out with no varmints, you need the energy for maintaining the wilderness anyway.

The game's isometric view is especially painful here. One time, I was clearing some trees, and a bear appeared. It was hidden behind a big tree, so I had to pay 2 energy times 12 to clear that tree!

Co-op Play
There is one nice new feature. In Farmville, you could visit your friends' farms. There you could get some extra xp and money by "helping out" (which actually did not help them at all). In Frontierville, you can actually help. This makes things a little better, but is not usually reliable enough to impact planning. You usually have more things than you have energy for, and friends can help there.

The game has just started, so it might get better - but probably not.

Saturday, July 03, 2010

Farmville

(continuing my review of Facebook games)

Farmville is a really bad game. Shockingly bad - especially considering how many people play it (Wikipedia claims 80 million installs).

The game mechanics are very simple, you have a set of land (which gets bigger as you progress) which you can fill with crops, trees, animals, and buildings. Buildings serve no point, except to give you experience points (and look pretty).

There is an interesting trade-off between crops and trees/animals.

Every unit of production has some cost, and produces some experience points and money. Trees and animals produce repeatedly, while crops are one-shot. Also, crops will expire (wither) if they are not gathered after reaching term - while trees and animals will keep indefinitely.

The optimal strategy is to maximize your return in money and experience (money can buy experience) for the land you have, and the time you have. If you can dedicate lots of time, you can make a lot of money and experience very quickly.

Higher levels give access to new crops, etc. but this is of limited effect. You have your spreadsheet of $/hr and xp/hr, grouped into time groups (4 hours, 8 hours, 1 day, etc.). Based on your schedule, you put down some crops. If you aren't sure when you will be back, you can invest more in trees or animals.

At some point they added vehicles, which reduces the tedium of plow/plant/harvest some (a vehicle can do 4 at a time). Not really worth the time, though.

Friday, July 02, 2010

I'm a Wiener

(continuing my review of Facebook games)
I got style, I got grace.

Perhaps the saddest part of Facebook games is the lack of winning.

For some reason, game designers think that if they don't have an ending, and don't declare a winner, people will just play forever.

Of course, this requires a steady rollout of new content. So really, you're just playing new games with a steady increase in gear - which leads to massive inflation (old gear becomes useless).

Usually, the developers can't keep up with the rate of consumption, and the game dies anyway.

So, ironically, the very attempt at creating a unending game ends the game (there's a sermon in there).