.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #30  
Old March 3rd, 2004, 09:55 AM

Leif_- Leif_- is offline
Sergeant
 
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
Leif_- is on a distinguished road
Default Re: Better, Simpler Programming Contest

Quote:
Originally posted by LaFollet:
Well this is my approach so far:
1) Load both the resource info and unit info from text files.
2) Sort the units based on their "value"
3) Start using up all the resources that I can to make as many of the highest valued unit that I can. (With the test this is limited by Holy, as it usually is in game.)
4) Use up as much other resources with the next unit with the next highest value.
5) Keep doing this until resources are used up.


Anyone have any thoughts? Comments? Suggestions?
This greedy approach will give you quite good solutions to the problem, but not necessarily optimal ones. The quickest way to find an optimal solution for a handful of units is probably a brute-force search; for slightly larger problems I suppose that stochastic search techniques such as genetic algorithms or simulated annealing will yield decent results quickly.
__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.