Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

A maths problem (OT)

Posted on 2000-05-04
27
Medium Priority
?
296 Views
Last Modified: 2010-05-02
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
Comment
Question by:Arachn1d
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 13
  • 9
  • 2
  • +3
27 Comments
 
LVL 3

Expert Comment

by:Gordonp
ID: 2779961
How much food or wood can a gatherer gather in 1 time period.

0
 
LVL 5

Expert Comment

by:KDivad
ID: 2780156
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
 
LVL 5

Expert Comment

by:KDivad
ID: 2780161
Also, how much do you wish to gather? You say "in the shortest amount of time", but you don't say how much.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 17

Expert Comment

by:calacuccia
ID: 2780322
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
 
LVL 17

Expert Comment

by:calacuccia
ID: 2780326
>The fame is...

The game is...
0
 
LVL 1

Expert Comment

by:Vingamel
ID: 2780588
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
 

Expert Comment

by:AlessandroF
ID: 2780692
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
 
LVL 5

Expert Comment

by:KDivad
ID: 2780931
<<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 Comment

by:Arachn1d
ID: 2782485
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
 
LVL 5

Expert Comment

by:KDivad
ID: 2783358
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
 
LVL 5

Expert Comment

by:KDivad
ID: 2783373
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 Comment

by:Arachn1d
ID: 2783473
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
 
LVL 5

Expert Comment

by:KDivad
ID: 2783489
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 Comment

by:Arachn1d
ID: 2783703
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
 
LVL 5

Expert Comment

by:KDivad
ID: 2784069
<<...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 Comment

by:Arachn1d
ID: 2784562
Adjusted points from 50 to 100
0
 

Author Comment

by:Arachn1d
ID: 2784563
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
 
LVL 5

Expert Comment

by:KDivad
ID: 2798825
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
 
LVL 5

Expert Comment

by:KDivad
ID: 2798828
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 Comment

by:Arachn1d
ID: 2802025
Ok, thanks. I was beginning to wonder...
BTW, _thanks_ for all your help!
0
 
LVL 5

Expert Comment

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

Author Comment

by:Arachn1d
ID: 2806481
Oops, sorry. Yes.
0
 
LVL 5

Expert Comment

by:KDivad
ID: 2807278
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 Comment

by:Arachn1d
ID: 2807418
Well, thanks for all the work, and if you don't have any success, you still deserve the points, IMHO.
0
 
LVL 5

Accepted Solution

by:
KDivad earned 400 total points
ID: 2829756
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 Comment

by:Arachn1d
ID: 2829835
All the effort you have put in is more than enough for me. Thanks for all your help!
0
 
LVL 5

Expert Comment

by:KDivad
ID: 2832089
Glad I could at least help get you started!

Until next time...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question