@b8factor wrote:
After playing some HD Age of Empires with Microsoft’s updated AI, I just could not resist trying to dust off my Homeworld RM and give it a go.
The first step… play lots of games! So the AI… is sort of repetitive… predictable, and often either too easy or too hard (when I try to play 4 teamed experts to make it more interesting). And the worst part, they do not even use all the units and tech!
So off to create a new AI…
1st step was to get everything installed… takes a while. I got the latest .BIG extracted and can now “search for text in files” to help find what I need.
I built a new “wordfile” for my UltraEdit that now shows the log file with at least some help full color coding. At least my aitrace, prints, errors, and number stand out! That will save my eyes some.
I know most of you use Notepad++. Can not blame you it is a fantastic tool. I have really been digging Eclipse for Lua. Having auto complete is fantastic when you don’t have all the functions memorized!
Now on the the MOD stuff.
I started by documenting the AI files that I know of. Adding logging to see what calls what and etc.
I also started experimenting with the game rules.
After a week of hacking around this is what I have accomplished.
- Created an Custom AI that can have custom Build Orders.
This was no small task. My first hurdle was how to select and load my Custom AI. I wanted to add another option in the player selection. e.g. Easy, Hard, Expert, B8factorAI. But I could not figure out how to do that so I tried something else… override one of the existing AI’s. I chose to override “Easy” since it is the least likely needed.QUESTION: Does anyone know if I can actualy change the text on the screen from EASY to B8factorAI?
In overriding the AI I added overrides the ai/default/*.lua files but was able to do so with little effort. Some of the problems I ran into where that, using “gamerules” did not allow me to use CPURemoveSobtype like I do in the campaign lua files. The bloody AI code just ignores me… so in the overrides I cut out any conflicts with the AI when player is on EASY but left the rest that way Player’s can play my AI with default AI’s. I have tried this with up to 4 players without problem in Multiplayer. On the plus side, even with the AI’s off the individual units still behave and have part of a brain. And I find I can manipulate their behavior with game rules.
I have successfully gotten the AI to do a Frigate Rush from random approach paths to the player… in MULTIPLAYER… I was not even sure if that was possible. Now I know, COOP maps can be a thing.
- Added some Game Rules to tweak what the AI’s do.
I have been working on this. several areas I think need improving are:
- End Game needs a better finish… Homeworld just ends too abruptly!
- AI to cloak more like a human.
- AI needs a personality. I can display messages to the Multiplayer users but I have not tried to introduce sound yet. I also have not been able to get EVENTS to work at all.
- AI needs to do a better job of what units it teams up on, especially with its BC. In a large fight the HUMAN would double team the big ticket ships but the AI does not make that a priority… yet!
- AI needs to do a better job of using hyperspace. Everybody that has played knows that their MS just hyperspaces a few ships lengths away and blows up.
- Would love to see some random appearances of ally ships from time to time just to surprise the Player. “Incoming communication from TarToba, traveling through this sector!”
- AI needs to repair more! I have gotten some of this to work!
*AI Randomly decide to stay docked when building to full the human.
- give the AI the ability to choose random attack paths, hit and run on strategic areas, and flank! I have succeeded in this without modifying the level files… which I was not sure if it could be done. I cam AddSphere in the game rules files. that means based on player starts I can fill the map with a handful of Spheres to use for AI Mine Laying, Alternate attack paths, Scouting patrols, Hyperspace get away… for some of the things I have done.
![]()
What I would like to accomplish is:
- Positioning the MS for optimal mining like a human. (Getting Sphere of first miner and using some math this should be possible.
- Have AI Battle cruisers stay at range better like a human. (Not sure about this one!)
- Use Sphere to have attacking units Hyperspace more accurately… further away if need be, out of senor range, etc.
- Give the Human Players the ability to add their own build orders for my AI.
This is one area I failed at with first pass. It was far more difficult than I imagined. I may need to scrap the effort and start again. The IDEA is to allow a HUMAN to place a file in the profile directory and I import and populate into a table and process it. One difficulty (outside of the fact that I do not yet know how to read/write in homeworld lua) is that this has to be processed for X number of players because it runs in multi player. I wont get too much into this one yet… I just kept feeling like there was a better way to do it when I was writing. e.g. there has to be some way to import all the Research techs, unit costs, build times, unit names, oh the list goes on… without having to hard code in my MOD. An AI should be able to port well to updates… IMO.
Anyway… for those our there that have Idea’s for the AI, or some insight into where or how I should approach some of this (especially if you have already tried) please throw it at me! That includes the ney-sayers! I will either learn something and save myself hours of wasted effort or prove you wrong… either way it can turn into a WIN-WIN!
B8factor
Posts: 6
Participants: 3