[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
jdstankosky
Guru
Posts: 904
Joined: Thu Nov 25, 2010 12:30 pm
Location: Florida, USA
Contact:

[UP] Hell-Raven BETA 4

Post by jdstankosky »

User Patch Only

Hell-Raven

Please note! This is an EXTREMELY early, and non-fully functioning script. There is no sense in expecting it to fight anything. As of this current version, it is a proof of concept!


It is able to advance to Imperial-Age. It doesn't have dynamic strategy yet. It is incapable of attacking or trading/tributing as of this moment. The gather percentages are dynamically generated with every rule pass. I DO NOT HAVE ANY PRE-SET GATHER PERCENTS!

Let me know what you think so far? :dance
Hell-Raven will be a completely organic AI. This means that it has no set strategy. It is completely reactionary. It will not ever play the same way twice, as a result.

It will be completely capable of playing with all civs, on all possible maps, with any settings, against any type of opponent.

Code: Select all

; ============================================================================================
; ||========================================================================================||
; ||         o---o    o---o   o----------o   o---o           o---o                          ||
; ||        /   /    /   /   /  ________/   /   /           /   /                           ||
; ||       /   /____/   /   /  /_______    /   /           /   /           ________         ||
; ||      /            /   /  ________/   /   /           /   /           /_______/         ||
; ||     /   /----/   /   /  /_______    /   /_______    /   /_______                       ||
; ||    /   /    /   /   /          /   /           /   /           /                       ||
; ||   o---o    o---o   o----------o   o-----------o   o-----------o                        ||
; ||                                                                                        ||
; ||       o---------o         o------o   o---o    o---o   o----------o   o-----o   o---o   ||
; ||        |   ___   \       /       |   |   |   /   /   /  ________/   /      |  /   /    ||
; ||       /   /__/   /      /   /|   |   |   |  /   /   /  /_______    /       | /   /     ||
; ||      /         _/      /   __    |   |   | /   /   /  ________/   /   /|   |/   /      ||
; ||     /   /--\   \      /   /  |   |   |   |/   /   /  /_______    /   / |       /       ||
; ||    /   /    \   \    /   /   |   |   |       /   /          /   /   /  |      /        ||
; ||   o---o      o---o  o---o    o---o   o------o   o----------o   o---o   o-----o         ||
; ||========================================================================================||
; ============================================================================================


; ============================================================================================
; ==                                                                                        ==
; ==    Welcome!                                                                            ==
; ==                                                                                        ==
; ==    Hell-Raven is a script that is ONLY compatible with the UserPatch Update that was   ==
; ==    developed at the forums of aiscripters.com by the member 'scripter64'               ==
; ==                                                                                        ==
; ==    This AI was developed by JD Stankosky. All code used in this script is considered   ==
; ==    the intellectual property of JD Stankosky as far as it goes to influence the        ==
; ==    behaviour and actions of the computer player.                                       ==
; ==                                                                                        ==
; ==    Portions of this script may be used with permission. To obtain permission, please   ==
; ==    request it along with the portion of code that you desire to use at the forums of   ==
; ==    aiscripters.com in the appropriate script thread.                                   ==
; ==                                                                                        ==
; ============================================================================================
Attachments
Hell-Raven BETA 4.zip
(15.72 KiB) Downloaded 137 times
Last edited by jdstankosky on Sun May 13, 2012 8:04 am, edited 6 times in total.
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.

kunyi
Guru
Posts: 738
Joined: Tue Mar 21, 2006 7:48 am

Re: [UP] Hell-Raven

Post by kunyi »

where is the file ?:$

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

Re: [UP] Hell-Raven

Post by jdstankosky »

It's being made ^^

I made the post so I could encourage myself to get it done faster. Also, because I might forget what I was doing if I didn't.

I have an... Interesting.... Way of doing things, lol.
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

Post by scripter64 »

:devil :devil :devil

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

Re: [UP] Hell-Raven

Post by jdstankosky »

Here goes, putting this out there...

Try not to let your head explode if you browse the code... :devil
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
offwo200
Guru
Posts: 529
Joined: Mon Feb 21, 2011 9:31 am

Re: [UP] Hell-Raven

Post by offwo200 »

Verry intresting idea. The closest I've seen to an AI doing that is Charmeleon.

Anyway your DA has some problems:
1) You were chinese and you never took loom. This isn't a good idea. Espically with chinese.
2) Consequently, you did no boar hunting.
3) You built a deer mill not next to the deer and a mining camp in the middle of nowhere (camp-distance increase prehaps)
4) Because of this, you advance in 17'.

I presume you know all about these yourself. If your gather %s are over 100, my observation is (different from other scripters) that when you go over 100, gradually more villagers will "disobey" your gather percentages. If they add up to 105 and they appear to work, no problem, since only a few villagers will disobey and they will go to resources, and not idle. However, if it comes up as 4000 or something then you have a problem.

Again, an intresting idea.
those hackers are just idiots, i spit on them :lol: - Mabuse

User avatar
St_Aquinas
Swami
Posts: 106
Joined: Wed Feb 23, 2011 4:33 pm
Location: Phoenix, AZ

Re: [UP] Hell-Raven

Post by St_Aquinas »

Haven't had a chance to test your script yet, since I'm currently in the middle of trying to write my own UP script, but what do you think about this method of determining gather percents?

Code: Select all

(defrule
	(current-age == dark-age)
	(unit-type-count villager >= 10)
=>
	(up-modify-goal FOOD-GATHERERS c:= 9)
	(up-modify-goal FOOD-GATHERERS g:%* VILLAGER-COUNT)
	(up-modify-goal FOOD-GATHER-PERCENT g:= FOOD-GATHERERS)
	(up-modify-goal FREE-GATHER-PERCENT c:= 100)
	(up-modify-goal FREE-GATHER-PERCENT g:- FOOD-GATHER-PERCENT)
	(up-modify-goal WOOD-GATHER-PERCENT g:= FREE-GATHER-PERCENT)
	(set-strategic-number sn-food-gatherer-percentage FOOD-GATHER-PERCENT)
	(set-strategic-number sn-wood-gatherer-percentage WOOD-GATHER-PERCENT)
	(set-strategic-number sn-gold-gatherer-percentage 0)
	(set-strategic-number sn-stone-gatherer-percentage 0))   

(defrule
	(up-research-status feudal-age == pending)
=>
	(set-strategic-number sn-gold-gatherer-percentage 20) 
	(up-modify-goal FOOD-GATHERERS c:= 4)
	(up-modify-goal FREE-GATHER-PERCENT c:= 100)
	(up-modify-goal FREE-GAHTER-PERCENT s:- sn-gold-gatherer-percentage)
	(up-modify-goal FOOD-GATHERERS g:%* VILLAGER-COUNT)
	(up-modify-goal FOOD-GATHER-PERCENT g:= FOOD-GATHERERS)
	(up-modify-goal FREE-GATHER-PERCENT g:- FOOD-GATHER-PERCENT)
	(set-strategic-number sn-food-gatherer-percentage FOOD-GATHER-PERCENT)
	(set-strategic-number sn-wood-gatherer-percentage FREE-GATHER-PERCENT)
	(set-strategic-number sn-stone-gatherer-percentage 0))

;Feudal-Age

(defrule
	(current-age == feudal-age)
	(not  (up-research-status castle-age == pending)) 
=>
	(up-modify-goal FOOD-GATHERERS c:= 15)
	(up-modify-goal GOLD-GATHERERS c:= 5)
	(up-modify-goal FREE-GATHER-PERCENT c:= 100)
	(up-modify-goal FOOD-GATHERERS g:%* VILLAGER-COUNT)
	(up-modify-goal FOOD-GATHER-PERCENT g:= FOOD-GATHERERS)
	(up-modify-goal FREE-GATHER-PERCENT g:- FOOD-GATHER-PERCENT)
	(set-strategic-number sn-food-gatherer-percentage FOOD-GATHER-PERCENT)
	(up-modify-goal GOLD-GATHERERS g%* VILLAGER-COUNT)
	(up-modify-goal GOLD-GATHER-PERCENT g:= GOLD-GATHERERS)
	(set-strategic-number sn-gold-gatherer-percentage GOLD-GATHER-PERCENT)
	(up-modify-goal FREE-GATHER-PERCENT g:- GOLD-GATHER-PERCENT)
	(set-strategic-number sn-wood-gatherer-percentage FREE-GATHER-PERCENT)
	(set-strategic-number sn-stone-gatherer-percentage 0))    
This might also help resolve your over 100 percentages problem.
"Sorrow can be alleviated by good sleep, a bath and a glass of wine."
-St. Thomas Aquinas-

fenris_w0lf
Guru
Posts: 982
Joined: Fri Aug 20, 2004 8:50 am
Contact:

Re: [UP] Hell-Raven

Post by fenris_w0lf »

jdstankosky wrote:It will be completely capable of playing with all civs, on all possible maps, with any settings, against any type of opponent.
:blink: :blink: :blink: :blink: :blink:

:D :D :D

weeeeeeeeeeeeeeeeeeeee!!!!!!!!!!!!!!!11

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

Re: [UP] Hell-Raven

Post by jdstankosky »

offwo200 wrote:Verry intresting idea. The closest I've seen to an AI doing that is Charmeleon.

Anyway your DA has some problems:
1) You were chinese and you never took loom. This isn't a good idea. Espically with chinese.
2) Consequently, you did no boar hunting.
3) You built a deer mill not next to the deer and a mining camp in the middle of nowhere (camp-distance increase prehaps)
4) Because of this, you advance in 17'.

I presume you know all about these yourself. If your gather %s are over 100, my observation is (different from other scripters) that when you go over 100, gradually more villagers will "disobey" your gather percentages. If they add up to 105 and they appear to work, no problem, since only a few villagers will disobey and they will go to resources, and not idle. However, if it comes up as 4000 or something then you have a problem.

Again, an intresting idea.
I'm curious as to why you need to point out my lack of tech researching. It's obviously not scripted yet. :lol: Also, it doesn't hunt boars because it has too many farms by the time the berries run out. Heck, it's already jumping into Feudal before the berries run out because it has so many farms! I need to add some smarts for utilizing free food sources.

I'm still compiling this guy one component at a time. Once I KNOW that the script is working THIS far, I will add onto it. It's not going to have a strategy, so in my testing I just try to get myself into each age, and that I can get them to gather appropriately.

St_Aquinas had a good idea, subtracting from each previous gather percent from 100. I will play around with it while keeping everything dynamic per rule pass.
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

Post by scripter64 »

The 100% issue was caused by the operator used in the chat actions. The redirection operator (prefix:<) has to be used instead of the assignment operator (prefix:=). That used to work in the past, but it was only a coincidence, since the math ops and the compare ops were equal in number back then lol. The math for the gathering calculations had to be adjusted a bit, as well. For the % symbol to appear as text in up-chat-data-* messages, it has to be doubled as %%. You can check all of this stuff in the attached per.

It's important to note that since these changes "fixed" (broke lol) the percentages, wood gathering is now a bit limited. This is probably because the lumber camp isn't added to the wood demand list when 0 camps exist, and the cost of a single farm isn't significant enough to get more lumberjacks (only +60 wood demand).

I look forward to seeing what this becomes!
Attachments
resource-manager.rar
resource-manager.per
(453 Bytes) Downloaded 65 times

Post Reply