New A.I. system, PhysX 3.1.1 and fixed that damned water transparency and depth sorting issue
For a final's exam this semester, I had to develop a multi-agent system that could play team-based 2-on-2 tenis (with a soccer ball) and came up with this:
It's just the first test of the AI Framework used to create multiple agents for single or team-based interactions. Just a test of visual sensors, communication, coordination and stuff like that. Also a test of thread safety for the SceneGraph as each entity's local transformation matrix is modified by the AI thread and rendered in a separate thread. 3 threads, one pointer :) Some shadow artifacts occur during mid-video, but that's due to the not yet finished PSSM system I'm working on. Also. don't mind the complete lack of animations :)) I have better things to code for now. Performance is choppy due to the Profiler from VS2010, Fraps, the code being compiled as a debug build, shader failing on the ball. Also, the quality is low as this video is used to pass my AI exam, and I don't have a lot of time to waste on compression. nVidia released the 3.x iteration of it's PhysX SDK which you can read about >>here<< so I thought of adding it to the framework. Specifically the 3.1.1 iteration (info >>here<< ) After some long coding sessions, the API was up and running, driverless and really fast. Only simple box-collisions for now, but it proves that the API is syncing data with the SceneGraph nicely and in a thread-safe manner: Water wasn't really transparent, because 2 very important states, culling = off, blending = on, weren't set correctly while rendering. This was due to the absence of a Render State Manager and a Render Queue. Everything was rendered via a recursive callback on the SceneGraph. Adding a Render Queue sorting method and some minor changes to the State Manager, I finally managed to properly switch states and render transparent objects in a back-to-front order. The result? Well, semi-transparent water:The A.I. part:
The PhysX part:
The water transparency stuff:
Fixed water and added shadows. Now ... the SceneGraph ...
And shadow map generation is getting better and better. Only directional lights are working for now, but still: Now that the engine supports some more rendering eye-candy, back to logic behind the scenes. SceneGraph implementation is buggy, crash-prone, Resource Manager doesn't work, Mesh - SubMesh <-> SceneGraphNode parent <-> children conversion not working etc. But ... things are looking promising for the future.
Broken water and Post Processing effects
Bloom: Now, Depth of Field is already implemented, but depth calculations are still buggy and the image is just too blurred. Will fix that later. On another note, just signed up for the GameDev section of this: ImagineCup
New features as of October 2011
- Format independent geometry importer (using ASSIMP) - Water rendering with reflection/refraction and caustics - SceneGraph based hierarchy system in each scene - Post Processing effects such as: Depth of Field, Bloom, 3D anaglyph rendering - Memory safe resource manager for creation, retrieval and removal of assets - OPCode based networking system - Multi-modal input event system (using OIS) - XML defines (config, scene structure, material definitions) - Deferred rendering system as an alternative to the forward rendering system - API independent sound playback interface - Multi-camera support and management - Much, much more(click on each title to see a description)
Cross Platform Networking Code and Server Code
Get the servercode using this repository: http://xp-dev.com/svn/Divide-Server/ And the networking code using this: http://xp-dev.com/svn/Divide-Networking/ To download and build see the guide bellow for the engine (the system is almost identical) Proper copyright notices will be added later, but I really wanna thank the people at the MaNGOS project for the inspiration on packet structures.
Finally managed to move the networking code to a separate project (that is free and open source, but you have to find it yourself). Compiled the networking code as ".a" file and linked it with the server code. Compiled the server code on Kubuntu and ran it with "sudo ./DivideServer". The end result? LINUX server and Windows Client working togheter in complete harmony. That means that 2/3 of my projects (networking code and server code) are cross platform \:D/ (used gcc 4.5 on Kubuntu and VC.90 on Windows)
Under the hood preview for everyone :)
Some people tried to download the code before and it didn't compile. Here's a step by step guide to get the code going using Visual C++ 2008/2010 (the only, currently supported editions). 1) Download and install Tortoise SVN 2) Create a new folder anywhere you want 3) Right click that folder and select "SVN Checkout ..." 4) The url of the repository is: xp-dev.com/svn/Divide-Framework/ 4.1) That will download the main trunk and all of the branches. To get the main development code, just add "trunk/" at the end of the svn url: http://xp-dev.com/svn/Divide-Framework/trunk/ 5) Press OK, wait for the download to finish and click OK again. After this step, you have a working copy of the source code. You can now browse the code and check it out but it won't compile. You still need a few libraries/SDK's, like: 5.1) Luckily, all of the libraries, except for PhysX can be downloaded from a different repository: 5.1.1) Follow the same steps as for the main trunk. Create a new folder, click "SVN Checkout" and use the following SVN url: https://xp-dev.com/svn/Divide-Dependencies/ 5.2) PhysX can't be shared like the rest of the libraries, so head over to nVidia Developer Zone or Ageia Support and download the SDK from there (registration is required!) 5.3) The libraries are already compiled, but if you wish, you can get them from another source and compile them yourself. They were not altered in any way prior to compiling as MTDd/MTD for a x86 target. 6) Right Click "Computer" and go to "Properties->Advanced system settings->Environment Variables" and under "User variables for XXX" where XXX is your username, click "New ...". Add a new variable named "EngineLibraries" and add the directory where you downloaded the libraries; like in the following image: 7) Go to: << "OutputFolder"\VCData >> where OutputFolder is the folder where you downloaded the source code to and open "Divide VS2008.sln" or "Divide VS2010.sln" with the appropriate IDE.