-
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 setDoorCloseTime
to 2 minutes and it wouldn't speed up / slow down the animation at all.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.
This may help:
Edit: oops, replace "fps" with "milliseconds per frame". 1/30 FPS = 0.033 seconds per 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.
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
andDoorCloseTime
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
andDoorWaitOpenTime
are less important, but must together be smaller than the fastestBuiltTime
of any unit, otherwise theDoorOpeningTime
delay is skipped.If necessary, the door animations can be adjusted by using
AnimationSpeedFactorRange
in theW3DModelDraw
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.