Author Topic: Cpu Players In Multiplayer  (Read 3037 times)

Offline Luke

  • Newbie
  • *
  • Posts: 21
Cpu Players In Multiplayer
« on: February 02, 2007, 04:10:26 PM »
'Afternoon, gentlemen...

I swear I have seen someone ask this question already in these forums, but I can't find it again for the life of me so 'scuse the repeat.
In multiplayer games, is the computer opponent's existence (and number of them) fixed to the map you choose? This is my impression, but I am wondering if there is some type of mod where you can add computer opponents manually.

If there isn't, it would be great to be able to choose the CPU's color and colony, and perhaps even their difficulty. I know the AI isn't great but as far as their resources level goes and perhaps how fast they progress would be good difficulty level factors.

I think this would be a nice addition to the game, as it makes things a little more interesting, especially when you want to play large maps but don't have enough people to play. It would be fun if no one was online to play alone against 4 or 5 other computer opponnents, and also when I'm introducing people to the game it's nice to be able to ally against a computer opponent. I'm sure you can see why I think this would be cool at this point.

So, is there a mod already made where this is possible, or one that is being worked on? Or is this possible in OP2 as it is? If this isn't really possible at all without years of work, are there any maps that have two computer opponents on them?

Thanks for your answers, guys. :lol:

-Luke
   
The killer eiffel tower!!

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 404
Cpu Players In Multiplayer
« Reply #1 on: February 02, 2007, 04:25:31 PM »
You can't simply add computers into any game, because unlike other rts games, op2 doesn't have a standard AI. All op2 AIs are custom coded into the missions. This means that everything the AI does must be typed out and tested (taking a very long time).
« Last Edit: February 02, 2007, 04:26:06 PM by Mcshay »

Offline Luke

  • Newbie
  • *
  • Posts: 21
Cpu Players In Multiplayer
« Reply #2 on: February 02, 2007, 04:46:36 PM »
Is the nature of OP2's coding that everything really must be spelled out, from structure locations to construction of each vehicle?
Or is there some kind of 'standardized' (or standard-iz-able :P ) AI someone has already made that could be implemented into several mp maps? For example, depending on difficulty, the CPU would just progress at one of a few speeds and send out random numbers of attack vehicles at random times to enemy locations, possible high-yield ore locations, or other localized patrols?
Some games have different 'personalities' of AI, in OP2, this could mean an AI that likes to rush-attack, one that goes for advanced technology, guerilla-attack AI, one with colonization as top priority, one that is defense-oriented (focuses on walls and guard posts), etc, with each "personality" perhaps aligned to a different color. You get the idea.

Is this whole concept really impossible, because of the aforementioned OP2 code?
If not, what kind of "personalities" would people be interested in having?

-Luke :op2:  
The killer eiffel tower!!

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Cpu Players In Multiplayer
« Reply #3 on: February 02, 2007, 06:59:34 PM »
Well, to add a generic AI into the game engine itself that could play on any map, as a distinct player, would be a lot of work. Since each mission _is_ a piece of code (a .dll file) it would make more sense to implement a somewhat generic AI into specific missions, which uses up one player slot (see La Corrida and Peacekeeper for examples of this; ignore the fact that they are very simple/stupid AI's designed specifically for the map).

Eddy-B is currently working on something like that, basically a piece of code that would be added to a mission and could scan the map, figure out where impassable objects are, figure out where to locate structures, and so on. Basically, the work for creating a generic AI is shifted from the game developer to the mission designer here. (and in the case of OP2, it wasn't really necessary to implement a generic AI in the game engine itself -- mainly because they did not intend for users to create their own missions for the game. Any missions that were released were created by Dynamix, and thus had any necessary AI coding in place inside the mission).

The personalities aligned to color is an interesting thing, but the main issue is that an AI cannot appear as a player in the players list and thus its color or race could not be controlled by the player. This would have to be hardcoded or randomly selected in the mission.

Offline Brazilian Fan

  • Sr. Member
  • ****
  • Posts: 302
Cpu Players In Multiplayer
« Reply #4 on: February 03, 2007, 12:25:13 PM »
Quote
I swear I have seen someone ask this question already in these forums, but I can't find it again for the life of me so 'scuse the repeat.

That was me, can't remember the topic too  :P

How 'bout a separate "client program", that connects to OP2 and act as a normal player?

Or a general AI coded into a separate dll, just waiting for a scenario call for it and DESTROY ALL ENEMYES, MHAUHAUAHUAHUAHAU.

Offline TRIX Rabbit

  • Full Member
  • ***
  • Posts: 139
    • http://androidar.deviantart.com/
Cpu Players In Multiplayer
« Reply #5 on: February 03, 2007, 04:39:04 PM »
We could study the way people play, and make an AI from there. For instance, some maps use, for example Leviathan, while others use other players. I think that making an AI for each map would be tedious, but it could make it easier than having an AI for all maps.

Note: Leviathan should be a Hard difficulty opponent.
I'm more commonly known as AndroidAR now:
My deviantArt

Offline Savant 231-A

  • Sr. Member
  • ****
  • Posts: 486
    • https://www.outpost2.net
Cpu Players In Multiplayer
« Reply #6 on: February 04, 2007, 02:04:57 AM »
Lol, if you are so willing to have bots in multiplayer, why wouldn't you help eddy or anybody else who works on AI? Maybe you could be of some help.
Gordon Freeman, and mr. Crowbar would own Master Chief in any part of the day.
"Come here citizen."

"From the ashes of the collapse we seek to build a better world for all."

Offline Luke

  • Newbie
  • *
  • Posts: 21
Cpu Players In Multiplayer
« Reply #7 on: February 04, 2007, 10:42:18 PM »
:P  You're right, I should help, if I knew how to code anything besides HTML and CSS. I half wondered if anything like that was in progress, and half was just dreaming.
The killer eiffel tower!!

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Cpu Players In Multiplayer
« Reply #8 on: February 05, 2007, 02:09:36 PM »
Quote
How 'bout a separate "client program", that connects to OP2 and act as a normal player?
To go to that work you'd basically be rewriting the OP2 game engine and just not having a UI, since it would have to rely on all the 'assumptions' that the regular game does.

Remember that stats like the amount of ore a player has, etc., are never sent across the wire -- only actions are. So the program would need to be able to manage these actions.

It would also have to be able to load levels, and manage in-game things the same way, for example disasters and morale just to give a limited example.

A separate DLL would work, like a shared library that other missions can call into. However, it seems like you could have a fair bit of 'DLL hell' if you did that (wrong versions of the AI dll, etc).

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Cpu Players In Multiplayer
« Reply #9 on: February 05, 2007, 05:39:35 PM »
Heh, just a few of the reasons why I've pretty much given up on the idea. With the amount of time it'd take to write a good AI for this game, it seems like you might as well have just rewritten the whole game and included better support for writing an AI. The exported functions don't really cut it for a lot of things, so to write a decent AI, in particular one that doesn't cheat, you really need to hack into the game and understand it's internals which aren't exposed in any standard way. Suffice it to say that writing a good AI for OP2, particularly a general use one, is a huge mess.

So yeah, I think a better project than an OP2 AI, would be an OP2 clone, which you could add decent AI support to in a well organized and standard way. (Even if you didn't have the time to write the AI, you could at least expose enough that other people can).