[engine] Support asynchronous gameplay

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
RustyJustice
Posts: 2
Joined: July 26th, 2011, 6:54 pm

[engine] Support asynchronous gameplay

Post by RustyJustice »

Here in 2011, asynchronous gameplay is already exploding in popularity. Because it is a turn based game, a long game of Wesnoth is a perfect candidate for this type of play.

Examples of asynchronous play include:
* Mary and Bob are playing a game, and Bob suddenly has to go attend to an emergency. He apologizes to Mary, and they agree to pick up the game later the next day.
* Mary and Bob are playing a game over the course of several days. Mary makes her moves during her breaks from work. Bob checks to see if it's his turn whenever he has a moment, and makes his turn if available.

Requirements for asynchronous play (to preserve Wesnoth conventions, prevent cheating, and generally make it a good experience):

* Authentication into the Multiplayer server, so that only Bob can see Bob's troops' view and only Bob can move his troops.
* Persistence of the game on the Multplayer server, even if all players have disconnected.
* Preserving the overall state of the game on the Multiplayer server.
* When connecting, a user should see all the games in which she is participating.

Some thoughts on how it could be done:

* Games don't have to be active on the server if nobody is connected. They can be saved and re-loaded when one of the users connects.
* Game would need unique identifiers.
* Randomized transactions (combat results) should be written to the game server on completion, to prevent cheating. (Actually, a lot of asynchronous games out today don't have this step, but rampant cheating either hasn't taken place or hasn't been a problem for players).

Thanks for reading! I'm happy to help flesh out requirements or help in any other way I can.
User avatar
Captain_Wrathbow
Posts: 1664
Joined: June 30th, 2009, 2:03 pm
Location: Guardia

Re: Feature request: Support asynchronous gameplay

Post by Captain_Wrathbow »

You can already save/load games in MP to continue them later, or over the course of a few days if you wish. And there is already "authentication" on the multiplayer server. It's synchronized with your forum account. (that is, you can "register" your MP nick on the forums so that no one else can use it) Then you have to use your password and username to log on to MP.

I don't see what this would add to the game that can't already be done, although it's possible that I'm not fully understanding your idea. If so, please correct me. :)
User avatar
Pentarctagon
Project Manager
Posts: 5732
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Feature request: Support asynchronous gameplay

Post by Pentarctagon »

Wrong Forum
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Gambit
Loose Screw
Posts: 3266
Joined: August 13th, 2008, 3:00 pm
Location: Dynamica
Contact:

Re: Feature request: Support asynchronous gameplay

Post by Gambit »

It would be kind of resource intensive to keep games open that had no players in them.

As the Captain pointed out, Bob can reload the saved game after the emergency is over and Mary can rejoin.
Bob could also keep his Wesnoth client open for he and Mary to occasionally check on.
Bob and Mary could host their own modified Wesnoth server that supports playerless games.
Bob and Mary could pass a save game back and forth through email or Dropbox.

Random numbers are already generated by the server.


We do store replays of every game though. It'd be neat if unfinished ones could be searched, reloaded, and continued by their owners somehow. I wonder if that thought is worth fleshing out. :hmm:
User avatar
pauxlo
Posts: 1049
Joined: September 19th, 2006, 8:54 pm

Re: Feature request: Support asynchronous gameplay

Post by pauxlo »

Some related discussions can be found searching "play by mail" (they can't really be found, as the forum's search chooses to ignore "play" and "by", though).

Here are some previous discussions I found:

[engine] PBEM
Networkgame with real long time between turns
SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: Feature request: Support asynchronous gameplay

Post by SlowThinker »

A possibility of PBEM would be nice (then one could play GEB past turn 3 :mrgreen: ) and probably easier to implement than a server-based solution.

I always missed a possibility to rewind the game back and forth: sometimes you didn't notice which enemy units entered the fog because you are at speed 16, or you must go afk, and in these situations you would like to return back and replay moves again.
It would also allow PBEM - you really need to see replays of the enemy turns.

PBEM would also require one player saves at the end of his turn, and the other player opens the start of his turn, without having to click end of turn of his opponent.
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums
Caphriel
Posts: 994
Joined: April 21st, 2008, 4:10 pm

Re: Feature request: Support asynchronous gameplay

Post by Caphriel »

Don't use speed 16? Also, open a menu when you are going AFK. I use the stats menu. Having a menu open delays playback until the menu is closed. This is a workaround, but a functional one.
SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: Feature request: Support asynchronous gameplay

Post by SlowThinker »

Usually I switch between speed 16 (my turn) and approx. speed 1 (not my turn).

I open a menu to delay the game too, but this is not reasonable if I host an AI - all players must wait until I return.
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums
RustyJustice
Posts: 2
Joined: July 26th, 2011, 6:54 pm

Re: [engine] Support asynchronous gameplay

Post by RustyJustice »

Thanks for all the replies, and I'm sorry if I'm ignorant of something here.

Re: saving games on the server and/or PBeM, I've had little success with these options. I'm not super concerned with cheating, but I am concerned with the view aspect. That is, I don't see a way to do it where I do not see my opponents view, even for a moment while I try not to look. This renders Fog, Submerge, Nightstalker, etc. to be pointless traits and reduces the complexity (and fun!) of the game. If I'm reading the wrong threads or not understanding what I am reading, I'd be grateful for your continued assistance.

Re: resource intensive, I think that's a very solvable problem. If indeed all the replays are stored on the server, we are simply talking about a new way to access a subset of them. If they aren't, I think they could be with the understanding that after a time limit they would be deleted (necessary to prevent bloat).

Re: Hosting my own modified version of the server, I certainly would if I knew how to make it so! My friends and I are hacking this together right now using some spare equipment that stand in as always-connected players to a private server. This situation is not ideal, and excludes friends who either don't have a computer to dedicate to the cause or who don't want to put up with the hassle. (We actually did the same thing with Wesnoth 1.4 and eventually gave up playing because of the hassle. This time around I've been exposed to a bunch of asynchronous games in the mobile space, and so I know these things can be done).

If any developers are willing to take this up, I'll definitely be willing to assist however I can.
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: [engine] Support asynchronous gameplay

Post by DEATH_is_undead »

RustyJustice wrote: Re: resource intensive, I think that's a very solvable problem. If indeed all the replays are stored on the server, we are simply talking about a new way to access a subset of them. If they aren't, I think they could be with the understanding that after a time limit they would be deleted (necessary to prevent bloat).
Replays are, game saves aren't. Game saves and replays would take up too much space for the website.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
Insinuator
Posts: 707
Joined: January 6th, 2004, 10:42 pm
Location: Wichita, KS

Re: [engine] Support asynchronous gameplay

Post by Insinuator »

RustyJustice wrote:Re: saving games on the server and/or PBeM, I've had little success with these options. I'm not super concerned with cheating, but I am concerned with the view aspect. That is, I don't see a way to do it where I do not see my opponents view, even for a moment while I try not to look. This renders Fog, Submerge, Nightstalker, etc. to be pointless traits and reduces the complexity (and fun!) of the game. If I'm reading the wrong threads or not understanding what I am reading, I'd be grateful for your continued assistance.
As long as your opponent leaves on your turn, you should be able to give control over to either a "Local player" or the computer without revealing their FoW or units. Just make sure you don't end your turn before saving and quitting the game. So long as you are the one doing the reloading of the game, you can open it up, reconnect with your opponent, and end your turn.

Of course, this would mean you'd both have to be available at the same time, at least for a minute. Maybe that's what you're trying to avoid. Hmmm. An alternate method is this: Learn to touch-type. Memorize this sequence: Ctrl-Space, Ctrl-S, "My Game with Suzie - Turn whatever", Enter, Enter, Ctrl-Q, Enter. Then close your eyes and do it all! Voila, problem solved.
SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: [engine] Support asynchronous gameplay

Post by SlowThinker »

Insinuator wrote:Of course, this would mean you'd both have to be available at the same time, at least for a minute. Maybe that's what you're trying to avoid. Hmmm. An alternate method is this: Learn to touch-type. Memorize this sequence: Ctrl-Space, Ctrl-S, "My Game with Suzie - Turn whatever", Enter, Enter, Ctrl-Q, Enter. Then close your eyes and do it all! Voila, problem solved.
Is it possible to have a save of a game just before the events 'side turn' and 'new turn' are executed (I mean you load a save, do nothing, and your turn starts: your side gets new gold and its units heal)? If so then an external program could edit a savefile and "simulate Ctrl-space" this way.
(I don't know the structure of a savefile thought)

Another possibility would be to invoke "hide map" at end of turn (this functionality may be done by a WML code), then the opponent would end turn, and invoke "reveal map".

The problem is players still couldn't watch a replay of enemy moves...
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums
Post Reply