You must be logged in to post messages.
Please login or register

Modding Discussions
Moderated by Alexastor, MosheLevi, Mister SCP

Hop to:    
Welcome! You are not logged in. Please Login or Register.403 replies, Sticky
Age of Empires III Heaven » Forums » Modding Discussions » Idea: Let's start a "Better AI project"
Bottom
Topic Subject:Idea: Let's start a "Better AI project"
« Previous Page  1 ··· 10 ··· 14 15 16  Next Page »
murdilator
Skirmisher
posted 09-22-12 06:52 AM EDT (US)         
EDIT:

Here are links to The Beginner's Guide to AI Modification, written by me:

Part 1:

http://aoe3.heavengames.com/cgi-bin/forums/display.cgi?action=ct&f=14,38878,,10

Part 2:

http://aoe3.heavengames.com/cgi-bin/forums/display.cgi?action=ct&f=14,38885,30,100


------------------------------

Original Post (9-22-2012, 06:52 AM)

I have an idea that we can significantly improve the AOE3 AI. This will of course build from the Drauger AI. I have made a decent AI in my mod N3O Fan Patch, but it currently uses some techs that I have added to the game, so it won't work yet for an unmodified Age of Empires III. Yet I can easily remove those techs with some testing (to make sure it works) so that it can be played on an unmodified AOE3 and furthermore be a base rubric for further AI improvement.

http://aoe3.heavengames.com/downloads/showfile.php?fileid=3363

Mandorex also has an improved version of the Drauger AI:

http://aoe3.heavengames.com/downloads/showfile.php?fileid=3222


I also noticed another Drauger AI improvement uploaded for Vanilla AOE3 which makes the computer build forward bases. This would be interesting to look into, but I do say that this is quite a job for one coder. However, what I suggest is that we make it a community project to sort of build off an already improved AI and (for those who have time) fix various issues. I myself am pressed for time otherwise.


Anyone for an idea such as this!


Feel free to discuss and share your ideas! Its best if we discuss before we actually decide anything big.



best of regards to all here,




murdilator

[This message has been edited by murdilator (edited 06-23-2013 @ 10:35 AM).]

AuthorReplies:
ylg_hke
Skirmisher
posted 11-14-18 10:19 AM EDT (US)     376 / 403       
Any progress on escrows?

anyway, i just wanted to say that kbUnitQuerySetAreaGroupID is very important when it comes to maps like ceylon, Yucatan.
AlistairJah
Skirmisher
posted 11-15-18 01:47 PM EDT (US)     377 / 403       
You know, I kinda missed you

No progress at all... I practically abandoned this stuff. I mean, I *think* there is not much to do with escrows. But I'm checking here from time to time hoping to get interesting infos.

Indeed I was making a short AI for a single player RPG scenario. Query with area is really helpful. BTW I think you should seriously consider recheck the original AI, it has too many typos and human mistakes. I don't remember all of them... But I it's always better to remain clean.
ylg_hke
Skirmisher
posted 11-15-18 11:42 PM EDT (US)     378 / 403       
haha, I was busy last 2 weeks.

I haven't checked anything about "resource leakage in escrows" yet.
Can you please give me some more infos about it, so that we can speed up our overall progress?
eg: Does it happen all the time, or randomly? By how much(approximately)?

Currently I think kbUnitQuerySetAreaGroupID is a must for ManualGathering, take Yucatan as the example, we have 2 seas on 2 sides, without AreaGroupID, we might end up in tasking a fishing boat on the left to the right, the same goes for land areaGroup.

BTW I think you should seriously consider recheck the original AI
==> True, but don't worry since I disabled most rules, I also build my own functions, only things like ai chats from the original AI are active.
Its fair to say i put a new AI after the original one so that i dont have to constantly worry about OOS error.
Panmaster2014
Skirmisher
posted 11-16-18 10:37 AM EDT (US)     379 / 403       
Currently I think kbUnitQuerySetAreaGroupID is a must for ManualGathering, take Yucatan as the example, we have 2 seas on 2 sides, without AreaGroupID, we might end up in tasking a fishing boat on the left to the right, the same goes for land areaGroup.
I think kbCanSimPath() would also work.
Fishing boats are a nuisance.
What's the fastest way to count total settlers count and population?
AbstractFishingBoat includes too many ships so I think counting each settler is fastest: coureur, cree coureur, pilgrim, wagon, settler, Asian settler...

I hope kbUnitQuerySetAreaGroupID doesn't slow queries down. Testing already has sorted queries of a normal sized map down to 2000 to 4000 per second.

Escrows don't leak as far as I can tell. I was more concerned with shipments or xp being escrowed.
Using aiTaskBuild, aiTaskTrain, aiTaskResearch results in wrong values for escrow amounts requiring kbEscrowAllocateCurrentResources() to reset in proportion to percentages. Gaining back resources from cancellations might also mess it up.

Not made any real breakthroughs. Lot's of small ideas but nothing inspiring. You can add action type 8 for units blocking building foundations and wandering away.
ylg_hke
Skirmisher
posted 11-17-18 04:06 AM EDT (US)     380 / 403       
I think kbCanSimPath() would also work.
==> how? it always returns false.
even if kbCanSimPath works, if it can't simPath, then we will have to continue the for-loop, right? then it might ends up in doing hundreds of loops to get the correct resource.

What's the fastest way to count total settlers count and population?
==>the fastest way must be AbstractVillagerNo + SettlerWagonNo, but the fastest may not be the most helpful one, it largely depends on how you are going to handle the villagers.
personally I don't think counting all villager types is a good idea.

Using aiTaskBuild, aiTaskTrain, aiTaskResearch results in wrong values for escrow amounts requiring kbEscrowAllocateCurrentResources() to reset in proportion to percentages
==>thanks!

[This message has been edited by ylg_hke (edited 11-17-2018 @ 04:11 AM).]

Panmaster2014
Skirmisher
posted 03-06-19 12:34 PM EDT (US)     381 / 403       
Work on the AI project continues.

Micromanagement efforts for conventional scripted AI have improved dramatically.
The "attack nearest unit" algorithm is by far the most efficient but more sophisticated tactics such as melee mode are used effectively also.

Neural Net AI Training is hampered due to commanding 80 units with multiple actions and have only a simple "good" or "bad" feedback. Either it always converges on "attack nearest" or "retreat from enemy" to avoid losing units or worst of all no changes or a NaN explosion.

Action ID 42 allows cannons to be controlled more effectively.
Atomiswave
Skirmisher
posted 03-26-19 03:36 AM EDT (US)     382 / 403       
Do you plan to release it to the public?
murdilator
Skirmisher
posted 07-21-19 05:50 AM EDT (US)     383 / 403       
Is this thread still active? Is anyone still interested?
Atomiswave
Skirmisher
posted 07-24-19 09:17 AM EDT (US)     384 / 403       
Ofc, we are still waiting for new version of your AI projects. Helot Major is great.....
Panmaster2014
Skirmisher
posted 07-26-19 07:47 AM EDT (US)     385 / 403       
edit:
What new things have been discovered?

What's the most efficient way to detect and delete settlers stuck between buildings?

What causes lag? Attack-plans or build-plans?


edit: edit:
Now have:
unlock all homecity cards, taunts, gates, wonder powers, HC destination, treaty time, repair, cancel train, eject garrison.

Building rotation is far too difficult.
Abilities are quite close but there's 1 parameter I can't identify. I've found where the explorer plans use ability 91 sharpshooter and have found the entire code but it takes 1 unknown parameter as well as guardian ID, explorer ID and ability ID.

[This message has been edited by Panmaster2014 (edited 08-09-2019 @ 00:40 AM).]

murdilator
Skirmisher
posted 11-02-19 12:46 PM EDT (US)     386 / 403       
I have added a new AI for download:

https://www.moddb.com/games/age-of-empires-iii-the-asian-dynasties/downloads/ai-9-the-big-daddy

This AI trains 4 unit types, and upgrades all economic upgrades for Natives and Asians.

All AIs redone with new calculations.
murdilator
Skirmisher
posted 05-08-20 08:21 AM EDT (US)     387 / 403       
AI trains less of units with 4 unit types but with 3 unit types it trains more in blocks (that is to say it trains too much of one unit). This said, AI works with more interesting combinations, and it is possible to add behavior for certain cards such that in Industrial Age the Computer favors the cards over others. An example of this would be my Japanese AI and British AI which use Shipments and Rockets to supplement their armies. The Spanish AI and Russian AI also send a set of Heavy Cannons.

This movement and changing up of AI is possible only with some cards, in which you do not jack up the deck completely. Also, AI basis for my AI does not use Level 40 Cards. It can use level 25 Cards. If a card is pre-researched, either by start or custom home city, the computer player can and will use those cards on low levels automatically (Levels 5-20). It is also in the code to favor Native Warrior Shipments. An ideal AI would use some shipments for each civ, and for Chinese and Iroquois perhaps use Shipment Handling to send cards (lategame unit shipments) when appropriate.

The article I wrote here is a report on AI behavior and I intend to share the little things I have found work. In my AI the Japanese Shipments are over 5000 in value so they beat the Shogun Shipment by far. Also another factor in Japanese AI is that I've put a low priority for the Daimyo and Shogun Units, such that it can focus more on Naginata Riders. This is not ideal, but it works better overall for now. Making a Mansabdar Monitor for Shoguns/Daimyos doesn't work right; I would have to ask others how they've done it (and this is because training an un-enabled unit for a civ bugs up the AI).

[This message has been edited by murdilator (edited 05-08-2020 @ 08:23 AM).]

AlistairJah
Skirmisher
posted 06-16-20 07:11 AM EDT (US)     388 / 403       
@Panmaster2014 You have to manually count the ability's index in powers.xml and abilities.xml

It can be tedious for some, but not for you since you literally counted each civ's HC Card ID lol

The problem is that no matter what player you put in the parameter, YOU (I mean, as the human that owns the game copy) have to "confirm" the cast in order for the ability to work. The AI itself can't cast. I absolutely have no clue how to circumvent it...

Also, I don't know if you have noticed, but many of the console commands behave unreliably when you reference them in GroupAI or GroupXS. I tested repairUnit(), specialPower() and the HC gather point functions. I don't know why they work when used as a command, but not when used by the AI...
murdilator
Skirmisher
posted 08-13-20 11:36 AM EDT (US)     389 / 403       
I have tested the AI 9 - Big Daddy AI on Hard on NR20 and it works: It produces villagers, fishing boats, upgrades, and Towers and Military. It gets to Industrial (mainly because it builds military in Colonial and Fortress), not always to Imperial, unless it begins on a Custom Map with extra resources/villagers. On Custom Maps with big starts it can work well for a NR10 AI, though the N3O AI which it was based on is primarily a Post-Imperial DM AI.

I wanted to mention this because I find that it's hard to get treaty games unless you play NR40 or something long like that, and the AI gives players the option to have a game with their friend on LAN or play 1v1 Solo. The Big Daddy does do decent on Rush Games, and booms up and ages up, but was primarily tested on Custom Maps. It is aimed more to fun, and less to spamming troops, unlike the previous AIs that I have done.

The AI is less aggressive than a Vanilla AI, but should give a better account of itself in units and especially using the civilization's special units. The AI occasionally makes use of its consulate. I had to make it up to 0.6 on the UnitPickerPreference for it to do this.

I do not wish to make a master AI, but rather several different kinds of AIs, each with its own forte and weak points. I encourage other designers to take ideas from my works, and add to their own creations. That way we keep a public sentimental ownership, rather than a private ownership. If there ever is an AI in the future AOE3 game series that is too good, then someone will have to make a degraded version, like a reverse pattern from that AI. I never hope the day comes when custom AIs will be surpassed by conventional ones.

In development, the AI can use Native Warriors, Mercenaries, and the like, but it has to be told to build trading posts and have a Native Bias: in the UnitPickerPreference it is 0.5 + Native Bias / 2.0.
NoobToPerfect
Skirmisher
posted 10-10-20 04:40 PM EDT (US)     390 / 403       
Hi. I'm puipui_ro from ESO. I just played vs AI mod modified by Kaisor and uploaded here: https://github.com/NewAoeIIIAi/Supremacy-Trainer-AI/releases/tag/1.0

He promised he will make aditional changes because vs very good players AI still suck. In this version AI make mortars but other cannons are disabled, if start trade monnopolly AI revolts but not focusing enough to destroy TP. Ai is pretty good but with some changes can be much better and very tuff to beat and more challenging. This would be nice, to make AI "impossible" to beat. I don't understand nothing in main file and i hope you guys make proper changes for a cooler AI. I will try big daddy AI mod as soon i will get home, now i am at work. I just found this thread.

[This message has been edited by NoobToPerfect (edited 10-10-2020 @ 04:48 PM).]

murdilator
Skirmisher
posted 10-11-20 02:47 AM EDT (US)     391 / 403       
Try out the Horsemaster, a later version of the Big Daddy, which trains units for Dutch, Iroquois, India in an improved fashion plus all other civ.

I've tested it on Hard on NR30 and it does well getting 700+ score and an army and villagers. I tested on Texas, and Moderate on Orinico got 450 score by 30 minute treaty.

[This message has been edited by murdilator (edited 10-11-2020 @ 02:49 AM).]

NoobToPerfect
Skirmisher
posted 10-11-20 10:29 AM EDT (US)     392 / 403       
Thnx alot!

[This message has been edited by NoobToPerfect (edited 10-11-2020 @ 10:29 AM).]

Panmaster2014
Skirmisher
posted 10-29-20 05:40 AM EDT (US)     393 / 403       
@Panmaster2014 You have to manually count the ability's index in powers.xml and abilities.xml
It can be tedious for some, but not for you since you literally counted each civ's HC Card ID lol
The problem is that no matter what player you put in the parameter, YOU (I mean, as the human that owns the game copy) have to "confirm" the cast in order for the ability to work. The AI itself can't cast. I absolutely have no clue how to circumvent it...
Also, I don't know if you have noticed, but many of the console commands behave unreliably when you reference them in GroupAI or GroupXS. I tested repairUnit(), specialPower() and the HC gather point functions. I don't know why they work when used as a command, but not when used by the AI...


Yes I found the abilityID's. Sharpshooter is 91.
I think the farthest I got was getting the AI to select the ability and activate it but it only worked if I manually selected the explorer first. Alternatively I could change the plan activated sharpshooter to use crackshot.
I think I traced the .exe to where I could see differences between spyglass and sharpshooter before I gave up if I remember. Too many branches.

Repair, gather point, wonder powers all work perfectly for the AI.
murdilator
Skirmisher
posted 11-13-20 01:19 PM EDT (US)     394 / 403       
Here is a slideshow footage of the Housemaster AI on NR10, NR20 on Custom Maps in 1v1 and team games. Please take a look if you want to see how the AI plays. And bring out some popcorn, and enjoy the picture!

https://www.youtube.com/watch?v=dixbiCxIVTc

Good Gaming!
SeldomPooper
Skirmisher
posted 12-02-20 03:47 AM EDT (US)     395 / 403       
@murdilator
I watched the video you linked. In your video i see that akbar and kangxi made gates in their walls. I tried out this Horsemaster AI. Except for hiawatha, non-european civs are not making gates in walls. They totally block themselves and their ally units also. Its pissing me off. How do i fix it ? Please help !
P.S. I was playing 4v4 with computers and Frederick was stuck in colonial age.

[This message has been edited by SeldomPooper (edited 12-02-2020 @ 11:25 AM).]

murdilator
Skirmisher
posted 12-03-20 03:14 AM EDT (US)     396 / 403       
Its a bug in the Techtreey file that does not permit Asians and Aztecs to make gates, because these are not enabled there for them.

In my Ivory Maps, Ruby Maps, and Impeccable Maps I have fixed this by enabling gates for all civilizations via trigger on the maps.

The AI is a work in progress so I don't know what difficulty you are playing on. It's dependent on difficulty.

These are not bugs in the AI, they are bugs in the game. Also if you install a AI sometimes you have to change difficulty setting to get it to age up properly, and then change it back to what you did first. This is only in the case of an update.

Also I don't recommend 4v4 as my machine care barely run it. I recommend 3v3, 2v2, 1v1 and FFA up to 6 players.

[This message has been edited by murdilator (edited 12-03-2020 @ 03:15 AM).]

murdilator
Skirmisher
posted 12-03-20 04:33 AM EDT (US)     397 / 403       
I tested 1v1 against Germans on Hard on Silk Road and the AI got to Age 2 and Age 3 during the 15 minute game. I also tested 3v3 and found that the German AI does indeed get to Age 3 on Hard, but it has few unspent resources (800) compared to the other AIs (2500). This was also because it was under attack some.

I recommend Horsemaster as a Custom Map AI, some DM and Treaty as I have not tested regular rush games in a long time.

New:

I fixed the German Boom problem by making them force ship Settler Wagons in Discovery and Colonial Ages. They should also play well on Deathmatch Post-Imperial but that's up to you if you want to play that.

The test was on Expert on Himalayas on 4v4; all AIs made it to Fortress Age, and some to Industrial before I quit.

I recommend these maps for Comp Stomp:

http://aoe3.heavengames.com/downloads/showfile.php?fileid=4128

Thanks for testing!

[This message has been edited by murdilator (edited 12-03-2020 @ 08:35 AM).]

murdilator
Skirmisher
posted 12-04-20 01:41 PM EDT (US)     398 / 403       
I fixed Iroquois AI it now booms better and builds more Infantry, Mantlets and less Musket Riders and Kanya Horsemen (still more Kanyas than in previous versions).
SeldomPooper
Skirmisher
posted 12-06-20 04:02 AM EDT (US)     399 / 403       
I tried the zen master AI by panmaster2014
I think he fixed the issue of AI settlers idling at shrines waiting for animals to be free. I played with zen master AI twice. Didn't see any computer settlers on the shrines which had animals. Can others incorporate that fix too in their AIs ?
murdilator
Skirmisher
posted 12-06-20 11:52 AM EDT (US)     400 / 403       
Very well, I will also ask you a question.

Do men love women in France?
murdilator
Skirmisher
posted 12-25-20 09:18 AM EDT (US)     401 / 403       
The Horsemaster AI gets 700-800 points on Hard in NR30 and 1000 points on Expert difficulty. In the most recent update, I created always-use of villager shipments and aggressive tactics as well as some new cards.

AI builds army in Colonial and Fortress, Industrial and Imperial. One day it would be good to keep in Treaty period a delayed military setup. This could interfere with treasure gathering, but it would make the AI boom better and focus just on economics. Some things are hard-coded, and I believe that it would benefit treaty games in the long run. In custom maps, the AI gets about 60-70 villagers before the treaty ends, with a larger army. After the treaty period it gets about 90-99 villagers depending on whether it is a Native civilization or European. Asians also boom well, with India sending cards and getting villagers during the treaty, Japan needing less villagers and using shrines, and China having 20 villager age up politician.

Good Gaming!
murdilator
Skirmisher
posted 03-29-21 03:29 PM EDT (US)     402 / 403       
I have now added extra Town Centers to be queued up during Fortress Age, and added special Treaty Bonus Handicaps to Natives and to Easy and Moderate Difficulties. I have also added 95 villager population for Treaty, albeit lower for French (85), Dutch (75), Japanese (85), but still enough for them to build fishing boats in Treaty Games.

On Age Maps, the Hard gets anywhere from 1050-1400 Score in a 30 Minute Treaty. On Crimson Maps the Hard AI gets anywhere from 1050-1350 score in a 20 Minute Treaty.

I have added various Infinite Shipments, such as 10 Musketeers, 8 Halberdiers, 4 Cuirassiers, 7 Cavalry Archers, 1000 Coin and so on. These are handled as medium priority shipments, meaning that the AI will send them on condition that there are few military units of that type on the field.

The maps that I have made recently all work well with the AI, and are made for playing with AI allies/opponents. I recommend that if you want a game vs AI, do a custom map.

I have also worked with Wonder Placement, such that Wonders can be placed right next to other buildings with this AI (meaning that they always get to Industrial Age and almost always to Imperial Age on every map).

[This message has been edited by murdilator (edited 03-29-2021 @ 03:30 PM).]

murdilator
Skirmisher
posted 04-20-21 04:27 AM EDT (US)     403 / 403       
I have found that the AI now can be played online on Expert difficulty with only the Host needing to have the AI installed. Not any other difficulty will work online in Comp Stomps, only Expert, because I changed handicap bonuses for Hard, Moderate and Easy away from the original in AImain.xs, while I have reverted Handicap bonus of Expert back to 1.5.

I recommend NR20 on a custom map against 2 or 3 AI opponents, with of course, 1 to 2 Human Allies.

Only Host needs to install for multiplayer games.
« Previous Page  1 ··· 10 ··· 14 15 16  Next Page »
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Empires III Heaven | HeavenGames