• Status: Solved
• Priority: Medium
• Security: Public
• Views: 307

# A maths problem (OT)

Sorry, this is way Off Topic, but there are bound to be some people with maths knowledge here.
I have a game in which I have to collect a certain amount of food (f), and a certain amount of wood (w). I start off with 3 gatherers (g). For 50 food, I can create another gatherer. What is the optimum number of gatherers to create, and in what proportions should I assign them to wood or food in order to gather the resources in the shortest amount of time?
0
Arachn1d
• 13
• 9
• 2
• +3
1 Solution

Commented:
How much food or wood can a gatherer gather in 1 time period.

0

Commented:
How much food or wood does a gatherer consume?
Is there a point at which a gatherer can no longer gather (although they will still be consuming) because there's no area left to gather from? If not, then there's not really an optimum level as more gatherers gather more.
0

Commented:
Also, how much do you wish to gather? You say "in the shortest amount of time", but you don't say how much.
0

Commented:
The fame is Age Of Empires II.

What can be collected is actually Food/Wood/Gold and Stone.

All resources have their advantages and will make you progress in time, allowing to construct Civil Building, Military Building, Trading Buildings, later on Military units, Magicians, and all kind of arms.

There is no optimum for this. The best number of Food collectors/Wood collectors is depending on the strategy of the opponents.

You can gather enormous amounts of food, and concentrate on the technological progression, but when the opponents concentrate on military force, you will be slammed.

So it all depends on too much factors you did not mention.
0

Commented:
>The fame is...

The game is...
0

Commented:
Arachn1d, is this a game you are writing, or are you asking a question about a game on the market?
--Vingamel
Site for my own game: http://www.jarnath.freeservers.com
0

Commented:
1- At start the 3 gatherers must take   only food,

2- then you must create 2/3 of food's gatherers and 1/3 of wood's gatherers.

3- To optimize the cicle you can change each time T the gatherers that make food with the gatherers tha make wood.. at time.

[The total number of gatherers is in relation with the (time,speed) and is there are another type of gatherers that you want made]

enjoy with gatherers!

0

Commented:
<<The game is Age Of Empires II.>>
The game also sounds a lot like Civilization (though you are more limited in how you "gather" stuff). In civilization, only the first 20 "gatherers" per city can actually do anything. So in this situation, there is an optimum, but it partly depends on what you actually have as your main priority (technological advancements, population growth or military expansion).

As everyone else said, there are just too many factors that aren't mentioned.
0

Author Commented:
Yes it's age of Kings (or AOEII), but here's what I meant:
I want a general formula based on the following assumptions:
1)Resources are unlimited
2)One time period _is_ the time it takes for one gatherer to gather one unit of resource
3)There are two types of resource - those that help you create new villagers (food), and those that dont (wood,gold,stone). For the purpose of this, wood, gold, and stone are much the same.
4)There is a point where it costs more food to create another gatherer than it does to advance. Example: You need 500 food and have 10 villagers. Each can gather 50 food to make another villager, but in that amount of time you will have 500 food anyway.
5)We already know how much food/wood we need.

I deliberately left out the amount of each resource because I wanted a generalised formula. eg. in terms of amt of food and other, what ratio should be used, and how many villagers.

I want this because I am trying to write and optimise an AI for AOK.
If we assume there is only 1 type of resource food, it costs 50 to make a villager, and 500 is how much we need, then you can graph the equation with:
t=50/1 + 50/2 + 50/3 + ... + 50/v + 500/v
Where v is the no. of villagers and t is the time taken. What I need is an equation that takes other resources into account.
0

Commented:
I am making a guess here: 2 gatherers can each gather 25 food to make another gatherer (2 * 25 = 50). Am I right? If so, then the optimum number of gatherers (if they are devoted to food gathering) is equal to the total amount of food you need to gather divided by 83 1/3. For instance: You need 100 food. 100 / (83 1/3) = 2 (round up). 1 gatherer gathers 50 food and makes another gatherer. 50 turns so far. These two gatherers can gather the total 100 in 50 more turns. Need 200: Optimum is 3. 1 gathers 50. 2 gather 25 apiece. 75 turns so far. 3 gets the full 200 in 67 turns. 142 turns total. If each of the 2 gathered 50 apiece to make 4, 100 turns have elapsed. The 4 gather the 200 in 50 more turns. Total = 150. If the 2 instead go for the full 200, it takes 100 turns. Total = 150.

For a combination of (for example) 700 food and 300 stone, I would say the optimum is 12 (1000 / (83 1/3)). Create all 12 gatherers first thing then use the lot of them to gather the 1000 units.

Hope this is what you needed!
0

Commented:
Also, if my guess above was right, make the gatherers as fast as you can (make each one as you get enough food, don't make them in bulk). If the optimum is 4, then: 1 makes a second (50). 2 makes a third (25). 3 makes a fourth (17). This total is 92. 1 makes a second (50). 1 and 2 make third and fourth (50). This totals 100.
0

Author Commented:
Where did you get 83 1/3 from?
Here is how it works: Each gatherer can gather one resource. Many gatherers can gather the same resource. We can only build more gatherers if we have enough food for them. So, my equation is t = 50/1 + 50/2 + ... + 50/(n-1) + 500/n
for n gatherers - eg. 1 gatherer takes 50 turns to gather the 50 food needed for the next one. 2 take 25 for the 3rd 1, etc. These amounts are added, plus the total amount required (500 in this case) divided by number of gatherers getting it. My problem is the issue of other resources - when you gather stone, it cant be used to make more gatherers, so we need a higher proportion of food gatherers to make up for that, etc.
0

Commented:
I understand what you are saying...

I got 83 1/3 by making lists of gatherers and figuring out the number that were required to gather the necesary resources the fastest. It always came up to 83 1/3. The other resources can be handled in an identical manner. Using my idea, you aren't gathering food for storage(?) until you have the optimum number of gatherers. They ALWAYS use every bit of food gathered to make more gatherers until you have the number of gatherers you need. After that, food is no longer required to make new gatherers and is therefore essentially the exact same thing as wood/stone/etc.

Come up with some numbers to gather. (like in my example, 700 food and 300 other) You should find that the optimum number of gatherers is always going to be:
RoundUp(TotalResourcesToGather / (83 1/3))

If you find a situation where this number doesn't work, let me know.

It is simple logic: Until you have all your gatherers, you're using all the food to make new ones. Once you have all your gatherers, the food is no longer needed to make new ones, so it is the same as "other".
0

Author Commented:
I see what you mean. The only problem is that if you are gathering only food until you have the optimum no. of gatherers, you will have no other resources to do anything with. eg, in AOK, you need wood for houses.
Also, how did you calculate/work out the ideal number of gatherers?
0

Commented:
<<...only food until you have the optimum no. of gatherers...>>
I wondered about that, but found nothing in your phrasing to determine that the wood/etc. was put to use so I wasn't sure. (Bear with me, I've never played the game...) That makes it a lot trickier. Do you need to have the houses built before you have all the gatherers made? Or do you just need the wood/other gathered all along and done by the time the food is all gathered?

<<Also, how did you calculate/work out the ideal number of gatherers?>>
I just wrote out lists of stats. It's not important though, as the number is wrong now.
0

Author Commented:
Adjusted points from 50 to 100
0

Author Commented:
Yes, I do need to gather the wood at the same time in order to build houses. My original idea was to collect it in such proportions that they would all be finished at the same time, food for gatherers and food required included. However, other than 30 wood for a house per 5 gatherers, it's not essential to build anything until you have them all.

P.S. With all the effort you are putting into this question, I felt guilty only giving it 50 pts :)
0

Commented:
Fascinating.
I was beginning to wonder if I had turned notification off because I wasn't getting a response from my last post... Now that I have finally found the question again, I see that my last post never made it for some reason.
0

Commented:
Summary of the missing post:

If you have 10 gatherers, you need 2 houses, right? Let me know and I'll see if I can come up with something...
0

Author Commented:
Ok, thanks. I was beginning to wonder...
BTW, _thanks_ for all your help!
0

Commented:
Unless I missed something, you didn't answer my question: If you have 10 gatherers, you need 2 houses, right?
0

Author Commented:
Oops, sorry. Yes.
0

Commented:
I thought so. That's the amount I've been trying towards, but I've not had much luck so far. I just can't find an appropriate formula yet.

Still thinking...
0

Author Commented:
Well, thanks for all the work, and if you don't have any success, you still deserve the points, IMHO.
0

Commented:
I've had no success in coming up with a formula. It's just been too long since I was in school and I'm out of practice. If you like, you can delete the question. If you don't delete it and I finally figure something out I'll come back to post the idea.
0

Author Commented:
All the effort you have put in is more than enough for me. Thanks for all your help!
0

Commented:
Glad I could at least help get you started!

Until next time...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.