Skip to content

Conversation

@cullvox
Copy link
Contributor

@cullvox cullvox commented Jun 8, 2025

This is a basic, working, implementation of wind.

It's probably pretty inefficient at scale and might need optimizations.

  • Wind can be enabled and disabled
  • Noise scale and wind scale for both more control over simulation
  • Runtime configuration of wind noise with FastNoiseLite settings

Copy link
Owner

@mphe mphe left a comment

Choose a reason for hiding this comment

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

Thanks!
Besides these nitpicks, it looks fine.

The direction vector of the wind direction could be cached in GDScript so it doesn't need to be recomputed during simulation.
But I think it's negligible for now.

I also think it would be a good idea to extract wind simulation parameters in a dedicated Resource to make it reusable and reduce memory usage with many ropes sharing the same parameters. I also considered setting it globally in NativeRopeServer to be applied to all ropes. But using Resources enables more flexibility.

@mphe
Copy link
Owner

mphe commented Jun 8, 2025

Btw, I also suggest using the clangd language server as it has clang-tidy checks built-in which give you valuable static analysis hints and warnings.

@cullvox
Copy link
Contributor Author

cullvox commented Jun 8, 2025

Thanks for that suggestion, I am now setup with clangd. Usually I would use it, but I'm still getting familiar with the Godot scons build environment, so now everything should be setup as normal.

@cullvox
Copy link
Contributor Author

cullvox commented Jun 9, 2025

With the latest commit, I added a NativeRopeWind resource and updated the surrounding files for the change. I don't think that NativeRopeWind is a good name, we can come up with something better sounding.

Eventually, a noise image should be generated if we want to improve performance. The wind resource solves a couple challenges regarding that.

Copy link
Owner

@mphe mphe left a comment

Choose a reason for hiding this comment

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

In addition to the remarks:

  • Use an underscore prefix for private and protected members and functions. Not for function arguments.
  • Class declaration order should be: methods before attributes and public before protected before private (see other files)
  • Resources should emit the changed signal when changed. See emit_changed
  • Rename NativeRopeWind to RopeWindParameters, RopeWindSettings, RopeWindProperties or similar.
  • Attributes of NativeRopeWind should be private because there are getters and setters.
  • The wind example looks nice, but text needs a spell check. Also use ":" instead of "-" please. Description for strength is unclear.

@cullvox
Copy link
Contributor Author

cullvox commented Jun 9, 2025

Thanks for going through all this again! I'll try to make it a little cleaner next time.

@cullvox
Copy link
Contributor Author

cullvox commented Jun 10, 2025

I've still got to properly add documentation, but everything seems to be working as intended. I've still got to add the boolean enable value to the wind parameter resource, I'll add that tomorrow.

@cullvox
Copy link
Contributor Author

cullvox commented Jun 10, 2025

I've got this to a state that I like again. I added batch scripts for compiling on Windows too and they both work. Enabling and disabling wind is also in the resource now.

Copy link
Owner

@mphe mphe left a comment

Choose a reason for hiding this comment

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

Good work so far!

Regarding godot-cpp and documentation support. Rereading the docs it seems that at least godot-cpp 4.3 is needed to compile with documentation support, but I'm unsure if it would still be compatible with lower Godot versions. The documentation only talks about that if clause in the build script which makes it compatible with older build pipelines.

  • Let's just make it simple and bump the minimum version to 4.3. Ignore what I said before, sorry.
  • Track the 4.3 branch in godot-cpp

Thanks for unifying my inconsistent ""/<> includes as well :D

I think that will be the last iteration until it's ready to merge.

@cullvox
Copy link
Contributor Author

cullvox commented Jun 12, 2025

Sounds good! This last commit should have all of those changes, the XML documentation may still need to be updated. I've never really had much of my work reviewed before, but thanks for being cool and helping correct the inconsistencies and things. It's fun and useful.

@mphe
Copy link
Owner

mphe commented Jun 12, 2025

src/gen/doc_data.gen.cpp should be added to .gitignore and removed from the project as it is auto-generated during build.

Otherwise, looks good!
When you're finished with the XML and the above, you can squash all your commits into one to keep the history clean.
After that it's ready to merge.

I've never really had much of my work reviewed before, but thanks for being cool and helping correct the inconsistencies and things. It's fun and useful.

You're welcome, thanks for contributing and following through the whole process!

@cullvox
Copy link
Contributor Author

cullvox commented Jun 12, 2025

The docs are also updated, and I believe I squashed the commits correctly, so it should be good now.

@mphe mphe merged commit 2693964 into mphe:master Jun 12, 2025
12 of 15 checks passed
@mphe
Copy link
Owner

mphe commented Jun 12, 2025

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants