Monday, April 16, 2012

[WIP-FA] Takanami Naval AI Mod 0.0.9

Takanami Naval AI



About



This is an AI that focus on using primarily Naval forces. The existing Naval AI is quite broken in the initial release with naval units just sitting around and not doing anything. I'm aiming to fix this and then go on to making it more intelligent. Hopefully long term turn the Takanami AI into a decent competitor to the adapative and other AI's out there.



This AI requires Sorian's AI Support Mod which is included with the download.



This mod is still in the early stages i.e beta. There are lots of things that still need to be done to make it a very strong AI. I am focusing initially on the Naval Rush and then will move onto an Naval AI that plays more strategic.



Compatibility



- This mod is compatible with Cheating AI Adjustment Options

- This mod is compatible with Duncanes AI mods

- This mode is not compatible with Sorians AI mod. You can have both installed but if you choose both for a map one will take over the other depending on which one is picked first.

- Compatible with the latest FA patch.



Tested Maps



- Roanoake abyss

- Seraphim Glaciers - Works Ok but until I can get Sorians shooting into Terrain fix implemented, naval units often get stuck shooting into cliffs.



Install



Current Version: 0.0.8

The zip version is at:



http://takanami.googlecode.com/files/Takanami-009.zip



To Install please extract into the Gamedata folder.



Thanks



I want to thank Duncane and Sorian for their AI's which have helped me in creating this one.|||VERSIONS



.001

- Initial build

- Reconfigured base templates and setup Rush AI.

- Removed platoontemplate load from builders

- Changed intial rush build order to build a factory first. - 'MG CDR Initial Naval Rush'



.002

- Created MGNaval - all rounder. Copied most of the rush template to start with.

- Modified SeaAttack to MGSeaAttack

- Setup NavalForceAI to MG NavalForceAI

- put logging in navalforceai



.003

- Created SeaHuntAI for naval units that are sitting around with nothing to do. This aggressively attacks anything that



moves.



.004

- Added priorised targets to SeaAttackBuilders

- Added priority code to MGTaticalSeaHuntAI (rough for the moment)

- Forced MGTaticalSeaHuntAI to use own priorities



.005

- Remove priority code off Seattackbuilders - don't need it anymore

- Changed NavalForceAI to use MGTaticalSeaHuntAI for the rush AI.

- Use MGTaticalSeaHuntAI until we can get the NavalForceAI to work without getting stuck units.

- Reduced Land unit builds to defensive for rush.

- Check to see if Naval units are stuck then push out new targets.

- tweaked priority code



.006

- Changed air scouting to only start scouting for high threat areas after 10 mins - this means better all over map scouting



intially.

- Created rushseahunt and taticalseahunt

- Tweaked Land build units

- Added T1 naval defenses for Naval Factories for Rush.

- Tweaked priorities

- Changed some land builds on MGRush expansion naval

- MGRushSeaHuntAI put in pick a new target if stuck getting to it. (still needs work as often just keeps picking the first



target it likes).

- Stopped the adaptive AI from using my AI



.007

- Fixed MGNavalForceAI to use attack paths then on final destination go into attack mode rather than just sitting at it's



final waypoint. (still sometimes doesn't work properly)



.008

- Created MGCheckNavalThreat to check currently how much naval threat is on the map now.

- Created SeaDominanceBuilders - Rush AI will build higher Tech Naval if the AI focus on Tech or Air

- Tweaked priorites yet again. (not sure about engineer pri yet)

- Fixed land units not being built.

- stop building subs if there is nothing naval to attack (usually turtle,air,tech)



.009

- Changed the PickEnemylogic function to choose a new AI enemy when the current one is killed. Additionally made some changes so the AI's better choose their enemies.|||Reserved|||Very nice to see someone else taking a step forward towards designing an AI. Seeing as Duncane and Sorian have decided to go mainly for land and air AI's, your naval version might be the bane for either of them. It's too bad that this AI isn't compatible with sorian's though, maybe ask him how you can solve that issue?



By the way, too bad I'm the first to post something here that shows interest in your AI mod, but I'm sure more will follow :)|||Rock n roll...



Navy aint my thing so its great to see someone who is focusing on this.|||Thanks for the support guys.



It's a shame the AI isn't compatible with Sorian's. The main problem is we hook some of the same code.



I'm sure we can come up with something though. At the worst case one of us could just merge major releases together or something along those lines.|||Have upload version 0.0.9.



For this version I changed how the PickEnemyLogic function works.

In vanilla FA the AI's pick their first enemy in the first minute of the game and never choose another enemy. At least as far as I can tell.

So when their current targeted enemy died the AI kept trying to attack it even though it didn't exist anymore. This resulted every unit constantly looking for nonexistant units resulting in lots of units being stuck. Well in Naval anyway - I haven't tested this with Land or Air.



I have rewritten it so every couple of minutes the AI checks to see if the enemy it is attacking is dead, if it is the AI chooses another enemy. I have also added in some code that if it finds another enemy that is 1.5 times stronger than it's current enemy it changes targets. So hopefully this means AI's are more likely to gang up on stronger targets.



The default AI's will all use this function as well.|||This is a good move.



I dislike Naval, am weak at it, so this will be just what I need to set me straight. Good idea whylikethis. I hope it becomes a fearsome beast like Sorian's.|||The main issue FA has (Which TA didn't) is that naval is very limited. In TA you had mex points under water, could buy loads of building on and under water. You even had those "planes" that you could buy on some aircraft plant that you could build under water.



The problem with this is, if in FA you have someone, be it player or AI, going for land and/or air superiority, it will be much easier for him to claim mex points and thus gaining a huge advantage.



In TA you could build your base on top of and under water, so naval would be effective, with FA you have to build your base on land (Most of it anyway) and would make your base vulnerable.



This is quite a critical point in why naval is not as practical as land or air based tactics.|||whylikethis, your AI naval fix works well, keep up the good work. I have always been wanting large naval battles, but the AI were never that good with it. I am sure most players will be happy, to be able to play naval battles for once. :D|||Dragonfly: Glad you are enjoying it. When I start working on the Normal AI I am hoping to be able to build up large fleets rather than constantly throwing ships against the enemy.



GM1XXA: That is true on alot of the maps. Though I feel the more water a map has however the more important the Naval force becomes. In Roanakes abyss for example even the Tech1 ships can almost hit everything on land.



Though at the end of the day the Naval AI still needs backup from land and air. One of my versions I removed all land units to produce more naval units for Rush. However any AI that used alot of Air wiped the map with my AI by wiping out all the AI's mex points. So I had to go back to producing some land units just to help keep air and land away from the mex points.

My Naval AI has beaten the standard Air AI a few times on 1-1 matches in Roanakes abyss so I'm hoping for a lot better things :)|||Any reports on how well this is working?|||Okay... I have finally had a chance to give it a go. I should really be working on my own AI fixes of course but seeing as no one else seems to have given this a go I thought I would...



I have had a few games against it on Seraphim Glaciers.



This is a kick arse Naval AI. Much better that the default. I suggest playing it with a 1.5 AIx cheat. Play with a navy focus and it will play very well against you. Its Navy is much more mobile that the default Navy (I will have to check out your bugfixes to see if I should include them ;-)



Sure an Air focused enemy will really harm it, but this could improved on I think with more air defences. I had thought that playing with a near 100% navy focus wasn't viable, but looking at this AI I think it could work...



whylikethis, Congrats on a great naval AI. A couple of suggestions...



1. if you can resolve the issue that stops it working with Sorians I think you will get more users. Is it just that platoon.lua file thats the problem? Maybe try calling it MGplatoon.lua? I think it may still extend the platoon class even if Sorian already has. Otherwise look for other ways to to add you extensions... maybe in another utils file that can be called?



2. Dont call it Takanami Naval AI... just call it Takanami AI. Add a rush AI for maps 10km and smaller, a Air AI for 20km and bigger with less that 50 percent water and your naval AI for 20km and bigger with 50+ percent water. You can use the standard base AIs as a start for the other AI types...



Looking forward to your next release and going through your AI code changes...|||Thanks Duncane. Glad you enjoyed it. Still a long way to go and I have a list of about a hundred things I want to sort out.



Been distracted by the Simspeed problem lately and work has been busy so haven't had much of a chance to do more on it. But I'm going to look at working on it this week.



I've already added a non rush Naval AI and getting it to make more airdefenses and play better against an Air AI.



I agree with you about the name. The plan was to start on the Naval side and then add AI and Land in. I like your idea about having a rush, air and then naval AI's - probably could make it an adaptive AI that picks the right one depending on the map. I'll see what I can do for the next release.



You are welcome to any of my bugfixes so long as I can pinch yours :)



Getting it to work with Sorians is harder. I'm pretty sure I can change the platoon file to an MGplatoon file - I did try that a while ago - just means more work. The biggest problem is the AIbrain as whichever AI grabs it first to hook it gets to keep it. I curious to see how spliffs AI support pack will work - maybe that will help.

No comments:

Post a Comment