Game Development Community

Big Update

by Brian Ramage · in Torque Game Engine Advanced · 07/21/2005 (12:55 am) · 31 replies

I just checked in a pretty major update that covers many areas. First off, I'd like to warn you:

THIS UPDATE WILL BREAK YOUR CURRENT MATERIALS, SHADERDATA, and CUBEMAPDATA.

Not by a whole lot though ;)

Here's the short list of changes:

Merged latest updates from other TSE projects / products.
Fixed several bugs and memory leaks.
Materials, ShaderData, and CubemapData are no longer dataBlocks (they are client-side only).
materials.cs files auto-loaded.
addMaterialMapping() is no longer needed.
Textures and Materials can be reloaded on-the-fly without restarting TSE.
Materials now in MaterialSet.


More detail:
- materials, shaderData, and cubemaps are all loaded client side now. They are exec'd from client/init.cs. At the moment, it loads up all the material textures when init is called. This will change in the future such that all materials are loaded, but textures are only loaded as needed per level, and unloaded when the mission shuts down.

- materials.cs files are now loaded automatically from any data or script directory. This allows many materials.cs files and they can live in the same directories as the data. Ie. you can place a materials.cs file in the SpaceOrc directory that contains the material definitions for the orc's textures. This has been done in the demos, so review them for further detail.

- Load order on materials.cs files cannot be assumed - it does not execute from top level directories downward. This means common data to be used across multiple materials.cs files (such as ShaderData and cubemaps) needs to be exec'd before the materials. Loading occurs in client/init.cs

- Full paths are no longer needed (but still supported) for textures referenced in Material definitions. This is true only if the textures are located in the same directory as the materials.cs file referencing them. This allows moving art data around in different directories without having to change the materials.cs files.

- addMaterialMapping() calls are no longer needed. You can map Materials to textures from within the Material definition itself now. This is done with the "mapTo" parameter. Note - specifying the mapTo parameter is not necessary if the baseTex[0] texture name is identical to the texture you want to map the Material to. All CustomMaterials are required to have a mapTo parameter. The addMaterialMapping() call still works, so it won't break anything in your current data, but it is no longer necessary.

- Textures and Materials can now be reloaded on the fly without restarting TSE. This is done via the reloadTextures() and reloadMaterials() script functions. The reloadTextures() function is defined in code (gfxTextureManager), and reloadMaterials is a pure script function located in client/init.cs. Note that reloadMaterials() calls reloadTextures(), so if you want one function that does it all, that's the one. When executing these functions, you will get a console message indicating which files it has recognized as changed and reloaded.

- Materials are now all a part of SimSet MaterialSet

- Materials reload like dataBlocks. You can exec a materials.cs script and it will add any new materials, and reload existing ones.
Page «Previous 1 2
#1
07/21/2005 (1:01 am)
This info will be posted to TDN, so you'll be able to see it and modify it when that goes live. Hopefully it will be better formatted ;)

The VC6 project files have not been updated, so you'll need to do that yourself if you are still using VC6.
#2
07/21/2005 (1:23 am)
Excellent...this will make working with materials in game much easier! Ill check it out.
#3
07/21/2005 (1:49 am)
Yeah, agreed! I spent a little bit of time fighting weird material issues that only happened when I was joining a new game during my GID. I bet they'll magically go away with this update.
#4
07/22/2005 (4:47 pm)
Hi,
I'm starting a fresh TSE project, so I decided to use the HEAD version with the "BIG UPDATE". Unfortunately some things are not working. when running the demo mod, and trying to do a walkthrough, the program just waits on connecting to server. I tried the terrain water mod, and that worked nicely. but the gui editor or level editor do not work at all. So basically what I want to know is which tag/branch from CVS should I get to get milestone 2 and have "some" amount of stability. It seems that the HEAD version is unstable right now.
thanks
#5
07/22/2005 (6:24 pm)
Kuni, go to init.cs in the client folder and find:

createServer("SinglePlayer", "testdemo/data/missions/features.mis");

change to

createServer("SinglePlayer", "demo/data/missions/features.mis");

and it should work
#6
07/22/2005 (6:25 pm)
Another problem is when tse was slow looking out of the orc building before it now crashes
#7
07/22/2005 (8:26 pm)
@Brian - Great update... i'll be merging it into our game ASAP.

On the material loading i would like to see TSE evolve toward an asset centric system. If you have a game with 20 missions i don't see that you would want all the materials for all game assets loaded at startup. Ideally... When an interior is loaded the material.cs in that interior folder is loaded... When a mesh is loaded the material.cs in the mesh folder is loaded.. etc.

The 'commonMaterialData.cs' you described in your TDN article could be used for exec'ing ui and hud materials you would want loaded at startup and to be persistent for the entire game session. You would also want two different sim groups so that you can selectively dump them... for instance like calling freeUnreferencedTextures( missionMaterialSet ) when a mission is unloaded.

Anyway. Your new changes make the evolution toward a system like this possible to do.

Great stuff!
#8
07/22/2005 (8:28 pm)
Thanks james, that worked for the demo mod. But I agree with you on the crases when looking out the building. Maybe something has gone wrong with the interior dif. Also, have u experienced the gui and world editor not working correctly? Main quesiton is what is the label I can get from CVS to have a stable built with Milestone 2 implemented?
#9
07/22/2005 (8:31 pm)
I want to read the TDN article....
#10
07/23/2005 (6:52 am)
Kuni - Glad to see you got it 'working'. the editors dont work for me either, will have a look at this. as for cvs no idea...
#11
07/23/2005 (7:01 am)
Sorry but the big update causes more problems than it fixes:

- mission and gui editors not working
- (simple) main path for features.mis is testdemo not demo
- tse crashes on loading mission files
- demo/server/scripts/environment.cs (0): Unable to instantiate non-conobject class volumeLightData.
- Missing file: demo/data/materialMap.cs!
- demo/data/missions/features.mis (0): Unable to instantiate non-conobject class fxSunLight.
- common/client/missionDownload.cs (67): Unable to find function StartClientReplication
- common/client/missionDownload.cs (68): Unable to find function StartFoliageReplication
- Missing glow buffer datablock. Check glowBuffer.cs
- MatInstance::MatInstance() - Unable to find material 'TerrainMaterial'
- MatInstance::MatInstance() - Unable to find material 'TerrainBlenderPS20Material'
- MatInstance::MatInstance() - Unable to find material 'TerrainBlenderPS11AMaterial'
- Searches for a graphics card profile custom to that card:
- No profile/D3D9.NVIDIA.GeForce6200.cs
- No profile/D3D9.NVIDIA.GeForce6200.7214.cs

in options dialog
- bit depth not working
- resolution not working
for the options dialog this is shown in console.log:
"NVIDIA GeForce 6200 " display device not found!
demo/client/scripts/optionsDlg.cs (122): ::getResolutionList - wrong number of arguments.
demo/client/scripts/optionsDlg.cs (122): usage:
"NVIDIA GeForce 6200 " display device not found!
#12
07/23/2005 (7:08 am)
This maybe the cause of the editors not working:
Missing file: creator/main.cs!
Error: Unable to find specified mod: creator
#13
07/23/2005 (7:28 am)
Ok after working through some code I managed to fix some things:

goto -> demo/data/init.cs

change
exec( "./materialMap.cs" );
to
exec( "./materials.cs" );

goto -> demo/data/materials.cs

delete

//*****************************************************************************
// Overview Panels
//*****************************************************************************

new Material(PanelSurface)
{
baseTex[0] = "~/data/shapes/panels/overview";
pixelSpecular[0] = false;
specular[0] = "1.0 1.0 1.0 1.0";
specularPower[0] = 4.0;
};


now start tse
#14
07/23/2005 (7:35 am)
The mission editor works but there is no pane on the right.
the texture painter just wont work in tse
the gui editor wont work

where are the gui editor files?
#15
07/23/2005 (3:28 pm)
Come on guys, these problems are all minor and easily corrected. I just finished porting all this new stuff into our project, which is much more complex than any of the demos. Except for a few minor troubles getting a super secret GG beta product to work properly again, everything has gone pretty smooth. If I didn't have that product, merging would have been very easy, with everything working.
#16
07/23/2005 (4:04 pm)
Super secret gg beta product?
#17
07/23/2005 (4:05 pm)
The textue painter has always had its set of issues in TSE. It wont work with the Atlas terrain system (And if Im current there is no plan to get it to work because of the way the atlas terrain system works).

As far as the other editors there use to be a bug where you had to press esc after you hit the F10 or F12 button to get the edtitor to popup. It was fixed for abit but I havent checked the latest head yet.
#18
07/25/2005 (8:07 pm)
Gahh, I somehow forgot to check in the creator directory. There is also a new client/init.cs with proper material loading and load directories.

Sorry guys, I did actually pull down a clean copy of the CVS to test before I made this thread. Guess I forgot to open the editors. Not sure how the bad init.cs got by though.

It's checked in now, let me know if you still see problems.

@Tom, yes, I agree, it would be best to load only the Materials used in the current mission. Unfortunately, the way the resource manager works and the way missions load I don't think it will be a trivial change to get that to work properly. For large projects it might be easiest to write custom material load scripts per mission. The script names would need to be transmitted to client on mission load. I'll think about this some more, there might be a better way. I'm guessing that 1000 or more Material definitions would take seconds to load though (with no resource loading).
#19
07/26/2005 (2:25 am)
Where is this TDN article?

Can anyone show me a link or something. THX
#20
07/26/2005 (2:38 am)
TDN hasn't been made public yet. Everyone has to wait just a little bit longer. :)
Page «Previous 1 2