A downloadable game for Windows, macOS, and Linux
Jonathan's Infinity Resources. I've made or contributed to a number of different projects for the miniatures game Infinity.Here you can find a central listing of all of them, with information and links.
Ghostlords is a strategic turn-based RPG that tells the story of a post-apocalyptic haunted Great Britain. Experience the new world, capture wild spirits, and put together a team of ghosts to help you battle the forces of evil. Inspired by games like Pokémon and FTL - every playthrough will be a unique challenge.
- Infinity Marker Sheet Creator. Please see the updated version for N4! Create a custom marker sheet by selecting the number and size of each kind of marker you want.
- Made with Unity. Collect ghosts in this spooky strategic turn-based RPG.
- Lord Huron - Ghost On The Shorehttp://www.twitter.com/SkipperRadioTumbl.
The year is 2038. It has been twenty years since the Rending - an event that left most of the world's population dead, their souls severed from their bodies. These souls linger, and survive as ghosts.
There are rumours of humans developing supernatural abilities. Apparently there are people possessing the same magical abilities as the ghosts, and even people able to control the ghosts themselves.
Ghostlords tells the stories of these individuals and the world they live in.
Status | In development |
Platforms | Windows, macOS, Linux |
Release date | Nov 18, 2016 |
Rating | |
Author | Kyle |
Genre | Role Playing |
Tags | Ghosts, Spooky, Strategy RPG, Turn-based, Turn-Based Combat |
Average session | About an hour |
Languages | English |
Inputs | Keyboard, Mouse |
Accessibility | Subtitles, One button |
Links | Homepage |
Download
Click download now to get access to the following files:
Community
The miniatures game Infinity has some interesting and unique mechanics. The first is that the player who is not currently taking their turn gets to have their models react to the actions of the active player. The second mechanic is that if the action and reaction are directly opposed (for example, the two models are firing at one another), both players roll dice at the same time (called a Face to Face roll). The player who scores “better” wins the contest and their models performs the action.
Let’s take a very simple case of two basic infantry troops shooting each other. The active model is he Fusilier Angus, firing his Combi Rifle with Ballistic Skill (BS) of 12. This weapon lets him roll 3 20-sided dice, which will succeed on a roll of his BS of 12 or less on each die. His opponent is the Zhanshi Wen Liu, firing his Combi Rifle with BS 11. As he is reacting, he only gets a single die, and his BS is lower, so he is looking to roll an 11 or less. They both roll their dice at the same time, and then compare results. First, any dice that missed (rolled above the firer’s BS) are discarded. Then, any successes that rolled lower than the opponent’s highest die are discarded. This leaves at most one player with any successful hits, which are then applied to the target. There are a few more complexities, but this outlines the basic flow. To make it concrete – Angus rolls a 15, 10, and 7, and Wen Liu rolls a 9. Angus’s 15 is discarded as a miss (since he rolled greater than 12), and his 7 is discarded since it is lower than Wen Liu’s 9. Meanwhile, Wen Liu’s 9 is discarded since Angus rolled a 10. The only die left is Angus’s 10, meaning he scored one hit on Wen Liu.
In this basic case, the probabilities are relatively easy to calculate. For each of the active player’s dice, it is easy to calculate the chance that they rolled less than or equal to their target, minus the chance that their opponent rolled higher without going over their own target value. And in fact, there has long been an online tool called Infinity Math to help calculate probabilities where the reactive player is limited to one die.
The calculations get much more complicated when the reactive model is allowed to roll multiple dice. I attempted for some time to come up with a reasonably simple numerical way of calculating these chances, but kept on coming up short. Eventually, I remembered that my personal strengths are not in numerical analysis, but rather in computational and algorithmic optimization. Therefore, I decided to make a program which implements a really simple and straightforward means of calculating these probabilities, and then optimize it until it was acceptably efficient.
Basic Design Overview
The basic design of my dice rolling engine is to enumerate every possible permutation of dice that could be rolled, evaluate the results, and then calculate how likely each possible result is. Since the number of dice required can change for every scenario, my program implements this step using recursion. This allowed me to produce accurate results, but very slowly. Even a moderately complex calculation could easily take several minutes to complete. As such, looked for ways to optimize the algorithm to reduce the time taken.
Optimization – Matrix Symmetries
The first and biggest optimization that I implemented that decreased my running time by several orders of magnitude was to take advantage of symmetries in the matrix of all dice rolls I was generating. In other words, I made sure I never calculated results that varied only by the order of the numbers rolled.
Take this matrix showing all possible combinations of two four-sided dice as a simplified example:
Because a player doesn’t care what order they rolled their dice in (since all dice are rolled simultaneously), we can cut the number of dice rolled approximately in half, by including only those rolls where the second number is greater than or equal to the first.
As you can see, the second matrix doesn’t have any duplicate entries, but does mark the ones that need to be double-counted. As the number of dimensions increases, the multiplicative factor can become much larger than 2, based on the number of repeated values.
As the number of dice increases, so do the number of dimensions of the matrix. In these higher-dimension matrices, the savings from matrix symmetries increase exponentially.
Dice | Permutations | After Optimization | Percentage |
---|---|---|---|
1 | 20 | 20 | 100% |
2 | 400 | 210 | 52.5% |
3 | 8000 | 1540 | 19.25% |
4 | 160000 | 8855 | 5.35% |
And so forth.
Optimization – Miss Consolidation
The great thing about that optimization is that it always works, no matter what the scenario. The next one I did, however, helps in most common cases, but will occasionally offer little to no benefit.
Since all dice that roll higher than the target number are discarded without being used, it is unnecessary to roll all of them. I let the first failing die through in order to count it in the statistics for failures and misses, and I simply multiply the number of results by how many other failure states I rolled up. From the initial example of Fusilier Angus trying to roll a 12 or less, this:
Becomes this:
Obviously, the lower the target numbers involved, the greater the value of this optimization. Due to the way that this optimization stacks with the prior one, it frequently reduces the number of rolls calculated by well more than half.
Optimization – Multithreading
The final optimization I implemented was to make the tabulating of dice rolls multi-threaded. I start one thread for each of the 20 possible values of the first die, and then tabulate the results when all threads have completed. My hosting company gives me access to 2 CPU cores, so the calculation takes approximately half as long to complete. Due to the various optimizations in the prior sections, different threads will take different amounts of time to complete, but how the operating system balances them between the cores evens everything out.
Web App
With that done, I had the time consuming part of the calculations taken care of. The next step was to create a web frontend that allows you to select what sort of scenario you would like to run, and then hands the data off to the back end utility. This has been another significant challenge, but has overall been pretty straightforward. My tool is available here, for you to play around with if such things interest you. I periodically update it with new features and to keep it up-to-date with the latest releases for the game.
Prologue – Numerical Analysis
Ghost Lord Minecraft Skin
After I had already mostly completed work on this part of my tool, one of my fellow Infinity players from Maryland took the time to find a solution to this that is as close to closed-form as possible, using Mathematica and my tool to check his results. His description of his method is available in HTML or PDF, if you are interested.