GSoC-WesnothWhiteboard Gabba

From The Battle for Wesnoth Wiki
Revision as of 22:51, 27 March 2010 by Gabba (talk | contribs) (Created page with '{{SoC2010Student}} =Description= <h3>Gabba - Wesnoth Whiteboard</h3> My original goal for this project was to reduce waiting tedium in coop multiplayer games, by allowing you t…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page is related to Summer of Code 2010
See the list of Summer of Code 2010 Ideas

This is a Summer of Code 2010 student page


Gabba - Wesnoth Whiteboard

My original goal for this project was to reduce waiting tedium in coop multiplayer games, by allowing you to see your ally's moves exactly as if you were staring at the same screen while he plays his turn.

This has evolved in a wider Whiteboard project, which will allow you and your allies to visually plan moves on the map together. It will replace the current undo system, which has some kludgy problems and conflicts.

About Me



To put things in context, this idea was already discussed in embryonic form

before it ended up as this formal GSoC proposal.

The Problem

Waiting tedium and difficult allied planning

Currently when playing a coop game (either RPG or more standard multiplayer campaign), there are several things that really irk me when it's not my turn:

  • You wait a long time before seeing anything happening (unless your opponents are playing without delay shroud updates).
  • When your ally who's taking his turn finally attacks an enemy or makes another non-undoable move, you have to sit through a delayed replay of his moves. If he already finished his turn, your ally has to wait while you watch this.
  • After a few undoable moves by either allied player, communication is completely out of sync. If you tell your ally, "look, I'm encircling his leader", he has no clue what you're talking about: he doesn't see what you're doing. If your ally asks you "should I move my white mage here to heal you units next turn", you 1) have no clue about which hex "here" is supposed to mean 2) even if you did, you can't adequately counsel him, since you don't see how he positioned his other units.

For this last point, you can of course place labels all over the place, but this project intends to provide a much more natural way to communicate.

Conflicts between undo and various events

Undo and delay shroud updates are very useful, but several game features conflict with them. You could have 10 temporary moves planned, just to see what your ZOC would look like, but the first of any of these events will makes you lose any undo possibility:

  • Triggering an ambush
  • Triggering an WML event ("sighted" in particular poses problems)
  • Attacking a unit
  • etc.

One of the goal of this project is to remove conflicts between planning moves, and this kind of event.

The Project


Some kind of summary description is needed here, but in the meanwhile you'll have to dive into the raw design notes below.

Design Notes

The following are my design notes up to now, which will get cleaned up and completed as time goes. What you have below is basically a list of milestones I would implement in order, to get to the desired functionality.


Development steps:

  •  ??? Get common snapshot working and use it for a proof of concept: Share undoable moves through snapshot on common baseline, and substract the latest action and fast replay when there's an undo.

--> after all, doesn't seem that useful, since little to none of the features below would depend on that functionality.

  • Backend work: store an ordered set of actions and detect which ones conflict with the current terrain, units, and so on (for that use isvalid() function defined in AI code). Allow committing them in any order; a commit means the action is executed, deleted from the list, and all other actions are evaluated for validity again. API must allow for deleting an action, (and switching its place in the queue, inserting directly in some place in the queue, etc, but those can be added later.) Those manipulations should preferably be described in WML or maybe serializable/deserializable, so they can later be synced on the network and applied on clients in the same manner they're applied locally.
    • does this warrant introducing a new Planned_Move object, or do we reuse replay commands, or something else? (I'd love the idea of a Command that does the real thing i.e. contains the code to actually do the action, and can even undo itself, and supports a "planned" status.) At least they must be WML or serialize easily to it, so they can be sent on the network.
  • Allow for commiting all actions in sequence, stopping as soon as an invalid action is detected.
  • Sync those actions to the other allied clients. For now since they're supposed to be allies and have the same view of things, Clients receive the conflict status, and don't verify it themselves. (Later, checking will be needed to "suggest" moves.) For now a move commited can just be applied like now (apply replay command), and all planned moves uploaded again to each client.
  • More advanced syncing of planned moves: when a move is commited, notify clients so that they execute the right action, identified by its place in the order sequence. Manage the syncing of other types of changes, such as actions switching places and so on.
  • Interface to define moves:
    • Option A: footsteps or red lines coming from units at their current position, and reuse current attack markers to show where they want to attack. Problem: may get messy and illegible if many lines lead to the same place or cross. Need for something (an alternate display mode with spacebar?) to show future location of units and their ZOC properly.
    • Option B: units actually move to their planned location; also reuse current attack markers to show planned attacks. Better for clarity. Problem: doesn't allow to plan the movement of several units to the same place, such as 10 walking corpses wanting to attack the same Paladin from the same spot.
    • Design choice for option B: how to represent the movement of units to their projected location? We could use replay, and fast-replay every move whenever a change that conflicts with those moves is made. However it's probably better to just move the unit image around, leaving it's real position untouched.
    • Design choice for options A and B: if we're not really moving the units to their future location, how to calculate ZOC and possible enemy moves? It's probably possible to use directly or adapt the functions doing those calculations, but it's something to keep in mind.


  • Defining moves when it's not our turn. This simply player B add actions for his own units to the queue while player A is doing his turn. If player A is an ally, player B will see both the moves he defined and the moves his ally defined. We may or may not elect to detect conflict between player B's moves and player A's planned moves (actually, it's more complicated and probably not necessary.)
  • Allow allies of player A to suggest moves to him while he's playing his turn. Overall idea is: player B moves one of A's units that he sees on screen, creating a planned moves. A then either immediately sees the suggested move (could be a pale line of the suggesting player's color, or something of the sort), or gets a prompt "suggested moves from player B are available", and he can then see a list of suggested moves, see what would their result on-screen be, and choose for each one to apply it (add them to his set of planned actions) or delete it.
  • We can also allow the system to work in reverse, and allow the current player to see all moves that his allies are currently planning. This would be just amazing for coordination. Only caveat: we'll need to add the ability to filter some of that noise, otherwise the interface of players will definitely be too crowded.
  • Add a way to show the attack choice and stats for already planned attacks, and to change the weapon used for that attack. Possibly show at the same time all attacks that are going to be executed on a single unit.
  • (Very Difficult) Find some way of displaying the dialogues the current player sees to his allies (for instance the item choice screens from Bob's RPG era), but in a non-interactive way, so they can counsel him and again, be a bit less bored.


Since I reworked the whole proposal, there's nothing to see here for now.