|
6 hari lalu | |
---|---|---|
.. | ||
.vscode | 1 Minggu lalu | |
Core | 6 hari lalu | |
Platforms | 6 hari lalu | |
NetworkPrediction.sln | 1 Minggu lalu | |
README.md | 1 Minggu lalu |
A MonoGame sample demonstrating network prediction and smoothing techniques to compensate for network latency and low packet send rates.
This sample shows how to use prediction and smoothing to compensate for the effects of network latency, and for the low packet send rates needed to conserve network bandwidth. The project has been modernized to use:
The project includes support for multiple platforms, each with its own folder and entry point:
Platforms/Windows/NetworkPrediction.Windows.csproj
, Program.cs
) - Uses DirectX backendPlatforms/Desktop/NetworkPrediction.DesktopGL.csproj
, Program.cs
) - Cross-platform OpenGL backendPlatforms/Android/NetworkPrediction.Android.csproj
, Program.cs
) - Android mobile platformPlatforms/iOS/NetworkPrediction.iOS.csproj
, Program.cs
) - iOS mobile platformAll platform projects reference the shared core logic in Core/NetworkPrediction.Core.csproj
.
Folder Structure:
NetworkPrediction.sln
README.md
Core/
NetworkPrediction.Core.csproj
NetworkPredictionGame.cs
RollingAverage.cs
Tank.cs
Content/
Platforms/
Windows/
NetworkPrediction.Windows.csproj
Program.cs
Desktop/
NetworkPrediction.DesktopGL.csproj
Program.cs
Android/
NetworkPrediction.Android.csproj
Program.cs
iOS/
NetworkPrediction.iOS.csproj
Program.cs
✅ Completed:
✅ XNA 4.0 API Compatibility:
⚠️ Minor Notes:
# Build Windows version
dotnet build NetworkPrediction.Windows.csproj
# Build DesktopGL version
dotnet build NetworkPrediction.DesktopGL.csproj
# Build Android version
dotnet build NetworkPrediction.Android.csproj
# Build iOS version
dotnet build NetworkPrediction.iOS.csproj
# Build all projects
dotnet build NetworkPrediction.sln
Open NetworkPrediction.sln
in Visual Studio and build the solution.
Use the Command Palette (Ctrl+Shift+P) and run:
Tasks: Run Task
→ build-windows
or build-desktopgl
Debug: Start Debugging
→ Choose "Launch Windows" or "Launch DesktopGL"dotnet run --project NetworkPrediction.Windows.csproj
dotnet run --project NetworkPrediction.DesktopGL.csproj
Use platform-specific deployment tools (Android Studio, Xcode) or dotnet publish commands for mobile platforms.
The project uses pre-built XNB content files located in the Content/
directory:
Font.xnb
- Sprite font for UI textTank.xnb
- Tank sprite textureTurret.xnb
- Turret sprite textureThe project uses the NetRumble MonoGame.Xna.Framework.Net library which provides a fully compatible implementation of the Microsoft.Xna.Framework.Net and Microsoft.Xna.Framework.GamerServices namespaces. This shared implementation:
The project follows a consolidated architecture:
To contribute to this project:
This project is based on the original Microsoft XNA Community Game Platform samples and follows the same licensing terms.