Skip to content

Commit 736de04

Browse files
Copilotxezno
andcommitted
Improve copilot instructions with validation findings and cross-platform notes
Co-authored-by: xezno <[email protected]>
1 parent bbac93b commit 736de04

File tree

220 files changed

+17247
-17212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+17247
-17212
lines changed

.github/copilot-instructions.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ setup_x64.cmd
3636
# OR for 32-bit: setup_x86.cmd
3737
3838
# 2. Build the entire solution (15-45 minutes total)
39-
# NEVER CANCEL: Use MSBuild with long timeout
39+
# NEVER CANCEL: Complex dependency resolution and interop generation
4040
msbuild Mocha.sln /p:Configuration=Debug /p:Platform=x64
4141
# OR use Visual Studio: Open Source/Mocha.sln and build solution
42+
# First build takes longer due to vcpkg package installation
4243
```
4344

4445
**Build Order Dependencies:**
@@ -77,10 +78,19 @@ dotnet test Mocha.Tests/Mocha.Tests.csproj
7778
cd Source
7879
dotnet format
7980
81+
# Check formatting without making changes
82+
dotnet format --verify-no-changes
83+
8084
# The CI pipeline (.github/workflows/format.yml) will fail if code is not formatted
8185
# Always run dotnet format before committing changes
8286
```
8387

88+
**Formatting Notes:**
89+
- Uses tabs for indentation (tab_size = 4) as defined in .editorconfig
90+
- Enforces CRLF line endings on Windows
91+
- Formatting applies only to .NET projects (C++ projects use .clang-format)
92+
- Security vulnerabilities in dependencies (SixLabors.ImageSharp) may cause warnings
93+
8494
## Project Structure
8595

8696
### Key Directories
@@ -108,6 +118,25 @@ dotnet format
108118
- **`Mocha`** - Main executable wrapper
109119
- **`MochaDedicatedServer`** - Server executable
110120

121+
### Sample Projects
122+
123+
#### mocha-minimal Sample
124+
Located in `Samples/mocha-minimal/`, this is the basic sample project demonstrating engine usage.
125+
126+
**Structure:**
127+
- `project.json` - Project configuration (name, version, resources, tick rate)
128+
- `code/` - C# game code (Game.cs, Player.cs, Controllers)
129+
- `content/` - Game assets
130+
- `materials/pbr/` - PBR material definitions and textures (.mmat, .mtex files)
131+
- `models/` - 3D models (FBX files and .mmdl material mappings)
132+
- `ui/` - SCSS stylesheets for HTML/CSS UI
133+
134+
**Running the Sample:**
135+
```batch
136+
cd build
137+
Mocha.exe -project ..\Samples\mocha-minimal\project.json
138+
```
139+
111140
## Common Development Tasks
112141

113142
### Building Individual Components
@@ -126,7 +155,11 @@ msbuild Mocha.Host/Mocha.Host.vcxproj /p:Configuration=Debug /p:Platform=x64
126155
### Asset Compilation
127156
```batch
128157
# Compile assets (after successful build)
158+
# This compiles content from both sample project and core engine content
129159
build\MochaTool.AssetCompiler.exe --mountpoints "samples/mocha-minimal/content/" "content/core/" -f
160+
161+
# Or use the provided batch file
162+
BuildContent.bat
130163
```
131164

132165
### Debugging
@@ -185,9 +218,11 @@ Mocha.exe -project ..\Samples\mocha-minimal\project.json
185218
### Build Issues
186219
- **"Missing Microsoft.Cpp.Default.props"** - Install Visual Studio 2022 with C++ workload
187220
- **"vcpkg packages not found"** - Run `setup_x64.cmd` first
188-
- **"Vulkan not found"** - Install Vulkan SDK
221+
- **"Vulkan not found"** - Install Vulkan SDK and ensure graphics drivers are updated
189222
- **"InteropGen.exe not found"** - Build order issue; clean and rebuild entire solution
190223
- **".NET 7.0 not found"** - Install .NET 7.0 SDK (or newer with 7.0 targeting pack)
224+
- **"Package vulnerabilities"** - Known issues with SixLabors.ImageSharp 3.1.5; warnings can be ignored for development
225+
- **"Cannot open .vcxproj"** - Linux limitation; C++ projects require Windows and Visual Studio
191226

192227
### Runtime Issues
193228
- **"Vulkan initialization failed"** - Update graphics drivers or install Vulkan runtime
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
using System.Runtime.CompilerServices;
2-
using System.Runtime.InteropServices;
3-
4-
// In SDK-style projects such as this one, several assembly attributes that were historically
5-
// defined in this file are now automatically added during build and populated with
6-
// values defined in project properties. For details of which attributes are included
7-
// and how to customise this process see: https://aka.ms/assembly-info-properties
8-
9-
10-
// Setting ComVisible to false makes the types in this assembly not visible to COM
11-
// components. If you need to access a type in this assembly from COM, set the ComVisible
12-
// attribute to true on that type.
13-
14-
[assembly: ComVisible( false )]
15-
16-
// The following GUID is for the ID of the typelib if this project is exposed to COM.
17-
18-
[assembly: Guid( "c43b1a2c-60e4-4832-a0ea-066eb190ba74" )]
19-
20-
[assembly: InternalsVisibleTo( "Mocha.Tests" )]
21-
[assembly: InternalsVisibleTo( "Mocha.Engine" )]
22-
[assembly: InternalsVisibleTo( "Mocha.UI" )]
23-
[assembly: InternalsVisibleTo( "Mocha.Hotload" )]
24-
[assembly: InternalsVisibleTo( "Mocha.Networking" )]
25-
[assembly: InternalsVisibleTo( "Mocha.CodeGen" )]
26-
[assembly: InternalsVisibleTo( "Mocha.Editor" )]
1+
using System.Runtime.CompilerServices;
2+
using System.Runtime.InteropServices;
3+
4+
// In SDK-style projects such as this one, several assembly attributes that were historically
5+
// defined in this file are now automatically added during build and populated with
6+
// values defined in project properties. For details of which attributes are included
7+
// and how to customise this process see: https://aka.ms/assembly-info-properties
8+
9+
10+
// Setting ComVisible to false makes the types in this assembly not visible to COM
11+
// components. If you need to access a type in this assembly from COM, set the ComVisible
12+
// attribute to true on that type.
13+
14+
[assembly: ComVisible( false )]
15+
16+
// The following GUID is for the ID of the typelib if this project is exposed to COM.
17+
18+
[assembly: Guid( "c43b1a2c-60e4-4832-a0ea-066eb190ba74" )]
19+
20+
[assembly: InternalsVisibleTo( "Mocha.Tests" )]
21+
[assembly: InternalsVisibleTo( "Mocha.Engine" )]
22+
[assembly: InternalsVisibleTo( "Mocha.UI" )]
23+
[assembly: InternalsVisibleTo( "Mocha.Hotload" )]
24+
[assembly: InternalsVisibleTo( "Mocha.Networking" )]
25+
[assembly: InternalsVisibleTo( "Mocha.CodeGen" )]
26+
[assembly: InternalsVisibleTo( "Mocha.Editor" )]
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
namespace Mocha.Common;
2-
3-
[System.AttributeUsage( AttributeTargets.Property | AttributeTargets.Field, Inherited = false, AllowMultiple = true )]
4-
public sealed class HotloadSkipAttribute : Attribute
5-
{
6-
public HotloadSkipAttribute()
7-
{
8-
}
9-
}
1+
namespace Mocha.Common;
2+
3+
[System.AttributeUsage( AttributeTargets.Property | AttributeTargets.Field, Inherited = false, AllowMultiple = true )]
4+
public sealed class HotloadSkipAttribute : Attribute
5+
{
6+
public HotloadSkipAttribute()
7+
{
8+
}
9+
}
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
namespace Mocha.Common;
2-
3-
[AttributeUsage( AttributeTargets.Class, AllowMultiple = false, Inherited = false )]
4-
public class IconAttribute : Attribute
5-
{
6-
public string icon;
7-
8-
public IconAttribute( string icon )
9-
{
10-
this.icon = icon;
11-
}
12-
}
1+
namespace Mocha.Common;
2+
3+
[AttributeUsage( AttributeTargets.Class, AllowMultiple = false, Inherited = false )]
4+
public class IconAttribute : Attribute
5+
{
6+
public string icon;
7+
8+
public IconAttribute( string icon )
9+
{
10+
this.icon = icon;
11+
}
12+
}
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
namespace Mocha.Common;
2-
3-
/// <summary>
4-
/// Defines a mode for a property editor to display itself.
5-
/// </summary>
6-
public enum DisplayMode
7-
{
8-
/// <summary>
9-
/// Simple text input.
10-
/// </summary>
11-
Text,
12-
/// <summary>
13-
/// An element you can drag to change value.
14-
/// </summary>
15-
Drag,
16-
/// <summary>
17-
/// An element with a slidable element to change value.
18-
/// </summary>
19-
Slider
20-
}
1+
namespace Mocha.Common;
2+
3+
/// <summary>
4+
/// Defines a mode for a property editor to display itself.
5+
/// </summary>
6+
public enum DisplayMode
7+
{
8+
/// <summary>
9+
/// Simple text input.
10+
/// </summary>
11+
Text,
12+
/// <summary>
13+
/// An element you can drag to change value.
14+
/// </summary>
15+
Drag,
16+
/// <summary>
17+
/// An element with a slidable element to change value.
18+
/// </summary>
19+
Slider
20+
}
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
namespace Mocha.Common;
2-
3-
/// <summary>
4-
/// Marks a property to override the default display method of its property editor with the given option.
5-
/// </summary>
6-
[AttributeUsage( AttributeTargets.Property, AllowMultiple = false, Inherited = true )]
7-
public class DisplayModeAttribute : Attribute
8-
{
9-
public DisplayMode DisplayMode { get; }
10-
11-
public DisplayModeAttribute( DisplayMode displayMode = DisplayMode.Text )
12-
{
13-
DisplayMode = displayMode;
14-
}
15-
}
1+
namespace Mocha.Common;
2+
3+
/// <summary>
4+
/// Marks a property to override the default display method of its property editor with the given option.
5+
/// </summary>
6+
[AttributeUsage( AttributeTargets.Property, AllowMultiple = false, Inherited = true )]
7+
public class DisplayModeAttribute : Attribute
8+
{
9+
public DisplayMode DisplayMode { get; }
10+
11+
public DisplayModeAttribute( DisplayMode displayMode = DisplayMode.Text )
12+
{
13+
DisplayMode = displayMode;
14+
}
15+
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
namespace Mocha.Common;
2-
3-
/// <summary>
4-
/// Marks an item to be hidden in the inspector window.
5-
/// </summary>
6-
[AttributeUsage( AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true )]
7-
public class HideInInspectorAttribute : Attribute
8-
{
9-
}
1+
namespace Mocha.Common;
2+
3+
/// <summary>
4+
/// Marks an item to be hidden in the inspector window.
5+
/// </summary>
6+
[AttributeUsage( AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true )]
7+
public class HideInInspectorAttribute : Attribute
8+
{
9+
}
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
namespace Mocha.Common;
2-
3-
/// <summary>
4-
/// Marks a property to override the default Min/Max value of the property editor.
5-
/// </summary>
6-
[AttributeUsage( AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true )]
7-
public class MinMaxAttribute : Attribute
8-
{
9-
public int Min { get; }
10-
public int Max { get; }
11-
12-
public MinMaxAttribute( int min, int max )
13-
{
14-
Min = min;
15-
Max = max;
16-
}
17-
18-
public MinMaxAttribute( int max ) : this( 0, max )
19-
{
20-
}
21-
}
1+
namespace Mocha.Common;
2+
3+
/// <summary>
4+
/// Marks a property to override the default Min/Max value of the property editor.
5+
/// </summary>
6+
[AttributeUsage( AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true )]
7+
public class MinMaxAttribute : Attribute
8+
{
9+
public int Min { get; }
10+
public int Max { get; }
11+
12+
public MinMaxAttribute( int min, int max )
13+
{
14+
Min = min;
15+
Max = max;
16+
}
17+
18+
public MinMaxAttribute( int max ) : this( 0, max )
19+
{
20+
}
21+
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
namespace Mocha.Common;
2-
3-
/// <summary>
4-
/// Marks a property to only be read from in the inspector.
5-
/// </summary>
6-
[AttributeUsage( AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true )]
7-
public class ReadOnlyInInspectorAttribute : Attribute
8-
{
9-
}
1+
namespace Mocha.Common;
2+
3+
/// <summary>
4+
/// Marks a property to only be read from in the inspector.
5+
/// </summary>
6+
[AttributeUsage( AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true )]
7+
public class ReadOnlyInInspectorAttribute : Attribute
8+
{
9+
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
namespace Mocha.Common;
2-
3-
/// <summary>
4-
/// Marks a property that would otherwise be hidden in the inspector to be shown instead.
5-
/// </summary>
6-
[AttributeUsage( AttributeTargets.Property, AllowMultiple = false, Inherited = true )]
7-
public class ShowInInspectorAttribute : Attribute
8-
{
9-
}
1+
namespace Mocha.Common;
2+
3+
/// <summary>
4+
/// Marks a property that would otherwise be hidden in the inspector to be shown instead.
5+
/// </summary>
6+
[AttributeUsage( AttributeTargets.Property, AllowMultiple = false, Inherited = true )]
7+
public class ShowInInspectorAttribute : Attribute
8+
{
9+
}

0 commit comments

Comments
 (0)