Skip to content

C# Hotloading Roadmap #23

@xezno

Description

@xezno

C# hotloading is a powerful feature that allows developers to make changes to their games while the engine is running, without having to restart their games. This is a huge workflow booster, and helps make development a lot more efficient.

In order to implement hotloading, the following needs to be completed:

  • Implement game projects
    • Add a custom project manifest format containing basic information: this involves loading information like the project's name, content folder, default namespace etc. from a JSON file
    • Generate csproj from project manifest: this involves creating code that will take the information from the project manifest and use it to generate a csproj file
    • Mount virtual filesystem based on content folder specified in the manifest: the default FileSystem.Game just points to the Content/ directory that ships with Mocha, ideally this should become FileSystem.Core instead
    • Use this game project for native information too
  • Move editor out into its own project
    • Separate the editor code from the engine: move the editor out of the main project and into a separate project, so that it can be worked on and maintained independently
  • Implement compiler
    • Read project info from generated csproj: read the information from the generated csproj file and use it to determine which files need to be compiled
    • Build up a list of references e.g. System.dll: read the references specified in the csproj file and use them to build a list of assemblies that need to be included in the compilation process
    • Use CSharpCompiler to build files specified in the generated csproj
    • Load the compiled assembly
  • Implement upgraders: these take data from the old assembly and copy it to the newly loaded assembly
    • Basic primitive upgrader (int, float, etc.): this should handle upgrading basic primitive data types such as integers and floating-point numbers
    • String upgrader
    • Class upgrader
    • Struct upgrader
    • Array upgrader
    • ICollection upgrader
  • Upgrade entities: currently, entities are the only things that do not change after a hotload.. they are instantiated in one assembly and then this type is held between hotloads, even when the original assembly has been unloaded and replaced.
  • Upgrade class references: reference types should only be upgraded once rather than splitting into two

Bugs:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions