Skip to content
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

Improve the architecture documentation by pointing out the input system #4980

Merged
merged 2 commits into from Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Expand Up @@ -30,7 +30,8 @@ in the "doc" folder as well as check Godot's
[documentation](https://docs.godotengine.org/en/stable/). Note that
you should check the [setup instructions](doc/setup_instructions.md)
for which version of Godot you need, as well as the version of the
Godot documentation you should read.
Godot documentation you should read. As an introduction to Thrive
code, you can read [architecture.md](doc/architecture.md).

Please follow our [styleguide](doc/style_guide.md) when making your
changes to Thrive. Note that our styleguide has a section on Git
Expand Down
24 changes: 17 additions & 7 deletions doc/architecture.md
Expand Up @@ -13,13 +13,14 @@ that's why it's important for Thrive contributors to be familiar with
Godot), we have added various extensions to in-built Godot systems or
added new utility systems that were missing from Godot. This makes it
so that not all standard Godot usage is good practice in Thrive
code. Some examples of this include our custom input system, extended
functionality GUI Nodes, and other smaller helper methods. These can
be learned by reading the documents in this folder (if available about
a specific system) or by reading other Thrive code and using the same
approach. That second way is also a good way to get familiar with the
[Thrive style](style_guide.md) and become familiar with various parts
of the codebase that provide commonly needed operations.
code. Some examples of this include our [custom input
system](input_system.md), extended functionality GUI Nodes, and other
smaller helper methods. These can be learned by reading the documents
in this folder (if available about a specific system) or by reading
other Thrive code and using the same approach. That second way is also
a good way to get familiar with the [Thrive style](style_guide.md) and
become familiar with various parts of the codebase that provide
commonly needed operations.

The remainder of this document describes the overall code architecture
of Thrive. For GUI Thrive uses Godot as intended, but for gameplay
Expand Down Expand Up @@ -221,6 +222,15 @@ folders for utility and GUI code. There's also an `engine` folder for
kind of lower level features that Godot Engine doesn't provide but we
have coded ourselves to be useful in Thrive.

Input
-----

We don't use the built-in Godot input methods as those are not
flexible enough for our use. We have a custom input system that allows
more flexibly specifying input priority and consuming input from other
users when certain conditions match. There is a separate document
describing how the input system works so those details are not
repeated here, please read that [here](input_system.md).

Native Code
-----------
Expand Down
3 changes: 2 additions & 1 deletion src/general/Mutations.cs
Expand Up @@ -42,7 +42,8 @@ public Mutations()
random = new XoShiRo256starstar();
}

// TODO: proper unit testing (note the code here relies on Godot colour type)
// TODO: proper unit testing (note the code here relies on Godot colour type, and loading the thrive simulation
// parameters). See: https://github.com/Revolutionary-Games/Thrive/issues/4963
public static void TestConsistentGenerationWithSeed()
{
int seed = 234234565;
Expand Down