Sign in to follow this  
Followers 0
MattDoerksen

#1054 - multiplayer with no humans

8 posts in this topic

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

gamesetup.txt

Edited by MattDoerksen

Share this post


Link to post
Share on other sites

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.wildfiregames.com/ticket/1054#comment:1

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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). :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0