-
Notifications
You must be signed in to change notification settings - Fork 40
Create CreatingFormations.md #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a120aaa
952f180
35e4d32
198bf38
40a6134
f5c1c72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| # CreatingFormations | ||
|
|
||
| The syntax for the definition of a formation is: | ||
|
|
||
| ```html | ||
| formation <name> | ||
| flippable x y | ||
| rotatable <degree of symmetry> | ||
| arc | ||
| start <x> <y> | ||
| angle <angle> | ||
| skip (first | last) | ||
| positions <positions> | ||
| repeat | ||
| start <x> <y> | ||
| angle <angle> | ||
| positions <positions> | ||
| line | ||
| start <x> <y> | ||
| end <x> <y> | ||
| positions <positions> | ||
| skip (first | last) | ||
| repeat | ||
| start <x> <y> | ||
| end <x> <y> | ||
| positions <positions> | ||
| position <x> <y> | ||
| repeat <x> <y> | ||
| ``` | ||
|
|
||
| # Symmetry | ||
|
|
||
| If a formation is symmetrical, the definition can include an axis or degree of symmetry. In the event of escorts losing their formation, such as when the flagship rotates faster than the escorts can move, they will re-establish the formation referenced from the nose or one of the symmetry directions, whichever is closer. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The formation is relative to the flagships movement direction, not to the flagships rotation. (Except when the flagship is not moving at all, then it is relative to its rotation.) |
||
|
|
||
| ```html | ||
| flippable x y | ||
| ``` | ||
|
|
||
| The `flippable` attribute allows the x or y (or both) axis to be specified as an axis of symmetry. | ||
|
|
||
| ```html | ||
| rotatable <degree> | ||
| ``` | ||
|
|
||
| `rotatable` specifies a degree of rotational symmetry for the formation, such as 90 for squares, and 1 for circles. | ||
|
|
||
| Both attributes essentially add reference directions for the formation, from only one pointing out the nose to any axis or multiple of degrees thereof. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| # Repeats | ||
|
|
||
| ```html | ||
| repeat | ||
| <start> <x> <y> | ||
| ... | ||
| ``` | ||
|
|
||
| To make formations scalable to any number of ships, a repeat attribute must be applied to the block. Any attribute that exists in a block can be used as a child attribute in `repeat`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be nice to describe that the attributes in repeat are added on top of the original values, so repeating with a position of 1 will make each repeat iteration one larger than the previous one. While repeating an arc with an non-zero angle in the repeat section will make the repeat sections have larger angles. |
||
|
|
||
| When a block is fully populated with ships, if it has `repeat`, the block will be rendered again with any children of `repeat` added to their corresponding attributes in the block. | ||
|
|
||
| For instance, | ||
| ```html | ||
| position 0 200 | ||
| repeat 0 200 | ||
| ``` | ||
| Will render the first position at 0,200 and then 0,400; 0,600; etc. | ||
|
|
||
| If no repeat attribute is present, all positions will be filled, and any remaining ships will group at 0,0 underneath the flagship. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This description for "remaining ships at 0.0" is correct for the current implementation, but do we want this? We might want to consider such "remaining ships" behavior to be undesirable, and file a feature request to let those ships beyond the end position return to the default "flocking" behavior. What do you think? |
||
|
|
||
| # Positions | ||
| ```html | ||
| positions 2 | ||
| repeat | ||
| positions 2 | ||
| ``` | ||
|
|
||
| The `positions` attribute is used in `arc` or `line` to specify the number of positions that can be filled along the shape. Positions are spread out evenly across the shape, starting at each end. | ||
|
|
||
| # Blocks | ||
|
|
||
| Blocks can be one of three types: `arc`, `line`, and `position`. | ||
|
|
||
| <degrees> are clockwise | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. positive degrees are clockwise, negative degrees are counter-clockwise. |
||
| <x> is positive right, negative left | ||
| <y> is positive back, negative forward | ||
|
|
||
| ```html | ||
| arc | ||
| start <x> <y> | ||
| angle <degrees> | ||
| skip (first | last) | ||
| positions <positions> | ||
| repeat | ||
| ... | ||
| ``` | ||
| `arc` populates an arc around the player. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Around the flagship of the formation. (Formations can also be applied to NPC ships.) |
||
| `start`: Specifies the start location of the arc. | ||
| `angle`: Arc distance, referenced clockwise around the player at a constant distance. | ||
| `skip (first | last)`: Prevents the filling of either the first or last position in a block. Useful for when starting points overlap, such as a 360 arc. | ||
| `positions`: Number of positions in the shape, modified by `skip` | ||
|
|
||
| ```html | ||
| line | ||
| start <x> <y> | ||
| end <x> <y> | ||
| skip (first | last) | ||
| positions <positions> | ||
| repeat | ||
| ... | ||
| ``` | ||
| `line` specifies a line along which escorts are located. | ||
| `start`: Starting point of the line | ||
| `end`: Ending point of the line | ||
| `skip (first | last)`: Prevents the filling of either the first or last position. | ||
| `positions`: Number of spots for ships along the line. | ||
|
|
||
| ```html | ||
| position <x> <y> | ||
| repeat <x> <y> | ||
| ``` | ||
| `position` blocks render a single position at the given coordinates. | ||
| `repeat` Unlike other blocks, repeat criteria are written directly onto `repeat`. Both `<x>` and `<y>` must be specified whenever `repeat` is used. | ||
|
|
||
| All blocks are rendered from top to bottom before any block is repeated, and all will repeat top to bottom. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An
arcalso has an anchor point (which defaults to 0,0 relative to the ship around which the formation is formed).