Scene Design

 Creating a New World

Creating a New World in Visual3D is very easy and quick. Locate your World Launcher Icon on your desktop. It will look like the one in Fig. 1. {Double-Click} on the icon and your on your way to a brand new world!
 
In the below screenshot, you can see the Visual3D World Selector screen. It defaults to Open Existing World. You will need to select [Create New World]. Once you do that you will notice that [Load Architect] automatically selects itself. You will also see the directory into which you will generate your new world.   Also you will see a message at the bottom of the window to "Choose a base world for your new world". Select Visual Studio 2008. Now {Click} the [New World] button at the bottom of the window.   
 
 
 
 
From there Visual3D will go through the process of creating your world and getting everything setup for you to start building your world. At the completion of the process you'll be presented with the World Architect development window. It's divided into several sections with which to allow you to build your world. (See Fig. 3)
 
 
Fig. 3
 
 
     Now that was easy! In other tutorials we'll show you have to build terrain, add objects plus many other features that will allow you a great deal of freedom to build your new world.

Creating Scenes in the Editor


You can create new scenes in the toolset by the File (Visual3D icon) menu > New Scene or right clicking on the World (root node) in World Explorer and selecting New Scene.  You can also create new scenes by creating classes derived from the BaseScene class that is created for you in a C# Visual Studio project (such as Isles of War/Scenes/BaseScene.cs if you create a world project named "Isles of War") and then registering those classes in the WorldApp class for your world project (such as found at Isles of War/World/WorldApp.cs).

When you are in the Scene Editor (Scene > Design tab), you can drag-drop assets (such as entity prefabs, scripts, entity abilities, action/behavior presets, etc.) into the Scene Editor viewport to place them into the scene and then position them using the mouse. You can also drag-drop assets onto entities (and entity triggers/components shown when expanding an entity) shown in World Explorer.  Also, if you want to modify entity prefabs, you can drag-drop them onto entities in Asset Explorer or onto the Entity Editor (Entity > Entity tab).

This is covered in more detail in the Placing Objects in the Scene section of this Scene Design user manual.


Creating Scenes and GUI Forms in Code (eg. C#)

You can create new scene classes and GUI form classes in code such as by adding and modifying the following classes in the Visual Studio world project (such as Isles of War/Isles of War.csproj) and then compiling them and (re)starting the toolset, such as by pressing F5 in Visual Studio after making your changes. For example, you could modify the BaseScene.cs to be like shown below, to add a UI panel that shows when the scene starts and which has a button which, when pressed, will add a vehicle to the scene at the camera's current position.  In this case, it will create an instance of a vehicle prefab.  That prefab will then be saved to a .v3dx XML file after its added to the scene via the button (due to the use of World.Database.GetOrCreate() method), if you save the world before exiting the toolset (such as via Ctrl-Shift-S or File > Save World or saving when prompted when exiting the toolset).

 

For more details, including sample code (based on latest version of v0.9.7 API, though compatible with current public release with a few changes), checkout the World, Scene, and UI Creation in Code (C#).

 

Scripting Areas and Entity Abilities

 Usually, its a better idea to create a class derived from SceneArea (for a scripted scenario/mission/simulation/scene logic that applies to the entire scene) or Area (for logic, sound, etc. that is triggered only when user or entities enter into a trigger area / series of bounding boxes configured in the toolset), which will appear automatically in Asset Explorer under the Entities (or possible Areas or Entities/Areas/ depending on the version) folder.    You can configure where that shows up in Asset Explorer by applying the [ComponentType("Entities/Areas", Name="My Area")] attribute, for example.  Also, you can derive from ModelEntity class (if the logic/scripting applies to a 3D object represented by a model, such as an .obj or .dae file) or one of its derived classes like AvatarBase, VehicleBase, etc, and then drag-drop those into the scene (eg. onto the Scene Editor viewport)  and place/position one or more instances of them in the scene. 


Also, you can create classes derived from Ability which will show up under the Scripting/AI/Abilities folder in Asset Explorer automatically, and then drag-drop those onto entities, or even onto the scene itself (represented by the node with the scenes name in World Explorer, or the "SCENE GRAPH" node  under it).  You can override OnActivated() and OnDeactivated() in these custom Ability classes to define your own scripted state or scene setup logic which can be shared/reused by different scenes easily. Abilities are activated automatically after the scene loads (or when entities are added to the scene after it has already loaded).

 

Scripted Actions/States using Event Triggers

Alternatively, you can create classes derived from ActionBase and override OnActivated() and OnDeactivated() (or just OnExecuted()) in them, and then drag-drop them onto a Trigger such as "Activated" (shown when expanding an Entity and its Triggers folder in Asset Explorer or World Explorer), so that those actions (or "scripts") will run when the entity is activated (at same time Ability.OnActivated() occurs).  

Or, you can drag-drop SceneLoad event from Scripting/Events in Asset Explorer onto an entity and a new trigger which will execute on Scene  Load event only will be added under Triggers folder of that entity. You can rename that trigger if desired and drag-drop one or more actions and abilities onto it.
And, you can add a "PythonAction" or "Python Behavior" onto an entity state / event trigger this way as well, allowing you to define a small python script in the toolset without any need for programming in Visual Studio, C#, etc.  This and more about triggers, events, and entity states is covered in the Entity States and Triggers manual  and Actions and Scripts manual.

 

Also, you can visually script your scene/mission logic using the Behavior Tree Editor as well as the other scripting tools and techniques described in the Scripting Manual.

 

Smart Copies (Instancing) for Entity Prefab Assets

 If you set the Entity Persistence property to ExtendedPrefabReference (or PrefabReference in some cases), by editing that property in Object Editor for the entity instances (selected in the scene) or the entity prefab (selected in Asset Explorer), then only the entity's position and any additional abilities, triggers, etc. attached to that instance in the scene will be persisted, and all other edits applied to the prefab will be shared between instances in the scene (applied when those scenes are loaded or reloaded). This allows for "smart copies" of centrally defined entity "prefab assets" which makes it a lot easier to manager large scenes with many instances of entities which have similar settings or behaviors, and it also allows for smaller scene definition files.


Placing Objects into the Scene

 
Different ways of Placing Objects and Assets:

 

1. "Painting" them on using Object Brushes and Layers

Tutorial: Object Brushes and Layers - Painting on Trees, Rocks, Vegetation, or any Object
For quickly "Painting" many objects into eitable "Scene Layers".  This can be used for Ground Cover - such as Plants, Trees, Vegetation, and Rocks - as well as for any type of SceneObject (even Lights, Enemies, Buildings, etc.).
Object Brushes have procedural settings for semi-random layout (position, scale, number of objects) and clustering.


2. Drag-dropping them into the scene from Asset Explorer

Bridge Building (with Physics)
This video tutorial shows the user driving a car around a scene, placing objects, configuring them using Object Editor (for physics settings in this case) - all while the game is still playing (without even having to pause).
 
You can checkout screenshots and short tutorial showing this, as found towards the bottom of this page as well.
 


3. Adding Assets via Right-click (Context) Menus


You can right click anywhere in the Scene Editor and then "Add Asset > ..." to select nearly any asset from Asset Explorer, just navigating through a sub-menu for the Asset Group and one for each "Category Folder" for how its organized in Asset Explorer. 
You can also use right click > Add New > ... context menu to select from common asset types to place an instance of in the scene.  What is shown here can be edited by users by drag-dropping assets in Asset Explorer into the "Base Types" asset group (top-level folder), and can rename existing ones, or group them into subfolders.  This allows you to create your own "shortcuts" for your own custom asset types (eg. a custom "Weapon" or "Vehicle" class, or even specific prefabs / presets you commonly use.

You can also attach other types of Assets to the Scene this way, such as Behaviors, Scripts, Cinematics, etc.

 

4. Attaching Assets to an Object


You can right click on any Scene Object in Scene Editor, World Explorer or Asset Explorer (as well as a few other types of assets) and select from the "Attach Asset" or "Attach New" context menus, which are used in the same way as "Add Asset" and "Add New" are for adding objects to the scene, except that they are "attached" to an object, so that they are "moved" (as well as scaled and rotated) with the parent object.  
 
You can also attach other types of Assets this way to an Object (or Entity / Actor), such as Behaviors, Scripts, Actions, etc.

4. Advanced Drag-drop for Selecting Attachment Site or Slot


If you hold down the right (instead of left) mouse key when drag-dropping an Asset / Object onto another Object (or the Scene), then you can select "how" you would like to attach an object, or specifically "which" object you would like to attach to (which is useful when you might want to attach to a parent object, instead of the specific Object Part you had drag-dropped onto). 
You can select from the "Attach To" context menu to attach to a certain "slot", such as Moint Points / Actor Attachment slots.

Equipping Weapons and Apparel using Attachment Slots

Additional Documentation

Also checkout the related Assets and Actors documentation:

[[Assets and Actors]] - Creating and Placing Avatars and Smart Objects; Configuring Behavior Presets


Manipulating Objects - Moving, Scaling, and Rotating


User Controls for Camera, Mouse, and Scene Editor
Reference sheet for keyboard and mouse controls - both for editing/design using the toolset, and default user controls for demo games.

Placing and Manipulating Objects

Video tutorial showing how to manipulate objects using the mouse, and using the "Object Manipulator" Widget / Gadget / Grips.

Camera and Avatar Controls

Camera User Controls
Controlling Avatars




Tutorial's and How-To's


Drag-dropping an Object from Asset Explorer

Find the model you want to place in Asset Explorer (tool window on the left hand side of the Visual3D Architect toolset).
You can type part of the name or category/folder for the asset you are trying to find in the Search Filter box (at the top right of the Asset Explorer) to quickly find something, if you have an idea of what you are looking for.
 
Fig. 1
 
 
    In Fig. 1 you have your Architect window. On the left side of the screen, you will find your Asset Explorer container with all the assets that you have in your asset directory. "C:\_realmware\Visual3D_Project\My_Assets\MyGame\Assets". Just a side note. It won't necessarily be on "C:\" drive. It will be on the drive that you installed the program on. 
 
 
 
Fig. 2
 
From this list you will select the asset you wish to drop onto your terrain. The asset can either have the .MESH or the .DAE extension. Once you have selected the asset you want, {Click} and hold down the mouse button and drag it to your scene. as seen in Fig. 3.
 
 
 
 
 
 
Fig. 3
 
And there you have it! It's really that easy. Modifying your asset will be covered in later tutorials.

Adding Entities to Scene


This video shows adding entities to the scene.