Archive for the ‘Nytro Engine’ Category

Editor: Groups and other features

Thursday, August 26th, 2010

Added the Groups editing dialog, you can group entities, show/hide group, open/close group, etc.

Added new features of the Base class where you can user-format property values when they are shown as text in the editor property grid control, and when the values are changed, you can format the value before its sent to the actual class member.

Camera settings and fly around speed are saved per level.

The game play button is working and you can jump into game play mode in a second, directly in the editor’s viewport.

Small shader system refactor, now there is no DirectX FX shader files dependency, you can write your shader code in any supported shader language (HLSL,Cg,GLSL), as .vsh(vertex shader), .gsh (geometry shader), .psh (pixel shader).
The shader techniques and passes were moved as XML in the shader’s definition file, so its cross-platform, for any kind of shading language.
The shader system will be open for ubershader with shader permutations, dynamic branching or shader graph nodes (fragments), the current one is a generic Blinn shader with diffuse/normal/specular/alpha maps, fresnel term and other stuff , but probably all types of shader systems will be implemented.

Editor: New dialogs and features

Tuesday, August 10th, 2010

Added the layers edit dialog, where you can create layers, hide them, lock them, assign current entity selection to the layers, export/import to xml (for use in other levels), and so on.

Added the Align and distribute dialog, so you can align the current selected objects and distribute them evenly, using the bounding boxes of the objects, also will add to distribute selected entities in a circle.

Working on skeletal meshes to have all the features in place.

Working on the terrain integration into the editor.

Made shortcuts for switching between operation modes for move/rotate/scale gizmo, and also there is a composite gizmo with all transformation modes at once like in the image:

Composite transform gizmo

Composite transform gizmo

Overall this is the current state/looks of the editor:

NytroStudio

NytroStudio

Flowgraph editor UI

Sunday, July 4th, 2010

Using the C# and GDI+ is a real pleasure to make custom controls and such. The flowgraph editor tool from inside NytroStudio started to shape up, I am testing the looks and functionality and will start connecting this UI to the flowgraph C++ engine code. I took inspiration from UnrealEd and CryEngine and other several editors, resistance is futile ! :)

Here is a glimpse of what’s to come:

Flowgraph editor (click to see it bigger)

Flowgraph editor (click to see it bigger)

Editor API

Wednesday, June 9th, 2010

I made the decision to have a thin Editor API in C++, only one big abstract interface, which will be translated by SWIG into many languages, so I can make editor GUI in any OS/IDE/API/SDK, (MFC, C# Winforms/WPF/Silverlight), and this header file interface uses only simple types, no dependencies, it exposes only needed methods for the editor GUI in C#, the GUI doesnt know about engine classes, its only a mere client for the Editor.DLL which contains the implementation of the thin layer Editor API. These scheme seems to work for now pretty nice.

Engine code style changes

Saturday, May 1st, 2010

After some thoughts I have started to refactor some naming conventions in the engine, better “unicity” among enums, constans and defines, also made a GeometryBuffer more simpler to use, and other various speed and optimizations changes, related to loops, storage, code architecture, all looking good so far, the editor is now even more simple to use, it has only toolbars and docking panels, most of the important operations are one-click away. More screenshots soon.

Editor progress

Tuesday, March 30th, 2010

Editor is going good and looking great, C# GUI development is pretty nice, implemented a color picker with alpha support for the property grid, made the settings and game setups dialog, select entities from a list, and other small things.

Here is a sneak peak:

NytroStudio alpha

NytroStudio alpha

COLLADA deception

Wednesday, February 17th, 2010

“Wow! COLLADA is so great!” were my first words about COLLADA, after a brief research made :) . But devil is in the details. COLLADA is a nice format that can store everything, let me emphasize, everything. I have use it for quite some time, its good when you use the same DCC tool and the same exporter for DAE, but when that DAE comes from various DCC tools and also exporters, things get nasty, of course it can be an escuse for a lame importer, but still, the format is too loose for game development at least, and now I’m limited at exporting only the mesh data, skeletons get complicated a little, etc., so in a moment of “professional rage” I have started an open source game asset file format specification and its exporters for MAX, Maya and XSI, plus a simple import/load library, called .GSCENE , found at http://sourceforge.net/projects/gscene (work in progress of course).

If you dont believe me about COLLADA, then start using it, good luck :)

Fixed pipeline mode goodbye, console commands & variables

Thursday, January 14th, 2010

I had the rendering of text and UI elements, and also debug / schematic rendering based on the SetShader(NULL), which fell back on the fixed function pipeline of the driver/card, but this thing is gone in DX10 and beyond, so I said bye bye to FF, and added a new ‘basic’ shader that only can render unlit simple stuff, colored and textured/untextured primitives, now the engine is really full shader based.
The engine has a console with commands that can be registered in C++ and script code, and also it has a global variables system, which can be created dynamically or from the engine.setup.xml or from C++/script code, the variables are Variant objects holding any kind of data from numbers to strings (is there any more ? :) )

nytro::engine::setGlobalVariable( "yeah_someGlobalVar", 2.0f );
nytro::engine::setGlobalVariable( "someGlobalVar2", "HAHA!" );
nytro::engine::setGlobalVariable( "someGlobalVar3", 123 );
 
Variant val = nytro::engine::getGlobalVariable( "yeah_someGlobalVar", 2.0f /*default*/ );
or
float32 val = nytro::engine::getGlobalVariable( "yeah_someGlobalVar", 2.0f /*default*/ );

Assemblies – What are they ? What are theeeeeeey!!??

Wednesday, December 30th, 2009

An assembly object in Nytro terms, is a scene node that holds a hierarchy of scene nodes or slots for scene nodes. So for example you have a tank with wheels attached to a body, a turret that can rotate, and a gun attached on that turret. Also for the muzzle flash particle system you have a slot on the gun, at its end. All this complex hierarchy is defined in a *.assembly.xml file format. Here we have a video example:

<assembly>
	<slots>
		<slot class="Model" name="body" file="models/body/body.model.xml" translation="1.870190,0.018445,-0.069976" pivot="0.000000,0.000000,0.000000" rotation="0.000000,0.000000,0.000000,0.000000" scale="1.000000,1.000000,1.000000" >
			<slots>
				<slot class="Model" name="turret" file="models/turret/turret.model.xml" translation="5.246300,14.022100,0.408924" pivot="0.000000,0.000000,0.000000" rotation="4.111712,0.000000,1.000000,0.000000" scale="1.000000,1.000000,1.000000" >
					<slots>
						<slot class="Model" name="gun" file="models/gun/gun.model.xml" translation="-10.754400,5.583590,-0.214642" pivot="-10.926900,-1.618770,-0.000000" rotation="90.000000,1.000000,0.000000,0.000000" scale="1.000000,1.000000,1.000000" />
					</slots>
				</slot>
				<slot class="Model" name="wheel_front_l" file="models/wheel_front_l/wheel_front_l.model.xml" translation="-18.369900,6.254620,22.929800" pivot="0.000000,-2.952030,0.000000" rotation="90.047203,0.999177,0.028690,0.028690" scale="1.000000,1.000000,1.000000" />
				<slot class="Model" name="wheel_front_r" file="models/wheel_front_r/wheel_front_r.model.xml" translation="-18.369900,6.254620,-22.176701" pivot="0.000000,-2.952030,0.000000" rotation="90.000000,1.000000,0.000000,0.000000" scale="1.000000,1.000000,1.000000" />
				<slot class="Model" name="wheel_back_r" file="models/wheel_back_r/wheel_back_r.model.xml" translation="19.323000,6.254620,-22.176701" pivot="0.000000,-2.952030,0.000000" rotation="90.000000,1.000000,0.000000,0.000000" scale="1.000000,1.000000,1.000000" />
				<slot class="Model" name="wheel_back_l" file="models/wheel_back_l/wheel_back_l.model.xml" translation="19.323000,6.254620,22.929800" pivot="0.000000,-2.952030,0.000000" rotation="90.000000,1.000000,0.000000,0.000000" scale="1.000000,1.000000,1.000000" />
			</slots>
		</slot>
	</slots>
</assembly>

DCC tools exporter, materials and tutorials

Wednesday, December 23rd, 2009

Worked on the exporter side, to get data from DCC tools (Maya, MAX, XSI, whatever) to the engine. The main workflow goes like this (tho will be improved): you model your thing in the 3D package of your choice, export the scene/object as a COLLADA (.DAE) file, using the package’s COLLADA exporter (some DCC tools have their own, some can be extended with free COLLADA exporters like ColladaMAX, ColladaMaya, XSI has its Crosswalk thingie; after you have the *.DAE file, you will run The NAC (Nytro Asset Compiler) from command line, like this (it also has options switches not shown here): nac “d:\where my dae at\some.dae” “d:\some\gamedata\output here”, this will generate, depending on COLLADA file contents and given NAC options, a *.mesh or more, or *.material.xml, *.model.xml, *.anim for objects and/or skeletons, and so on. That’s all, from there you setup and use the resulting optimized binary files how you wish.

Materials had a little, yet major modification done to them, now in a .material.xml file you can have a <subMaterials> tag and have <material> children sub-materials, so when you apply a material to some mesh, it will apply submaterials onto the submeshes of that mesh. Example for a model with a mesh containing 3 submeshes:

crate.material.xml:
 
<material>
    <subMaterials>
        <material name="frontSide" shader="materials/shaders/generic.shader.xml" shaderPreset="generic">
            <textures>
                <texture file="textures/some1.png"/>
                <texture file="textures/some2_normal.png"/>
            </textures>
        </material>
        <material name="leftSideOfCrate" shader="materials/shaders/ice.shader.xml">
            <textures>
                <texture file="textures/some2.png"/>
                <texture file="textures/some2_normal.png"/>
            </textures>
	</material>
        <material name="topWaterThing" shader="materials/shaders/water.shader.xml" shaderPreset="pool">
            <textures>
                <texture file="textures/some3.png"/>
                <texture file="textures/some3_normal.png"/>
            </textures>
        </material>
    </subMaterials>
</material>
 
crate.model.xml:
 
<model>
    <lods maxDistance="100">
        <lod mesh="meshes/box.mesh" distance="0">
            <subMesh material="models/crate/crate.material.xml" subMaterial="0" />
            <subMesh material="models/crate/crate.material.xml" subMaterial="1" />
            <subMesh material="models/crate/crate.material.xml" subMaterial="2" />
        </lod>
    </lods>
</model>

In the future I will add a tag to select a material for the entire LOD, so you dont specify a material, same material for each submesh, but the option to override a submesh material with other will remain of course.

Started on writing basic engine usage tutorials/examples, but I’m afraid this milestone for an alpha SDK for 25 dec. will not reach its completeness, but things are going nicely, rushing it would probably do more bad than good. As always, stay tuned.