Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Designing -> Programming: Farmers, Traders, and Soldiers  (Read 1606 times)

RustedAxe

  • Bay Watcher
    • View Profile
Designing -> Programming: Farmers, Traders, and Soldiers
« on: July 27, 2009, 02:15:43 pm »

The game is about achieving a balanced economy with a formidable army.

I started designing this game last weekend and this is what I have come up with.  I should start that this project was designed under considerations that it could be programmed in less than 48 hours with my poor oh so very poor programming abilities.

Economy:
Farmers make food.  They can support one extra person.  Traders require one food.  They create one extra gold.  Soldiers require one food and one gold.  They're required to protect your village -> kingdom.

You want a balanced economy, so that means, preferably, you don't want more farmers than soldiers and traders total, because that would put you with food loss.  And, you wouldn't want more traders than soldiers, because then you're at a gold loss. 
=====
Now, the tricky part!
Before, you were asked a question on whether you want a farmer.  Or it might ask whether you want a trader, or a soldier, and basically you're just trying to answer as quickly as possible,
correctly, both to balance your economy and create a strong army to defend your lands.  Now, I've completely revamped that question system since.  It is now a puzzle type question. 

I'll start simple.

One Farmer -> ?
Your task is to find out what this can offer, or in another way, how to balance this so that it turns out neutralized to zero.
One Farmer makes one food.  Thus, to even it out, the answer would be one Trader; one Trader takes one food.
So One Farmer + One Farmer -> ?
Answer is two traders.
So if you say, "yes, I agree this to!", you gain two traders.  You can also say no.  Basically, you are the leader who can only communicate Yes or No.
Gaining two traders would end up pretty badly though in the beginning, as you would have no farmers to support them.  Thus, you lose.

So One Trader -> ?
Well, a trader makes one gold and takes one food.  So you end up with this -1f (negative one food) and 1g (plus one gold).  To even it out, you would need one farmer to cover up the cost of the trader.  Thus, you would gain one extra farmer if you answered yes.  But there is that 1g increase, and to balance that, one soldier will be required to balance that to neutral.  But since a soldier requires one food also, you would also need one more farmer added onto that first farmer.

Say yes, you gain two farmers and one soldier.  Say no, you gain nothing.  As you could see from the example where you gain traders, saying no has its advantages.  You want to balance your economy, not just hire anyone.

I've explained some very simple possibilities.  It could be 2 Farmers + 1 Trader - 1 Soldier - 2 Traders, or 2 Farmers / 1 Trader (2f/(-1f + 1g))  No wait, that doesn't work?  Yeah... oh, headache.  I just gave my poor math unskilled brain a headache.  If anyone is good at math and can give me different ways for equations, or whether 2 Farmers / 1 Trader is even possible, even if my brain tells me no no no, I'd love to hear it.  I gotta take a long break to cool my fragile grey matter.

This is the economy arc, the combat arc is very much underdeveloped due to both my perceived time restrictions and... nothing creative coming up in that old noggin' :)

That 48 hours programming time limit hasn't started yet, so I'm just simply designing till that time comes (I did program up this economy simulator + puzzle question system though in a simple console application... cheating!  Just don't tell!).

Thank you for reading, and I create this topic for any and all suggestions! 
(Especially math related suggestions!)

- Andy
Logged

cerapa

  • Bay Watcher
  • It wont bite....unless you are the sun.
    • View Profile
Re: Designing -> Programming: Farmers, Traders, and Soldiers
« Reply #1 on: July 27, 2009, 02:26:13 pm »

You would need 50% farmers and 25% traders and 25% soldiers.

Pretty simple.
Logged

Tick, tick, tick the time goes by,
tick, tick, tick the clock blows up.

RustedAxe

  • Bay Watcher
    • View Profile
Re: Designing -> Programming: Farmers, Traders, and Soldiers
« Reply #2 on: July 27, 2009, 02:30:21 pm »

Right, knowing what the stable economy is is simple enough.  The thinking is on answering yes or no to those puzzle questions so that you don't mess that 50/25/25 economy up, and it wont always be as simple as 1 Farmer -> ? or 1 Trader -> ?  (they'll get more tricky over time)

*that, along with the constant danger of being attacked, means you would have to think quick, and thus, possibly erroneously.
« Last Edit: July 27, 2009, 02:36:47 pm by RustedAxe »
Logged

cerapa

  • Bay Watcher
  • It wont bite....unless you are the sun.
    • View Profile
Re: Designing -> Programming: Farmers, Traders, and Soldiers
« Reply #3 on: July 27, 2009, 02:33:30 pm »

Its like blackjack. You need the right numbers.

Seems awfully luck based.
Logged

Tick, tick, tick the time goes by,
tick, tick, tick the clock blows up.

RustedAxe

  • Bay Watcher
    • View Profile
Re: Designing -> Programming: Farmers, Traders, and Soldiers
« Reply #4 on: July 27, 2009, 02:39:16 pm »

Its like blackjack. You need the right numbers.

Seems awfully luck based.

That's why you can say yes And... here's the kicker, you can say no.
Say yes to the ones that are beneficial to your current situation, no to the ones you don't want to go with.  Not to say that there isn't luck, it's about as much luck as Tetris has, skillful players will be able to answer quickly and accurately, while newer players will have to think carefully, or not so carefully, through on their actions.
Logged

Muz

  • Bay Watcher
    • View Profile
Re: Designing -> Programming: Farmers, Traders, and Soldiers
« Reply #5 on: July 29, 2009, 05:04:32 am »

I shall bring in my experience as a semi-pro gamer and game designer to break your system.
F -> Number of Farmers, S -> Soldiers, T -> Traders

My strategy would be:
F = S+T+(Expected F deaths)*(Probability of death)

S would be kept to an absolute minimum, especially during a peaceful era.
Or T would be kept low if I was swimming in gold.
So, yeah, the only reason to have extra farmers is if you expect to lose them.
Logged
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Zironic

  • Bay Watcher
  • [SDRAW_KCAB]
    • View Profile
Re: Designing -> Programming: Farmers, Traders, and Soldiers
« Reply #6 on: July 29, 2009, 01:04:16 pm »

I shall bring in my experience as a semi-pro gamer and game designer to break your system.
F -> Number of Farmers, S -> Soldiers, T -> Traders

My strategy would be:
F = S+T+(Expected F deaths)*(Probability of death)

S would be kept to an absolute minimum, especially during a peaceful era.
Or T would be kept low if I was swimming in gold.
So, yeah, the only reason to have extra farmers is if you expect to lose them.
F = f
T = -f + g
S = -f + -g
$ = profit
2F = T + S
3F = 2T + S + g
4F = 2T + 2S,  3T + S +2g
5F = (2T + 2S + f), 3T + 2S + g, 4T + S + 3g
6F = 3T + 3S, 4T + 2S + 2g
7F = 4T + 3S + g, 5T + 2S + 3g
8F = 4T + 4S, 6T + 2S + 4g
9F = 5T + 4S + g, 7T + 2S + 5g
10F = 5T + 5S, 8T + 2S + 6g
11F 6T + 5S + g, 8T + 3S + 5g
(If it worked in turns and you could store gold and you gained a farmer each turn then)
10th Turn = 10F = 5g (with 5T and 5S), 26g (8T and 2S)
(1)nF = (n-(n/5(rounded up)))T + (n/5 (rounded up)S + ((n-(n/5(ru)))T-(n/5(ru))S)g
or
(2)nF = (n/2 (rounded up))T +(n/2 (rounded down))S + ((n/2(ru))T -(n/2(rd))S)g
The main problem here, is what is the use of the soldier? Does he give you something in return currently?
I would suggest using the second equation during war time, as it means that you'll always have the maximum amount of soldiers possible, especially when working with an even amount of farmers.
The first equation means, that you'll always have an ever increasing amount with a small amount of soldiers. Eventually you might want to switch to the 1st method after acquiring a large number of soldiers. Method 1 is the most basic 2F = T + S, while method two, involves considering a much slower increase of soldiers. I don't know how effective each individual soldier is, and method 2 can be adjusted to accomidate more or less.

I'd probably use something that skirts both

2F = T + S
3F = 2T + S + g (1g)
4F = 3T + S + 2g (3g)
5F = 3T + 2S + g (4g)
6F = 4T + 2S + 2g (6g)
7F = 4T + 3S + g (7g)
8F = 5T + 3S + 2g (9g)
9F = 5T + 4S + g (10g)
10F = 6T + 4S + 2g (12g)
nF = (n - (n/2.5 (rounded))T + (n/2.5 (rounded to the nearest int (2.51 goes up, 2.49 goes down)) S + (n-(n/2.5(rd))T - (n/2.5 (rd))S)g

Sorry for the roundings, I don't exactly know how to write algorithms.

And if the point of the game is just to gain Soldiers - no excess money.
2F = T +S
4F = 2T + 2S
6F = 3T + 3S
etc
You'd want to increase your farmers evenly.
« Last Edit: July 29, 2009, 01:06:59 pm by Zironic »
Logged

RustedAxe

  • Bay Watcher
    • View Profile
Re: Designing -> Programming: Farmers, Traders, and Soldiers
« Reply #7 on: August 01, 2009, 01:16:46 pm »

I shall bring in my experience as a semi-pro gamer and game designer to break your system.
F -> Number of Farmers, S -> Soldiers, T -> Traders

My strategy would be:
F = S+T+(Expected F deaths)*(Probability of death)

S would be kept to an absolute minimum, especially during a peaceful era.
Or T would be kept low if I was swimming in gold.
So, yeah, the only reason to have extra farmers is if you expect to lose them.

I tweaked the system.  Instead of farmers and traders accumulating a stockpile of food and gold, they will govern the morale, morale affecting (so far) the combat efficiency of the soldiers.  I also tweaked how after combat works, as I realized if soldiers only kept on dying and I went with the same puzzle question for hiring, a player could just keep on tapping 'yes' as there would be little repercussion (food and gold would also be skyrocketing at this point).  So after battles, farmers and traders will start to mix up into the soldier makeup to reset it at 50/25/25.  Farmers and traders being worse soldiers.

So because of 'tapping yes' after battle problem and the skyrocketing food/gold, that's why I've went with the morale and reset system.
Logged

RustedAxe

  • Bay Watcher
    • View Profile
Re: Designing -> Programming: Farmers, Traders, and Soldiers
« Reply #8 on: August 01, 2009, 01:19:43 pm »

The main problem here, is what is the use of the soldier? Does he give you something in return currently?

Right now the system is to have a healthy supply of soldiers as you won't know when a enemy will raid you.  So would you risk going with a high economy and low soldier count or keep things as close as possible to 50/25/25.  However, as shown in my last post, while the system has changed, you wouldn't want to lose a majority of your soldiers as that will leave you with a lot of farmers and traders to take their place, in which they will only be replaced with soldiers over time (as you solve the puzzles in their respective spots).
Logged