Milestone 3 water not working 100
by Afrim Kacaj · in Torque Game Engine Advanced · 05/01/2006 (8:46 pm) · 16 replies
When I save changes to a mission in TSE and then restart the program my water dissapears. I found out why it is happening but i cant find the right place to permanently fix it.
When I save the mission in TSE it is not writing all the fields for the WaterBloock to the mission file.
This is what it is writing :
This is what is missing:
When I type it in manually it works fine but its getting on my nerves to have to do that each time I make changes to the mission. Looked all over for the save routine but cant figure out where the fault is.
Maybe there are other things missing but thats all that I have noticed so far.
And to hijack my own thread, is there an easy way to make the shore look more realistic or has that not been implemented yet?
When I save the mission in TSE it is not writing all the fields for the WaterBloock to the mission file.
This is what it is writing :
new WaterBlock() {
position = "0 0 0";
rotation = "1 0 0 0";
scale = "2048 2048 200";
waveDir[0] = "0 1";
waveDir[1] = "0.707 0.707";
waveDir[2] = "0.5 0.86";
waveDir[3] = "0.86 8.5";
waveSpeed[0] = "0";
waveSpeed[1] = "0.09";
waveSpeed[2] = "0.04";
waveSpeed[3] = "0.025";
waveTexScale[0] = "9.14 9.14";
waveTexScale[1] = "6.25 100.5";
waveTexScale[2] = "50 50";
waveTexScale[3] = "0 0";
reflectTexSize = "512";
baseColor = "6 12 22 153";
underwaterColor = "12 31 50 190";
gridSize = "100";
surfMaterial[1] = "Underwater";
surfMaterial[2] = "Water1_1FogPass";
surfMaterial[3] = "WaterBlendMat";
surfMaterial[4] = "WaterFallback1_1";
fullReflect = "1";
clarity = "0.4";
fresnelBias = "0.13";
fresnelPower = "4";
renderFogMesh = "1";
};This is what is missing:
surfMaterial[0] = "Water";
When I type it in manually it works fine but its getting on my nerves to have to do that each time I make changes to the mission. Looked all over for the save routine but cant figure out where the fault is.
Maybe there are other things missing but thats all that I have noticed so far.
And to hijack my own thread, is there an easy way to make the shore look more realistic or has that not been implemented yet?
#2
05/02/2006 (1:29 am)
I can confirm the water disappearing. Had this too. But not everytime - just sometimes.
#3
NB: I used the wrong milestone the first post on the bugs forum and then reposted it under M3, so there are two posts to read. One for the description and one for the reply. Sorry.
05/02/2006 (1:57 am)
I reported this a few weeks back over on the bugs forum. It's been noted but is low priority at the moment.NB: I used the wrong milestone the first post on the bugs forum and then reposted it under M3, so there are two posts to read. One for the description and one for the reply. Sorry.
#4
05/02/2006 (2:05 am)
Ah, sorry, I haven't prior checked the bug forum. Anyway, better report it twice than never :)
#5
05/02/2006 (2:40 pm)
Can anyone point me in the direction of the mission save routine?
#6
05/27/2006 (10:21 am)
Confirm. When i save my map, the water will disappear the next time. It's not completely gone, there's still an underwater, but the above water is gone.
#7
05/27/2006 (11:57 am)
The surfMaterial[0] = "Water";property is being removed from the water block when the mission is saved. As far as I can tell it only happens if you actually modify the water block before saving the mission. To duplicate: start a game, move the water just a little, then save and restart mission. You can fix it with a text editor by replacing the missing line.
#8
One thing that you can do in the meantime instead of manually editing the mission file is in the world editor, type 'Water' into the surfMaterial field before you save it.
05/27/2006 (8:21 pm)
I'm looking into this issue. What it looks like is the world editor doesn't handle arrays of values well. None of the fields that use arrays have any of their values show up in the properties in the world editor. There is an entry for them, only one. For Float values it seems that it doesn't matter if they're blank, they'll use the existing object values, but if there is a blank string value, it just treats it as an empty string, and when the object is written to disk it sees that it is a blank string and doesnt write out that field. The other 4 in the array still have their values so they are written.One thing that you can do in the meantime instead of manually editing the mission file is in the world editor, type 'Water' into the surfMaterial field before you save it.
#9
05/28/2006 (5:42 am)
One thing i dont get though.. why wasn't this tested? I mean.. this is something you would notice right away.
#10
05/28/2006 (8:03 am)
And that is why TSE is EA status. If you want 100% working, stable, nonbuggy software then wait tell release. EA status means alot of the features are not working / buggy / crashs / ect.
#11
05/28/2006 (10:35 am)
Torque and TSE development is partly community driven, which is one of the reasons they offer products cheaply, especially the EA products. In other words, it HAS been tested; the Early Adopters in the community tested it and filed bug reports, and opened this thread. It just hasn't been fixed yet. I'm sure it will though.
#12
05/28/2006 (10:56 am)
BTW, a temporary fix to the problem could be to change the mSurfMatName[] array to 5 seperate values in waterblock.h/waterblock.cpp, i.e. mSurfMatName1, mSurfMatName2, etc... and surfMaterial1, surfMaterial2, etc. for the field names, and edit newObject.cs to reflect this. It might even make sense to change them to descriptive names which can all be modifeid in the editor. i.e. waterMaterial, underwaterMaterial, etc.
#13
and add this:
Then in creator/editor/objectBuilderGui.gui change this;
to this:
so that new water blocks will have these fields.
Now not only does the waterblock not disappear when you modify it, but you can edit all of the surface material names from within the editor.
05/28/2006 (11:20 am)
Actually, I just did this to fix my version, until GG comes up with a better solution. In waterblock.cpp comment out this line:addField( "surfMaterial", TypeString, Offset( mSurfMatName, WaterBlock ), NUM_MAT_TYPES );
and add this:
addField( "waterMaterial", TypeString, Offset( mSurfMatName[0], WaterBlock ) ); addField( "underwaterMaterial", TypeString, Offset( mSurfMatName[1], WaterBlock ) ); addField( "fogpassMaterial", TypeString, Offset( mSurfMatName[2], WaterBlock ) ); addField( "blendMaterial", TypeString, Offset( mSurfMatName[3], WaterBlock ) ); addField( "fallbackMaterial", TypeString, Offset( mSurfMatName[4], WaterBlock ) );
Then in creator/editor/objectBuilderGui.gui change this;
%this.addField("surfMaterial[0]", "TypeString", "Surface Material 0", "Water");
%this.addField("surfMaterial[1]", "TypeString", "Surface Material 1", "Underwater");
%this.addField("surfMaterial[2]", "TypeString", "Surface Material 2", "Water1_1FogPass");
%this.addField("surfMaterial[3]", "TypeString", "Surface Material 3", "WaterBlendMat");
%this.addField("surfMaterial[4]", "TypeString", "Surface Material 4", "WaterFallback1_1");to this:
%this.addField("waterMaterial", "TypeString", "Surface Material 0", "Water");
%this.addField("underwaterMaterial", "TypeString", "Surface Material 1", "Underwater");
%this.addField("fogpassMaterial", "TypeString", "Surface Material 2", "Water1_1FogPass");
%this.addField("blendMaterial", "TypeString", "Surface Material 3", "WaterBlendMat");
%this.addField("fallbackMaterial", "TypeString", "Surface Material 4", "WaterFallback1_1");so that new water blocks will have these fields.
Now not only does the waterblock not disappear when you modify it, but you can edit all of the surface material names from within the editor.
#14
05/30/2006 (11:30 am)
Can anyone else confirm this.. I tried it and while it solved the water line error, the water top would no longer render...
#15
05/30/2006 (11:55 am)
If you're using it with existing datablocks, you'll need to edit the mission file and change the surfMaterial[] field names in the WaterBlock datablocks to the above field names. It should work okay when you add new waterblocks if you updated the objectBuilderGui.gui file, but it probably won't work with existing blocks until you manually update them first.
#16
06/03/2006 (5:08 pm)
Is shoreline rendering going to be implemented?
Torque Owner Thomas \"Man of Ice\" Lund