Computer Player Allies / Enemies

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
adam_bise
Filter Inserter
Filter Inserter
Posts: 360
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Computer Player Allies / Enemies

Post by adam_bise »

Would be nice to select a number of computer players as either allies or enemies.

Koub
Global Moderator
Global Moderator
Posts: 7203
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Computer Player Allies / Enemies

Post by Koub »

Would require the implementation of a computer AI. Preferably in several different levels. That's a lot of work (to do it right).
Koub - Please consider English is not my native language.

adam_bise
Filter Inserter
Filter Inserter
Posts: 360
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Computer Player Allies / Enemies

Post by adam_bise »

At least the game already supports more than one player / force. So those components are in place already. Just need to make a distinction between AI and human player and then script the AI.

Course, I'm no programmer so have no idea how hard that would be.

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Computer Player Allies / Enemies

Post by mrvn »

adam_bise wrote:
Wed Oct 27, 2021 10:04 pm
At least the game already supports more than one player / force. So those components are in place already. Just need to make a distinction between AI and human player and then script the AI.

Course, I'm no programmer so have no idea how hard that would be.
Making something that has some hardcoded blueprints, tech goals and progression to building a rocket wouldn't be too hard. Figuring out belts to get from mines to the factory or train tracks will probably be the hardest there.

Having something that can attack a player in a challenging way or defend against a player? Difficulty goes way way up.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Computer Player Allies / Enemies

Post by ssilk »

When you see how hard it is to create an AI for Factorio. …

See viewtopic.php?f=5&t=98794
And further the, see his videos, how often he struggles with simple details.

Not easy.

Lately I thought about what AIs you need to do that:

- an master AI, which understand in which phase(s) of the game you currently are and from here it triggers the other AIs.
- early game AI, understands to make everything by hand
- burner AI is clever enough to make resources on the mines.
- assembling AI that can create repetitive structures (assemblies, labs, chemical plants…) for producing all kinds of items. What item is told from master AI
- research-AI knows what to research now. In very high cooperation with the master AI.
And so on and so on.
-
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Computer Player Allies / Enemies

Post by mrvn »

Well, JOSEF has to do everything with circuit wires. Normally you would look at chunks and read out what ores are present or where water is.

That said think about what happens when an enemy player shoots the locomotive. Game over JOSEF.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Computer Player Allies / Enemies

Post by ssilk »

Yah, exactly, but such wired cases can also happen in Factorio when you write mods and mean you have the full control over an process.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Computer Player Allies / Enemies

Post by mrvn »

Indeed. The fact that factorio already has self expanding factories shows that building an AI that can launch a rocket is not that hard. Or look at the mini factories that assemble and disassemble themself to build different stages for the rocket and in the end launch one and start over.

The fact there is no mod for an AI enemy hints that that is a real challenge.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Computer Player Allies / Enemies

Post by ssilk »

The problem is, that you cannot know, if the AI makes progress.
AI learning Go:
AI: what should I do?
Programmer: you should win the game! Here are the rules.
AI: ahhhh!

AI learning Factorio:
AI: what should I do?
Programmer: you should start the rocket!
AI: rocket wad??? There is no rocket.

Factorio can’t be solved by a soft AI, you need a hard AI.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Computer Player Allies / Enemies

Post by mrvn »

I was thinking ASI, artificial sequential inteligence, not a self learning AI like a neural net. An ASI basically just has a cook book or decision tree / graph that it follows. You can have multiple ASI with some overlord ASI that decides which AI to follow too like you described.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Computer Player Allies / Enemies

Post by ssilk »

But you need to know which of the ASI should now work. You can create worlds, where you need a completely different strategy, which an ASI is not programmed to. That’s also not possible to know for a soft AI in every case in Factorio. You need an hard AI.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Computer Player Allies / Enemies

Post by mrvn »

True, an ASI will not adapt. The behavior is hardcoded. Throw in a mod that it doesn't understand and it breaks. The "progress feedback" that would be missing for a self learning AI is baked into the decision tree.

You can still make it quite smart. Mods that just add some extra recipes or intermediaries an ASI can figure out. Even something like Bobs or Angels mods is not unreasonable if you teach the ASI to handle loops in the recipes. You can use that already in vanilla for the late game oil stuff. Or covarex. Although those loops are simple compared to some mods have.

Obviously a self learning / adadptive AI would be better but as you say: How do you tell it that it's making progress? Best idea I have there would be feeding it recorded games so it has a baseline for how to launch a rocket.

Post Reply

Return to “Ideas and Suggestions”