Intersect Engine

repository·main·Indexed 43 days ago

https://github.com/ascensiongamedev/intersect-engine

A complete game development suite powered by MonoGame for creating 2D MMORPGs with minimal programming experience. The engine includes a client, server, and editor, supporting .NET 8 and featuring a comprehensive event command system for gameplay mechanics such as item modification, spell casting, and character customization.

Tokens
29.1K
Snippets
115
Records
159
Agent score
53%

What's inside Intersect Engine

  1. Understand the required file structure for AvatarController

    main

    The AvatarController requires a specific directory hierarchy to locate avatar assets. The assets directory must be a sibling to the server's standard logs and resources directories. The editor-specific resources must reside within assets/editor/resources.

    server_root/
    ├── assets/
    │   └── editor/
    │       └── resources/
    │           ├── entities/
    │           └── faces/
    ├── logs/
    └── resources/
  2. Understand supported database contexts and providers

    main

    Intersect Engine supports migrations across three primary logical contexts and two database providers.

    Supported Contexts

    • Game: Uses Game and GameContext in code.
    • Logging: Uses Logging and LoggingContext in code.
    • Player: Uses Player and PlayerContext in code.

    Supported Database Providers

    • MySQL: Referred to as MySql in code (includes MariaDB).
    • SQLite: Referred to as Sqlite in code.
  3. Identify breaking changes in the API

    main

    When integrating with Intersect Engine, be aware of what constitutes a breaking change:

    Breaking changes include:

    • Altering or removing field signatures.
    • Altering or removing property signatures.
    • Altering or removing method signatures.
    • Altering or removing class signatures.
    • Altering or deleting assemblies.

    Breaking changes do NOT include:

    • Introducing overloads.
    • Introducing new signatures (though these are still restricted in the main branch).
  4. Understand supported migration contexts and providers

    main

    Migrations in Intersect Engine are organized by Context (the logical domain) and Provider (the database engine).

    Supported Contexts

    When specifying the --context flag, use the following roots:

    • Game: Game or GameContext
    • Logging: Logging or LoggingContext
    • Player: Player or PlayerContext

    Supported Database Providers

    • MySQL: Identified by MySql in code.
    • SQLite: Identified by Sqlite in code.
  5. Identify the correct branch for development or stability

    main

    The project uses different branches to manage stability and feature sets. Note that branch definitions change after the 0.7.0-beta release.

    Current Branching Model

    NameCurrent VersionNotes
    main0.6.2.460Receives markdown documentation or GitHub automation related changes
    prerelease0.7.0.129Non-breaking or security bug fixes only (the actual stable branch)
    development0.7.0Non-breaking or security fixes and features only

    Post 0.7.0-beta Branching Model

    NameCurrent VersionNotes
    main0.7.0.xNon-breaking or security bug fixes, markdown documentation, and GitHub automation changes
    prerelease0.7.x.yNon-breaking or security fixes and features
    development0.8.x.yBreaking changes permitted
  6. Generate MariaDB/MySQL migrations

    main

    When generating migrations for MariaDB or MySQL, you must follow specific naming conventions and provide a connection string. Note that MariaDB and MySQL are treated interchangeably as MySql in the migration commands.

    Critical Requirements:

    1. Connection String: A valid connection string is required. Failure to provide one will cause the command to crash with a DbContext creation error.
    2. Windows Users: You may need to include Server=localhost in your connection string.
    3. Parameters: Do not omit the --namespace or --output-dir parameters due to an existing dotnet ef bug regarding *ModelSnapshot.cs generation.

    General Command Pattern:

    dotnet ef migrations add <migration name> --context MySql<context> --namespace Intersect.Server.Migrations.MySql.<context root name> --output-dir Migrations/MySql/<context root name>/ -- --databaseType MySql --connectionString "<connection_string>"

    Example (Logging Context):

    dotnet ef migrations add Net7Upgrade --context MySqlLoggingContext --namespace Intersect.Server.Migrations.MySql.Logging --output-dir Migrations/MySql/Logging/ -- --databaseType MySql --connectionString "Username=<username>;Password=<password>;Database=<a db that exists>"
    dotnet ef migrations add Net7Upgrade --context MySqlLoggingContext --namespace Intersect.Server.Migrations.MySql.Logging --output-dir Migrations/MySql/Logging/ -- --databaseType MySql --connectionString "Username=<username>;Password=<password>;Database=<a db that exists>"
  7. Install dotnet-ef for database migrations

    main

    To manage database migrations in Intersect Engine, you must install the dotnet-ef tool.

    Installation Command:

    dotnet tool install --global dotnet-ef --version 7.*

    Notes for Unix-like systems: If you encounter a zsh: no matches found: 7.* error, escape the asterisk:

    dotnet tool install --global dotnet-ef --version 7.\*

    Updating the tool: If you receive warnings that your tools version is older than the runtime, update them using:

    dotnet tool update --global dotnet-ef --version 7.0.13

    (Or use 7.* on Unix-like systems).

    dotnet tool install --global dotnet-ef --version 7.*
  8. Configure assets for client debugging

    main

    The Intersect client will not run from a debugger unless assets are present in the assets/development/client directory.

    You should add assets (such as those from Intersect-Assets) to this location.

    Recommended Workflow: Create a symbolic link from your custom resources repository (or a clone of the main_full branch of Intersect-Assets) to assets/development/client/resources to facilitate development.

  9. Generate migrations for Intersect.Server.Core

    main

    When generating migrations within the Intersect.Server.Core project, you must adhere to specific command patterns to avoid known dotnet ef bugs and ensure correct file generation.

    Critical Requirements

    1. Always include --startup-project ../Intersect.Server/. Do not omit this.
    2. Always include --namespace and --output-dir. Omitting these may prevent the correct generation of *ModelSnapshot.cs files due to an existing dotnet ef bug.

    General Command Pattern

    dotnet ef migrations add <migration name> --context <provider><context full> --namespace Intersect.Server.Migrations.<provider>.<context root> --output-dir Migrations/<provider>/<context root>/ -- --databaseType <provider> [--connectionString "..."]