Level crossing animation gets stuck in the first frame

Bug #1374776 reported by Andres Blaho
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Rails
Fix Released
Medium
James Ross

Bug Description

An animated crossing has been created with a total of 20 animated frames, but when animation is triggered it gets stuck in the first frame.

Tags: graphics
Revision history for this message
Andres Blaho (andresblaho) wrote :
Revision history for this message
Rippstein (ch-signale) wrote :

For Levelcrossing animated by trains you need only 3 frames.
1) Gate open
2) Gate closed
3) Gate again open
The closing- /opening-time and all other parameters you can enter in the "i" Window in the Routeeditor, when you place the levelcrossing on a crosspoint of track and street

Revision history for this message
Rippstein (ch-signale) wrote :

correction:
 0) Gate open
 1) Gate closed
 2) Gate again open

and in the *.ref file:
LevelCr (
    Class ( "<Bahnübergänge>" )
    Filename ( PAN_Automatico.s )
    Description ( "PAN_Automatico" )

Revision history for this message
Andres Blaho (andresblaho) wrote :

MSTS supports multi-framed animations for level crossings, that allows creating more accurate, detailed and complex objects. For example, the attached one that was created with as multi-framed crossing for a proper timing with the light animations.

Revision history for this message
James Ross (twpol) wrote :

So Open Rails supports multi-frame level crossings only with negative animation timings (for looping), but that may not be right. Can you confirm whether this model is configured to loop or not in the world file?

Changed in or:
assignee: nobody → James Ross (twpol)
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
James Ross (twpol) wrote :

Please try this test build (based on X2689) by extracting it on top of Open Rails and deleting RunActivityLAA.exe or turning off general OR option "Large address aware binaries".

James Ross (twpol)
tags: added: graphics
removed: crossing level
Revision history for this message
James Ross (twpol) wrote :

Andres, do you think you could try my test version I posted in December?

Revision history for this message
Andres Blaho (andresblaho) wrote :

Dear James, thank you for your answe. The problem is not fixed. I've tested both with version X2689 and the actual version x2864 turning off the option "Large address aware binaries".

Revision history for this message
Rippstein (ch-signale) wrote :

Hi Andreas,
I have worked a bit with your shape, there are many Problems with it.

But first of all for OR :
James sad:
"So Open Rails supports multi-frame level crossings only with negative animation timings (for looping), but that may not be right"
If I enter for your shape a negative valour the gate is perpetual moving! with positive valour it stuck in the first step.

I have a flashing light commanded by Train, preview for negative animation time. It flash with negative times, but stuck in the first step, as your shape does, if I enter a positive valour.

And now to your shape:
1) here is a gate and a flashing light in the same shape. You have to made two shape, one for the gate, that moves only two time for a passing train, and one for the flashing light, that flash one time every half second.
In the trackeditor you have to enter a animation period a negative valour und use the ENTER-Key instead of OK-Button
try with -0.02 (60s x 0.02 = 1,2 s flashing period)

2) For the your Gate you doesn't need multiframe-animation. Three steps are enough for a continues movement of the gate.
Open, close, open. Animation with this two (three) steps will work in OR. The animation time you enter with the Tarckeditor as a parameter of the Gate.

3) For the Flashing lights you need more steps, so that you can switch the lights hard in the middle of the time. But with negative animation period this will work in OR.

4) Instead of the "CUBRE1 ...4 there are some parts of the Lightboxes ????

Revision history for this message
Rippstein (ch-signale) wrote :

I have tested my flashing light (multi frame animation) with positive animation time in MSTS.
also MSTS stuck in the first frame as it does OR. So I think this is not a Bug, this is compatible with MSTS.

Revision history for this message
James Ross (twpol) wrote :

According to my tests, the level crossing attached here works fine in MSTS and my fix does help - it animates all the way through - but it does so too slowly because it didn't take the frame count into account for the speed.

I've made a complete fix in X2977.

Changed in or:
status: Triaged → Fix Committed
milestone: none → 1.0
Revision history for this message
Rippstein (ch-signale) wrote :

X2977
Thank you for your fix.
But now a animated gate with 3 frames (open, close, open) makes problems
It close and open when the gate is activate and close and open again when the Train has passed.
In MSTS this work without problems.
same problem with jp1carcrossing.s from the Japan1 folder

Revision history for this message
James Ross (twpol) wrote :

Hmm, I can indeed believe that is now broken. If you have any insights into what might be used in MSTS to do many-frames vs 3-frames, that'd be useful. Either way I'll have a look in the next few days.

Changed in or:
status: Fix Committed → In Progress
Revision history for this message
James Ross (twpol) wrote :

Okay, I think I've done a better job in X2983. Having more fully understood MSTS's behaviour (which I've explained in a comment) the code even got simpler, which I think is a good sign it is more likely correct than before.

Changed in or:
status: In Progress → Fix Committed
Revision history for this message
Rippstein (ch-signale) wrote :

Hi James,
many thanks for your work. The Fix is O.K.
I have found the reason why I sad, MSTS doesn't work with multiframes:
All my testshape I have produced with more frames has worked anyway only with one Frame!!!
By Backward-engineering with MSTS I have found the reason. Multiframe animated shape I have also to change the number of Frames per second here 30:
  animations ( 1
  animation ( 2 30
30 frame per second is good for one animated position.
This number has to be as time x30 as more frames are to present.
I think your Fix based now also in this Number ?
Cheers
Eugen

Revision history for this message
James Ross (twpol) wrote :

Yes, this is in my fix. MSTS only uses the first second of animation for non-looped level crossings AFAICT so the frame rate needs to be 30*frames to use the whole animation.

Revision history for this message
Andres Blaho (andresblaho) wrote :

Hello, problem is fixed, thank you!

James Ross (twpol)
Changed in or:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.