|
|
2 bulan lalu | |
|---|---|---|
| .. | ||
| .config | 2 bulan lalu | |
| .vscode | 2 bulan lalu | |
| Core | 2 bulan lalu | |
| Platforms | 2 bulan lalu | |
| RolePlayingGameData | 2 bulan lalu | |
| RolePlayingGameProcessors | 2 bulan lalu | |
| README.md | 2 bulan lalu | |
| RolePlayingGame.sln | 2 bulan lalu | |
| Tutorial_1_Quest.md | 2 bulan lalu | |
| Tutorial_2_Engine.md | 2 bulan lalu | |
The Role-Playing Game Starter Kit is a complete XNA Game Studio game. The project comes ready to compile and run, and it's easy to customize with a little bit of C# programming. You are free to use the source code as the basis for your own XNA Game Studio game projects, and to share your work with others.
This starter kit contains a two-dimensional, tile-based, single-player, role-playing game. This game is complete with character classes, multiple party members, items, and quests. It also features a turn-based combat engine with a side-on presentation and animated characters and effects. All of the game data is exposed in XML files, making it easy to write your own quests, create your own towns, or even write your own storyline right into the game.
Note: This documentation assumes that you have a basic knowledge of programming concepts and the Visual C# environment. You can learn more about these topics in the product documentation by clicking one of the Help menu items. Another way to learn is to position the mouse cursor on language keywords or user interface elements such as windows or dialog boxes and then press F1.
This starter kit provides a complete XNA Game Studio game. It includes source code and game content such as models, textures, and sounds. The starter kit documentation describes the general layout and controls for the Role-Playing Game Starter Kit.
Nearly all game data is exposed in XML files outside of the game code, which means there is support for extensive modifications that don’t require any programming knowledge.
Supported game data types include:
These types have direct correlations in the RolePlayingGameData class library. These types have very little game logic in them to make them as easy to maintain and modify as possible.
The project is organized for modern .NET and MonoGame development, with clear separation between shared and platform-specific code:
RolePlayingGame/
├── Core/ # Shared game logic and systems
│ ├── Combat/ # Combat system
│ ├── GameScreens/ # Game UI screens
│ ├── MenuScreens/ # Menu system
│ ├── Session/ # Save/load system
│ ├── TileEngine/ # 2D tile rendering
│ ├── ScreenManager/ # Screen management system
│ ├── AudioManager.cs # Audio manager
│ ├── ... # Other shared files
│ └── RolePlayingGame.Core.csproj
├── Platforms/
│ ├── Windows/ # Windows DirectX platform
│ │ ├── Program.cs
│ │ └── RolePlayingGame.Windows.csproj
│ ├── Desktop/ # Cross-platform OpenGL
│ │ ├── Program.cs
│ │ └── RolePlayingGame.Desktop.csproj
│ ├── Android/ # Android platform
│ │ ├── Program.cs
│ │ └── RolePlayingGame.Android.csproj
│ └── iOS/ # iOS platform
│ ├── Program.cs
│ └── RolePlayingGame.iOS.csproj
├── Content/ # Game assets (textures, audio, data)
├── RolePlayingGameData/ # Shared game data library
│ └── RolePlayingGameData.csproj
├── README.md
└── RolePlayingGame.sln # Solution file
/Core and referenced by each platform project./Platforms/{Platform}.Minimum Shader Profile:
RolePlayingGame.sln in Visual Studio 2022build-windows - Build Windows versionbuild-desktopgl - Build DesktopGL versionbuild-android - Build Android versionrun-windows - Build and run Windows versionrun-desktopgl - Build and run DesktopGL version# Restore NuGet packages
dotnet restore
# Build specific platform
dotnet build Platforms/Windows/RolePlayingGame.Windows.csproj
dotnet build Platforms/DesktopGL/RolePlayingGame.DesktopGL.csproj
dotnet build Platforms/Android/RolePlayingGame.Android.csproj
# Run specific platform
dotnet run --project Platforms/Windows/RolePlayingGame.Windows.csproj
dotnet run --project Platforms/DesktopGL/RolePlayingGame.DesktopGL.csproj
This project uses pre-built .xnb content files located in the Content/ directory. The content includes:
The Role-Playing Game begins at the Main Menu.
From the Main Menu, you can start a New Game, Load Game, check the Controls, access Help, or Exit.
| Action | Controller | Keyboard |
|---|---|---|
| Highlight a menu option | D-Pad UP or D-Pad DOWN | UP ARROW/DOWN ARROW |
| Select a highlighted option | A | ENTER |
| Exit the game | BACK | ESC |
You will explore the game world with your party by controlling your party leader from a top-down perspective.
| Action | Controller | Keyboard |
|---|---|---|
| Move Up/Down/Left/Right | Left Thumbstick Up/Down/Left/Right | UP/DOWN/LEFT/RIGHT |
| Enter Character Management | Y | SPACE |
| Return to the Main Menu | START | TAB |
| Exit the Game | BACK | ESC |
When your characters enter combat, the perspective will shift to a side-on view. Control your characters in turn-based combat to defeat enemies.
| Action | Controller | Keyboard |
|---|---|---|
| Change Active Character | Left Thumbstick Left/Right | LEFT/RIGHT |
| Change Menu Selection Up/Down | Left Thumbstick Up/Down | UP/DOWN |
| Select Option | A | ENTER |
| Cancel Option | B | ESC |
| Win Combat (Debug Only) | Right Shoulder | W |
There are many ways to add your own functionality to the Role-Playing Game:
All of the gameplay content is contained in XML files loaded by the XNA Content Pipeline. These can be altered, or new files can be added and integrated into the game.
For example, you can edit Content/MainGameDescription.xml to add more members to the party at the start of the game, or edit Content/Characters/Players/Kolatt.xml to give him better equipment at the start of the game.
Additional changes could be made to the code to support additional features built on top of these data types. For example, you could change the quest system to support rewarding the party with a new party member.
All of the animations are implemented as sprite sheets, combined with animation definitions in the game types that use them (spells, characters, etc.).
There is a lot of extra content provided with this starter kit than is used in the pre-existing game. For example, walking animations for the map sprites for your party members are provided, and you could use these to draw all of the party members trailing behind the leader.
Additional content will be made available on the XNA Creators Club Online website that will describe some of these content-creation scenarios in more detail.
The player chooses combat actions for the party members, and the code in Combat/ArtificialIntelligence.cs chooses combat actions for the monsters. This AI code can be customized to provide advanced behaviors, like healing fellow monsters or performing statistic-damaging attacks.
With more alterations to the combat engine, defined in Combat/CombatEngine.cs, the player's party can have NPCs of its own, fighting under AI control.
Additional combat actions could be added by deriving new classes from CombatAction, using the existing actions as a reference. The combat engine, in Combat/CombatEngine.cs, and the HUD (heads-up-display) menu, in GameScreens/Hud.cs, would have to be updated to support this additional action. For example, a Steal action would add a fun dimension to combat.
Another possibility is to extend the size of the party beyond the current four-member limit, and create a new menu to designate which party members will fight in combat.
The current combat system chooses sides randomly, and each side completes all of their moves before the other side may take their turn. You could interleave the combat turns and make the order deterministic by adding a dexterity or speed attribute to fighting characters.
Many of the game systems represent universal concepts to role-playing games, such as quests and characters, that could be re-used in an original game engine. This would leverage the existing XNA Content Pipeline-based data management system while using these types in entirely new ways.
The game execution systems could also be decoupled from the rest of the starter kit and reused in new games. The tile engine, defined in TileEngine.cs, could be used in many different kinds of games.