-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Powered Arms Dealer Door Still Open When Chain Building Technicals and Combat Bikes #538
Conversation
…ls and Combat Bikes
Aside from visuals, this means that Technical build time is 12 sec w/o power and 7 sec w/ power now always. In 1.04, it is - with power - 7 seconds for the first Technical only, and 5 seconds starting from the second Technical. |
Behavior = ProductionUpdate ModuleTag_10 | ||
NumDoorAnimations = 1 | ||
DoorOpeningTime = 2000 ;in mSeconds | ||
DoorWaitOpenTime = 3000 ;in mSeconds | ||
DoorCloseTime = 2000 ;in mSeconds | ||
DoorWaitOpenTime = 2000 ;in mSeconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Wouldn't it have been enough to just decrease DoorWaitOpenTime
by a few milliseconds? I don't understand why 2 variables had to be changed. Plus now Door close is quicker than door open. Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plus now Door close is quicker than door open. Why?
The time it takes for the door to close is animation based, so part of the model. DoorCloseTime
is used to make the logic register that the door was already closed. You could set DoorCloseTime
to 2 minutes and it wouldn't speed up / slow down the animation at all.
Wouldn't it have been enough to just decrease
DoorWaitOpenTime
by a few milliseconds?
The game is not precise enough for a few msecs to mean anything. It runs at 30 FPS in multiplayer, so to make an actual difference, you need at least 33.33 msecs (= 1 frame).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Condition for not bugging out door opening for fast building units:
DoorWaitOpenTime + DoorCloseTime < (fastest) BuildTime
2000 msec + 1800 msec < 4.0 sec (Combat Bike w/ power)
3800 msec < 4000 msec, check
Condition for not bugging out door animation:
<animation frame count> / 30 FPS < DoorCloseTime
50 (Arms Dealer) / 30 FPS < 1800 msec
1667 msec < 1800 msec, check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DoorOpeningTime
and DoorCloseTime
do not determine the speed of the door animation. To not bug out the visuals, these must be bigger than the actual door animation time though.
DoorOpeningTime
is important in that it adds a constant to actual build-time of units.
DoorCloseTime
and DoorWaitOpenTime
are less important, but must together be smaller than the fastest BuiltTime
of any unit, otherwise the DoorOpeningTime
delay is skipped.
If necessary, the door animations can be adjusted by using AnimationSpeedFactorRange
in the W3DModelDraw
module. That parameter can be used indepentently for door opening and closing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok now it makes sense. Bike build is 4000 ms. I was wondering why door close time is combined 3800 ms when Technical build is 5000 ms. What you refer to as "milliseconds per frame" is called "frame time" in programmer terms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for detailed investigation and explanations!
ZH 1.04:
door.mp4
Patch:
door-gla-fixed.mp4