NEW AI for Empire Earth

Talk about anything EE related and doesn't belong in another forum. Gameplay, chit-chat, or any questions you have -- it all belongs here.
Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

NEW AI for Empire Earth

Post by Udolf »

Hi all,

I'm an EE fan from Germany. As you may all know, the AI from Empire Earth is very very bad, to say it in a polite way.
This is why I wanted to create a "new AI" for EE. Unfortunately the source code of the game is not available, so
I had to do it with the Scenario. I'm working on the "new AI" for almost half a year now, and it works only for Middle Age.
Basically it's a scenario game that you can change to your likings if you want. I put "new AI" into quotation marks, because it's actually just a scenario with a lot of Triggers, and the Triggers will help the AI to work in an intelligent way. It's not ready yet, but it will be in some months I guess. Please tell me if this is something that you will be interested in or not. You can also ask anything you want to know or if you have improvement suggestions, you can tell them to me. However, please note that I'm limited by the restrictions of the Scenario Editor.

Here are some features of the new AI:
- It doesn't cheat at all (most important!)
- It doesn't kill its own units like the normal AI of Empire Earth
- It quickly gives tasks to all idle citizens
- It recreates destroyed farms
- It attacks hostile citizens who try to build a building
- It attacks hostile priests, prophets and heroes with a large part of its army
- It builds buildings quickly with several citizens
- It places towers intelligently
- It populates settlements with wounded citizens
- It handles its economy intelligently, allowing citizens only to work for resources which are necessary
- It will be able to play together with you against others, either other human players or AI players, it doesn't matter

If you have more suggestions, please tell me.

MxT
Forum Noob
Posts: 8
Joined: Thu May 07, 2015 10:10 am
Lobby Username: -Istari- MxT

Re: NEW AI for Empire Earth

Post by MxT »

Nice to see people still working on the game :) I really like it! The AI really sucks, Stainless did a bad job on them, for beginnerst hard to handle and none of its steps is reproducable for human players. Is it possible to may add several commands, so the human ally can tell the AI to attack/defend whatever? You may talk to Jodocus to find a way to apply the new AI to the multiplayer games! This would be an awesome solution for the times, the lobby isn't already playable crowded like in the morning to fill up games!

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

Hello MxT. I'm glad that you like it. Thanks for your suggestion. What you suggested is possible. I could create a Trigger which would search for words like "help" or "attack" in the messages of allies.
In case you write "help", he would send you help, and in case you write "attack", he would attack the enemy, so you could synchronize your attacks with the AI, just like you would do it with a human player.
As far as I know it's possible without any problems to play scenarios in multiplayer games, so there is no more programing necessary. You simply load the map with the AI, and it will work just fine.

What about the others? What are your suggestions? You think the new AI could be something interesting for you?

User avatar
lightnessking.
Nemesis
Posts: 2050
Joined: Fri Nov 27, 2009 9:27 pm

Re: NEW AI for Empire Earth

Post by lightnessking. »

The idea is really great, but in my experience is that some triggers will 'fight' with each other, causing the scenario to crash. (had this many times :P)
You cannot make another post so soon after your last.

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

Thanks for your feedback.

I thought about your idea MxT. It's possible to do it like this:
When you want help, you mark a unit and write "help". The AI will send you support to the unit that you marked.
The same goes if you want the AI to fight an enemy:
You mark a hostile unit and write "attack". The AI send it's army to the hostile unit that you marked.
But I didn't implemented this feature so far, because there are things which are more important for the AI,
like its economy, that I want to fix before that. Furthermore I have to fight with performance issues, and therefore I try to avoid
every unnecessary Trigger at the moment.

Hello lightnessking,
you're right, this can happen. Triggers can "fight" each other, and cause the scenario to crash. But so far, I was always able to find the reason for the crash and fix it.
So there are no crashs at the moment with this AI, even though it has 120 Triggers. My biggest enemy at the moment is the performance. If there are many units in the game,
it may lagg. This is why I try to make the conditions as simple as possible and I try to keep the number of Triggers as low as possible. If your Scenario crashes I suggest
you save it with an other name just before it crashes, and then you load the scenario again and again, and every time you load it, you delete a Trigger and test the Scenario,
to see if this Trigger caused the crash. You understand?

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

I tested the AI in a fight against other normal AIs. It destroys five normal AIs (if none of them is cheating).

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

@Jodocus and any other person who knows how to mod/program:
I have a problem. There is an error with the EE Scenario Editor that I didn't know:
When you create 7 players for the scenario, then you expand it to 8 players and after that you set it back to 7 players, the scenario is changed somehow and the game will crash if you load it as an ees file. Unfortunately this is what I have done, so I search a way to undo it. Do you know a way to change things in the Scenario file without the Scenario Editor?

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

Hello guys.

I just want you to know that I'm still working on this. You can't even imagine how much work this is.
Maybe you ask yourself why I'm not presenting anything. The reason is, that I don't want to present something that isn't even ready to play with properly.

My biggest problem still is the performance, but this doesn't seem to be my fault, it's some error inside Empire Earth. After some time of playing, the game laggs,
then when I save the game, exit and reload, it doesn't lagg anymore. Also there are some errors in the Scenario Editor which I try to fix with Triggers. I wish I could edit the Source Code, I could make the AI so much better then. With the Scenario Editor, my possibilities are very limited, unfortunately. However, the only reason why I can even create a new AI like this is that the Scenario Editor of Empire Earth is very complex and intelligently created.

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

UPDATE:

New features I implemented in the AI:

- AI kills animals of hostile players (this was extremely much work, but the result is satisfying for me)
- AI lures animals to its capitol and kills them either there or near its settlement, city centre or silo for shortest way to the flesh
- AI orders its hero back to the capitol if he is heavily wounded, so he doesn't get killed so easily
- AI preferably collects flesh from one dead animal for minimization of rotting time and maximization of flesh (thanks Arntzen for your discovery, I implemented it)
- AI defends attacks in the view area of its buildings with all army units available in the view area of its buildings
- AI passes by hostile towers if available units for the attack are too few to destroy the tower for minimization of casualties
- AI towers aim at hostile units which aren't moving so AI's towers almost always hit their targets

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

I can see that the scenario editor wasn't created to do something like this. For normal scenarios you don't need so many triggers, the scenario already has approximately 150 triggers, and they will be more in the end, which means hundreds of conditions and effects which are checked several times per second, leading to maybe even more lagging. I hope I'll be able to reduce the lagging.

Did anyone of you or somebody that you know ever created an EE scenario with so many triggers, effects and objects? (Approximately 150 triggers - conditions, effects and objects together may be more than thousand.)

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

If you have suggestions for improvements or considerations, they are welcome.

User avatar
lightnessking.
Nemesis
Posts: 2050
Joined: Fri Nov 27, 2009 9:27 pm

Re: NEW AI for Empire Earth

Post by lightnessking. »

hey udolf, i'm interested in how you managed the towers to shoot at non moving units.
You cannot make another post so soon after your last.

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

Hey Lightnessking, nice to see somebody is interested in my AI. :)
This Trigger was a lot of work actually. You will see how it works.
First, the tower within view area of an enemy unit which has the state "wait for reload" (not moving) gets variable 10. Then, the enemy unit within range of the tower with variable 10 gets variable 11. Then all towers within view area of the enemy unit with variable 11 get also variable 10. Then all towers with variable 10 shoot at the one hostile unit with variable 11, so the hostile unit is dead immediately if there are numerous towers. Then the variables of said units are reset to zero. This is much more efficient than the normal way the tower attacks.

Small update:
I managed to get the AI develop the swordsman's properties in an efficient way. This is the order the AI will develop the swordsman's properties:
1. HP
2. Attack
3. Speed
4. HP
5. Speed

If you think an other order would be better, or other properties would be better to improve, please tell me. I don't really know which properties are best to improve with swordsman, this is just my guess. Thank you.
Last edited by Udolf on Fri Jun 26, 2015 2:34 am, edited 1 time in total.

User avatar
Arntzen
Administrator
Posts: 1983
Joined: Sun Jan 17, 2010 4:13 am
Lobby Username: _[eC]_Arntzen_
Location: Norway

Re: NEW AI for Empire Earth

Post by Arntzen »

For AI, I really like those sword upgrades. Of course human would do them slightly differently, but a human would always have sword upgrades in their civ, AI don't.
What you did is something like what I do when I make swordsmen without having them in civ.
A Good Place to Start: viewtopic.php?f=75&t=3884
Click to download: eC Civilization

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: NEW AI for Empire Earth

Post by Udolf »

The AI also got a civilization. This is the AI's civilization.
Attachments
New AI Civilization.png
Last edited by Udolf on Fri Jun 26, 2015 5:30 am, edited 1 time in total.

Post Reply

Return to “EE General Discussion”

Who is online

Users browsing this forum: No registered users and 20 guests