Massive *.csv object vs. composite *.animated object
5 posters
Page 1 of 1
Massive *.csv object vs. composite *.animated object
Hello,
I would like to verify one thing. Which of the two is more demanding for the use HW? Having a massive .csv object, or having an .animated object composed of smaller units? Both showing the same result...
I would expect the .animated to be in disadvantage here, since in the .csv you have to hardcode everything exactly (therefore there are no additional calculations), while in the .animated you will obviously help yourself with a little rotate function here and there...
Thanks.
Last edited by Dexter on Mon Jul 15, 2019 3:48 pm; edited 1 time in total
Re: Massive *.csv object vs. composite *.animated object
I thought its the animated objects functions that can cause the FPS to drop, more than just the use of a .animated composing of multiple .csv's to build one main object?
mrknowitall- Posts : 824
Join date : 2011-07-09
Age : 32
Location : W. Yorkshire
Re: Massive *.csv object vs. composite *.animated object
That's basically correct, although the animated object would load marginally slower. (It first builds the 3D meshes and then applies the rotations to the result, as opposed to the single object which does it as it goes along)
The engine is smart enough to optimize (most) functions returning a static result out, and would then store both identically internally.
Dependant on your number of verticies there could be some small differences after de-duplication, but notjing that would have a meaningful effect.
Functions which don't return a constant result are the killer.
The engine is smart enough to optimize (most) functions returning a static result out, and would then store both identically internally.
Dependant on your number of verticies there could be some small differences after de-duplication, but notjing that would have a meaningful effect.
Functions which don't return a constant result are the killer.
Re: Massive *.csv object vs. composite *.animated object
Thank you, that's what I was thinking. I know that you have made an optimisation to the code regarding functions with constant output as previously it was re-evaluated per every single drawn frame. I think we were discussing a similar topic when I was surprised with the fps drop chased by static bushes in an animated file.
Re: Massive *.csv object vs. composite *.animated object
That does sound familiar
IIRC the original behaviour worked when it was a single number (e.g. RotateXFunction = 0.5 ) , but not when it was an actual sum (e.g. RotateXFunction = 1 / 2 )
There's still a lot of mess in the way animated files work internally though
When I've got it so they load as a single common plugin, will try and do something further at improving stuff.
IIRC the original behaviour worked when it was a single number (e.g. RotateXFunction = 0.5 ) , but not when it was an actual sum (e.g. RotateXFunction = 1 / 2 )
There's still a lot of mess in the way animated files work internally though
When I've got it so they load as a single common plugin, will try and do something further at improving stuff.
Re: Massive *.csv object vs. composite *.animated object
It might be worth thinking outside the OpenBVE box and taking a look at others: LokSim3D took the easy and yet elegant way of setting an additional attribute to composite files (*.l3dgrp in their case); it tells the sim that the object's states don't change during the simulation. When it's set, the sim calculates everything, removes unneeded components from memory etc. and never touches the results again during the simulation. Maybe, if you want, you could just ask Lukas how exactly they tackled the issue; IIRC it's a rather new feature, so he might remember.
Quork- Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union
Re: Massive *.csv object vs. composite *.animated object
I believe this should not be too difficult to implement... at least as far as my coding knowledge goes anyway.
Let's say we can add a variable to the animations. The variable will be of a boolean type (yes/no) and will be called "indefinitive". When set to yes (that would equal 1), the animation needs to be evaluated continually. When set to no (or 0 in that case), then the sim will only evaluate it once. This quite a simple logic.
I am not entirely sure if we can look into the parameter "RefreshRate" to help us in this case - probably tell the sim if RefreshRate = 0 then do not refresh (ie. don't recalculate)?Last edited by Dexter on Mon Jul 15, 2019 8:06 pm; edited 1 time in total
Re: Massive *.csv object vs. composite *.animated object
Nope, but maybe there are some fringe cases and nontrivial conflicts in specific circumstances.
Quork- Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union
Re: Massive *.csv object vs. composite *.animated object
Quork wrote:Nope, but maybe there are some fringe cases and nontrivial conflicts in specific circumstances.
Yes, there are always such cases. Everywhere, you can't escape them.
Re: Massive *.csv object vs. composite *.animated object
I think using [include] rather than [object] helps when you need to only move the included object. I haven't noticed significant fps drops of .animated with parts vs whole object in one csv/b3d (I use multiple static parts in .animated a lot, I make window frames separately and then "insert" them several times. I don't like leaving edges of texture transparency open).
I've noticed an interesting effect though. I modeled a rather complex window (more like, 2 windows, left and right. I avoid using Translate(all) and Rotate(all) as much as possible for optimization) in one b3d. I did this before working on the rest of the car and just placed them where they're supposd to be in the car's .animated file. There are 5 of them per car (though 2 are slightly different, they're shorter and lack a few very simple parts, but this shouldn't affect performance much), 6 cars in test consist, plus bogies that are .animated files, with a couple of b3ds added with [include] and 2 rotating axles. This test train has good fps (lowest I got was 25). Then I was building another train with the same technique, first bogies and windows, then the rest. I reused bogies and windows from the previous train, didn't change them at all. There are 6 cars there as well, but there are 9 window b3ds + 4 b3ds that have a single narrow frame and TranslateAll applied to the whole file once (for car ends) this time. This train runs at 15-20 fps. Quite expected, as there are more "heavy" window objects now. However, after I modeled the rest of the car, it didn't drop any further. It stayed at this level even after I added doors - not only they were quite detailed, but they're "folding" (think of class 141) - 4 b3ds per door and 2 of them use trigonometric functions to operate properly, there are 4 doors (2 on the left side and 2 on the right) in each car. This seems somewhat illogical (and pleasing, I expected less fps) to me...
I've noticed an interesting effect though. I modeled a rather complex window (more like, 2 windows, left and right. I avoid using Translate(all) and Rotate(all) as much as possible for optimization) in one b3d. I did this before working on the rest of the car and just placed them where they're supposd to be in the car's .animated file. There are 5 of them per car (though 2 are slightly different, they're shorter and lack a few very simple parts, but this shouldn't affect performance much), 6 cars in test consist, plus bogies that are .animated files, with a couple of b3ds added with [include] and 2 rotating axles. This test train has good fps (lowest I got was 25). Then I was building another train with the same technique, first bogies and windows, then the rest. I reused bogies and windows from the previous train, didn't change them at all. There are 6 cars there as well, but there are 9 window b3ds + 4 b3ds that have a single narrow frame and TranslateAll applied to the whole file once (for car ends) this time. This train runs at 15-20 fps. Quite expected, as there are more "heavy" window objects now. However, after I modeled the rest of the car, it didn't drop any further. It stayed at this level even after I added doors - not only they were quite detailed, but they're "folding" (think of class 141) - 4 b3ds per door and 2 of them use trigonometric functions to operate properly, there are 4 doors (2 on the left side and 2 on the right) in each car. This seems somewhat illogical (and pleasing, I expected less fps) to me...
Delsin- Posts : 313
Join date : 2016-08-20
Similar topics
» Can we use Sub and If statement the same as ANIMATED object?
» "Fade in" in animated object
» Nested animated object
» Animated sound not rotating with object
» Large .ANIMATED object disappear on the new Renderer.
» "Fade in" in animated object
» Nested animated object
» Animated sound not rotating with object
» Large .ANIMATED object disappear on the new Renderer.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum