Skip to content

Conversation

@chemtrailoperator
Copy link

@chemtrailoperator chemtrailoperator commented Oct 20, 2025

(Choose one heading.)

New feature

(If this PR is to include details on a new feature or a change to a feature, include a link to the PR that makes the corresponding change to Endless Sky.)
endless-sky/endless-sky#4471

Summary

Created a new wiki document called CreatingFormations to cover coding formations into the game. Written by reverse engineering syntax in formations.txt

@TheGiraffe3 TheGiraffe3 added the enhancement Adding documentation about a new feature being PR'd to endless-sky/endless-sky label Oct 21, 2025
Copy link
Member

@TheGiraffe3 TheGiraffe3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add links to this page in Home.md and _Sidebar.md?

chemtrailoperator and others added 3 commits October 21, 2025 08:12
typo fix

Co-authored-by: Loymdayddaud <[email protected]>
typo fix

Co-authored-by: Loymdayddaud <[email protected]>
typo fix

Co-authored-by: Loymdayddaud <[email protected]>
@chemtrailoperator
Copy link
Author

Could you add links to this page in Home.md and _Sidebar.md?

Done.

@TheGiraffe3
Copy link
Member

Ideally that would be done in this PR, since this is where the file is added.

@warp-core
Copy link
Contributor

I'm guessing you're using GitHub's web editor to make these changes.
To add additional changes to this PR:

  1. Navigate to the "head" branch. The easiest way to do this is to look near the top of this page, just below the pull request title, and click the link with the text: "chemtrailoperator:master" (the link in this message will also work).
  2. This should take you to the main page for your fork of this repository, on the appropriate branch for this PR.
  3. Navigate to the file you want to edit.
  4. Use the edit button, make your changes, then click the "commit changes" button.
  5. This should add a new commit to the branch for this PR.

Once a file is changed by a PR, making further changes to it is a bit more straightforward, you can find a guide here: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#making-changes-to-files-in-your-pull-request

If you are using git or GitHub Desktop on your computer, you can alternatively either merge the branches with the other commits into this one, or cherry-pick those commits onto this branch.

@chemtrailoperator
Copy link
Author

I'm guessing you're using GitHub's web editor to make these changes. To add additional changes to this PR:

1. Navigate to the "head" branch. The easiest way to do this is to look near the top of this page, just below the pull request title, and click the link with the text: "[chemtrailoperator:master](https://github.com/chemtrailoperator/endless-sky-wiki/tree/master)" (the link in this message will also work).

2. This should take you to the main page for your fork of this repository, on the appropriate branch for this PR.

3. Navigate to the file you want to edit.

4. Use the edit button, make your changes, then click the "commit changes" button.

5. This should add a new commit to the branch for this PR.

Once a file is changed by a PR, making further changes to it is a bit more straightforward, you can find a guide here: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#making-changes-to-files-in-your-pull-request

If you are using git or GitHub Desktop on your computer, you can alternatively either merge the branches with the other commits into this one, or cherry-pick those commits onto this branch.

Apologies, I am very new at using Github.
I made two new pull requests for the changes to the files. Do those need to be closed?

@TheGiraffe3
Copy link
Member

Yes.

@chemtrailoperator
Copy link
Author

done

Copy link
Member

@petervdmeer petervdmeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for documenting this!

I added some remarks based on the implementation and the early/original RFCs.


`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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flippable attribute does not add directions, but allows formations patterns to mirror themselves over an axis if the flagship suddenly changes direction. (For example by revere thrusting.)

```
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.
Copy link
Member

Choose a reason for hiding this comment

The 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?

repeat
...
```
`arc` populates an arc around the player.
Copy link
Member

Choose a reason for hiding this comment

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

flippable x y
rotatable <degree of symmetry>
arc
start <x> <y>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An arc also has an anchor point (which defaults to 0,0 relative to the ship around which the formation is formed).


Blocks can be one of three types: `arc`, `line`, and `position`.

<degrees> are clockwise
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

positive degrees are clockwise, negative degrees are counter-clockwise.

...
```

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`.
Copy link
Member

Choose a reason for hiding this comment

The 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.


# 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.
Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adding documentation about a new feature being PR'd to endless-sky/endless-sky

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants