Game Development Community

MS 4: Terrain_Water_Demo not working

by Martin Schultz · in Torque Game Engine Advanced · 09/06/2006 (11:00 pm) · 14 replies

I just checked out a fresh copy of MS 4 and tried to start the terrain_water_demo mod by changing the main.cs pointing to it. TSE crashes then (release build) at this point in the log:

Executing terrain_water_demo/client/scripts/default.bind.cs.
Executing terrain_water_demo/client/config.cs.
Executing common/client/materials.cs.
Executing terrain_water_demo/data/water/materials.cs.


Martin

#1
09/06/2006 (11:18 pm)
Try running a debug version and posting the call stack. It will be tough to find the issue without the specific crash info.
#2
09/06/2006 (11:26 pm)
You're right, I'll do that when I'm back home today.

Could you possibly test if you experience the same behaviour?
#3
09/06/2006 (11:30 pm)
I loaded it earlier without any trouble.
#4
09/07/2006 (12:49 am)
With earlier you mean in MS 3? In MS 3 it worked also flawlessly for me.
#5
09/07/2006 (2:24 am)
Works without problems here, Martin.
#6
09/07/2006 (3:19 am)
Hmm, strange. Thanks for testing, Stefan. I'll give it a try again this evening when I'm back home.
#7
09/07/2006 (10:50 am)
I don't crash when I run the terrain_water_demo, but the terrain is rendering as either "white" or with a funky blue/green pattern.

Todd
#8
09/08/2006 (9:33 am)
Just wanted to followup here...

I got this working just fine, it was my error.

@Stefan - Thanks for the confirmation that you weren't having problems - which was a strong hint that I had screwed up :)

Todd
#9
09/11/2006 (3:16 am)
I was finally able to track the problem I had with the terrain_water_demo!

In debug mode the TSE starts and immediately displays a warning dialog box:

...\gbitmap.cpp @ 185
GBitmap::allocateBitmap: width or height is 0

In the console log it stopped at this position with the water materials:
Executing terrain_water_demo/client/scripts/commonMaterialData.cs.
PlatformMemory: allocating new page, total bytes allocated so far: 8121992 (total bytes in all pages=16777216)
Executing terrain_water_demo/client/scripts/default.bind.cs.
Executing terrain_water_demo/client/config.cs.
Executing common/client/materials.cs.
[b]Executing terrain_water_demo/data/water/materials.cs.[/b]

I took a look at the materials.cs in the water folder and the texture that jumped in my eyes was the water fresnel texture "waterFres04.png" with its dimensions 256x1. I thought first I had a damaged version checked out so I re-downloaded the fresh head from CVS, but the texture was the same in the HEAD. Then I copied the texture "noise01.png" in the water folded and renamed it to "waterFres04.png" and tried running TSE again. And wonder what - now it worked!

I absolutly have no clue what the problem is with this 256x1 texture. My guess is that the driver has a problem in creating non power of 2 textures.

I'm running an Acer 1691 notebook with an ATI X600 card in it, but as Acer behaves unfortunately, they don't update their drivers very often once they sold the notebooks. So my next step is to try the alternative drivers they offer somewhere on the net.

Question to Ben and Brian: Would it make sense to have a bit more of checks there in the code to not let TSE crash, but rather point out the user that his drivers may be old as it was not possible to create the texture?

Anyway, I'm happy I found that out :-)

Martin
#10
09/11/2006 (3:40 am)
Bah - I updated to the latest Catalyst drivers and still the same. It crashes when loading this 256x1 pixel image.
#11
09/11/2006 (2:04 pm)
OK, I think I know what's going on here. I'm guessing your card has 128MB of ram on it? TSE will reduce texture size in that case, and so it's trying to reduce the 1 pixel to uhh 0 ;) Try setting this pref in client/prefs.cs and see if it makes a difference:

$pref::TextureManager::qualityMode = "2"; // this should force high quality mode - check it in console.log

I'll try and get a fix in soon.
#12
09/11/2006 (10:47 pm)
I wish it would have 128 MB - it has only 64 MB... :-)

But your guess was right, Brian. I changed the qualityMode to 2 and it didn't assert anymore and worked flawlessly. Good job! :-)
#13
09/12/2006 (4:12 pm)
Cool, the fix is checked in.
#14
09/12/2006 (9:32 pm)
Great! :-)