File is included in both EXE and SOURCE RAR files.
By: Eudaimonium
///////////////////////////////////////////////////
XNA 3D Engine project readme file
///////////////////////////////////////////////////
XNA 3D Engine is a pet project of mine developed entirely on XNA 4.0, .NET 4 technology.
Even if it's not technically an "Engine" in modern sense of the word (implying graphical editors), it's more of an expanded framework, a collection of classes to help write games.
Running the EXE requires XNA 4.0 and .NET 4 technologies installed in your Windows machine.
Both can be found here:
http://www.microsoft.com/en-us/download/details.aspx?id=20914
http://www.microsoft.com/en-us/download/details.aspx?id=17718
SOURCE version requires XNA 4.0 Developer package and Visual Studio IDE 2010 or newer (Express is enough).
http://www.microsoft.com/en-us/download/details.aspx?id=23714
Visual Studio C# 2010 Express:
http://www.visualstudio.com/en-us/downloads#d-2010-express
Download link under blue ribbon named: Visual C# 2010 Express
If you have newer version of Visual Studio, you need XNA 4.0 Refresh for your specific version:
2012: https://msxna.codeplex.com/releases/view/117564
2013: https://msxna.codeplex.com/releases/view/117230
Minimum requirements:
If you can run Windows 7, it's fine.
You need a dedicated GPU with Shader Model 3.0 support. Up until recently, Shader Model 2.0 was enough, but the new terrain mipmap rendering needed the new version. I will try to reduce the minimum requirement back to 2.0 in future, when I figure out a workaround for the terrain shaders.
Technically - Minimum
- A working processor (Something in range of Pentium Dual Core is more than enough)
- 512MB RAM (Game never takes more than 300MB currently, most of it is .NET framework underneath)
- Dedicated GPU with SM 3.0 (nVidia 9300M or so)
- Sound card preferable but not required
Recommended: Same as minimum, with the exception of GPU, since the post process chain is currently the most demanding part of the program. Anything that was at least "middle tier" 5 years ago will reliably run the game without falling below 60FPS. Not-even-so-modern nVidia GTX 560 will run the game at several hundreds of frames per second.
/////////////////////////////////////
The executable
If you just downloaded the EXE version and want to play, here are a few things to know:
Unpack the entire project - don't run Exe from RAR!
Run 3D Engine.exe to start the game. Upon first startup, a small file called "config" will be created in the same folder which keeps your desired settings that you change in the Settings menu panel. If you get a black screen or crash to desktop, make sure the game is allowed to write on the hard drive - check your antivirus or other security software, and try running as admin.
You can start the main menu music by clicking the main menu "Music on/off" button. I have had it on by default for too long, so now it's off by default.
Music credit goes to my musically talented cousin (so don't ask for a link or anything, it's not on the net) whom random guitar improvisation I have recorded. If you want it, it's in the SOURCE version's "3D EngineContent" folder.
You can change various game settings from the Settings screen. They will be applied when you click "Back" button or hit ESC key, which will return you to the main menu. I do not reccomend selecting resolution lower than 800x600, since menus will look a bit weird (but game performance will be great on very low end GPUs).
By clicking Start game you can choose two levels.
devTestLevel is the first level created and serves primarily for testing out various core mechanics, such as terrain generation and collision.
You can find a small house there I made in 3DS Max. It's gray walls are collidable, so you can play around with collision if you want. Roof is currently not collidable as I'm working on a way to figure out collision boxes that are pre-rotated in 3DS Max before export.
It is also larger of the two levels, featuring 8 x 4 tiles of terrain rendered with Blend2 shader.
testLevel2 is second level, made primarily for testing out various eye-candy effects such as more advanced Blend3 shader for terrain, level Water object (which I hear is pretty nice), a portal pair object mechanics (you can find two portals near your spawn point), and particle system. You will notice snow falling on the level shortly after it's started. Terrain is only 4x4 tiles but rendered with nicer Blend3 shader.
***********
The controls:
For now, the controls cannot be changed, I will implement the menu system for it later.
- WASD for movement
- Space to jump
- Right click [hold] the mouse to disable gravity and enter flying mode:
- WASD fly direction
- Space fly up
- CTRL fly down
You also move ten times faster in this mode
- You may open the developer console by pressing '~' key (left of "1" key, under ESC key).
-List of all commands is available by typing "HELP".
***********
/////////////////////////////////////
The code
Immediate disclamer: Code is by no means of "professional" quality. This entire project started with me starting to learn 2D and 3D graphics and general game programming. As I learned new concepts, I have written them into this project. This means this is not a dedicated effort by a professional to write a reliable framework. This is a learner's project, by n00b for n00bs and should be treated as such.
Code of the project is currently in very early development, but even as-is I believe it's a great collection of tutorials anybody can learn from. Experienced programmers will take note that the entire project is built using VERY unconventional coding techniques that may be hard to understand first time around.
However, this is the coding technique that came to me naturally while trying to organize a complex project and I have no doubts there will be other people out there who will find out that this is also a viable way to code, and realise they can, too, write some fantastic projects :)
Further down the road of the development of this project, there will be extensive documentation, usage scenarios and tutorials written for it, when there are enough of the elements within the infrastructure to build a viable game the way it's meant to be built using this Engine. With that said, for now, unfortunately there are no real guidelines on how to use this code except your own intuition. There is not overly much to build for now, but what little there is, I think that recognizing the techniques used to build it and what logic applies is straight forward and easily understood. Of special note are the two classes that build levels in "Game_code" folder, Player class that deals with player's physics chain and input solving, "PhysicsObject" that has a lot of code dedicated to importing objects from FBX and detecting/resolving collisions, PostProcess class that has a lot of rendering code that you can easily port over to your projects, and Terrain classes for building terrains from heightmaps and blendmaps.
This is because I have found there is a great deal of tutorials around the internet that deal with beginner's concepts of programming, a few that deal with advanced concepts and graphics, and NOTHING in between connecting those two, very seperate areas. I am slowly stumbling between those two and everything I learn and write, is available here.
/////////////////////////////////////
Progress
This "Engine" has more or less this features done, in the way they can be used to build parts of the game:
Menu system:
-Structures and classes needed to create, render and manipulate menu "panels".
* Could probably use a good overhaul in naming conventions and usability. This is the earliest component written, and as such pretty lacking.
-For presentation, settings screen and level selection screens available from main menu with nice background
Input and controls:
- Class handling the user controls
- Player class:
- Player bounding volumes (predicted and actual)
- Player movement using spring physics and world influences
- Camera and FPS control scheme (for now)
- Developer console for logging and executing various functions during play time, very useful for debugging and visualisation.
Game objects:
- Terrain built from heightmap:
- Depth fog shading (further the terrain is, more defined color tint it has)
- Up to 3 textures blended using BlendMap and Blend2 or Blend3 shaders
- Water level, implementation as easy as two lines of code (see testLevel2 class)
- Rudimentary terrain collision using colliding grid (point cloud) constructed from terrain's polygons.
- Can walk and jump on terrain, and cannot walk on too steep inclines.
- Physics objects - complex objects made from visible and colliding geometry:
- Construction of visible geometry from predefined shaders and even imported textures directly from FBX
- Position on world defined simply as map coordinates and it's rotation
- Bounding boxes created from specifically named objects in FBX file: not rendered but collidable (Collision Mesh basics)
- For presentation, there is a house in first level for testing Physics.
-Particle system: DPSF implemented from xnaparticles.com (see Thanks and Credits class!)
- For presentation, snow is falling on second level.
Physics:
- Rudimentary physics chain solving for Player alike professional engines:
- Player next-frame predictions and iterative solving of geometry collisions produce VERY reliable and nice results
- Desired and actual movement modifiers
- World influence such as terrain and gravity
Graphics:
- Optional post process chain with multiple cool features:
- "Bloom" effect partially written by myself (Unsatisfied with MS's example) with tons of customisable parameters for each level such as :
* Bloom threshold, tint and intensity, strenght and width of the effect
* Rest of scene tint and intensity
- HDR-Like effect with scene desaturation and color shift according to scene brightness
- Motion blur effect based on mouse movement
- Lens masking effect (effect of scratched and dirty camera lens)
- Sun Shaft (god rays) post process effect with modifiable parameters
- Sun shaft effect uses a nice "trick" - rendering to one renderTarget while using depthBuffer from other. See Post process class.
- Terrain rendering:
- Terrain is seperated into specific size tiles and engine only renders ones you can see
- Two different Level-of-detail levels, far away tiles are rendered in lower quality (1/4 of vertices)
- Full anisotropic mipmap rendering of all terrain's textures, based on vertex camera distance
* Gives very nice, professonal look, gets rid of noise patters on far away terrain using sharp tiled textures
- Shaders:
- A lot of cool shaders that can be applied to various in game objects, including materials that dissapear when you look at them, when you get close to them, reflection (mirror like) materials etc.
- Post process shaders for various nice effects. They could probably use a bit more comments, though.
/////////////////////////////////////
Long term goals
Eventual long term goal is a creation of a full-fledged real-time third person Role Playing Game, with a story created by a particlarily long DnD game session by a friend of mine, Makul. Main menu is already headed that way.
/////////////////////////////////////
Permissions
You are 100% free to use any code, logic, algorithm or any other part(s) of this project that I wrote for any purpose you wish - personal, public, non-commercial, commercial, EXCEPT claiming you wrote it yourself. You are not obligated to, but I'd appreciate it if you'd credit me for anything you may have used from this project.
DPSF.dll and the accompanying code is the exception and it is the property if it's creator, Daniel Schroeder.
See the DPSF Readme file for permissions information.
////////////////////////////////////
Contact
If you want to provide any feedback, such as comments, critiques, ideas, praise or curse words, you can contact me at
eudaimonium <at> gmail <dot> com
[replace needed characters, obviously]
Just put something related to this engine in the subject.