Presentation is loading. Please wait.

Presentation is loading. Please wait.

Open-Source Graphics Development with the Delta3D Game Engine Chris Osborn Lead Software Engineer Delta3D, MOVES Institute

Similar presentations


Presentation on theme: "Open-Source Graphics Development with the Delta3D Game Engine Chris Osborn Lead Software Engineer Delta3D, MOVES Institute"— Presentation transcript:

1 Open-Source Graphics Development with the Delta3D Game Engine Chris Osborn Lead Software Engineer Delta3D, MOVES Institute cwosborn@nps.edu

2 Agenda Why Use Open-Source Software? Overview of the Delta3D Game Engine Building a Delta3D Application STAGE: the Simulation, Training, And Game Editor Building Actor Libraries for STAGE Questions

3 Why Use Open-Source Software? Often cross-platform... Windows, Linux, OSX, BSD, and more Always the lowest bid! No vendor lock-in Freedom to modify and enhance code Often has commercial-friendly licensing

4 Licensing The Delta3D libraries are licensed under the LGPL. Lesser GNU Public License http://www.gnu.org/copyleft/lesser.html Applications may use a LGPL library and retain a commercial license. In contrast to the GPL, where programs that use a GPL library automatically fall under the GPL themselves. The STAGE source code is licensed with the GPL.

5 What’s in Delta3D? Libraries dtUtil: General utilities dtCore: Core engine dtABC: Application Base Classes dtAudio: Audio dtChar: Characters dtGUI: CEGUI implementation dtHLA: HLA/RTI networking dtScript: Python scripts dtTerrain: Terrain framework dtDAL: Dynamic Actor Layer dtGame: GameManager dtActors: STAGE export of dtCore dtBSP: BSP Library dtInspector: FLTK debugging tool Utilities bspCompiler STAGE hlaStealthViewer psEditor: Particle Systems Viewer: Model Viewer

6 Architecture

7 Building a Delta3D Application Rapid, iterative development is good. Delta3D provides base classes to facilitate this style of development. Derive from dtABC::Application to instantly have a working program with a window, scene, mouse & keyboard callbacks, and an entry point into the frame loop.

8 dtABC::Application void Confg() Setup your scene here void KeyPressed() Keyboard callback void ButtonPressed() Mouse callback void PreFrame() Per-frame callback It is safe to add and remove objects from the scene here

9 Let’s take a look at a sample application.

10 STAGE The Simulation, Training, And Game Editor Assemble 3D scenes by placing “actors” and modifying their properties Contains core library of actors supporting almost all Delta3D classes Extensible plug-in interface for your own actors Intuitive user-interface Supports triggers and basic scripting

11 Let’s take a look at STAGE.

12 dtDAL & STAGE Architecture

13 Building an Actor Library 1. Create your Actor classes. 2. Wrap the classes using ActorProxies. 3. Export the ActorProxies in a shared library. 4. Load the library via a GUI in STAGE.

14 Creating Actors Here, Actor refers to a custom Delta3D classes that you wish to use in STAGE. Actor classes must have a base class of dtCore::DeltaDrawable. An Actor Property is any member variable you wish to manipulate in STAGE. For example, a collision shape. You must define Gets & Sets for all of the Actor Properties.

15 Let’s take a look at a custom Actor: the TessellationActor. It represents a flag-like object that can be assigned a texture.

16 Wrapping classes with ActorProxies An ActorProxy is a generic interface to Actor Properties. They allow STAGE to manipulate Actor without understanding the Actor type. Custom ActorProxies dervie from dtDAL::ActorProxy, dtDAL::TransformableActorProxy, etc. Often, you will need to wrap the Gets/Sets on the Actor itself to fit the interface required by STAGE. void BuildPropertyMap() Associates Properties with Gets/Sets.

17 Let’s take a look at the ActorProxy for our TessellationActor.

18 Exporting ActorProxies to a Library Finally, we must export the ActorProxy into a shared library that STAGE can use. On Windows, this would be a.dll. On Linux, the library is a.so. ActorProxy Libraries derive from dtDAL::ActorPluginRegistry. void RegisterActorTypes() Defines which Actors are in this library.

19 Let’s take a look at the library containing our TessellationActorProxy.

20 Loading a ActorProxy Library in STAGE Edit -> Map Libraries... -> Import Library Then you’ll be able to use your Actor in STAGE! Oh, and if you want to open your map at another time, make sure you custom library is somewhere in your PATH (Windows) or LD_LIBRARY_PATH (Linux).

21 Let’s go check out our new Actors in STAGE.

22 Loading a Map from an Application dtDAL::Project::GetInstance().GetMap(“MyMap”) This function returns a reference to the map with the name “MyMap”. void LoadMap( dtDAL::Map& map ) You can then pass that reference into this function, which loads the map into the default Scene in your application.

23 Let’s see how to load map with some good ol’ C++.

24 Finding Proxies in a Map dtDAL::Map::FindProxies(vector,name) vector is of type std::vector > name is of type std::string (wildcards allowed, i.e. *) This function will fill the vector with proxies that match the wildcard string name. Once you have the matching ActorProxies you can call ActorProxy::GetActor() to return the internal Actor. Then you should dynamic_cast the Actor to your Actor’s static type.

25 Let’s see how to find our TessellationActorProxy in a Map.

26 Thank you! Questions? Chris Osborn cwosborn@nps.edu osb on the forums, come say hi! http://www.delta3d.org/IISECTutorial.zip


Download ppt "Open-Source Graphics Development with the Delta3D Game Engine Chris Osborn Lead Software Engineer Delta3D, MOVES Institute"

Similar presentations


Ads by Google