Game Development Community

Modernization Kit Beta

by Alex Scarborough · in Torque Game Engine · 02/26/2007 (12:02 am) · 331 replies

Due to the absurd length of this thread, a new one has been started HERE. Please post in the new thread!


This thread is essentially a restatement of this except it's crossplatform now.

farm1.static.flickr.com/123/370544870_646796e1aa.jpg

I am contractually obligated to do at least one (1) shiny thing a month, so here's my shiny thing for this month:

A working Win32 version of the ModernizationKit.

A huge thanks to OneST8 for getting the port started, and to GG for putting me in front of a PC and not minding that I quietly spent around 20 minutes a day getting this working.

Current version is: v0.8 build 0010 released 4-10-07

This is for TGE 1.5.0/1.5.1 ONLY!

Modernization Kit Website
Username: torqueUser
Password: tMK60152

This code is compatible with the latest version of Mac OS X and Windows 2000/XP

Thanks to the fabulous Jeff "Reno" Raab for letting me host this on the server he runs, and to Ben Sparks for setting up the website and forums!

I can't guarantee this code will work, or even compile, on anything other than my personal computer! Backup your copy of TGE if you use this! Actually, download a clean copy and play with that. I am not responsible for any damage done to your hardware or software as a result of using this!

Some notes: Cg is disabled by default, because it saved me the trouble of shoving Cg into TGE under Windows. Trust me, you're not going to miss the Cg layer anyways, GLSL is where it's at. If you do happen to want to enable Cg for whatever reason, uncomment #define SHADER_MANAGER_USE_CG in mkShaderManager.h.

Unit tests are disabled on Windows, to save the trouble of getting the CppUnit library up and running properly. Unit tests are enabled on OS X because you don't have to do anything for them to work; the bundled project file will link with the compiled dylib, copy it into the application bundle, and even change the install path so you really don't have to do a thing to use unit tests.

This code has not been tested on ATI GPUs under Win32. Presumably it will all work, but who knows. It has been confirmed to at least function on nVidia cards (there are a couple of known issues which will be addressed before 2008).

If you would like to subscribe to the Modernization Kit mailing list, submit a bug, or send some general feedback, please use the links on the Modernization Kit Web Center.

Best of luck, and I hope you get some good use, pretty screenshots, or fun out of this code!
#161
04/07/2007 (9:34 am)
Ahhhhh, so many link errors *beats head against key board...
#162
04/07/2007 (9:54 am)
Anyone got this working on vista? I compiled the code on my xp machine, runs great, but cant figure out why it has problems loading of MK in vista. it runs the CG code, but very messed up. is it true that vista did limit the opengl support for the OS?
#163
04/07/2007 (10:00 am)
OpenGL support is not limited in Vista. However, OpenGL drivers for Vista are still incredibly new and therefore rather buggy.

In the meantime, I will say that I have no plans to officially support Vista in the near future.
#164
04/09/2007 (11:51 am)
Any word on 1.5.1 support?
#165
04/09/2007 (12:12 pm)
Any word on 1.5.1 support?
#166
04/09/2007 (3:34 pm)
Alex with the addition of 1.5.1 support, how are you going to get around the alpha layers being used for your height maps in the modernization kit and the fact that they are used now for tranparencies in 1.5.1 and it is part of Constructor now too?
#167
04/09/2007 (3:50 pm)
@Jon: Hopefully tonight.

@Ron: There's nothing to work around. The MK uses the alpha channel of the normal maps, not the base textures. The only thing I'd need to worry about is making sure the shaders properly pass through the alpha from the base textures, which will be a five minute job.
#168
04/09/2007 (5:12 pm)
Awesome
#169
04/10/2007 (3:13 am)
It's absolutely superb!
OpenGL is the way to go!

It took me a while to get in running (forgot to delete the DSOs and so on :/ )
But now it works:

giggsy.3d-diggers.de/firsModernKit.jpg


Do you think you can make the normalmaps for shapes standard and not a do-it-yourself coding task?
That would be very, very nice :)
#170
04/11/2007 (4:52 pm)
Hmm just dropped the 1.5.1 code into a clean 1.5.1 and tried to compile. Got this result:

interiorRender.cc
..\engine\interior\interiorRender.cc(1167) : error C2664: 'flushPrimitives' : cannot convert parameter 1 from 'void *' to 'const U16 *'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
..\engine\interior\interiorRender.cc(1193) : error C2664: 'flushPrimitives' : cannot convert parameter 1 from 'void *' to 'const U16 *'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
..\engine\interior\interiorRender.cc(1214) : error C2664: 'flushPrimitives' : cannot convert parameter 1 from 'void *' to 'const U16 *'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
..\engine\interior\interiorRender.cc(1232) : error C2664: 'flushPrimitives' : cannot convert parameter 1 from 'void *' to 'const U16 *'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
..\engine\interior\interiorRender.cc(1852) : error C2664: 'flushPrimitives' : cannot convert parameter 1 from 'void *' to 'const U16 *'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
..\engine\interior\interiorRender.cc(1878) : error C2664: 'flushPrimitives' : cannot convert parameter 1 from 'void *' to 'const U16 *'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
..\engine\interior\interiorRender.cc(1899) : error C2664: 'emitPrimitive' : cannot convert parameter 3 from 'U32 *' to 'const U32'
        There is no context in which this conversion is possible
..\engine\interior\interiorRender.cc(1926) : error C2664: 'flushPrimitives' : cannot convert parameter 1 from 'void *' to 'const U16 *'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
I thought maybe this was related to the treat wchar as built-in error listed way up top but my project setting were already set correctly.

Anyone else see this with 1.5.1?
#171
04/11/2007 (5:24 pm)
@Corey: I'll check that out tonight. I didn't have a chance to do a windows build so something like that isn't too surprising. It's probably just a very simple straightforward fix, looks like a bit of casting needs to be done.

@All: Build 0010 is available for download, and it includes 1.5.1 support (which needs a tiny bit of work as you can tell).

Furthermore there's a new MK site! Check it out!
User Name: torqueUser
Password: tMK60152

It has forums! Use the forums, vote in the poll, give feedback, whatever!
#172
04/11/2007 (8:33 pm)
@ Alex:
Thanks very much!

and one problem:
link errors in win32 1.5.0 & 1.5.1

when merge Build 0010 to clean TGE 1.5.0 and TGE 1.5.1.
They all have this link errors:

Quote:------ Build started: Project: Torque Demo, Configuration: Release Win32 ------

Compiling...
interiorRender.cc
Compiling resources...
Linking...
gameTSCtrl.obj : error LNK2001:
unresolved external symbol "public: void __thiscall mkFluid::prepReflection(struct CameraQuery *,class PlaneF)" (?prepReflection@mkFluid@@QAEXPAUCameraQuery@@VPlaneF@@@Z)
mkFluid.obj : error LNK2001:
unresolved external symbol "public: void __thiscall _MKGFX::prepRenderPlanarReflection(class CameraQuery *,class PlaneF,class RenderTexture *)" (?prepRenderPlanarReflection@_MKGFX@@QAEXPAVCameraQuery@@VPlaneF@@PAVRenderTexture@@@Z)

../example/torqueDemo.exe : fatal error LNK1120: 2 unresolved externals

Build log was saved at "file://c:\Torque(2007)\1.5SDK(MK Build0010)\engine\out.VC7.RELEASE\BuildLog.htm"
Torque Demo - 3 error(s), 0 warning(s)
#173
04/12/2007 (11:14 pm)
@ Alex:
Thanks very much!

Now It's ok using the MK 1.5/1.5.1 update.
#174
04/13/2007 (1:34 pm)
Alright, I've resolved the issues with the windows versions of build 0010 for TGE 1.5.0 and TGE 1.5.1. Furthermore a VC7 project for build 0010 in TGE 1.5.1 is now in the download.


There's a new MK site! Check it out!
User Name: torqueUser
Password: tMK60152

It has forums! Use the forums, vote in the poll, give feedback, whatever!
#175
04/14/2007 (8:36 am)
Hi Alex,

Downloaded, installed, and can run, but do I have to do something specific to "activate" the shaders. My mission just looks darker, and there is no reflection in the water. I looked over the docs and dont see any..."do this" to activate the MK kit. Thanks in advance for any help.

System:

WinXP
Dual Core 2.8GHz
1 GB RAM
Geforce 7900 GS 512 MB RAM
newest Cg toolkit
VC++ 2003

Running TGE 1.5.1 and the latest MK kit from your site. Also, running Stronghold mission. I used the console commands i saw listed above and they had no affect either.

J
#176
04/14/2007 (9:19 am)
Are you using the open gl driver or the directx one in the options screen?
#177
04/14/2007 (9:43 am)
There are a few things that have to happen for the MK to work. Sorry for the complexity, and lack of clear documentation on how to get it up and running.

1) The materials.cs file included in the Modernization Kit download must be executed. Copying over all the files in common will ensure that this happens.

2) The following lines should be added to your defaults.cs

$pref::DRL::enable = "1";
$pref::DRL::bloomQuality = "3";
$pref::Water::reflectionSize = "1024";
$pref::Water::Refract = "1";
$pref::Material::qualityLevel = "500";

Alternatively you can use the following console commands

DRL::enable(1);
DRL::setBloomQuality(3);
mkFluid::setReflectionSize(1024);
mkFluid::enableRefraction(1);
MaterialManager::setShaderQualityLevel(500);

3) The water requires a bit more setup. You'll have to launch the mission and select your waterblock. In the "Media" section there should be a few new fields, namely Normal Map, UseShader, ReflectionSize, and Refract. Normal Map and UseShader should already be set properly. You'll want to set ReflectionSize to 1024, and check the checkbox next to Refract. This will give you the shiniest possible water.

4) That's all that you need to do to get the MK up and running. There are some other things you could do as well. For example, when you load a mission with interiors, you'll notice that there are new autogenMatList.cs files in the directories containing interiors. If you load those after initCanvas has been called the MK won't regenerate the normal maps every time the mission loads.

Again, I apologize for the lack of clear documentation about what all this is and why it needs to be done. I'm working on documentation now which should make things a fair bit simpler for everyone.
#178
04/14/2007 (3:23 pm)
Why not throw in some drop boxes and sliders in the Options dialog for these settings?

also just wondering:
about 3 lines of code to get DTS shapes working eh?
has anyone gotten this to work with DTS shapes? i'm studying it now but i'm a bit lost.
#179
04/14/2007 (6:38 pm)
TS shapes can't be too hard. . . i know it's here somewhere! why must you taunt me so?
#180
04/16/2007 (11:09 am)
Thanks, Alex. I'm at work now. I'll give it a shot when i get home.