Changes in SeafaringImplementation
Editor Comment
Major overhaul, reflect current status of implementation
Revision Differences of Revision 9
### Related links ¶¶
* Forum discussion: <http://wl.widelands.org/forum/topic/503/> ¶
* Launchpad blueprint: <https://blueprints.launchpad.net/widelands/+spec/ships> ¶
¶
## General Idea ¶
¶
This blueprint is meant to provide a step by step implementation guideline for: ¶
¶
1) Shipyard buildings ¶
¶
* Kind of building + input + worker type ¶
¶
1b) Workers of the shipyard building -> production programs ¶
¶
2) Ships ¶
¶
* What type of map object is this? ¶
* What should it be able to do? ¶
¶
3) Ports ¶
¶
* What building type (child of warehouse ? ) ¶
¶
4) Expedition and building of new settlements ¶
¶
* How to handle? ¶
¶
¶
¶
¶
### Shipyard buildings -- partly implemented ¶
¶
implemented: ¶
¶
* The shipyard is a medium sized production site building. It should get occupied by a **shipwright**. It should have resource slots for wood/planks and cloth. ¶
* The work program of the building should send the shipwright out to build a ship. ¶
¶
to be implemented: ¶
¶
* Through check for water (if no water around, only rawboats are produced) and target quantities (for ships (in whole game not per economy) and rawboats) the shipyard should as well produce raw boats out of 1 wood/plank + 1 trunk ¶
¶
to be decided: ¶
* Should there be different kind of ships? Small, medium and big merchant-ships? What about conquering harbour buildings of the enemy?) ¶
¶
¶
¶
### Worker shipwright -- implemented ¶
¶
implemented: ¶
¶
* The shipwright costs 1 hammer + 1 carrier ¶
* The work program should first check if there's already a mapobject of type "ship constructionsite" and if yes the worker should continue to build that ship. Else the program should search for a place near water and send the shipwrigth to that location to start building a new ship. ¶
¶
¶
¶
### Ships -- partly implemented ¶
¶
implemented: ¶
¶
* The "ship construction sites" is handled similiar to a normal construction site with different building state pictures. ¶
* Once the ship construction site reaches 100% it is transformed to a mapobject of type "ship" ¶
¶
to be implemented: ¶
¶
* if the user clicks a swimable field and a ship is on that field or r = 1 around, a window should pop up for the ship, allowing the user to assign a name for that ship (should be printed above the ship later on), assign a task (ware exchange, scout/explore, attack - see the subpoint "ship tasks") and a forward, go to and a backward button (previous ship, go to current ship, next ship) - this menu should be accessable via the window of a port building as well (or via statistics, like building statistics?) ¶
¶
#### Ship tasks ¶
¶
to be defined. ¶
¶
¶
¶
### Rawboats ¶
¶
to be defined ¶
¶
¶
¶
### Port building ¶
¶
to be defined.
## Overview ¶
¶
Seafaring consists of two separate transportation features that are almost entirely separate: ¶
¶
* Rowing boats that are used on "water roads" to transport wares across small rivers ¶
* Ships that can be used to discover, settle, and attack islands (or other parts of a large continent) across the ocean ¶
¶
This blueprint is meant to document design decisions and provide a step by step implementation guideline for these features. ¶
¶
## Stories ¶
¶
Here are some typical use case stories for seafaring. ¶
¶
### Rowboats ¶
¶
* Player notices that her territory is cut by long river-like pieces of water. ¶
* Player builds a shipyard and sets it up to produce rowboats (How?) ¶
* Player builds a flag on the shore of one of the rivers. ¶
* Player clicks on the flag and chooses the "Build water way" button to build a "water road" across the river, just like building a regular road. ¶
* A carrier with a row boat occupies the water way and thereby provides a short-cut across the river ¶
¶
### Sending expeditions ¶
¶
* Player notices that she can build a port near to her headquarters (this is indicated by a buildhelp icon) ¶
* Player builds a port there and a shipyard next to it which is set up to produce ships (How?) ¶
* Player clicks on the port building and then on the "Send Expedition" button ¶
* Some wares and workers (Scout and Food?) get ready inside the port and wait for the ship to be built and arrive ¶
* The expedition starts automatically and sets sail into undiscovered territory ¶
* The expedition ship choose a direction automatically and follows it along a straight line unless a previously undiscovered shoreline is detected; shorelines are followed automatically ¶
* The player can click on the ship to change its direction of exploration to one of the six major directions ¶
* The player receives a notification when the expedition starts and whenever the expedition discovers a port ¶
* The expedition does not stop when a port is discovered; however, ports are clearly marked using an overlay (e.g. an anchor) ¶
* The player stops the expedition by clicking on the ship and pressing the appropriate button; the ship will return any worker (e.g. Scout), but other resources (e.g. Food) may be consumed ¶
¶
### Colonizing an island ¶
¶
* After discovering a place where a port may be built, that spot is clearly marked by an overlay, even when the spot is under Fog of War ¶
* The player decides to attempt to colonize an island by clicking on that overlay and selecting the colonization button in the resulting field action window ¶
* Building materials for a port and a builder are automatically collected in one of the player's ports, and a ship will come to bring them to the anchoring location ¶
* If the spot is occupied by another player when the colonization ship arrives, the attempt is aborted and the ship returns to one of the player's ports ¶
* Otherwise, some area around the port becomes occupied by the player and a construction site for a new port begins ¶
* Meanwhile, the colonization ship is free to do anything else, such as start a new expedition/colonization, or transport wares between existing ports ¶
* Once the new port is built, transportation between it and other existing ports begins automatically as needed ¶
¶
### Attacking another player by sea ¶
¶
This needs to be discussed. A military expedition can be started by clicking on a port location on enemy territory (even when there is no port there), and a ship with soldiers will start moving. It should turn into a military-site-like object once it arrives, able to attack any enemy military sites that lay claim to any of the port fields, but of course the expedition ship can also be attacked by the enemy. ¶
¶
## Implementation Status ¶
¶
The following are already implemented in trunk: ¶
¶
* Shipyard and port buildings (atlanteans only) are implemented but disallowed by default ¶
* Shipyards build ships if they are sufficiently close to water ¶
* Ships transport wares and workers between existing ports ¶
¶
What remains to be done for seafaring (in rough order): ¶
¶
1. Allow map makers to designate locations where ports can be built ¶
2. Add shipyard, port buildings and ships themselves to all tribes ¶
3. (depends on 1) Automatically enable the building of ports (and shipyards that are able to build ships) on maps that allow ports to be built ¶
4. (depends on 1) Implement the overlay that makes port locations outside the player's territory visible ¶
5. Implement expeditions (discovery of islands in fog of war) ¶
6. (depends on 1) Implement colonization ¶
7. (depends on 1) Implement ship-based attacks (to be discussed) ¶
8. Allow configuration of the shipyard to produce ships or rowboats; possibly partly automatic (produce only rowboats when no water is nearby) ¶
9. Implement water ways ¶
¶
Possible additional gimmicks: ¶
¶
1. Allow player to give names to ship ¶
2. Some type of "inventory of ships", where all ships can be shown ¶
¶
## Testing ¶
¶
Play Atlanteans on an appropriate map (e.g. island hopping). You will have to cheat to enable building of port and shipyard. In a debug build, press F6 to bring up the developer console, and use: ¶
¶
> wl.Game().players[1]:allow_buildings{"shipyard", "port"} ¶
¶
> wl.Game().players[1]:place_building("port", wl.Game().map:get_field(123, 78), false, true) ¶
¶
to enable building, and to place a port on an inaccessible island, respectively. ¶
¶
## Questions ¶
¶
Q: Should rowboats be able to transport workers? ¶
¶
* Would be neat ¶
* Might provide quite significant short-cuts in territory expansion - problematic for some maps ¶
* This is counter-intuitive but true: It is actually easier to implement rowboats that can transport workers; having rowboats that can only transport wares creates problems for consistency of the Economy code, because connectivity for wares may be different from connectivity for workers ¶
¶
Q: Should there be different ship types? ¶
¶
* It was suggested that there might be two ship types, medium ships (for expedition, colonizations, and transport of wares, but with low capacity) and big ships (which can be used for any purpose, and which have higher carrying capacity for regular transport) ¶
* This may complicate things needlessly (IMHO -- nha) ¶