Game Development Community

TX3D 3.1.5 Beta 2 - Sun has changed

by Henry Shilling · in Torque X 3D · 07/07/2010 (1:03 pm) · 9 replies

Build: 3.1.5 Beta - 2

Platform: Windows 7-64 (specs i7 920, nVidia GTS250 6GB ram)

Target: VS2008, Xbox

Issues: Null object when using old sun from .txscene files

1) Open file I have been working on works in 3.1.5 first version.

2) Null object in TranslucentInstance3DComparison

Suggested Fix:
Replace sun in txscene file with new version.

old sun:
<Sun type="GarageGames.Torque.T3D.Sun" name="Sun">
            <Material1 nameRef="SunMaterial1" />
            <Material2 nameRef="SunMaterial2" />
            <Components>
                <T3DSceneComponent type="GarageGames.Torque.T3D.T3DSceneComponent">
                    <ObjectType />
                </T3DSceneComponent>
                <T3DLightComponent type="GarageGames.Torque.Lighting.T3DLightComponent">
                    <LightList>
                        <DirectionalLight type="GarageGames.Torque.Lighting.DirectionalLight">
                            <AmbientColor>
                                <X>0.4</X>
                                <Y>0.4</Y>
                                <Z>0.35</Z>
                            </AmbientColor>
                            <DiffuseColor>
                                <X>0.9</X>
                                <Y>0.9</Y>
                                <Z>0.8</Z>
                            </DiffuseColor>
                            <ConstantAttenuation>1</ConstantAttenuation>
                        </DirectionalLight>
                    </LightList>
                </T3DLightComponent>
            </Components>
            <ObjectType />
        </Sun>

New Sun:
<Sun type="GarageGames.Torque.T3D.Sun" name="Sun">
      <Material1 nameRef="SunMaterial1" />
      <Material2 nameRef="SunMaterial2" />
      <Components inPlace="true">
        <SceneComponent type="GarageGames.Torque.T3D.T3DSceneComponent" />
        <LightComponent type="GarageGames.Torque.Lighting.T3DLightComponent">
          <LightList>
            <Light type="GarageGames.Torque.Lighting.DirectionalLight">
              <DiffuseColor>
                <X>0.9</X>
                <Y>0.9</Y>
                <Z>0.63</Z>
              </DiffuseColor>
              <AmbientColor>
                <X>0.4</X>
                <Y>0.5</Y>
                <Z>0.65</Z>
              </AmbientColor>
              <Direction>
                <X>0</X>
                <Y>-0.8191521</Y>
                <Z>-0.5735765</Z>
              </Direction>
              <ConstantAttenuation>1.0</ConstantAttenuation>
            </Light>
          </LightList>
        </LightComponent>
      </Components>
    </Sun>

I do not see much of a difference outside of the Direction. Maybe someone knows why the old one has a problem?

#1
07/07/2010 (1:09 pm)
the differences are in the XML tags.
T3DSceneComponent in one and SceneComponent in the other.
I'm not too sure how the serializer works but I'm sure its trying to match those tags.
#2
07/07/2010 (1:40 pm)
I believe the serializer was changed recently, alongside the way the Sun creates itself. I could be wrong, but I think that old suns may need updating...
#3
07/07/2010 (1:54 pm)
Even worse is the Editor replaces the new sun with the old one causing the same issue every time I edit the scene. I think you can name the xml tags whatever you wish it is the type=xxx that matters.

#4
07/07/2010 (2:17 pm)
Hmm? Really? That does sound peculiar... I'll look into it.

This change in particular looks interesting.

<Components inPlace="true">
#5
07/07/2010 (5:43 pm)
What is truely perplexing is this:

Create a new project, build.
Open new project in editor.
Save project.
Run project and error.

This is apparent if you do anything.

#6
07/07/2010 (5:48 pm)
Logged as TRQX-154
#7
07/07/2010 (6:21 pm)
Here is the deal, the default original light block works if you add the Direction block.

If you remove the <Direction> block it errors.

Nothing else has to change, so hopefully that helps you guys track it down.
#8
07/08/2010 (4:38 pm)
Henry,

I've pasted both the old and new suns XML into the FPS Terrain demo and was unable to raise any kind of exception or error. (The one WITHOUT a direction block.) Would you be able to send me a .txscene of the culprit? (Extra super bonus points if you can get it to error in a FPS demo level.)
#9
07/09/2010 (8:14 pm)
OK I have been away a few days, came home, removed all traces of TX3.1.4, TX3.1.5 beta 2. Redownloaded, files are the same. Reinstalled 3.1.5B2 only. Everything is great. Perhaps I had some cross pollination from the previous beta, or 3.1.4 I do not know. but I can say this issue is dead on my machine.

Yes before installing 3.1.5 B2 I did uninstall 3.1.5 B1. Who freaking knows.

Sorry for the possible wild goose chase.

Now I have to go over all my other B2 bugs and see if they are bugs...