Light Style© by Fisana

Jump to content


Photo

#1054 - multiplayer with no humans


  • Please log in to reply
7 replies to this topic

#1 MattDoerksen

MattDoerksen

    Discens

  • Community Members
  • Pip
  • 21 posts

Posted 13 April 2012 - 12:30 AM


Description: It is possible to host a multiplayer game with only bots. When launched, gui/session/session.js fails because playerState is undefined.



How do we want to handle this? I would assume that, since it's a multiplayer game we should force at least 2 non-AI players to be in the game (if 0, it shouldn't be valid anyway otherwise it will get ugly. If 1 then they should play a local game instead). Can I get a confirmation that this is how it should be done.


Matt
  • 0

#2 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,967 posts

Posted 13 April 2012 - 12:45 AM

It should probably just launch a single player game at that point.
  • 0

#3 MattDoerksen

MattDoerksen

    Discens

  • Community Members
  • Pip
  • 21 posts

Posted 13 April 2012 - 01:45 AM

It should probably just launch a single player game at that point.


I don't know if that's going to be very clean (or even possible) because of the setup performed when we make it a multiplayer game (as opposed to a single player game where we don't need the network). This means we'd have a lot of setup that needs to be discarded (fine) but all of the information that was set (and is needed) such as # players, civs, etc. won't work since the multiplayer setup uses different data structures for network games.

I think the best thing to do is say at least 2 humans must be part of the game. Then they can choose to back out or have the other person join. But I'll let some one else also come in and give their 2c on this.
  • 0

#4 MattDoerksen

MattDoerksen

    Discens

  • Community Members
  • Pip
  • 21 posts

Posted 13 April 2012 - 06:30 PM

I don't know if that's going to be very clean (or even possible) because of the setup performed when we make it a multiplayer game (as opposed to a single player game where we don't need the network). This means we'd have a lot of setup that needs to be discarded (fine) but all of the information that was set (and is needed) such as # players, civs, etc. won't work since the multiplayer setup uses different data structures for network games.

I think the best thing to do is say at least 2 humans must be part of the game. Then they can choose to back out or have the other person join. But I'll let some one else also come in and give their 2c on this.


I've gone ahead and started on something and I'd like to get some feedback on it (attached, change extension to .js). Due to the different game setup for a network game as opposed to a single player game, I've specified that at least 2 humans must be in a network game before it will proceed (otherwise they should back out and make a single player game). I've added some code to determine the number of humans (I didn't see anything offhand regarding how to calculate this) and check this before launching a network game. Now, the one thing I'm not sure about since I haven't dealt with screens much before is the message (which I've just printed out as an error right now in the console) and how to relay that to the user though a dialog box (or something similar, I guess greying out and disabling the start game button could work provided we give them a reason its greyed out).

EDIT: I see a number of downloads, anyone have any info or feedback on my code?

Attached Files


Edited by MattDoerksen, 15 April 2012 - 03:09 AM.

  • 0

#5 MattDoerksen

MattDoerksen

    Discens

  • Community Members
  • Pip
  • 21 posts

Posted 19 April 2012 - 03:13 AM

I've gone ahead and started on something and I'd like to get some feedback on it (attached, change extension to .js). Due to the different game setup for a network game as opposed to a single player game, I've specified that at least 2 humans must be in a network game before it will proceed (otherwise they should back out and make a single player game). I've added some code to determine the number of humans (I didn't see anything offhand regarding how to calculate this) and check this before launching a network game. Now, the one thing I'm not sure about since I haven't dealt with screens much before is the message (which I've just printed out as an error right now in the console) and how to relay that to the user though a dialog box (or something similar, I guess greying out and disabling the start game button could work provided we give them a reason its greyed out).

EDIT: I see a number of downloads, anyone have any info or feedback on my code?


Ticket updated. http://trac.wildfire.../1054#comment:1
  • 0

#6 Echelon9

Echelon9

    Discens

  • Donator
  • 87 posts

Posted 19 April 2012 - 03:23 AM

Just a thought, but for those interested in AI development or prototyping, could there be a use case of running a game between two bots over the network?

This could be to:
- observe how two different strategies and approaches work,
- for repeatable simulation and outcome testing,
- competitive AI competitions, or
- basic research

All is possible on a localhost, but there is flexibility being able to do the same over the network.

i.e. can we address that undefined playerstate error in a way that doesn't require a fallback to singleplayer?
  • 0

#7 feneur

feneur

    Cartographer of imaginary worlds

  • 0 A.D. Project Leader
  • 7,935 posts

Posted 19 April 2012 - 06:36 AM

Just a thought, but for those interested in AI development or prototyping, could there be a use case of running a game between two bots over the network?

This could be to:
- observe how two different strategies and approaches work,
- for repeatable simulation and outcome testing,
- competitive AI competitions, or
- basic research

All is possible on a localhost, but there is flexibility being able to do the same over the network.

i.e. can we address that undefined playerstate error in a way that doesn't require a fallback to singleplayer?

Which of those doesn't give the same result being played on a local machine? If there is no additional benefit it seems like a waste of time to me to put in a lot of extra work just to be able to have two AIs play over a network (especially since you could just add a human player as "observer" and it would work). :)
  • 0

Erik Johansson [ aka feneur ]

Wildfire Games
Contact me: feneur@wildfiregames.com



Support Wildfire Games!


#8 quantumstate

quantumstate

    Primus Pilus

  • WFG Retired
  • 1,150 posts

Posted 19 April 2012 - 09:27 AM

Just a thought, but for those interested in AI development or prototyping, could there be a use case of running a game between two bots over the network?

This could be to:
- observe how two different strategies and approaches work,
- for repeatable simulation and outcome testing,
- competitive AI competitions, or
- basic research

All is possible on a localhost, but there is flexibility being able to do the same over the network.

i.e. can we address that undefined playerstate error in a way that doesn't require a fallback to singleplayer?


Currently AI's are run as part of the game simulation. This means they run on every machine that the game is being played on. So by using a network game with AI's it would be identical to a single player game but with added syncing. So unless we redesign how the AI system works this si pretty pointless.
  • 0

Jonathan Waller [ aka quantumstate ]

Wildfire Games Programmer
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!