AI Improvement

Supremacy; support/discussion/questions

Moderators: thunderchero, Iceman

Post Reply
User avatar
Tracing
Cadet 2nd Year
Cadet 2nd Year
Posts: 5
Joined: Sun May 04, 2014 12:37 pm

AI Improvement

Post by Tracing »

I've made a small patch for the AI to allow it to explore. (Without using large amounts of CPU power) If I get the time, I hope to do some more modifications on the AI to bring it closer to single player usability.
Attachments
UnitAI.zip
(4.56 KiB) Downloaded 163 times
Iceman
Admiral
Admiral
Posts: 3312
Joined: Fri Apr 10, 2009 2:00 am

Re: AI Improvement

Post by Iceman »

Thanks Tracing!
I'll include these changes in the next release.
Keep it coming. :up:
User avatar
rawsy
Lieutenant-Junior Grade
Lieutenant-Junior Grade
Posts: 66
Joined: Sun Jun 15, 2008 2:00 am

Re: AI Improvement

Post by rawsy »

wow great. many thanks i cant wait to try it.
Iceman
Admiral
Admiral
Posts: 3312
Joined: Fri Apr 10, 2009 2:00 am

Re: AI Improvement

Post by Iceman »

Tracing, one nice improvement to this would be to have MaxExploreRange get the Range value for the Scout in question - which depends on tech level. I was actually working on something similar for the number of colony ships the ai builds. I wasn't very successful yet though...
User avatar
Tracing
Cadet 2nd Year
Cadet 2nd Year
Posts: 5
Joined: Sun May 04, 2014 12:37 pm

Re: AI Improvement

Post by Tracing »

Tracing, one nice improvement to this would be to have MaxExploreRange get the Range value for the Scout in question - which depends on tech level. I was actually working on something similar for the number of colony ships the ai builds. I wasn't very successful yet though...
Thanks for the tip. I've made the changes the ai file. I'm currently in the process of creating a couple of new features in the UnitAI file around ship roles and fleet assignments. It should probably make the SP universe a little bit more lively.

I'm looking forward to the next release. Hopefully it will come soon :)
Iceman
Admiral
Admiral
Posts: 3312
Joined: Fri Apr 10, 2009 2:00 am

Re: AI Improvement

Post by Iceman »

Cool!

The next release is probably going to be in a couple of weeks, for xmas. Not that that is mandatory though :wink:
I've made a slight change to your code, so that only empires' Scouts actually explore. That's because I've made the minors build some scouts too, and there was a boatload of scouts flying around the galaxy... :grin: Hope you don't mind.

Other changes, not AI related, are some tweaks to galaxy generation (trying to minimize some weirdnesses), decreased PFs costs so that higher level colonies are easier to manage, reworked ships scanner ranges again, fixed a few things in combat (and more to come), fixed a couple rare crashes.
I have yet to polish Agents, and some other stuff.
Iceman
Admiral
Admiral
Posts: 3312
Joined: Fri Apr 10, 2009 2:00 am

Re: AI Improvement

Post by Iceman »

While at it, those scouts should probably return to the homesystem after all the systems in range are explored, else they'll just remain wherever they explored last - which includes other civs' homesystems :wink:
Iceman
Admiral
Admiral
Posts: 3312
Joined: Fri Apr 10, 2009 2:00 am

Re: AI Improvement

Post by Iceman »

The next release will include the mentioned improvements (scouts use their own range for exploration purposes, and they return home after all systems in range are explored). Scouts will also avoid BHs and NSs if they're detected.
The AI should also only build as many colony ships as needed, but that part is not working correctly yet.
Iceman
Admiral
Admiral
Posts: 3312
Joined: Fri Apr 10, 2009 2:00 am

Re: AI Improvement

Post by Iceman »

Tracing wrote: I'm currently in the process of creating a couple of new features in the UnitAI file around ship roles and fleet assignments. It should probably make the SP universe a little bit more lively.
Tracing, any news on this?
It'd be really nice for the next release!
User avatar
Tracing
Cadet 2nd Year
Cadet 2nd Year
Posts: 5
Joined: Sun May 04, 2014 12:37 pm

Re: AI Improvement

Post by Tracing »

Tracing, any news on this?
It'd be really nice for the next release!
I'm sorry about my short absence. I had some real life events (i.e. exams) that I needed to take care of and for the last month i've been quite engrossed in doing my studies so making/distributing code hasn't been a very high priority for me lately.

The revisions I was making got sort of abandoned, since the code became quite large and unwieldy, and is pretty non-functional when I try to test it.

Anyway, I made a few (other) code improvements at about early may, which i'm going to put here:
http://www.mediafire.com/download/78e4i ... 8-06-15.7z

Changes:
- AI should build combat ships and transports and will send half of those ships to invade enemy territory if they are at war.
- AI should declare war on minor races.
- Some code for making the AI build shipyards and dilithium refineries, but this isn't working yet.

Notes:
- I commented out a line in SupremacyService.cs because keeping it in would cause the game to crash whenever the AI launches an invasion.
- AI only tries attack systems that are within fuel range. If I can remember correctly I believe that this is working fine, but there may be some rough edges that need to be stamped out.
- The diplomatic ai has been somewhat stripped down, but I believe that most of the code that I commented out should be functional, I might get to this abit later.
Iceman
Admiral
Admiral
Posts: 3312
Joined: Fri Apr 10, 2009 2:00 am

Re: AI Improvement

Post by Iceman »

Sweet! I will integrate this into the next build. Thanks!
Iceman
Admiral
Admiral
Posts: 3312
Joined: Fri Apr 10, 2009 2:00 am

Re: AI Improvement

Post by Iceman »

- Some code for making the AI build shipyards and dilithium refineries, but this isn't working yet.
Managed to make the AI build dilithium structures (will have a go at shipyards tomorrow), and assign the necessary pop to energy structures for any shipyards and dilithium structures that aren't powered.
Post Reply

Return to “Supremacy”