Game Development Community

dev|Pro Game Development Curriculum

Super Environment Package

by Michael Perry · 02/19/2008 (6:31 am) · 32 comments

Super Environment Package contains a collection of the most popular and useful new environment upgrades and objects. The resources have been updated to work with TGE 1.5.2, and include new replicators, Ben Garney's forest pack, terrain deformation, and more.

This package has been set up for the easiest possible integration if you are starting with a fresh build of Torque Game Engine v1.5.2. You will only need to add a few files to your engine solution, and the rest is simple drag and drop. If you are not starting with a fresh build, I highly recommend you use a manual integration program such as WinMerge.

The following resources (followed by the authors) were used in the creation of this package. Some resources had multiple authors, so if I left a name out be sure to correct me as everyone involved deserves a mention for this awesome code.

Forest Pack
by Ben Garney

Environment Package System
by Michael Perry

Grass Replicator
by Bendik Stang and Ken Finney

Updated Terrain Deformer
by Ron Nelson, Robert Brower, Stephen Zepp, Gary Preston, and others

Relative Paths for Terrain Textures
by Ed Zavada

fxShapeReplicator Update
by James Laker (BurNinG)

Animated fxShapeReplicator
by Vincent BILLET

fxShapeReplicator: Up to 16 random shapes
by Ben Sparks (Warspawn)

fxSquareFoliageReplicator
by Jon Jorajuria

Clustering in the Foliage and Shape Replicators
by Jeff Loveless

Changing the hard coded paths to script driven ones
by Gregory "Centove" McLean

Terrain Textures: Place by Latitude
by Andy Schatz


These directions are aimed at Windows users who compile in Visual Studio. If you require help with integration on a different OS, please post in the comment section.

Start by clicking HERE to download the files

ENGINE INTEGRATION
Step 1: Back up all your files, both engine and script

Step 2: Copy this resource's engine directory over your local engine directory.

Step 3: Open the Torque SDK solution (Torque SDK.sln)

Step 4: Under the Torque Demo project, right click on the Source Files filter (folder)

Step 5: Left click Add->New Filter

Step 6: Name the new filter "forest" (without the quotes)

Step 7: Right click the new forest filter

Step 8: Add->Existing Files

Step 9: Navigate to the engineforest directory

Step 10: Select all forest files and click "OK"

Step 11: Just as in steps 9-11, add the following files to the dgl filter:
  • gTextureSheet.cc[li]gTextureSheet.h
Step 12: Add the following files to the gamefx filter:
  • fxGrassReplicator.cc[li]fxGrassReplicator.h[li]fxSquareFoliageReplicator.cc[li]fxSquareFoliageReplicator.h[li]terraindeformer.cc[li]terraindeformer.h[li]twSurfaceReference.cc[li]twSurfaceReference.h
Step 13: Recompile your debug and release builds



SCRIPT INTEGRATION
This resource was built around the default example folder, mainly the starter.fps mod. If you are working with a fresh example folder, you can simply drag the example folder in this resource to your directory. Make sure you delete any .dso files before you run.

The alternative is to manually merge the files in this resource to whatever directory you are working from. Again, software like WinMerge is a good idea.

I've provided sample missions for you to view the upgrades and new environment objects. If you want more detailed descriptions and instructions, post your questions in the resource comments or visit the original resources.

Also, you will find a local copy of the directions and a kind of "coder log" in the Super Environment Resource.doc file.

This resource is a work in progress, both the code and the text found here. Please inform me of any errors or failure(code, grammar, steps, etc)

*Note - Restored links to files
Page «Previous 1 2
#1
01/24/2008 (11:53 pm)
Very good job !
#2
01/25/2008 (10:47 am)
Nice!! I'm doing it now
#4
02/19/2008 (3:30 pm)
Thanks
#5
02/25/2008 (2:25 am)
Wonderfull! Finally a good 1.5.2 resource pack :P
#6
02/27/2008 (12:48 pm)
This worked like a charm on a clean 1.5.2 installation. I'm an artist and just following the instructions it took me a whopping 15 minutes - including compiling. Thank you very much!
#7
02/27/2008 (1:03 pm)
Glad you guys like it =)
#8
04/08/2008 (11:37 am)
Michael - you rawk ... that is all!
#9
05/10/2008 (10:44 pm)
Looks like an amazing package, but I'm having trouble installing it alongside the TMK. I get an error in mkMaterial.cpp:
ConsoleSetType(TypeSubShaderPtr)
{
   if(argc == 1)
   {
      SimGroup *rootGroup = Sim::getRootGroup();
      AssertFatal(rootGroup, "Why don't we have a root group?");
      SubShader **shd = (SubShader **)dptr;
      *shd = (SubShader*)rootGroup->findObject(argv[0]);
      AssertFatal(*shd != NULL, avar("SubShader: requested sub shader (%s) does not exist.", argv[0]));
   }
   else
   {
      Con::printf("(TypeSubShaderPtr) Cannot set multiple args to a single SubShaderPtr");
   }
}
At the second AssertFatal. This happens as soon as I start Torque.
#10
05/11/2008 (8:56 am)
@Daniel - Is that the entire function? I haven't used the TMK in a while, so I'm not familiar with that particular file. Is that code block apart of a ConsoleMethod or ConsoleFunction?

Also, I *think* the culprit has something to do with rootGroup->findObject(argv[0]);

If I remember correctly, I implemented a findObject(...) method in one of my Environment Package System resource. When I wake up completely, I can have a look.
#11
05/11/2008 (12:32 pm)
Nope, that's the entire thing. It comes after this line:
ConsoleType( SubShader, TypeSubShaderPtr, sizeof(SubShader*))
It's not inside any other parenthesis as far as I can see.
I agree that findObject is where it's going wrong... argv[1] seems correct. It is set to InteriorParallax20, the shader that gives the problem.
#12
05/11/2008 (2:32 pm)
Does the TMK work fine without the package code?
#13
05/11/2008 (11:17 pm)
Yep. I've been using it for a few months without problems.
#14
05/12/2008 (5:21 am)
Sorry Daniel, I should have been more clear. Do you still get the error message if you do not use the Environment Package System . That's the module that I wrote. In other words, try to comment out the code sections that use the packaging system and see if it works for you.

If not, I'll try a merge myself to see what's going on.
#15
05/12/2008 (5:44 am)
I commented out the two methods (one console method) declared in simBase.cc, but I still get the same problem. I'm going to see if I can rip out the entire enviro pack to make the problem go away. Then probably just add them in one by one.
#16
05/12/2008 (5:48 am)
OK. Well, before you do a complete scratch let me go ahead and do my merge. This is probably a one line fix, so give me a few to check this out
#17
05/12/2008 (7:27 am)
First merge didn't go so well. My error:

Message Box Assert
Quote:
Aw, crap.4

Awesome, very informative. I think we are gonna have some fighting between TMK vs Forest Pack vs Package System
#18
05/12/2008 (8:01 am)
OK. That last error had to do with old prefs and .dso files. Everything is running now.

1. Installed fresh TGE 1.5.2
2. Merged TMK with stock code (engine and example). Just a copy paste here.
3. Manually merged engine code from Super Environment Package using WinMerge.
4. Left out changes to simBase.cc
5. Compiled. Deleted .dso and .prefs
6. Ran game (starter.fps)
7. Made changes for Package Save/Load system (simBase.cc)
8. Compiled
9. Manually merged and copied files from Super Environment Package.
9. Ran with no .prefs or .dso files

Everything seems to be working fine on my end now. See any steps you might have skipped?
#19
05/12/2008 (8:08 am)
I didn't miss any steps... I guess the problem is in other things I've modified. I didn't delete DSOs, but that's never caused problems before. I'll try that. Still no dice, then I think I'll just do a fresh install and put this in first. I'm in the process of getting subversion running on my computer, so that should help keep stuff like this from happening in the future :P.
#20
05/12/2008 (8:14 am)
If you do have other modifications in, then the problem might revolve around code I do not have access to or know of. Let me know if there is anything else I can help with, and how the final build goes when you start over.

Definitely use source control when taking on a project as complex as the one you are doing. Whether it's documentation, code, or assets I always use source control. That's why I posted another resource:
Step by Step Source Control Setup. I still go back to that resource when I have to make a new server.
Page «Previous 1 2