Skip to content

Conversation

@JasonAtClockwork
Copy link
Contributor

Description of Changes

  • Added functionality to generate module support for multiple folders in the Unreal project (add .Build.cs, .h, .cpp) using the --module-name
  • Add new configuration option for spacetime generate to handle module prefix

Arvikasoft's original work has the --module-name option which tells the codegen which module's source folder we'll apply the generated code into. However it didn't ensure that this was a functional module for Unreal tying it into the .uproject and adding the core build file and module definition (.h/cpp). With this change it will detect and add the files if necessary allowing developers to put their module in a separate folder from their game logic.

With Unreal reflection system it is unable to use C++ namespaces which means with codegen we have to separate two modules by the object names. The unofficial standard is to give a prefix to your module for all your C++ classes/structs to avoid collision, for example struct FBhCircle, this is what --module-name will support.

API and ABI breaking changes

None

Expected complexity level and risk

2 - Heavy refactor to add the prefix across the scope of codegen

Testing

  • Codegen against previous Blackholio build without using the new feature and targetting the original module to confirm no breaking changes
  • Codegen against Blueprint Blackholio with second copy of Blackholio as "Fakeholio" to confirm no conflicts
  • Codegen against previous Blueprint Blackholio to extend with the Quickstart Chat sample to connect and receive messages

@JasonAtClockwork
Copy link
Contributor Author

This one might be useful for someone else to use the codegen for Unreal for a second pair of eyes.

@bfops bfops added the release-any To be landed in any release window label Oct 20, 2025
Copy link
Contributor

@rekhoff rekhoff left a comment

Choose a reason for hiding this comment

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

Reviewed code, everything is clear and reasonable.
Published and regenerated an existing Blackholio Unreal project (cSharp server) on this branch and confirmed existing projects loaded fine.
Published and regenerated an existing Blackholio Blueprint project (Rust server) on this branch with a new module prefix, and confirmed that Blueprint nodes are being generated with the new module prefix included. (This broken existing blueprints of course, but that's expected).
Everything look good, marking my approval.

@JasonAtClockwork JasonAtClockwork force-pushed the jlarabie/unreal-multimodule branch from 0435991 to 6a0ab69 Compare October 27, 2025 15:02
@JasonAtClockwork JasonAtClockwork added the documentation Improvements or additions to documentation label Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backward-compatible documentation Improvements or additions to documentation release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants