![]() |
Re: Better, Simpler Programming Contest
Quote:
Agreed, poor example, just had to come up with something in a hurry. But if you were to halt the archer production, you would need to have a way of deciding when to start it again. if(x kill all y) then (no y) until (x is driven to extinction) ? Loop enough times and it wouldn't produce anything anymore. Maybe that would be a broader question of AI logic as a whole. :> |
Re: Better, Simpler Programming Contest
One thing at a time people!!! There's only so much that can be done. http://forum.shrapnelgames.com/images/icons/icon10.gif
But I love the ideas. http://forum.shrapnelgames.com/images/icons/icon10.gif http://forum.shrapnelgames.com/images/icons/icon10.gif http://forum.shrapnelgames.com/images/icons/icon10.gif The only problem is that to get the current value of a "unit population" would require getting that information from Dominions, which we can't do without decompiling it, which I'm QUITE sure is against the EULA... But I also know that this program only has application inside of Dominions, so I'm still going to make it, and it's still going to produce a "balance" of units on the first turn. And I'd just like to note that by using a "unit population" reinforcements would be made for armies who suffered casualties in any of their Groups, and would be made at the same time that further "balanced" armies were being made. http://forum.shrapnelgames.com/images/icons/icon10.gif |
Re: Better, Simpler Programming Contest
Alright, my current program produces these results from the new test data:
1 lavawarrior 1 morningstar 2 battleaxe 1 salamander 3 humanbred Gold Remaining: 15 Resources Remaining: 10 Holy Remaining: 3 Score for units: 384 Score for Resources: -224 (Edit from -72 cause it was wrong) Total Score: 160 (Changed cause of Edit) Original Test data produced these results: 4 c 1 d 2 b 6 a Gold Remaining: 6 Resources Remaining: 17 Holy Remaining: 0 Score for units: 129 Score for Resources: -3 Total Score: 126 I added in a simple calculation to make units that cost more gold and resources combined will be added less frequently then those that cost less. What do you think of the results? http://forum.shrapnelgames.com/images/icons/icon10.gif [ March 03, 2004, 20:33: Message edited by: LaFollet ] |
Re: Better, Simpler Programming Contest
Quote:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">unittypes=5 unitname=humanbred gold=15 res=11 holy=0 value=29 unitname=battleaxe gold=20 res=27 holy=0 value=53 unitname=morningstar gold=20 res=30 holy=0 value=58 unitname=salamander gold=70 res=1 holy=0 value=42 unitname=lavawarrior gold=55 res=30 holy=1 value=91</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">I would say the output is non-optimal http://forum.shrapnelgames.com/images/icons/icon10.gif For example, adding 2 morningstars and removing 2 battleaxes gives you the following results: 1 lavawarrior 3 morningstar 1 salamander 3 humanbred Gold Remaining: 15 Resources Remaining: 4 Holy Remaining: 3 Score for units: 394 Score for Resources: -72 Total Score: 322 ...and simply removing the salamander would increase the score: 1 lavawarrior 3 morningstar 3 humanbred Gold Remaining: 85 Resources Remaining: 5 Holy Remaining: 3 Score for units: 352 Score for Resources: -2 Total Score: 350 So it produces a valid output, but is not quite optimal yet http://forum.shrapnelgames.com/images/icons/icon12.gif Actually... in retrospect... something is wrong with your "resources" number. Are you using the correct values? For "Abysia" I set them at gold=-1, res=0, holy=6, so using 230 gold and 1 holy should result in a resource score of -1*230 + 6*1 = -224. |
Re: Better, Simpler Programming Contest
While I find all of this intriguing, unfortunately I know nothing of 'real' computer programming. However, I would be willing to try to work out 'base values' for units.
Something that may help is to base unit value off of something that I would refer to as 'survivability', and this value would be calculated as HP/Min((Avg. Dmg. - Prot.), 1) As you can see, Survivability is the average number of hits one can take before dying. While this favors heavy infantry... I believe that is the current trend among players. I'd like to factor Morale in as well, but I'm not sure how. Let's take an example of HI and LI. Both have 10 HPs, and let's assume that the HI has Prot of 11, the LI has Prot of 6. Finally, let's assume the average damage in this game is 12. The HI would have a SUR value of 10/(12-11), or 10. The LI would have a SUR value of 10/(12-6), or 1.67. This would mean that HI is worth 6 times as much as LI, from a pure survivability standpoint. Now, one method of determining average damage that I think would be interesting is to have it compute the average damage of all units that he is aware of. By 'aware of', I would mean that it would calculate based on all National units of nations that it is in contact with. If it can access ind. province's information, it would also include their information as well. I kind of like, though, how giants skew everything. http://forum.shrapnelgames.com/images/icons/icon12.gif With giants in the game, the computer would probably tend to produce LI. Anyway, more later. Bayushi Tasogare |
Re: Better, Simpler Programming Contest
I never said it was optimized, I just said that it was the current results, which is pretty nice mix of units, if not the best mix of units for the resources provided, and as far as resource cost go, I think I forgot to count spent gold against and unspent gold for... Not really the what I've been focusing on. http://forum.shrapnelgames.com/images/icons/icon10.gif
Also, you can increase the score by removing the salamander, but that's only because the resources the salamander use are more valuable then the salamander is, but that's just using the current "value" system, which isn't what we've agreed on using anyways. http://forum.shrapnelgames.com/images/icons/icon10.gif The real point of this is the fact that this queue design will allow for all types of units that can be produced to be produced, not adding in the possiblity of using "unit population" numbers. EDIT Not what I thought it was, had the resource score values hard coded, even though I had the values being loaded with all the other data. http://forum.shrapnelgames.com/images/icons/icon10.gif Will fix and edit the results post. Edit Been playing around with the delay I built in, made it so it can be changed to emphasize the value, resources, gold, or holy. All this does is change how long a unit will wait to be added into the queue so that units with less of whatever the emphasized resource is will be made more often. These are the best results got by emphasizing Holy: 1 lavawarrior 2 morningstar 2 battleaxe 1 salamander 1 humanbred Gold Remaining: 25 Resources Remaining: 2 Holy Remaining: 3 Score for units: 384 Score for Resources: -214 Total Score: 170 Also worthy of note, 7 units are produced this way, with the max units produced with "emphasizing" being 8 with a score of 156 [ March 03, 2004, 21:14: Message edited by: LaFollet ] |
All times are GMT -4. The time now is 02:10 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.