[UP] Hell-Raven BETA 4

Upload your latest creations here.
Please note that by posting comments to posts in this forum you forfeit your personal copyright on whatever you post. AI Scripters reserves the right to re-use objective comments in script reviews without requiring the posting author's permission. Credit, where appropriate will be given in such cases.
User avatar
Campeador
Waheguru
Posts: 1340
Joined: Mon Nov 01, 2010 8:11 am
Location: Spain

Re: [UP] Hell-Raven BETA 4

Post by Campeador »

I wanted to speak about our ideas for our gatherer percentages manager.

I'm developing my own from an Marathon's idea in his thread to share tips and tricks for UP:
http://forums.aiscripters.com/viewtopic.php?f=3&t=2552

Cruzada uses it fix a similar build order for my dark age (or when I have less than 16 villagers) to my old Crusade. The number of foodies and woodies have changed because Up requires something different, but the philosophy to fix it is the same: empirical essay and error until get correct gatherer percentages. Although Cruzada system allows it without needing any excel file to calculate exact percentages and an easier to implement code.

About feudal and later ages, my last updated version also makes the same than Crusade: determine several age phases with a fixed percentage of woodies and stonies, get a standard percentage for and gold but allowing to change it sending a small percentage from food to gold or viceverse. Diferences:
- It's easier in Cruzada because UP helps.
- Cruzada allows 5 steps instead to 3. Apart from average, high or low foodies percentage, it allows very high and very low. Obviously very high for food means very low for gold and viceversa.

I am trying something very different now. Set a minimal number of foodies, woodies, etc depending of the units that I am training now, their cost, number of buildings and even training time. I've calculated it with the mentioned excel file. For example:

Code: Select all

(defrule
	(goal g-barracks militiaman)
	(up-get-fact building-type-count-total barracks g-math-4)
	(up-get-fact building-type-count-total barracks g-math-5)
	(up-get-fact building-type-count-total barracks g-math-6)
=>
	(up-modify-goal g-math-4 c:* 798)
	(up-modify-goal g-math-5 c:* 349)
	(up-modify-goal g-math-6 c:* 233)
	(up-modify-goal g-min-foodies g:+ g-math-4)
	(up-modify-goal g-min-woodies g:+ g-math-5)
	(up-modify-goal g-min-goldies g:+ g-math-6)
)
It means that in the feudal age, keep a barracks training swordmen with no stop, if you have completed every feudal techs, require 7'98 farmers (I've multiplied the number by 100 to get more exact number when additioned with other types of units), 3'49 wood cutters and 2'33 gold miners. The woodies are needed not only because every 5 swordmen require a house, it's also because to farm 275 food (if first mill upgrade researched) you need 60 wood.
So for example a Hun scout needed 10 farmers (not calculated) it should require too 10*60/275=3/XX woodcutters.

You also can get different rules to consider that you haven't wheel barrow yet or calculate without upgrades and consider them later to adapt to several possibilities. Not only about upgrades like conscripting, which increases the number of villgaers for some units, you acn even do it for possible bonuses, like a possible Briton ally for your archery units.


And once you get the minimal number of villagers to keep unit training, Cruzada in the first age phases uses a fixed gatherer percentages for the rest of villagers (g-extra-food-percent and alike), and in the later ones it calculates them.

For example, imagine that you have every needed building and ugprade and you want 1000/800 gold. Well, you can set for example follow these steps:
1- Set default value for extra woodies and goldies (10 and 25 or alike)
2- Food "should be" 100/80 higher than gold, otherwise multiple that default 25. For example, if the proportion is 200/80 multiply extra gold miners by 2, because food amount is twice higher compared to gold than it should be.
3- Depending of the mill upgrade you'll need to convert part of such extra foodies into extra woodies (see Hun scout example).

Although I recognize that I still have problems with this system. My feudal age now works with the same result than my previous system, and my castle age start too. But later my eco becomes hugely unbalanced, ruining my games. I don't know if I have bugs, I just need tests to set correct number or if the system is wrong itself.



I've read Hell&Raven and I see that you have a not so different idea. Probably I am wrong , but I'd say that want to calculate how much food do you need for your planed units with delta-food-cost (and perhaps this goal is too for planed upgrades or possible age jumps). Same with delta-wood-cost and alike, using the total number of need resources total-delta-units to set proportions and percentages. Isn't it?

I ask to know your ideas about how to implement, or even to know if your idea is very different to what I believe.

Of course, if you prefer to keep your ideas secretly I'll understand it, but be sure your secret will die once you script and upload it. :devil :rolleyes:

In any case I am glad to have you here. You always have good and creative ideas for AI scripting, I even use sometimes your Goemul to test the resistence of Cruzada vs trushes (and I'll have to use too Tlamacazqui). Welcome back to the world of :head . B)

User avatar
jdstankosky
Guru
Posts: 911
Joined: Thu Nov 25, 2010 12:30 pm
Location: Florida, USA
Contact:

Re: [UP] Hell-Raven BETA 4

Post by jdstankosky »

I haven't looked at the Hell-Raven code in a while, but I think you understand the basic idea fairly well. HR attempts to calculate the total number of resources needed at any given time, and then distributes the villager labor in the same portions as the demand for resources.

I think the biggest issue this method seems to face at the moment is the lack of forethought. I haven't messed with it in a while (like I said) but I think it fails to plan ahead. Like, if its core strategy is to advance to imperial age as soon as possible, then it's easy for the AI to know what the resource demands are going to be for vills, houses, farms, required buildings and the delays aren't as noticeable, but once you start adding layers of complexity in battle strategy, the system just doesn't seem to be able to mimic human intuition. Where a human player might feel like it should add a handful of hunters and choppers to prepare pikes for some cavalry units that may or may not show up soon, HR is much slower and thus the resource gathering is much slower because it simply isn't aware of any POTENTIAL threats. The current system works well to accommodate for CURRENT threats.

It will definitely take a lot of work to try to add that kind of intuition into the AI, but I definitely think it's possible. The more I work on the AI, the more it's going to to develop some kind of personality similar to my real play style. I think where I left off was trying to accommodate for ALL possible starting situations, develop scouting logic, and strategically think about allies and starting positions in team games throughout the entire game, not just the start. I dunno, there's a lot on the to-do list, lol.

I'm wrapping up my vacation/holiday and should be home in a few days. I'll dig into it further then. I don't even have the ability to view the source code here, haha.
Do not try to script a counter for everything. That is reactionary, and always slower than taking the initiative in battle. Decide from the start what you are going to do, and do not waiver from it. Own it.

User avatar
ER
Waheguru
Posts: 2764
Joined: Sat Nov 08, 2003 9:23 am
Location: Johannesburg, South Africa

Re: [UP] Hell-Raven BETA 4

Post by ER »

Any news ? :)
Stephen Hawking held a party for time travelers.
He sent the invitation out the day after. Nobody attended.

Ah coffee. The sweet balm by which we shall accomplish today's tasks. ~ Holly Black

User avatar
jdstankosky
Guru
Posts: 911
Joined: Thu Nov 25, 2010 12:30 pm
Location: Florida, USA
Contact:

Re: [UP] Hell-Raven BETA 4

Post by jdstankosky »

No good news, I'm afraid. Suffered some major hardware failures in my laptop and have since rebuilt it, and I haven't checked my archival drives for any of my scripting changes. It's entirely possible that I've lost any changes I might have had, as well as any other projects I might have been working on.

Now I'm trying to liquidate some assets to move to another state. It's been a really rough year so far in 2015.
Do not try to script a counter for everything. That is reactionary, and always slower than taking the initiative in battle. Decide from the start what you are going to do, and do not waiver from it. Own it.

scripter64
Waheguru
Posts: 5891
Joined: Fri Jan 16, 2009 8:36 pm

Re: [UP] Hell-Raven BETA 4

Post by scripter64 »

That's :' I hope you can recover your stuff.
Best wishes, jd!

Post Reply