hardcoded AI

Hi. I would like to inquire as to why major portions of this game, especially in Rebellion as it is the latest installment yet no change was made, are hardcoded?
Considering these systems integrate with the modding system so heavily, is it not counter-intuitive to restrict them so heavily?

 

The AI System is one thing that really should not be hardcoded. I've actually never played an RTS that maintains it's AI system constraints inside executable code. And I must admit it is quite frustrating.

It lends me to believe there is a STRUCT somewhere that contains a massive definition for AI operations - which I would love to find using Olly or IDA Pro. And I might just have to do that...

 

I like where this went: https://forums.sinsofasolarempire.com/415096

Does anyone have any suggestions contrary to hacking? 

9,670 views 14 replies
Reply #1 Top

Well as that thread pointed out, you can change some priorities in the Gameplay.Constants file, and there are other things you can do to the AI, such as getting them to research key techs my making duming techs only the AI can research that have them as prereqs. The biggest issue is not being able to teach the AI how to handle battles differently. I wouldn't recommend hacking it though, even if you succeeded you can't just make a normal mod for people to download. :S

Reply #2 Top

totally agree, thank you for the response. Just wish I had some method of instructing them how to operate, just a simple if this do that, else if this, do else if , else... do last resort. That kind of thing. 

Here's one thing I'd like to ask directly though regarding this topic:

Quoting Lavo_2, reply 22
I've found that if you give the AI capital ships that level up to 3 as soon as they are built the AI will spam capital ships. It isn't unusual to see fleets with 6+ capitals per fleet with such autoleveling. This was observed in the SoGE beta, before this was bumped down to level 2 due to being overwhelming because of our titans. As well, if you reduce the research cost to 0 for the AI, it will keep researching. I realize this sounds silly, but it makes the AI play a good deal better, in particular it ensures that ability unlocking techs are researched, among other things.
End of Lavo_2's quote

What exactly was he referring to? I've been searching heavily and have not found any .Constant variable or even within the capitalship def, or sharedAItable, where one can change that. But I would really like to , lol more capital ships, the better at this point. Need to get the AI more... deadly.

Reply #3 Top

Gameplay.Constants an entity file in gameinfo.

I fully support the reverse engineering of the game to expose the AI, but unfortunately I am no programmer and can offer no assistance other than warning that what you'll find inside the exe is probably a colossal mess given how badly the AI performs even mundane tasks like keeping its units together.

 

Oh, and Blizzard is another company that lovingly hardcodes everything.

Reply #4 Top

Quoting swucskdl, reply 2
What exactly was he referring to? I've been searching heavily and have not found any .Constant variable or even within the capitalship def, or sharedAItable, where one can change that. But I would really like to , lol more capital ships, the better at this point. Need to get the AI more... deadly.
End of swucskdl's quote

You know the that tier 8 advent tech that gives capitalship xp slowly over time up to a certain level? Basically he gave the AI a cheat tech that only they could research that would give like 10000 XP per second up to level 3, or in other words let the AI build capitalships right at level 3. Also note his mod is a total conversion, if you tried to do this with the Vanilla game it would break the tech its based of off, so you'd need to modify it the normal Advent version so the AI isn't get instant level 7 caps... 8O

Reply #5 Top

How was he able to give a tech that only the AI could research? I assume it was a research button a Player couldn't see on there screen, but as the AI is all knowing it could see it and interact with it?

Reply #6 Top

@Ben_Maxwell  

I am wondering the same thing. The only theory I am coming up with is making a duplicate player definition, but setting it 's IsSelectable to false. So like copy A.] PlayerPhaseLoyalist.entity and name it B.] PlayerPhaseLoyalist_AI.entity, add it to the manifest of course. Then change [B]'s isSelectable to false, and [A]'s remain true, except somehow disable the AI from using [A]?

Just an idea there. I'm also looking into that, cause it's a wonderful idea.

Reply #7 Top

Quoting Ben_Maxwell, reply 6
How was he able to give a tech that only the AI could research? I assume it was a research button a Player couldn't see on there screen, but as the AI is all knowing it could see it and interact with it?
End of Ben_Maxwell's quote

Yup, that's basically how. It's off-screen and the AI can see everything. I also have it give a small fleet supply increase and a single capital ship crew; which in combination with it's cost of 0, ensures that the AI will almost always research it within the first 5-15 minutes of gameplay. You can view the tech in full on pastebin if you wish. I also made it cost negative resources in order to give the AI a one time resource boost.

Reply #8 Top

oh cool. Well I assume then, that players that play the same race can use the same research item? (I hope not?)

Reply #9 Top

Quoting swucskdl, reply 9
oh cool. Well I assume then, that players that play the same race can use the same research item? (I hope not?)
End of swucskdl's quote

You can't research what you can't see. Only the AI can see it. I mean this quite literally.

Reply #10 Top

Quoting Lavo_2, reply 10
You can't research what you can't see. Only the AI can see it. I mean this quite literally.
End of Lavo_2's quote

Yup. If its off the GUI the player can't click it. But the AI doesn't use the GUI, it just uses some list of all the techs and picks from that. It generates a few error messages in the dev.exe but works perfectly. You can also tie this in to abilities by giving the AI extra abilities that require a tech only it can research.

Reply #11 Top

It was a very ingenious way of doing things, though I suspect it was found by trial & error :P Still very interesting, I may use this Ability toward the end of my Mod (couldn't stand the dev exe errors in the mean time ha ha).

@GoaFan77, *Off Topic* Do you know of an updated Galaxy Scenario Definition which lists all the Planetary Bonuses and other unlisted items in the stock Definition which comes in Galaxy Forge?

Reply #12 Top

absolutely brilliant. Works exactly as described. So far the AI has been nothing but exemplary, loving every minute. The only thing I'm worried about is how it will manage at end-game. Wish I had a newer / faster computer so i could 8x it :P

 

Thanks all, great info here :)

Reply #13 Top

The "Ai-Driver" system worked out by GoaFan, Lavo_2 and ZombieRus5 (and probably more) works great and isn't as complicated as one would think. 

Reply #14 Top

Quoting SemazRalan, reply 14
The "Ai-Driver" system worked out by GoaFan, Lavo_2 and ZombieRus5 (and probably more) works great and isn't as complicated as one would think. 

End of SemazRalan's quote

It was a good collaboration.

You can read the details here: Improving the AI