FAForever / fa-total-mayhem

A community maintained version of the Total Mayhem mod made by Burnie222
MIT License
0 stars 3 forks source link

[Bug]: BROT3BT and BROT3BT2 unit building animation bug #18

Closed zhanghm18GIT closed 2 weeks ago

zhanghm18GIT commented 5 months ago

What happened?

Two units, BROT3BT and BROT3BT2, had problems during construction. When built, their models would slowly pan off the map and fly inside the factory. You can see their models flying in from near the factory as they are nearing completion. This is a screenshot.. 图片 图片 图片

Steps to reproduce

The BROT3BT and BROT3BT2 units were built from Aeon's T3 plant. Then during construction, zoom in on the map to see how the construction model of the two units pans from the edge of the map to the inside of the factory. When the construction is almost complete, you can clearly see the unit model flying in from the factory side.

Expected behavior

If this problem gets fixed. These two units should be like other Aeon factory-built units, with models slowly growing from small inside the factory. Instead of flying in from outside the factory.

Uveso commented 3 weeks ago

@zhanghm18GIT

Can you still reproduce this error?

I tried building Rhyolite and Rhyolite II, and they worked as expected. The unit model appears at 80% completion and grows to normal unit size by 100%. (no moving) grafik

zhanghm18GIT commented 3 weeks ago

@zhanghm18GIT

Can you still reproduce this error?

I tried building Rhyolite and Rhyolite II, and they worked as expected. The unit model appears at 80% completion and grows to normal unit size by 100%. (no moving) grafik

I'll try it on the weekend. I don't have a computer on hand at the moment

zhanghm18GIT commented 3 weeks ago

图片 @Uveso Try again, the bug persists, using FAF dev, MOD the latest version downloaded from FAF vault

Uveso commented 3 weeks ago

@zhanghm18GIT

I am sorry i can't reproduce the error. i used faf launcher, develop version and Total Mayhem v137 and unreleased v138 Also tried FAF develop and TotalMayhem directly from GitHub repository (my default setup).

Standard question: Did you only test this with the TotalMayhem mod activated? No other sim or UI mod? No errors in Game.log? (if yes could you post me the log?)

zhanghm18GIT commented 3 weeks ago

@zhanghm18GIT

I am sorry i can't reproduce the error. i used faf launcher, develop version and Total Mayhem v137 and unreleased v138 Also tried FAF develop and TotalMayhem directly from GitHub repository (my default setup).

Standard question: Did you only test this with the TotalMayhem mod activated? No other sim or UI mod? No errors in Game.log? (if yes could you post me the log?)

Yeah, I tested it again. I only used this one MOD and nothing else. There is still this bug. I uploaded my reply and log, hoping it would help files.zip

Uveso commented 2 weeks ago

@zhanghm18GIT

Thanks a lot for the replay; that did the trick. Now I can reproduce it! It only sometimes happens when I start my own game, but at least I can confirm that it's not only on your side! :D

Uveso commented 2 weeks ago

traced it down to this function in FAF: https://github.com/FAForever/fa/blob/develop/lua/sim/Unit.lua#L2441

    StartBeingBuiltEffects = function(self, builder, layer)
        local BuildMeshBp = self.Blueprint.Display.BuildMeshBlueprint
        if BuildMeshBp then
            self:SetMesh(BuildMeshBp, true)
        end
    end,

Executing self:SetMesh(BuildMeshBp, true) is responsible for the sliding unit. I have no idea why that is yet; maybe @Garanas has an idea?

Garanas commented 2 weeks ago

I have no idea, is it specific to this unit? If so, then the cause is likely in the _script.lua source file.

Uveso commented 2 weeks ago

there are 5 units sliding:

brot1bt (Fate MK1) brot1btt2 (Fate MK2) brot2mt (Pumice) brot3bt (Rhyolite) brot3bt2 (Rhyolite II)

scriptfiles are clear, only 3 hooks like OnStopBeingBuilt, OnDetachedFromTransport, OnKilled. Nothing that would be executed before OnStopBeingBuilt.

My plan for now is to just delete BuildMeshBlueprint after OnCreate. The only drawback is that the unit won't gradually grow while being built but will instead be created at full size right from the start. But that's better than sliding across the map.

Garanas commented 2 weeks ago

Mmhh, I'll see what I can find based on the replay that @zhanghm18GIT shared.

Uveso commented 2 weeks ago

I tested on Seton's right upper starting place. (slot 1)

Funny thing: depending on the map position of the building factory, the speed of the units sliding to the factory varies! I also checked the position of the unit while it was sliding; unit:GetPosition() returned the fixed position inside the factory the entire time.