From 215830ca552b15a59847510dd587c7a400f99f98 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 22 Mar 2026 21:31:39 -0500 Subject: [PATCH 1/7] fix decal editor bounds and decalmanager raycast we weren't accounting for texRects for decal atlases --- Engine/source/T3D/decal/decalManager.cpp | 12 +++++++----- Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp | 11 +++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Engine/source/T3D/decal/decalManager.cpp b/Engine/source/T3D/decal/decalManager.cpp index 1dc6ff236..7a21cd5e0 100644 --- a/Engine/source/T3D/decal/decalManager.cpp +++ b/Engine/source/T3D/decal/decalManager.cpp @@ -660,12 +660,14 @@ DecalInstance* DecalManager::raycast( const Point3F &start, const Point3F &end, RayInfo ri; bool containsPoint = false; if ( gServerContainer.castRayRendered( start, end, STATIC_COLLISION_TYPEMASK, &ri ) ) - { + { + RectF rect = inst->mDataBlock->texRect[inst->mTextureRectIdx]; + rect.extent *= inst->mSize * 0.5f; Point2F poly[4]; - poly[0].set( inst->mPosition.x - (inst->mSize / 2), inst->mPosition.y + (inst->mSize / 2)); - poly[1].set( inst->mPosition.x - (inst->mSize / 2), inst->mPosition.y - (inst->mSize / 2)); - poly[2].set( inst->mPosition.x + (inst->mSize / 2), inst->mPosition.y - (inst->mSize / 2)); - poly[3].set( inst->mPosition.x + (inst->mSize / 2), inst->mPosition.y + (inst->mSize / 2)); + poly[0].set(inst->mPosition.x - rect.extent.x, inst->mPosition.y + rect.extent.y); + poly[1].set( inst->mPosition.x - rect.extent.x, inst->mPosition.y - rect.extent.y); + poly[2].set( inst->mPosition.x + rect.extent.x, inst->mPosition.y - rect.extent.y); + poly[3].set( inst->mPosition.x + rect.extent.x, inst->mPosition.y + rect.extent.y); if ( MathUtils::pointInPolygon( poly, 4, Point2F(ri.point.x, ri.point.y) ) ) containsPoint = true; diff --git a/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp b/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp index abb778ca0..26d6f742a 100644 --- a/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiDecalEditorCtrl.cpp @@ -516,11 +516,12 @@ void GuiDecalEditorCtrl::renderScene(const RectI & updateRect) if ( gDecalManager->clipDecal( mSELDecal, &mSELEdgeVerts ) ) _renderDecalEdge( mSELEdgeVerts, ColorI( 255, 255, 255, 255 ) ); - const F32 &decalSize = mSELDecal->mSize; + const F32 &decalSize = mSELDecal->mSize * 0.5; Point3F boxSize( decalSize, decalSize, decalSize ); - MatrixF worldMat( true ); - mSELDecal->getWorldMatrix( &worldMat, true ); + mSELDecal->getWorldMatrix( &worldMat, true ); + RectF rect = mSELDecal->mDataBlock->texRect[mSELDecal->mTextureRectIdx]; + worldMat.scale(Point3F(rect.extent.x, rect.extent.y, 0.25f)); drawUtil->drawObjectBox( desc, boxSize, mSELDecal->mPosition, worldMat, ColorI( 255, 255, 255, 255 ) ); } @@ -531,11 +532,13 @@ void GuiDecalEditorCtrl::renderScene(const RectI & updateRect) if ( gDecalManager->clipDecal( mHLDecal, &mHLEdgeVerts ) ) _renderDecalEdge( mHLEdgeVerts, ColorI( 255, 255, 255, 255 ) ); - const F32 &decalSize = mHLDecal->mSize; + const F32 &decalSize = mHLDecal->mSize * 0.5; Point3F boxSize( decalSize, decalSize, decalSize ); MatrixF worldMat( true ); mHLDecal->getWorldMatrix( &worldMat, true ); + RectF rect = mHLDecal->mDataBlock->texRect[mHLDecal->mTextureRectIdx]; + worldMat.scale(Point3F(rect.extent.x, rect.extent.y, 0.25f)); drawUtil->drawObjectBox( desc, boxSize, mHLDecal->mPosition, worldMat, ColorI( 255, 255, 255, 255 ) ); } From 4a0a7d2b1006b7356e564a683823f789dbdf0076 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Mon, 23 Mar 2026 12:22:54 +0000 Subject: [PATCH 2/7] fix for hasaccumulation exception There is an exception on teardown usually during a debug build that is caused during shapeBase onRemove calling hasAccumulation. This fix reorders the hasAccumulation check to be before shapebase calls Parent::onRemove, and also hard sets the mMaterialList to NULL when setMaterialList is called --- Engine/source/T3D/shapeBase.cpp | 14 +++++++------- Engine/source/ts/tsShapeInstance.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 96fadaf6e..44fe70382 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -1164,13 +1164,6 @@ void ShapeBase::onRemove() { mConvexList->nukeList(); - Parent::onRemove(); - - // Stop any running sounds on the client - if (isGhost()) - for (S32 i = 0; i < MaxSoundThreads; i++) - stopAudio(i); - // Accumulation and environment mapping if (isClientObject() && mShapeInstance) { @@ -1178,6 +1171,13 @@ void ShapeBase::onRemove() AccumulationVolume::removeObject(this); } + Parent::onRemove(); + + // Stop any running sounds on the client + if (isGhost()) + for (S32 i = 0; i < MaxSoundThreads; i++) + stopAudio(i); + if ( isClientObject() ) { if (mCubeReflector) diff --git a/Engine/source/ts/tsShapeInstance.cpp b/Engine/source/ts/tsShapeInstance.cpp index 2a7cb9c35..337e432fc 100644 --- a/Engine/source/ts/tsShapeInstance.cpp +++ b/Engine/source/ts/tsShapeInstance.cpp @@ -239,8 +239,11 @@ void TSShapeInstance::initMeshObjects() void TSShapeInstance::setMaterialList( TSMaterialList *matList ) { // get rid of old list - if ( mOwnMaterialList ) + if (mOwnMaterialList) + { delete mMaterialList; + mMaterialList = NULL; + } mMaterialList = matList; mOwnMaterialList = false; @@ -891,6 +894,9 @@ void TSShapeInstance::prepCollision() // Returns true is the shape contains any materials with accumulation enabled. bool TSShapeInstance::hasAccumulation() { + if (!mOwnMaterialList || mMaterialList == NULL) + return false; + bool result = false; for ( U32 i = 0; i < mMaterialList->size(); ++i ) { From a5e850b546da9e52f4b408e5309041a0210dcea0 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 23 Mar 2026 16:46:13 -0500 Subject: [PATCH 3/7] image asset popup augs create terrain texures asset context popup create Material context to spin up a mat --- .../scripts/assetTypes/image.tscript | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.tscript index 2b832d0ba..2df7b32da 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.tscript @@ -127,6 +127,28 @@ function ImageAsset::generatePreviewImage(%this, %previewButton, %forceRegenerat return false; } +function ImageAsset::makeMaterialFrom(%this) +{ + %matName = %this.assetName @ "_Mat"; + %assetLoc = AssetDatabase.getAssetPath(%this.getAssetId()) @"/"@ %this.assetName @"_Mat.asset.taml"; + %newMat = new Material(%matName) { + diffuseMapAsset[0] = %this.getAssetId(); + mapTo = %this.assetName; + }; + + %matAsset = new MaterialAsset() { + assetName = %matName; + materialDefinitionName = %matName; + }; + + %matAsset.add(%newMat); + + TamlWrite(%matAsset, expandPath(%assetLoc)); + AssetDatabase.addDeclaredAsset(AssetDatabase.getAssetModule(%this.getAssetId()), %assetLoc); + return %matAsset; +} + + function ImageAsset::onShowActionMenu(%this) { GenericAsset::onShowActionMenu(%this); @@ -134,6 +156,8 @@ function ImageAsset::onShowActionMenu(%this) %assetId = %this.getAssetId(); EditAssetPopup.setItemPosition("Create Composite Texture" TAB "" TAB "CompositeTextureEditor.buildComposite(\"" @ %assetId @ "\");", 4); + EditAssetPopup.setItemPosition("Create Terrain Textures" TAB "" TAB "makeTerrainMapsFrom(\"" @ %assetId @ "\");", 5); + EditAssetPopup.setItemPosition("Create Material" TAB "" TAB %this @ ".makeMaterialFrom();", 6); EditAssetPopup.objectData = %assetId; EditAssetPopup.objectType = AssetDatabase.getAssetType(%assetId); From 3fe67fb850f39784e4da98023a51168cf830edef Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 30 Mar 2026 23:07:21 -0500 Subject: [PATCH 4/7] fix verve editor crash if for some reason, function VerveEditor::CreateField( %targetStack, %fieldName, %fieldType ) is called without a %fieldType, the eval call was crashing. this fixes the imediate issue, but I'd advise followup tracing. --- .../game/tools/VerveEditor/Scripts/Inspector/Controls.tscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Inspector/Controls.tscript b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Inspector/Controls.tscript index 520ca3cfa..4d5808b98 100644 --- a/Templates/BaseGame/game/tools/VerveEditor/Scripts/Inspector/Controls.tscript +++ b/Templates/BaseGame/game/tools/VerveEditor/Scripts/Inspector/Controls.tscript @@ -120,7 +120,7 @@ function VerveEditor::CreateField( %targetStack, %fieldName, %fieldType ) }; %fieldContainer.add( %fieldLabel ); - if ( isMethod( "VerveEditor", "Create" @ %fieldType @ "Field" ) ) + if ( (%fieldType !$= "") && (isMethod( "VerveEditor", "Create" @ %fieldType @ "Field" ) )) { // Create the Input Control. %fieldInput = eval( "return VerveEditor::Create" @ %fieldType @ "Field(" @ %fieldContainer @ "," @ %fieldName @ ");" ); From 6c94836654afe3590bf9eedb4e2bdd47369acb47 Mon Sep 17 00:00:00 2001 From: Brian Roberts Date: Wed, 1 Apr 2026 16:06:43 -0500 Subject: [PATCH 5/7] Revert "client projectile origin tweak" --- Engine/source/T3D/projectile.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Engine/source/T3D/projectile.cpp b/Engine/source/T3D/projectile.cpp index a6f4c5ef6..4476d70dd 100644 --- a/Engine/source/T3D/projectile.cpp +++ b/Engine/source/T3D/projectile.cpp @@ -873,11 +873,8 @@ bool Projectile::onAdd() } } if (mSourceObject.isValid()) - { processAfter(mSourceObject); - if (isClientObject()) - mSourceObject->getRenderMuzzlePoint(mSourceObjectSlot, &mCurrPosition); - } + // Setup our bounding box if (bool(mDataBlock->getProjectileShape()) == true) mObjBox = mDataBlock->getProjectileShape()->mBounds; From e8193d1cc3df3e1c60ba0b512854184e74c1b8eb Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 4 Apr 2026 17:21:42 -0500 Subject: [PATCH 6/7] embed application info in console.logs ap name [ap version] [engine version] --- Templates/BaseGame/game/main.tscript.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/main.tscript.in b/Templates/BaseGame/game/main.tscript.in index a463756e0..d2c9ca13b 100644 --- a/Templates/BaseGame/game/main.tscript.in +++ b/Templates/BaseGame/game/main.tscript.in @@ -9,7 +9,7 @@ trace(false); // Set the name of our application $appName = "@TORQUE_APP_NAME@"; - +echo("Initializing" SPC $appName SPC getVersionString()); //----------------------------------------------------------------------------- // Load up scripts to initialise subsystems. ModuleDatabase.setModuleExtension("module"); From a8bc8e92b8d4525a92e60b8792843dcacf8dff2e Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 4 Apr 2026 17:47:58 -0500 Subject: [PATCH 7/7] update format --- Templates/BaseGame/game/main.tscript.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/main.tscript.in b/Templates/BaseGame/game/main.tscript.in index d2c9ca13b..2f837b4e1 100644 --- a/Templates/BaseGame/game/main.tscript.in +++ b/Templates/BaseGame/game/main.tscript.in @@ -9,7 +9,7 @@ trace(false); // Set the name of our application $appName = "@TORQUE_APP_NAME@"; -echo("Initializing" SPC $appName SPC getVersionString()); +echo("\nInitializing" SPC $appName SPC "["@getAppVersionString()@"] [Engine Version:"@getVersionString()@"]\n"); //----------------------------------------------------------------------------- // Load up scripts to initialise subsystems. ModuleDatabase.setModuleExtension("module");