Game Development Community

Content Pack2 and white terrain

by Vince McMullin · in Torque Game Engine · 07/13/2005 (10:51 am) · 15 replies

So I bought the content pack2 by Tim assuming that it was more a drag and drop type of package and that I could have some decent looking missions/terrains to develop in. I'm not really interested in building my own missions at the moment.

So after moving all of the scripts and data over to my personal build I found that all of the terrain's textures were appearing white and the scripting effects were not occuring like the blowing dust effect. So I fixed one mission's terrain (Afrika) and figured I could just hex edit the memory addresses to the new path for the rest of the missions, I'm assuming thats all thats broke.... but after hex editing one of the addresses the mission crashed the game when I tried to load it.

So I'm wondering is there an easy way to fix these pre-built missions to work with my build (different memory addresses) or do I need to simply re-add all of the textures used in the missions? Half the reason I bought the pack was for the quick and dirty environment.

#1
07/13/2005 (11:03 am)
Make sure your path to the textures is the same as the path specified in the original mission files.

I don't own the cntent pack, so that's just a guess.
#2
07/13/2005 (11:14 am)
Quote:hex edit the memory addresses to the new path for the rest of the missions

Sounds like just path's to the textures (like Kirby said).
#3
07/13/2005 (11:46 am)
Hit F11, bring up the Texture Editor and modify as necessary.
#4
07/14/2005 (2:23 pm)
I had this same issue, caused by Tim's setup using the path fps/data/terrain/blah. Caused me no end of difficulties, I kind of expected an official content pack release to be a bit more "out of the box", and not require so much work to fix against a stock TGE1.3

Raised as bugs over 6 weeks ago, still no reply. The supplied demo missions provided the only hard-reboot crash that I've ever had with Torque. :(

- Seb.
#5
07/14/2005 (4:34 pm)
Sebastian,
The terrain textures thing isn't a bug...it is simply how the engine works. The paths for the terrain textures are hardcoded in the terrain file. If you copy the terrain/textures into another folder then you simply need to spend 15 secs doing what Chris suggested and the textures will be fine.
#6
07/14/2005 (7:15 pm)
Matthew,

When I open a mission where the textures have an incorrect path and go into the terrain texture editor, there's no list of textures. Are you really telling artists that are buying content that they have to open the terrain files in a hex editor to find the names of the textures that should be applied, and then work out which texture layer is which, and how it should be applied?

Or am I missing something here? Is there some way in the terrain texture editor to just change the path it's searching for those textures and have them re-applied according to the data in the terrain file?

Thanks for any light you can shed.

- Seb.
#7
07/14/2005 (9:32 pm)
I had this problem and i found that there was no way to correct the textures in the editor. If you altered the loaded textures in the editor it would reset all the texturing. I eventually hacked in some code to have it change "fps" to "base" (my game's default directory) when it loaded and converted my maps, then saved and turned the hack off. This was with 1.1.2 though.
#8
07/14/2005 (10:27 pm)
Quote:So after moving all of the scripts and data over to my personal build I found that all of the terrain's textures were appearing white and the scripting effects were not occuring like the blowing dust effect.

Ugh...the words of a noob. Now remember, the blowing dust effect as seen in the highland missions is just a modified version of what his pack already gives you. Open the mission editor, go to world editor, click on the white dust effect object then edit it. You will have to slow down the speeds and after a little work you can make it happen. Oh yeah, make sure you're using Torque 1.3 or else you won't be able to do that. Anyway, good luck to you and be careful with what you edit. Always make backups!

-Matt

EDIT: I think you meant the blowing dust effects in the highland mission. If not, my apologies.
#9
07/15/2005 (12:48 am)
Sebastian, I can honestly say I never saw that help request, but as pointed in the Docs I am available any time through the email addresses provided for help.

As for the "drag & drop" comments. The demo example is simply that, a demo, so you can load up a torque project and see the stuff in action. It is not intended to be an easy "copy over" solution, as no such thing exists in a engine this complex. You need to know a little about what your doing to be able to do that, but it's not difficult.

As for the white terrains, the path to the textures is hardcoded into the terrain file when it's created in the mission editor. If you move the textures and terrain file to another directory, obviously those paths will break and when Torque doesn't find the texture, it just leaves white.

However, fixing this takes like 5 seconds of effort, and there is absolutely no hex editing involved. I don't even know why hex editing would be considered actually.

First, load up the mission with the incorrect terrain texture paths.

www.subreal.net/terrain_prob/terrain_one.jpg
Press F11 (if your key bindings are unchanged from the default, if this does nothing, you need to fix your key bindings). This brings up the in-game mission editor.

www.subreal.net/terrain_prob/terrain_two.jpg
Click on Window, then go down and select "Terrain Texture Painter". This will bring up the default texture painter, with the palette on the right with the terrain textures being used in this mission. They should all be grey boxes, because as stated before by moving the terrain and textures, the paths are broken.

www.subreal.net/terrain_prob/terrain_three.jpgwww.subreal.net/terrain_prob/terrain_four.jpg
If you just copied everything over, then the textures should be in the "terrains" directory. You need to point these to the right spot for them to work. This is the afrika one mission, so I click on the "Change" button under the upper left hand corner texture (afrika1), and then I use the browser to find the afrika one texture, and select ok. If you have nothing in this browser, you more then likely didn't put the textures in the "terrains" directory, or have a "terrains" directory under the "data" directory of your game. The browser uses the "terrains" directory as the top-level in it's search, so if it doesn't exist or you don't have it, then you'll have nothing in this window.

www.subreal.net/terrain_prob/terrain_five.jpgwww.subreal.net/terrain_prob/terrain_six.jpg
Repeat this process for the rest of the missing textures.

www.subreal.net/terrain_prob/terrain_seven.jpg
Once your done, you should have everything back to normal. Be sure to SAVE the mission so these changes are wrote to the terrain file, so you don' t have to do this again. If the "Save Mission" is greyed out, just take the brush and paint a small bit or make some small adjustment to the mission. Changing the terrain textures doesn't currently "ungrey" the Save mission option if you load fresh for some reason.

www.subreal.net/terrain_prob/terrain_eight.jpg
Thanks for the feedback and any confusion this might have cause regarding how Torque handles Terrain Textures is goin to be addressed in the upcoming TDN Artist section.
#10
07/15/2005 (12:51 am)
Regarding the particle effects and precipitation effects not showing up. Chances are they didn't get copied over correctly either.

Be sure to read the docs about how mission precipitation values (e.g. the floating particles in the highlands mission have their properties set in a mission precipitation datablock).

They all have external scripts that need to be initalized in game.cs as well, be sure that is happening, particle and precipitation effecst aren't really drag and drop either as they both use complicated systems that wouldn't work under that circumstance, so be sure to go in and check all the paths to the particle textures to be sure they are pointing correctly, and make sure the proper scripts are getting initalized, and that the right values are being used in the mission file for precipitation effects.

Online version the docs
#11
07/15/2005 (2:36 am)
Yo Tim... What Character is that!? It looks cooL!
#12
07/17/2005 (1:42 pm)
Wow, thanks for the reply Tim!

I actually fixed the hardcoded terrain files by hexing the memory addresses again but this time ensuring that the file size did not change.

After altering the memory addresses correctly, the terrain textures loaded.


For the afrika terrain for instance, find the offset 196609. From this offset to 196867 are four instances of "demonstration" where demonstration is the name of your mod's directory. Replace "demonstration" with the name of your mod's directory and fill the end of the file with any remaining nulls. If you don't want to work with nulls then I suggest replacing "demonstration" to something with the same number of characters. Then save the file and load the mission. Hexing the address and changing the file size will crash torque, make sure you don't remove any bytes.

Thats how I fixed all of the textures from the combo pack quickly........ Obviously it wasn't the proper way but it does work and takes no time at all if you know what to do.


Great work Tim!
#13
07/17/2005 (1:47 pm)
The particle effects are easy to get working..... just need to read the documentation!!!
#14
07/17/2005 (1:49 pm)
Yeah, um... hex editing a file vs. opening it in the mission editor and resetting the textures as Tim demonstrated.

I should really dig the hex editor thingy... but I don't. And I'm a programmer! That's an interesting adventure in wasting time. But then again, that's just my 2 cents. www.renderengine.com/stuff/plans/smile.jpg
- Brett
#15
08/15/2005 (5:43 am)
One simpler method may be to add a relativeTexturePath attribute in your terrain datablock. This way, you can load texture from this path and no longer deal with the hard-coded path in the terrain file. I add it for one of my project, and it works nicely.