Wednesday, December 26, 2007

Creating a new World

Here's what you have to do in order to create a new world. Let's assume your application name is Checkers.

Project Setup
  1. Create a library project called Checkers
  2. Set the output path to \Built Worlds\Demo Worlds\Checkers\
  3. Add a file called Checkers.v3d to the project and set it to copy to the output folder in the solution so that it can be shown in the world launcher. Note: v3d file name should match the name of the folder it is in
  4. Add references to Visual3D.Engine, Visual3D.Framework, Visual3D.ReferenceApplication and Microsoft.Xna.Framework
Config and Startup
  1. Set the name for your project in and nodes
  2. Set the paths to your content in the section, duplicate them in
  3. Create the world class and inherit it from Visual3D.Scenes.WorldApplication
  4. Specify the fully qualified world application class name in (e.g. Checkers.App)
  5. Create the Main Menu scene class and inherit it from Visual3D.Scene
  6. Specify the fully qualified class name in and in section
  7. Init and register the controls in App.OnInitialized method. Be sure to call base.OnInitalized()

Main Menu

  1. Add class MainMenu, inherit it from Visual3D.UI.Form
  2. Register MainMenu in App.OnInitialized using GuiSheets.RegisterGuiTypes
  3. Add menu creation code (see Tech Demos example)
  4. Create CheckersMainMenu class and add form code (see Tech Demos example)
  5. Register the scene in App.OnInitalized using this.Scenes.Add method
  6. As we dont have anything in background for the main menu, create CheckersMainMenuRegion and inherit it from RootSceneNode
  7. Specify the region in CheckersMainMenu using SetSceneSegment method

Main Gameplay Scene

  1. Add class GameplayScene that inherits from Visual3D.Scene. Register the scene in App.OnInitalized
  2. Add class GameplaySceneRegion that inherits from Visual3D.SceneObjects.RootSceneNode
  3. Perform other steps as you did for the Main Menu.


Now you can move on.

7 comments:

Anonymous said...

I'm still lost... can you please post some more detailed instructions on how to do this with VS 2005 Pro? Thx.

Sergey Lobko-Lobanovsky said...

the man, could you be more specific? what exactly puzzles you?

Anonymous said...

I'm confused as well. For instance, I can't seem to find Visual3D.ReferenceApplication. Also, the class Visual3D.Scenes.WorldApplication doesn't exist even though I've added references to every Visual3D dll I could. Everything mentioned seems very vague. You couldn't possibly post the source you've created could you? I think a little reference would help tons! Thanks!

Sergey Lobko-Lobanovsky said...

Sorry guys, RefApp will be made available as part of Beta 2, to be published in mid-Feb

Anonymous said...

Ahhh, ok. That makes a lot more sense now. Thanks for the quick response. I am really looking forward to Beta 2. Keep up the good work!

Anonymous said...

So will Beta 2 allow the creation of new worlds from within the IDE or will this be the only avenue if we would like to crate new worlds?

Sergey Lobko-Lobanovsky said...

RefApp will be your best bet during Beta2 phase to create new worlds. It's really easy and only looks difficult.

For example, there is currently a template project that can be used for new worlds.