Game Development Community

More waterblock related problems UPDATED!

by GregM · in RTS Starter Kit · 01/13/2005 (10:47 pm) · 7 replies

Looks like my little team is turning into the waterblock trouble makers.

First we had the squaresize issue with the frenzy map: www.garagegames.com/mg/forums/result.thread.php?qt=24072

now my art guy is fighting with maps that won't load if the water block is over 768 units in length or width.

Our project requires very large bodies of water and I know torque can handle them so this bug was not only a project killer for us but darned confusing.

I think I have the problem fixed but I'm not sure what caused it in the first place. I spent most of last night researching known waterblock issues and came to the conclusion that our problem was not so much a torque limitation (2048 units is the limit for waterblocks not 768) but some defect in the mission file that was causing torque to freak out.

I think the core of the problem is that our test missions were built starting with the example mission and terrain included with the RTS kit. This was the mission with the squaresize of 5 which caused all the water/shore issues. The texture paths for waterblocks still point back to starter.FPS instead of starter.RTS which caused some initial confusion. After fixing that issue my artist could create but couldn't reload maps with waterblocks bigger than 768 units wide or long.

I fiddled with the mission file this morning and got a map to reload with a 2048 x 2048 waterblock. Things were not all sweetness and light however. My beautiful tropical island was full of holes! I scrolled around a bit and found a funny diagonal pattern of holes and stone textures all across my pristine seabed - inspite of the fact that I don't use a single stone texture in my map!

Worse still, when I went to the waterblock in the world editor inspector and tried to examine some settings torque crashed!

So I did what any self respecting hot headed developer would do (no not punch the monitor) I deleted my island map and missions and started from scratch.

*** This may be tedious and/or ranty, you may skip ahead ***

- first, open the example mission

- fix the squaresize issue, save and exit torque.

- restart, add a waterblock and carefully copy the settings from a waterblock in the regular torque SDK (except texture paths of course). Then save and exit. Torque crashes on exit.

- Restart and reopen. Hey, it works. Go to world editor inspector, torque crashes when certain waterblock fields are expanded.

- edit mission file by hand. compare to known good torque SDK examples, fix paths to fit RTS kit, delete all dynamic fields that do not correspond to fields found in known good example. Save and restart.

- Holy hand grenades it works! Dropkick me Jeebus in the chestnuts of life!

*** if you are skipping ahead start reading again here ***

So, I'm still not 100% sure what caused all this. All I know is that my art guy was stuck for two weeks while I was vacationing in the PRDCM and I've got no beautiful tropical island maps. I do have a theory though.

Something in the defaults for the dynamic fields was causing the grief. After I deleted all of the dynamic entries for the waterblock my problems cleared up.

If you have RTS maps with large bodies of water don't base them on the example mission files, they are notwater friendly. Start from scratch or copy the .mis files from the regular SDK and hand edit them to fix the texture paths.

#1
01/14/2005 (4:35 am)
Hi Cholly, thanks for the write-up here, and sorry for the frustration.

Yeah, we should change the squaresize back to default, probably. And definitely clean up the paths, woops.
#2
01/14/2005 (11:44 am)
No problem. I'm not really frustrated, a little confused, but not frustrated.

Having torque and the RTS kit probably saves me a year of development time which makes this little project doable in the first place. I can live with little stopages and quirks.

The squaresize and paths were really no big deal for me, they didn't cause the crashes. What worries me is that I still don't really know what fixed the problem. I had already fixed both issues in our map before the waterblock size related crash cropped up.

As for the holes and texture weirdness, I'm operating on the assumption that my fiddlings with the editor and crashing somehow corrupted the .ter file and that it's not a torque bug.
#3
01/14/2005 (2:14 pm)
I've done some researching and think I've narrowed it down quite a bit.

It's some sort of .ter file corruption that leaves holes in the map and random texture errors.

It only occurs when I import a bitmap with the terrain terraform tool. It happens reliably with the island png I've been using to create my terrain. If I simply copy and rename another terrain file (one of the defaults, not one I imported) the problem goes away.

If I edit my mission file by hand and remove my waterblock the problem, along with holes in the terrain and texture issues also goes away.

I haven't determined if this happens with all .PNG files or just the ones my art guy sent me, if anyone tries and can't reproduce the bug let me know what tools you created your .png files with and I'll encourage my artist to switch.

Here is how I was able to reproduce the bug (requires a .png file to import for terrain):

1 from any map hit F11 to enter the editor.

2 in the world editor inspector change your squaresize to 8 if it isn't already (for shoreline compatibility)

3 save your map under a new name so you don't overwrite your example map

4 create a new waterblock. Make it large, I set it to maximum size (2048 x 2048) but any size over 768 units will probably cause the bug.

5 fix all your texture paths for water, shore, specmask etc. Adjust your water depth, get it as pretty as you like, or don't.

6 Save, exit and reload. At this point everything is still working fine. Water looks great, editor works, exits clean etc.

7 go back into the world editor and go to the Terrain Terraform Editor. Choose Operation > Bitmap and select a .png file to load as your heightfield. Save your mission file again and exit.

8 Restart torque and load that mission. Look at your terrain and textures, are there any holes, any weird rogue squares of texture where they don't belong? Try running the editor, if it works try opening some of the terrain tools. Try exiting the editor and quitting the mission. Try loading the mission again. Usually either the mission won't load or launching the world editor crashes torque.

I think I've got it down to 3 possibilities: Either I'm using a bad source for .pngs, I'm not using the bitmap import tool correctly or I've found a bug with imported terrains and large bodies of water.
#4
01/19/2005 (3:52 pm)
Followup to followup:

I've done a bit more experimenting and I think it's the PNG file I created the terrain from. I created a new PNG using Terraform and the GIMP under linux and just copied it over to my windows drive. Maps created from that file load great and exibit none of the problems I documented above.

It doesn't seem to matter what is in the dynamic fields for the waterblock with this new terrain, so I think that was a red herring.

Please pardon all this going into the RTS general forum, initially I thought this was a continuation of the issues I was having with the default mission having odd settings. Since that's not really a bug, just something to note for RTS users I figured it belonged here.

Anyhow, I'll continue fiddling until I better understand why that particular PNG file has issues and report back in the Artists forum where it belongs.
#5
01/20/2005 (12:43 am)
Things get stranger still.

I had the art guy whip up 3 more pngs for terrain files, he used photoshop 5. All caused crashes with large visible waterblocks.

Just for grins I decided to try the same .pngs in the regular TGE sdk. They work in regular torque but not in the RTS.

I'll try to post the files somewhere tomorrow (.pngs, .mis and .ter) so anyone who wishes to try this out can see it for themsleves.
#6
01/20/2005 (4:04 pm)
I don't know if it will help, but you might consider using the editor to export a heightmap of the terrain, maybe something will jump out. That might also serve as a work-aroiund (provided you need one) that is, to import your heightmap, export it from torque, and then import the new one.
#7
01/21/2005 (2:00 am)
Hmmm. I'll give that a try.

This really has me stumped right now. My understanding is that little or nothing was changes with respect to terrain and waterblocks in the RTS kit but maps that work in TGE aren't working in the RTS kit.

My artist also has a newer version of Pshop but hasn't installed it yet. I'll see if that solves the problem.