Forged Alliance Forever Forged Alliance Forever Forums 2018-11-20T19:38:08+02:00 /feed.php?f=41&t=16925 2018-11-20T19:38:08+02:00 2018-11-20T19:38:08+02:00 /viewtopic.php?t=16925&p=169729#p169729 <![CDATA[Re: Is it possible to implement AI as UI mod?]]> http://forums.faforever.com/viewtopic.php?f=41&t=13145

If you build a drone factory, then it will automated build up to 10 drones.
The drones itself are looking around for reclaimables, moving to it and reclaim it.
Good example for "SIM-Mod" bot units ;)

Statistics: Posted by Uveso — 20 Nov 2018, 19:38


]]>
2018-11-20T16:38:26+02:00 2018-11-20T16:38:26+02:00 /viewtopic.php?t=16925&p=169720#p169720 <![CDATA[Re: Is it possible to implement AI as UI mod?]]> If i need some further advice on how to use undocumented Supcom engine functions i will ask in the AI forum section. But before asking i will always look for examles across existing mods.

Statistics: Posted by mas — 20 Nov 2018, 16:38


]]>
2018-11-20T01:52:46+02:00 2018-11-20T01:52:46+02:00 /viewtopic.php?t=16925&p=169709#p169709 <![CDATA[Re: Is it possible to implement AI as UI mod?]]>
mas wrote:
If someone knows how to disable completely the integral AI logic when starting game in AI mode, i will be thankful for the information.


This is handled by a single function (InitializeSkirmishSystems):

https://github.com/FAForever/fa/blob/45 ... n.lua#L926

Statistics: Posted by Uveso — 20 Nov 2018, 01:52


]]>
2018-11-20T01:49:31+02:00 2018-11-20T01:49:31+02:00 /viewtopic.php?t=16925&p=169708#p169708 <![CDATA[Re: Is it possible to implement AI as UI mod?]]>
I mean integral AI must not only stop giving orders to units, but it also must not build / upgrade anything, must not set anything on pause, so on. It must stop doing anything at all, it should effectively "die", but not crashing the game and other scripts :)

Statistics: Posted by mas — 20 Nov 2018, 01:49


]]>
2018-11-20T01:51:59+02:00 2018-11-20T01:35:07+02:00 /viewtopic.php?t=16925&p=169706#p169706 <![CDATA[Re: Is it possible to implement AI as UI mod?]]>
> Btw, tha actual AI system is not bad, if you only use it to select your units.
> Then control the units with your own scripts like my AI does.
> This way you don't need to program the basics of an AI like conditionmonitor, location manager and so on.

It may be good, brilliant or anything. I just do not want it to interfere with my logic anyhow.
I want clean experiments with implementing different AI functions. When some external "black box" is "helping" me somehow that is not clean experiment and that is of less interest.

> You simply can't add a mini AI to every single unit. That's why SUPCOM is using platoons...

Please, let us skip repeating some parts of the university course. I am myself a professional software developer (for 15 years already) and i know some basics of machine learning, chess AI and other "true-AI" things. I understand basic concepts rather well. Using platoons (on my own) is quite ok.
Some external "black box" program (good or bad) interfering with my AI experiments - that is not ok.

If you know the quick way to get rid of game-integral AI completely (including condition manager, location manager and all other "useful stuff"), please give me direct advice on that.

Currently i know only one way - to start a game as a human player (so no integral AI is involved), then leave mouse alone and allow my sim mod to overtake full control over everything. Which is equivalent to making a bot - that is almost the only reason why I am talking about bots so much.
(Another lesser reason is that i also have ideas to experiment with combined AI+human control)

If someone knows how to disable completely the integral AI logic when starting game in AI mode, i will be thankful for the information.

Statistics: Posted by mas — 20 Nov 2018, 01:35


]]>
2018-11-19T20:19:44+02:00 2018-11-19T20:19:44+02:00 /viewtopic.php?t=16925&p=169696#p169696 <![CDATA[Re: Is it possible to implement AI as UI mod?]]> A: Only if you do this as UI mod. As Sim mod you can make a bot if you like.

Q: But as far as i learned, programs like Sorian AI are only tweaking settings of some AI code internal to the game core, which still continues to make some critical decisions.
A: no, you have full control over everything.

Q: What if i wish to write an AI program that will control everything in detail, giving exact commands to every entity like player does?
A: Only a question of CPU power. Units are controled in platoons, but like experimentals you can add a programmthread to a single unit and control everything from there.

Q: Is it possible with "normal" AI scripting or it requires bot creation using some SIM modding for bot-game interface?
A: AI scripts / programming is sim side only. Ui is only to display things.

Q: I did not looked into Uveso's source code yet
A: You should. I have several own functions to search for targets, move units, buildconditions.

Q: It is a set of a few very simple rules for the "predefined" AI algorithm that is a part of the game core.
A: No. I only use the Ai to select units with my buildconditions and then my own functions are controling platoons/units

Q: My primary question is how to retire that in-game AI completely and take full algorithmic control on every unit and every command.
A: You only need to tell the AI that it has to use your programmed functions to move / control units.

Q: I had an idea of creating an AI mod that can turn human player into a "bot" - (after pressing a hotkey)
A: The AI already can take over a human player if the player disconnects from a game. So this function is already present.

Q: I want to create a new AI from scratch, not to write a set of rules for build-in algorithm to work better, but to write a new algorithm itself (based on AI science)
A: Well, yes it is possible in theory. But you can't. Even if you have fixed AI scripts without learning algorithm there is not enough CPU power to do so.
A: You simply can't add a mini AI to every single unit. That's why SUPCOM is using platoons to control multiple units with a single AI programm thread.

You should first learn / understand how the actual AI is working.
Most of your questions should be answered then.

Btw, tha actual AI system is not bad, if you only use it to select your units.
Then control the units with your own scripts like my AI does.
This way you don't need to programm the basics of an AI like conditionmonitor, location manager and so on.
And you can control every single unit with its own programmcode if you wish. (but this will be slow after 400+ units.)

Statistics: Posted by Uveso — 19 Nov 2018, 20:19


]]>
2018-11-19T18:40:06+02:00 2018-11-19T18:40:06+02:00 /viewtopic.php?t=16925&p=169694#p169694 <![CDATA[Re: Is it possible to implement AI as UI mod?]]>
Anihilnine wrote:
still not sure if you can get the enemy data


You can on simside But it's tricky because recover opponent functions bypass radar and sneak.

Statistics: Posted by Franck83 — 19 Nov 2018, 18:40


]]>
2018-11-19T18:35:42+02:00 2018-11-19T18:35:42+02:00 /viewtopic.php?t=16925&p=169693#p169693 <![CDATA[Re: Is it possible to implement AI as UI mod?]]>

Does Uveso or anyone else knows how to get rid of built-in AI engine ?

If you don't want to override a complete AI, you can just mod like part of a human brain units. You can micro-AI it on a single unit. On sim-side, it's easy to do on human brain because there is no AI behavior by default.

For example, on my alliance of heroes mod there are several micro-AI assists. You have an auto-dodge and auto attack feature on your hero units. If an artillery outrange my hero unit and hit, my unit will respond by pursuing its opponent on a max range defined by the player (just like defensive and aggresive stance on other rts age of empire...).

You have micro-assist on heals and casting powers. AI ACU autocasts some powers when conditions trigger. On your unit, you can active auto heals or auto fire powers. it triggers only at some conditions (opponents at range, low health...).

So you can make an autobuilt mex engineer on sim side. It quite easy to do. You can make advanced bombard squads. Your bombers can check if there are aircrafts at range. It no, it can trigger bombards support. And retreat on interceptors attack.
You can make your artilleries stay at max range and retreat if your opponent send you units.

Statistics: Posted by Franck83 — 19 Nov 2018, 18:35


]]>
2018-11-19T18:00:11+02:00 2018-11-19T18:00:11+02:00 /viewtopic.php?t=16925&p=169690#p169690 <![CDATA[Re: Is it possible to implement AI as UI mod?]]>
Here's the list of all available engine functions http://supcom.wikia.com/wiki/LUADOC_1.5.3599 that's what you have to work with, feel free to go crazy

The same list is split on github https://github.com/FAForever/fa/tree/develop/engine and some functions are bit documented. Also git is good for finding examples how to use those functions (since majority isn't documented at all)

Have fun :)

Statistics: Posted by speed2 — 19 Nov 2018, 18:00


]]>
2018-11-19T15:57:39+02:00 2018-11-19T15:57:39+02:00 /viewtopic.php?t=16925&p=169688#p169688 <![CDATA[Re: Is it possible to implement AI as UI mod?]]>

you write a sim mod that selects units and issues orders.

still not sure if you can get the enemy data

Statistics: Posted by nine2 — 19 Nov 2018, 15:57


]]>
2018-11-19T15:58:41+02:00 2018-11-19T15:53:33+02:00 /viewtopic.php?t=16925&p=169687#p169687 <![CDATA[Re: Is it possible to implement AI as UI mod?]]> I did not looked into Uveso's source code yet, but what Softly have done... that is not an AI algorithm. Absolutely. It is a set of a few very simple rules for the "predefined" AI algorithm that is a part of the game core. If you look at the code by Softly you will see it instantly - it is a few lines and has nothing to do with any real AI research.

My primary question is not how to write rule files for game internal AI algorithm to improve it a bit - that is of zero interest for me.
My primary question is how to retire that in-game AI completely and take full algorithmic control on every unit and every command.
I had an idea of creating an AI mod that can turn human player into a "bot" - (after pressing a hotkey) it overtakes control and starts commanding all units and structures. The intention was not to cheat and deceive other players (and I hardly could win games like that easily - years of work are required to create a script that will win a good battle).
My intention was to get rid of built-in AI engine _completely. Deactivate it. And it is not active when game thinks human is playing.
Also, i had plans to test specific AI functions separately during a "normal" game - like (A) building economy, (B) micro-controlling anti-air fights, ...

Does Uveso or anyone else knows how to get rid of built-in AI engine? Please note - I want to create a new AI from scratch, not to write a set of rules for build-in algorithm to work better, but to write a new algorithm itself (based on AI science), not using _any function of the pre-existing one (I need that for clean experiment)

Statistics: Posted by mas — 19 Nov 2018, 15:53


]]>
2018-11-19T11:29:09+02:00 2018-11-19T11:29:09+02:00 /viewtopic.php?t=16925&p=169685#p169685 <![CDATA[Re: Is it possible to implement AI as UI mod?]]>
You want to change rules or balance ? you want add creative assisting tools ? just go on sim mod.

Statistics: Posted by Franck83 — 19 Nov 2018, 11:29


]]>
2018-11-19T10:04:00+02:00 2018-11-19T10:04:00+02:00 /viewtopic.php?t=16925&p=169684#p169684 <![CDATA[Re: Is it possible to implement AI as UI mod?]]> Its allowed, some consider is cheating, some don't.

What I was speaking about, which would be already over the line is for example a UI mod that can hover bomb pretty much unlimited number of bombers at the same time. Washy made that mod, just to demonstrate that it's possible.

Writing a new AI that would control the units in more detail is possible, but it will always have to be a sim mod. Uveso made his own AI, same for Softly, which should be already better than Sorian. And I'm sure it can still be improved.

There's a subforum for AI if you wanna start with it /viewforum.php?f=88
And there should be some basic guide on the wiki on adding a new AI.

Statistics: Posted by speed2 — 19 Nov 2018, 10:04


]]>
2018-11-18T23:49:12+02:00 2018-11-18T23:49:12+02:00 /viewtopic.php?t=16925&p=169682#p169682 <![CDATA[Re: Is it possible to implement AI as UI mod?]]> I do not know if it is really so important for everyone to know for sure what rules every hostile army - a human, an algorithm, or some complex system of both. For me it would be even more intriguing to play if any opponent could turn to be AI... if AI could play well enough and it would be hard to guess. It could be like part of game story is coming true right now :)

For me cheating is breaking game physics like programming enemy object to die without inflicting damage on it or like detecting an object that should not be "physically" visible from my current position. But why it matters which way i decide what commands to issue and if i use some tool to boost my mind or even APM? If using ecomanager is not cheating, why using some tool to give automated mass commands is so bad?

But ok, if you insist such things should be ruled out, i am not going to argue too much. Let it be forbidden... at least for the moment (when existing AIs are not too good)
As far as i understood you, i should never try creating a bot, or i will be banned for that.
But if i create a bot that requires specific SIM mod to run? And if mod name and lobby title clearly states it is about bot testing, is that also against the rules?

Also i could try to create "regular" AI script like Sorian AI. But as far as i learned, programs like Sorian AI are only tweaking settings of some AI code internal to the game core, which still continues to make some critical decisions. What if i wish to write an AI program that will control everything in detail, giving exact commands to every entity like player does? And detecting objects like player does (via radars and unit vision)? Is it possible with "normal" AI scripting or it requires bot creation using some SIM modding for bot-game interface?

Statistics: Posted by mas — 18 Nov 2018, 23:49


]]>
2018-11-18T19:18:06+02:00 2018-11-18T19:18:06+02:00 /viewtopic.php?t=16925&p=169679#p169679 <![CDATA[Re: Is it possible to implement AI as UI mod?]]>
Uveso wrote:
speed2 wrote:Like to issue move and attack is kinda possible


well, if you have the old sorian functions in mind... I removed them in AI patch V2. :mrgreen:

No and don't ask :P

Statistics: Posted by speed2 — 18 Nov 2018, 19:18


]]>