Jump to content

newaged

Members
  • Posts

    31
  • Joined

  • Last visited

Posts posted by newaged

  1. I never used them outside of the shape editor, but importing and playing the animations worked fine for me. Creating a new project using the dev branch could help, this isn't the first time someone has reported the prebuilt binaries doing things they shouldn't.


    For future reference - torque does not support shape keys from what I recall, its probably best to disable those. Torque needs triangulated meshes but isn't the best at triangulation, its best to let the modeling program do that when exporting. Use translocrot when exporting with the stock exporter, not matrix.

  2. This resource changes the shading on most objects, making them look like this http://i.imgur.com/slbN28E.png.


    Changes:

    shaders\common\lighting\advanced\vectorLightP.hlsl, line 203

       float dotNL = dot(-lightDirection, normal); 

    to

       float dotNL = clamp(smoothstep(0.4, 0.43, dot(-lightDirection, normal)), 0.2, 1.0); 

     

    shaders\common\lighting\advanced\pointLightP.hlsl, line 163

       float nDotL = dot( lightVec, normal ); 

    to

        float nDotL = clamp(smoothstep(0.4, 0.43, dot( lightVec, normal )), 0.2, 1.0); 

     

    shaders\common\lighting\advanced\spotLightP.hlsl, line 99

       float nDotL = dot( normal, -lightToPxlVec ); 

    to

       float nDotL = clamp(smoothstep(0.4, 0.43, dot( normal, -lightToPxlVec )), 0.2, 1.0); 

     

    A more difficult to install version that includes object outlines is currently in progress.

    http://i.imgur.com/fjN6ebA.png

  3. @Azaezel I should probably mention that the last comment was about lowering the hardcoded value, not about your idea of detecting filled slots. That would work fine if I knew how to do it.


    Anyways, I am posting here again because I will probably do github stuff soon. Does anyone have an opinion on this being one of the prs? Its not a pretty solution to the problem, but it doesn't break networking like whats in the engine right now.

  4. Went along with the lower precision idea for a bit, but my basic coding skills weren't enough to make something stable. I decided to use a bunch of flags until I get better at C++.

    The code changes for anyone who wants them.

     SFXPlayList::packData( sfx/sfxPlaylist.cpp line 366)
    ...
       FOR_EACH_SLOT stream->write( mSlots.mFadeTimeIn.mValue[ i ] );
      FOR_EACH_SLOT stream->write( mSlots.mFadeTimeIn.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->write( mSlots.mFadeTimeIn.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->write( mSlots.mFadeTimeOut.mValue[ i ] );
      FOR_EACH_SLOT stream->write( mSlots.mFadeTimeOut.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->write( mSlots.mFadeTimeOut.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->write( mSlots.mDelayTimeIn.mValue[ i ] );
      FOR_EACH_SLOT stream->write( mSlots.mDelayTimeIn.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->write( mSlots.mDelayTimeIn.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->write( mSlots.mDelayTimeOut.mValue[ i ] );
      FOR_EACH_SLOT stream->write( mSlots.mDelayTimeOut.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->write( mSlots.mDelayTimeOut.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->write( mSlots.mVolumeScale.mValue[ i ] );
      FOR_EACH_SLOT stream->write( mSlots.mVolumeScale.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->write( mSlots.mVolumeScale.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->write( mSlots.mPitchScale.mValue[ i ] );
      FOR_EACH_SLOT stream->write( mSlots.mPitchScale.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->write( mSlots.mPitchScale.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->write( mSlots.mRepeatCount[ i ] );
      ...
      SFXPlayList::unpackData(line 408)
      ...
         FOR_EACH_SLOT stream->read( &mSlots.mFadeTimeIn.mValue[ i ] );
      FOR_EACH_SLOT stream->read( &mSlots.mFadeTimeIn.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mFadeTimeIn.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mFadeTimeOut.mValue[ i ] );
      FOR_EACH_SLOT stream->read( &mSlots.mFadeTimeOut.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mFadeTimeOut.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mDelayTimeIn.mValue[ i ] );
      FOR_EACH_SLOT stream->read( &mSlots.mDelayTimeIn.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mDelayTimeIn.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mDelayTimeOut.mValue[ i ] );
      FOR_EACH_SLOT stream->read( &mSlots.mDelayTimeOut.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mDelayTimeOut.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mVolumeScale.mValue[ i ] );
      FOR_EACH_SLOT stream->read( &mSlots.mVolumeScale.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mVolumeScale.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mPitchScale.mValue[ i ] );
      FOR_EACH_SLOT stream->read( &mSlots.mPitchScale.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mPitchScale.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT stream->read( &mSlots.mRepeatCount[ i ] );
    

    change that to this

    SFXPlayList::packData
    ...
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mFadeTimeIn.mValue[ i ] != -1 ))
       stream->write( mSlots.mFadeTimeIn.mValue[ i ] );
      FOR_EACH_SLOT if (stream->writeFlag( mSlots.mFadeTimeIn.mVariance[ i ][ 0 ] > 0))
       stream->write(mSlots.mFadeTimeIn.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT if (stream->writeFlag( mSlots.mFadeTimeIn.mVariance[ i ][ 1 ] > 0))
       stream->write(mSlots.mFadeTimeIn.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mFadeTimeOut.mValue[ i ] != -1 ))
       stream->write( mSlots.mFadeTimeOut.mValue[ i ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mFadeTimeOut.mVariance[i][0] > 0))
       stream->write(mSlots.mFadeTimeOut.mVariance[i][0]);
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mFadeTimeOut.mVariance[i][1] > 0))
       stream->write(mSlots.mFadeTimeOut.mVariance[i][1]);
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mDelayTimeIn.mValue[ i ] > 0))
       stream->write(mSlots.mDelayTimeIn.mValue[ i ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mDelayTimeIn.mVariance[ i ][ 0 ] > 0))
       stream->write(mSlots.mDelayTimeIn.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mDelayTimeIn.mVariance[ i ][ 1 ] > 0))
       stream->write(mSlots.mDelayTimeIn.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mDelayTimeOut.mValue[ i ] > 0))
       stream->write(mSlots.mDelayTimeOut.mValue[ i ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mDelayTimeOut.mVariance[ i ][ 0 ] > 0))
       stream->write(mSlots.mDelayTimeOut.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mDelayTimeOut.mVariance[ i ][ 1 ] > 0))
       stream->write(mSlots.mDelayTimeOut.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mVolumeScale.mValue[ i ] != 1))
       stream->write(mSlots.mVolumeScale.mValue[ i ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mVolumeScale.mVariance[ i ][ 0 ] > 0))
       stream->write(mSlots.mVolumeScale.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mVolumeScale.mVariance[ i ][ 1 ] > 0))
       stream->write(mSlots.mVolumeScale.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mPitchScale.mValue[ i ] != 1))
       stream->write(mSlots.mPitchScale.mValue[ i ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mPitchScale.mVariance[ i ][ 0 ] > 0))
       stream->write(mSlots.mPitchScale.mVariance[ i ][ 0 ] );
      FOR_EACH_SLOT if (stream->writeFlag(mSlots.mPitchScale.mVariance[ i ][ 1 ] > 0))
       stream->write(mSlots.mPitchScale.mVariance[ i ][ 1 ] );
      FOR_EACH_SLOT if (stream->writeFlag( mSlots.mRepeatCount[ i ] > 0))
       stream->write( mSlots.mRepeatCount[ i ] );
    
       .....
    SFXPlayList::unpackData
    ...
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mFadeTimeIn.mValue[ i ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mFadeTimeIn.mVariance[ i ][ 0 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mFadeTimeIn.mVariance[ i ][ 1 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mFadeTimeOut.mValue[ i ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mFadeTimeOut.mVariance[ i ][ 0 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mFadeTimeOut.mVariance[ i ][ 1 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mDelayTimeIn.mValue[ i ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mDelayTimeIn.mVariance[ i ][ 0 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mDelayTimeIn.mVariance[ i ][ 1 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mDelayTimeOut.mValue[ i ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mDelayTimeOut.mVariance[ i ][ 0 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mDelayTimeOut.mVariance[ i ][ 1 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mVolumeScale.mValue[ i ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mVolumeScale.mVariance[ i ][ 0 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mVolumeScale.mVariance[ i ][ 1 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mPitchScale.mValue[ i ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mPitchScale.mVariance[ i ][ 0 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mPitchScale.mVariance[ i ][ 1 ] );}
      FOR_EACH_SLOT if(stream->readFlag()){ stream->read( &mSlots.mRepeatCount[ i ] );}
    

    I do realize I could have just changed the slot count, but it still would have sent out a large amount of mostly blank data.

  5. SFXPlaylist's pack function outputs too much data for the bitstream to handle, so I am reducing the amount of data it sends. Some of its default values are -1, so I was wondering if writesignedfloat has any downsides when compared to writefloat. Secondary topic, is assigning 10 bits for general data too much or too little?

  6. @PaulWeston As far as I can tell. Something to note - it seems the default behavior of zooming in the texture on low settings was intended. I don't know if it behaved that way to fix a problem, or if that problem is still here. It could also just be a quirk of some old code no one really uses or pays attention to, so it might not be a big deal. The change works fine for me in any case.

  7. Peeked at the engine code. Can't say I understand how most of the back end works, but I figured out a temporary solution.

    In gfx/video/theoratexture.cpp at line 60

    GFX_ImplementTextureProfile(  GFXTheoraTextureProfile,
                                 GFXTextureProfile::DiffuseMap,
                                 GFXTextureProfile::NoMipmap | GFXTextureProfile::Dynamic,
                                 GFXTextureProfile::NONE );
    

    Change that to this

    GFX_ImplementTextureProfile(  GFXTheoraTextureProfile,
                                 GFXTextureProfile::DiffuseMap,
    						  GFXTextureProfile::NoMipmap | GFXTextureProfile::Dynamic | GFXTextureProfile::PreserveSize,
                                 GFXTextureProfile::NONE );
    

    and texture scaling will be disabled.

  8. Posting here again because I haven't learned how to github yet.

    I was going through some tutorials when an issue popped up. The camera position given by GameTSCtrl::OnMouseDown and %GameConnection.getCameraObject().GetPosition() were clearly different, and it was making the serverCmd provided by the tutorial behave oddly. I wasn't sure if that was intended or not, so I made a new method to use in its place.

    DefineEngineMethod(GameConnection, getControlCameraPosition, Point3F, (), ,
    "@brief Gets the true position of this GameConnection's camera.\n\n"
    
    "@see GameConnection::getCameraObject()\n\n")
    {
    MatrixF transform;
    if (!object->getControlCameraTransform(0.032f, &transform))
    	return {0, 0, 0};
    return transform.getPosition();
    }
    

    Stick that somewhere near the end of gameConnection.cpp. %GameConnection.getControlCameraPosition() will return the position of the camera the same way OnMouseDown would.

  9. Updated the code - removed some pointless changes


    @JeffR I'll look into posting these fixes on github. Should they be batched together or done individually?

  10. Was it causing a crash? I stopped using the callOnChildren after it caused too much crash, also if I remember right it was not always working correctly when it wasn't causing crash...

    Yeah, it was causing a crash before. I haven't used it enough to comment on the second problem.

  11. Ran into another problem I managed to fix. If this isn't the right forums for posts like these, or if I should be doing this on github, please let me know.

    Anyways, the simgroup/simset function callOnChildren wasn't working, so I changed

    void SimSet::callOnChildren(simSet.cpp line 232)
    {
    ...
      ConsoleValueRef args[21];
      args[0] = method.c_str();
    

    to this

    	ConsoleValue vals[2];
    ConsoleValueRef args[21];
    vals[0].init();
    vals[0].setStringValue(method.c_str());
    args[0].value = &vals[0];
    vals[1].init();
    args[1].value = &vals[1];
    

    and things started to work again. Was that the right way to go about it?

  12. Maybe it has something to do with the tolerance, maybe it doesn't, I don't know enough about the collision system to say. The changes I made do seem to work however, the default soldier still works fine even when scaled to 1/20th of his original size.

×
×
  • Create New...