Can TGEA work well with TGE mods?
by Hongtao Wang · in Torque Game Engine · 06/15/2007 (6:54 pm) · 16 replies
If no, what can I do for it?
Thanks
Thanks
#2
thank you!
06/15/2007 (8:29 pm)
Can you tell me some detail how to rewrite the mods to work with tgea?thank you!
#3
Think of it this way, everything in TGEA is identical to TGE with the exception of the rendering layer, material system and Atlas terrain. There are some minor differences between the DTS and DIF formats as well. Everything else such as the general scripting language, audio layer, network code, GUI system, player and projectile controllers etc is identical. In essence, TGEA is merely TGE with a new rendering system.
TGEA uses DirectX whereas TGE uses OpenGL, so mods based on rendering code will not be interchangeable. Additionally, some systems in TGEA that work in TGE may be broken.
06/15/2007 (8:44 pm)
It really depends on what you're trying to do, unless you can provide me with a specific example then no, I can't go into detail.Think of it this way, everything in TGEA is identical to TGE with the exception of the rendering layer, material system and Atlas terrain. There are some minor differences between the DTS and DIF formats as well. Everything else such as the general scripting language, audio layer, network code, GUI system, player and projectile controllers etc is identical. In essence, TGEA is merely TGE with a new rendering system.
TGEA uses DirectX whereas TGE uses OpenGL, so mods based on rendering code will not be interchangeable. Additionally, some systems in TGEA that work in TGE may be broken.
#4
thank you!
06/15/2007 (8:53 pm)
Can you tell me some detail how to rewrite the mods to work with tgea?thank you!
#5
Slight correction--TGE-A uses GFX, which currently has a DirectX9 device as the default. A Xenon (XB360) device is available with a separate license, and other rendering devices may be implemented in the future, by either GG or 3rd parties.
06/15/2007 (9:33 pm)
Quote:
TGEA uses DirectX whereas TGE uses OpenGL
Slight correction--TGE-A uses GFX, which currently has a DirectX9 device as the default. A Xenon (XB360) device is available with a separate license, and other rendering devices may be implemented in the future, by either GG or 3rd parties.
#6
06/15/2007 (9:57 pm)
What's GFX?
#7
06/15/2007 (11:01 pm)
It's basically a rendering layer using DirectX9.0. The PrimBuilder is an addition to it that is designed to create a familiar geometry rendering environment for TGE users. Where you'd have glVertex3f(x,y,z); in OpenGL, you now have PrimBuild::vertex3f(x,y,z); with the GFX layer.
#8
Most mods can be ported easily by doing the following:
1) Open yourgame/client/init.cs and add these 2 functions at the top:
The loadMaterials function does a simple search that executes any file named materials.cs. Thus, all of your materials should be stored in these files for ease of use.
2) Copy demo/client/scripts/glowbuffer.cs, demo/client/scripts/shaders.cs, and demo/client/scripts/commonMaterialData.cs and place them in yourmod/client/scripts/.
The glowbuffer.cs contains the shader data for the glow buffer, shaders.cs contains most of the custom shaders, and commonMaterialData.cs contains cubemap data.
3) Somewhere in init.cs in the InitClient function paste the following:
This executes the new scripts and the common/client/shaders.cs script which is used for the new lighting system.
4) Still in that function, paste the following ABOVE setNetPort(0)
This loads up the materials and initializes the new rendering system, both very important lines. The initRenderInstManager function was added in Milestone 3.5.
5) Copy the folders demo/data/textures and demo/data/water and place them in yourmod/data/.
The textures folder is used for pulling cubemap images.
6) Open yourmod/server/scripts/game.cs and somewhere in the function onServerCreated place the following:
This is the last needed step for adding the new lighting system to your mod.
7) Copy demo/client/defaults.cs and replace the yourmod/client/defaults.cs.
8) Create a new materials.cs file somewhere in your data folder. Add the following to it:
These are the materials used by both terrain systems. Very important.
And I believe that should do it.
06/15/2007 (11:16 pm)
Hongtao Wang, Most mods can be ported easily by doing the following:
1) Open yourgame/client/init.cs and add these 2 functions at the top:
The loadMaterials function does a simple search that executes any file named materials.cs. Thus, all of your materials should be stored in these files for ease of use.
function loadMaterials()
{
for( %file = findFirstFile( "*/materials.cs" ); %file !$= ""; %file = findNextFile( "*/materials.cs" ))
{
exec( %file );
}
}
function reloadMaterials()
{
reloadTextures();
loadMaterials();
reInitMaterials();
}2) Copy demo/client/scripts/glowbuffer.cs, demo/client/scripts/shaders.cs, and demo/client/scripts/commonMaterialData.cs and place them in yourmod/client/scripts/.
The glowbuffer.cs contains the shader data for the glow buffer, shaders.cs contains most of the custom shaders, and commonMaterialData.cs contains cubemap data.
3) Somewhere in init.cs in the InitClient function paste the following:
This executes the new scripts and the common/client/shaders.cs script which is used for the new lighting system.
// material related
exec("./scripts/glowBuffer.cs");
exec("common/client/shaders.cs");
exec("./scripts/shaders.cs");
exec("./scripts/commonMaterialData.cs" );4) Still in that function, paste the following ABOVE setNetPort(0)
This loads up the materials and initializes the new rendering system, both very important lines. The initRenderInstManager function was added in Milestone 3.5.
loadMaterials(); initRenderInstManager();
5) Copy the folders demo/data/textures and demo/data/water and place them in yourmod/data/.
The textures folder is used for pulling cubemap images.
6) Open yourmod/server/scripts/game.cs and somewhere in the function onServerCreated place the following:
This is the last needed step for adding the new lighting system to your mod.
exec("common/server/lightingSystem.cs");7) Copy demo/client/defaults.cs and replace the yourmod/client/defaults.cs.
8) Create a new materials.cs file somewhere in your data folder. Add the following to it:
These are the materials used by both terrain systems. Very important.
//*****************************************************************************
// Custom Materials
//*****************************************************************************
// for writing to z buffer
new CustomMaterial( Blank )
{
shader = BlankShader;
version = 1.1;
};
//*****************************************************************************
// Environmental Materials
//*****************************************************************************
new CustomMaterial(AtlasDynamicLightingMaskMaterial)
{
texture[0] = "$dynamiclight";
texture[1] = "$dynamiclightmask";
shader = AtlasDynamicLightingMaskShader;
version = 1.1;
preload = true;
};
new CustomMaterial(AtlasDynamicLightingMaterial)
{
texture[0] = "$dynamiclight";
shader = AtlasDynamicLightingShader;
version = 1.1;
preload = true;
};
new CustomMaterial(AtlasMaterial)
{
shader = AtlasShader;
version = 1.1;
dynamicLightingMaterial = AtlasDynamicLightingMaterial;
dynamicLightingMaskMaterial = AtlasDynamicLightingMaskMaterial;
preload = true;
};
new CustomMaterial(AtlasBlender20Material)
{
shader = AtlasBlender20Shader;
version = 2.0;
preload = true;
};
new CustomMaterial(TerrainMaterialDynamicLightingMask)
{
texture[2] = "$dynamiclight";
texture[3] = "$dynamiclightmask";
shader = TerrDynamicLightingMaskShader;
version = 1.1;
preload = true;
};
new CustomMaterial(TerrainMaterialDynamicLighting)
{
texture[2] = "$dynamiclight";
shader = TerrDynamicLightingShader;
version = 1.1;
preload = true;
};
new CustomMaterial(TerrainMaterial)
{
shader = TerrShader;
version = 1.1;
texture[3] = "~/data/terrains/details/detail1";
dynamicLightingMaterial = TerrainMaterialDynamicLighting;
dynamicLightingMaskMaterial = TerrainMaterialDynamicLightingMask;
preload = true;
};
new CustomMaterial(TerrainBlenderPS20Material)
{
shader = TerrBlender20Shader;
version = 2.0;
preload = true;
};
new CustomMaterial(TerrainBlenderPS11AMaterial)
{
shader = TerrBlender11AShader;
pixVersion = 1.1;
preload = true;
};
new CustomMaterial(TerrainBlenderPS11BMaterial)
{
shader = TerrBlender11BShader;
pixVersion = 1.1;
preload = true;
};And I believe that should do it.
#9
You write your game code in GFX, and then whatever device you have implemented and compiled in will be used--currently TGE-A ships with a DirectX9 device, but anyone can implement any device they have the specifications for.
06/15/2007 (11:35 pm)
GFX is an abstraction layer for graphics that allows you to plug in any device that has been implemented for any rendering situation.You write your game code in GFX, and then whatever device you have implemented and compiled in will be used--currently TGE-A ships with a DirectX9 device, but anyone can implement any device they have the specifications for.
#10
06/15/2007 (11:43 pm)
Interesting. Thanks for the explanation Matt & Stephen. So, it's feasible that TGEA will have a publicly available OpenGL device at some point in time - that will make many people happy.
#11
First, Thank you!
I do as you teach me, but I failed.
I run two mods in the same machine, but get different console.log.
06/17/2007 (7:06 am)
Matt Vitelli,First, Thank you!
I do as you teach me, but I failed.
I run two mods in the same machine, but get different console.log.
Quote:
TGE MOD
//-------------------------- 6/17/2007 -- 21:03:36 -----
Fatal: (c:\tgea_sdk\engine\gfx\gfxinit.win32.cpp @ 115) Bad adapter type
Error, a DecalManager (1a58ab0) isn't properly out of the bins!
---------------------------------------------------------------------------------------------------
TGEA MOD
//-------------------------- 6/17/2007 -- 20:28:56 -----
......................
Direct 3D device found
Cur. D3DDevice ref count=1
Pix version detected: 1.400000
Vert version detected: 1.100000
Initializing GFXCardProfiler (D3D9)
o Vendor : 'ATI Technologies Inc.'
o Card : 'ATI MOBILITY/RADEON 9000 AGP (0x4C66)'
o Version: '65.25'
- Scanning card capabilities...
GFXCardProfiler (D3D9) - Setting capability 'autoMipMapLevel' to 1.
GFXCardProfiler (D3D9) - Setting capability 'maxTextureWidth' to 2048.
GFXCardProfiler (D3D9) - Setting capability 'maxTextureHeight' to 2048.
- Loading card profiles...
- Loading card profile profile/D3D9.cs
- Loading card profile profile/D3D9.ATITechnologiesInc.cs
- No card profile profile/D3D9.ATITechnologiesInc.ATIMOBILITYRADEON9000AGP0x4C66.cs exists
- No card profile profile/D3D9.ATITechnologiesInc.ATIMOBILITYRADEON9000AGP0x4C66.6525.cs exists
Executing common/ui/defaultProfiles.cs.
Executing common/ui/ConsoleDlg.gui.
................
#13
Sorry guys !!!
Daniel.
06/17/2007 (3:40 pm)
Crap ! Sorry !! Had to delete ! Posted link to Private rescources !! Sorry guys !!!
Daniel.
#14
06/18/2007 (5:59 pm)
Indeed, the TGE mods now run in TGEA engine, but the scene looks very bad, Why?
#15
06/19/2007 (10:54 am)
Uhh..without a screen shot I'm not sure what "looks very bad" is.

Torque Owner Tim Heldna