# Need equation(s) for PC strategy game.

1. Feb 5, 2012

### ViRTue

I'm having some trouble figuring out several different things. 1) How big an army can I make based on the amount of gold I have. 2) How much of each resource will I need to purchase to create said army. 3) How much of 1 resource would I need to buy given how much of the other I already have to maintain my 3:2 army ratio. There are 6 different units each requiring different amounts of each resource to create. There are only 2 resources WOOD and IRON. I really only prefer 2 different units, ARCHERS and PIKES. Ideally I try for a 3:2 ratio of PIKE to ARCHER. To create 1 unit of each it cost 3 IRON + 6 WOOD for PIKE and 13 WOOD for ARCHER. Each resource costs 2 gold from the merchant to buy, or I can just gather the resources myself, but sometimes both resources aren't available. If there is any other information needed that I may have left out just let me know.

P.S.- If anyone is wondering what game, it's Lords of the Realm 2. Old, I know, but still loads of fun.

2. Feb 6, 2012

### chiro

Hey ViRTue and welcome to the forums.

So just to clarify, these are the rules for buying soldiers:

1x PIKE = 3xIRON + 6xWOOD
1x ARCHER = 3xIRON + 13xWOOD

1xIRON = 2xGOLD and 1xWOOD = 2xGOLD

Now you said have a 3:2 ratio of PIKE:ARCHER and you want to maintain your 3:2 ratio.

If there are no other constraints then all you have to do is for every five new soldiers get three new pikes and two new archers, but from the context of your question it seems that there might be other constraints. You mentioned the fact that you can't always find resources so thats definitely one constraint.

Lets say you want to figure out how much gold for 3n PIKES and 2n ARCHERS to keep your 3:2 ratio.

In terms of gold for 1 PIKE you have 3xIRON + 6xWOOD in terms of gold = 3x2xGOLD + 6x2xGOLD = 18xGOLD and for 1 ARCHER you have 3xIRON + 13xWOOD in terms of gold = 3x2xGOLD + 13x2xGOLD = 32xGOLD. This means for n 'bunches' of 3:2 ratio soldier groups you have 18xGOLD + 32xGOLD = 50GOLD for 5 soldiers in your 3:2 ratio. More groups of 5 soldiers are just multiples of that.

Is this what you are looking for? Are there any other constraints?

3. Feb 6, 2012

### ViRTue

1x Archer = 13 Wood
1x Pike = 3 Iron + 6 Wood
1x Wood = 2 gold
1x Iron = 2 gold
X amount of gold = # of troops? (3:2)P:A
X amount of gold = # of resources

Yes that is along the lines of what I was thinking but I fail to create a universal equation I can just plug numbers into. I would like to find out how many units I can create given a certain amount of gold, and how much of each resource I need to purchase to create said troops.

Also the way the game works is you gather certain amounts of resources every turn from a "county" sometimes they don't always have Iron in them so I need to purchase that from the merchant. So I would like to know how much I need to buy to match the amount of wood I have to create my 3:2 army.

Was hoping to find something that would work in a spreadsheet but if I could figure out an equation to solve all these values I could easily transport it into spreadsheet.

4. Feb 6, 2012

### chiro

Well for these kind of problems the first thing to do is figure out the units of everything and what specific unit you are trying to find. From that you end developing ways to convert one unit to another (like wood to gold or iron to gold) and then from that you generate a formula.

So I'll do one and let you go about doing the rest.

So lets say we want to find the amount of gold for a pike. Now a pike needs iron and wood so we have to also find the amount of gold for a unit of wood and the amount of gold for a unit or iron.

We know that the amount of gold for iron and wood is $2 a piece. So our rate for [gold/piece of iron] = [gold/piece of wood] =$2.

Now we need to figure out [gold/pike]

7. Feb 6, 2012

### ViRTue

Yes, I just need some help simplifying this massive story problem into a single equation, if possible.

Should I have started this thread in a different subforum?