UnseenDT

The latest from the Unseen team

Moderator: Karl G.

UnseenDT

Postby Karl G. » Mon Apr 24, 2006 9:08 pm

I've been progressing on the Unseen Data/Template Library, which is basically a simple way for to designate information in a way the computer can understand. It's designed in such a way that any kind of data--from NPC dialogue to dungeon layouts--can be specified. I'm going to teach you about it a little so that in the near future, you'll be able to create basic maps for BtR using only notepad.

First, there are two very basic concepts:
  • templates - Describe a collection of data. Everything from the name of each piece to its type (see below) and size. Think of these as blueprints.
  • objects - Fill a template with data that the program can use. We'll be dealing with these.
Second, the 3 most simple kinds of information that can be stored are:
  • STRING - A string is simply words, numbers and symbols contained in double-quotes, such as "Ahoy, mate!"
  • DWORD - A positive integer. Don't worry about what the name means. Just know that these values can only be positive.
  • FLOAT - Any number, positive or negative, with decmial digits.
Finally (for tonight) there are symbols that you'll see in these files:
  • Curly Braces, such as "{" and "}" indicate groups of data that should be processed together. If this phrase reminds you of templates, great! They are used in both templates and objects.
  • Angled Brackets, the "<" and ">" symbols, indicate an ID number. These are generally very long and contain both letters and numbers. Don't worry about what they mean, for now.
  • The Semicolon, last but not least, is probably the most important and easy-to-forget symbol. ";" is always placed at the end of a statement. We'll get into these further next time.


Sorry this wasn't very long--I have an Economics test over three chapters I haven't read tomorrow, so I need to go review. If you have any questions or suggestions, ask!
User avatar
Karl G.
Lesser Spirit
 
Posts: 2453
Joined: Sat Mar 04, 2006 10:26 am

Postby Karl G. » Tue Apr 25, 2006 7:09 pm

The power of UnseenDT can be seen in these new screenshots of the MapView utility:

Image
1600x1200 | 800x600

Image
1600x1200 | 800x600

Image
1600x1200 | 800x600


The following code is the entire definition file for the scene--from it, you can probably get a feel for how UnseenDT maps work.

Code: Select all
//----------------------------------------------------------
// File:    map.dtf
//
// Copyright (c) Unseen Studios.   All rights reserved.
//----------------------------------------------------------



// All of the textures used by this map
D3DXTexture tex_flowerpot       { "flowerpot.tga"; };
D3DXTexture tex_frontofhouse    { "frontofhouse.tga"; };
D3DXTexture tex_knickknacks     { "knickknacks.tga"; };
D3DXTexture tex_pavement        { "pavement_3.tga"; };
D3DXTexture tex_rock            { "rock1.tga"; };


// Meshes
XOBJMesh mesh_arch          { "Arch.X"; };
XOBJMesh mesh_barn          { "Barn1.X"; };
XOBJMesh mesh_barrel        { "Barrel.X"; };
XOBJMesh mesh_flowerpot     { "flowerpot.X"; };
XOBJMesh mesh_longhouse     { "LongHouse1.X"; };
XOBJMesh mesh_largerock     { "LrgRock3.X"; };
XOBJMesh mesh_paperscrap    { "PaperScrap1.X"; };
XOBJMesh mesh_rocks         { "Rocks.X"; };
XOBJMesh mesh_rockslide     { "Rockslide1.X"; };


// Place some objects in the world
Object obj_rockslide01 {
    "mesh_rockslide";
    5.0; 0.0; 0.0;;
    0.0; 3.9; 0.0;;
    0.1; 0.1; 0.1;;
};


Object obj_archrow01 {
    "mesh_arch";
    10.0; 0.0; 5.0;;
    0.0; 1.570796325; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_archrow02 {
    "mesh_arch";
    12.0; 0.0; 5.0;;
    0.0; 1.570796325; 0.0;;
    0.01; 0.01; 0.01;;
};


Object obj_archrow03 {
    "mesh_arch";
    14.0; 0.0; 5.0;;
    0.0; 1.570796325; 0.0;;
    0.01; 0.01; 0.01;;
};


Object obj_archrow04 {
    "mesh_arch";
    16.0; 0.0; 5.0;;
    0.0; 1.570796325; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_archrow05 {
    "mesh_arch";
    18.0; 0.0; 5.0;;
    0.0; 1.570796325; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_house01 {
    "mesh_longhouse";
    13.0; 0.0; 20.0;;
    0.0; 0.0; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_house02 {
    "mesh_longhouse";
    5.0; 0.0; 23.0;;
    0.0; 5.97279; 0.0;;
    0.01; 0.01; 0.02;;
};

Object obj_house03 {
    "mesh_barn";
    21.0; 0.0; 20.0;;
    0.0; -0.2; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_house04 {
    "mesh_barn";
    24.0; 0.0; 18.0;;
    0.0; 1.3; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_house05 {
    "mesh_longhouse";
    20.0; 0.0; 10.0;;
    0.0; 1.56; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_barrel01 {
    "mesh_barrel";
    10.0; 0.0; 15.0;;
    0.0; 0.0; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_barrel02 {
    "mesh_barrel";
    10.0; 0.0; 15.2;;
    0.0; 0.0; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_barrel03 {
    "mesh_barrel";
    10.2; 0.0; 15.0;;
    0.0; 0.0; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_barrel04 {
    "mesh_barrel";
    10.2; 0.0; 15.2;;
    0.0; 0.0; 0.0;;
    0.01; 0.01; 0.01;;
};

Object obj_barrel05 {
    "mesh_barrel";
    10.1; 0.23; 15.1;;
    0.0; 0.0; 0.0;;
    0.01; 0.01; 0.01;;
};


Object obj_barrel06 {
    "mesh_barrel";
    10.3; 0.1; 15.3;;
    1.56; 0.0; 0.0;;
    0.01; 0.01; 0.01;;
};


Object obj_rocks01 {
    "mesh_rocks";
    10.1; 0.0; 15.1;;
    0.0; 0.0; 0.0;;
    0.03; 0.01; 0.03;;
};



Object obj_rocks02 {
    "mesh_rocks";
    11.1; 0.0; 13.1;;
    0.0; 0.0; 0.0;;
    0.03; 0.01; 0.03;;
};



Object obj_rocks03 {
    "mesh_rocks";
    6.1; 0.0; 16.1;;
    0.0; 0.0; 0.0;;
    0.03; 0.01; 0.03;;
};



Object obj_rocks04 {
    "mesh_rocks";
    19.1; 0.0; 7.1;;
    0.0; 0.0; 0.0;;
    0.03; 0.01; 0.03;;
};
User avatar
Karl G.
Lesser Spirit
 
Posts: 2453
Joined: Sat Mar 04, 2006 10:26 am

Postby Joe M. » Tue Apr 25, 2006 8:08 pm

those look nice (and kinda familiar...)

let's get the players in there!
User avatar
Joe M.
Developer
Developer
 
Posts: 996
Joined: Sat Mar 04, 2006 10:14 am
Location: Texas

Postby Lazy Babbage » Tue Apr 25, 2006 10:13 pm

This scripting language wouldn't have anything in common with, say, the .x file format, would it?

:)
Lazy Babbage
 

Postby Karl G. » Wed Apr 26, 2006 10:16 am

I started out using the X-file format, actually. Then I realized that the .X file format is ridiculously lame and made a better one. The parser is about 1,500 lines of code and took 7 hours to write.

For just a quick look at why UnseenDT is better than .X:

* Supports object references and reference types
* Has GUID as a built-in type
* More logical placement of template IDs
* Object GUIDs are not built-in (they must be in the template)
* Can have simple data-types directly in the definition file (IE outside of a template, to specify constants)
* Can parse templates from a file, then use those templates in that same file. No need to pre-register.
* Supports any number of sub-objects
* Full multidimensional array support
* Support for C-style comments
* C-style comments are RECURSIVE :) so /* ... /* ... */ ... */ will be interpreted it as a single comment
* Binary and text-format read/write
User avatar
Karl G.
Lesser Spirit
 
Posts: 2453
Joined: Sat Mar 04, 2006 10:26 am

Postby Joe M. » Wed Apr 26, 2006 9:10 pm

so it sounds like the answer there is: yes, but this one's better. And I'll take it that way, myself.
User avatar
Joe M.
Developer
Developer
 
Posts: 996
Joined: Sat Mar 04, 2006 10:14 am
Location: Texas

Postby mongatard » Thu Apr 27, 2006 11:29 am

Those screenies look nice, can't wait for more!
User avatar
mongatard
Tradesman
Tradesman
 
Posts: 15
Joined: Thu Apr 27, 2006 11:16 am
Location: Atlantis

Postby Keats » Thu Apr 27, 2006 4:37 pm

I love you Karl.

*ahem*

I mean...I can definitely see tons of custom maps coming from this...a lot of games just by the nature of their design make it difficult to create custom worlds, but this definitely seems easy, even for complete morons like me.
User avatar
Keats
Merchant
Merchant
 
Posts: 31
Joined: Sun Apr 23, 2006 11:22 am


Return to Dev Blog



Who is online

Users browsing this forum: No registered users and 1 guest