Incidental Issues

Discuss almost anything about RailWorks.

Incidental Issues

Unread postby ricksan » Sat Nov 26, 2011 7:54 pm

There were a couple of points that were raised in the "Donner Pass: List of Issues" thread that have more to do with the sim in general than just DP, so I thought I'd respond to them in a separate thread.

MikeK wrote with regard to asset-block trees...
An entire hill of trees that vanish when you get close.


There are two issues involved. One is the asset block object's bounding volume, the other is its LOD.

Every scenery object has a bounding volume defined in its geometry file. A bounding volume is an imaginary, simplified set of continuous surfaces that encompass all parts of a model. Usually a bounding volume is made up of a few intersecting spheres. The game engine uses the bounding volume to determine whether an object should be drawn or not. If the view frustum (http://en.wikipedia.org/wiki/Viewing_frustum) intersects an object's bounding volume the object gets drawn. However, if the bounding volume happens for some reason to be smaller than the object, in other words if a portion of the object protrudes beyond the surface of the bounding volume, the object may disappear (i.e. cease to be drawn) before it's actually off screen.

The LOD also determines if an object will be drawn. Most of us know how LODs work, but here it is anyway. The LOD (Level Of Detail) is the farthest distance away from the viewer (meaning your eyes) that an object will be drawn. If something has an LOD of, for example, 500, it will not be drawn if it's more than 500 meters away from the viewer.

In the case of asset blocks, there is no geometry file for the asset block itself -- only for the asset whose multiple instances are contained within the block. The bounding volume dimensions for asset blocks are evidently hard coded and it appears there are times when the dimensions the game engine uses are insufficient. When the asset block disappears, the instanced asset contained in the block also disappears regardless of the contained asset's own bounding volume. For models we ourselves create, placing the pivot point at the centroid of each part usually avoids the disappearing act, but if we need to we can hack the GeoPcDx file to make the bounding volume larger. Can't do that with an asset block.

To me, distant mountains means distant trees, too. It would be nice if we could extend the view distance -- the LOD -- of selected asset blocks to suit the terrain conditions, but again there's no geometry file for an asset block so we can't do that. Normally, "fog" is used to hide the popup effect in which objects pass or fail the LOD test and suddenly come in or out of view. That works nicely when the weather is actually supposed to look foggy, but it doesn't help us on a clear day when the fog region is much farther away.

Rich_S wrote with regard to radiator fan animations...
I'm just wondering how much GPU / CPU time is being wasted on all of these fans running when they shouldn't be? Is this another reason frame rates are dropping, Four engines times 5 fans per engine is this just to much animation and the fans are killing frame rates? Something to think about?


The radiator fan animation has a negligible effect on frame rates. To begin with, only a single fan animation (BAN) file is used in RSC's diesels. If the fans were to run separately, a separate animation file would be required for each fan, which in turn would require more time for the CPU to iterate through each one of them. To make the fans run separately the locomotive's LUA script would have to sequence the fans on and off in response to some kind of mathematical calculation involving perhaps the parameters Amperes and RPM. Those parameters may not be the most direct indicator of engine temperature, but it's about all we have to work with. I suspect it would take more CPU power to run such a script and all the separate animations than it takes to simply animate all the fans simultaneously and run them continuously.

Worth a try, though. :D

As an aside, one of our esteemed RWA colleagues is developing a diesel locomotive where the grid fan does in fact operate in response to dynamic braking only. That may have been done before but it's the first time I've seen it.
ricksan
Forum Mod
 
Posts: 311
Joined: Fri Feb 13, 2009 10:55 am
Location: Bandon, OR USA

Re: Incidental Issues

Unread postby Rich_S » Sat Nov 26, 2011 9:13 pm

ricksan wrote:The radiator fan animation has a negligible effect on frame rates. To begin with, only a single fan animation (BAN) file is used in RSC's diesels. If the fans were to run separately, a separate animation file would be required for each fan, which in turn would require more time for the CPU to iterate through each one of them. To make the fans run separately the locomotive's LUA script would have to sequence the fans on and off in response to some kind of mathematical calculation involving perhaps the parameters Amperes and RPM. Those parameters may not be the most direct indicator of engine temperature, but it's about all we have to work with. I suspect it would take more CPU power to run such a script and all the separate animations than it takes to simply animate all the fans simultaneously and run them continuously.


Hi Rick,
Is there anyway I can disable these fans on my engines? To be honest, seeing all of these fans spinning all of the time looks as silly to me, as the cars traveling on the highways with wheels that are not spinning :D

Regards,
Rich S.
Cheers,
Rich S.
User avatar
Rich_S
 
Posts: 708
Joined: Tue Aug 24, 2010 11:19 pm
Location: Baden, PA, USA

Re: Incidental Issues

Unread postby Kali » Sat Nov 26, 2011 10:11 pm

Even scripting all that frame by frame for four/five fans would be pretty neglegible in terms of resource usage; compared to working out what objects need to be drawn for the entire scene and then projecting them into a camera, it's a drop in the ocean. Obviously there's no point being inefficient when you don't have to, but I'd not worry about the odd animation.

I can't think of a reason for the db fan not to be either linked to the db notch, or just on/off - unlike a cooling fan you're not trying to keep everything the same temp, you're just trying to keep it as cold as you can. Not like I've got much experience there though.

Only way you're turning fans off is to remove the animations from your blueprint, and then you don't have any fans at all.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Incidental Issues

Unread postby Rich_S » Sun Nov 27, 2011 2:07 pm

If I move the sd40_fans.ban file to a backup folder the fans remain stationary. What exactly is this ban file other than having something to do with the fan animation? Is there a program available to edit this file? Is it OK just to move this file to a backup folder, or will this cause problems in the long run?

Regards,
Rich S.
Cheers,
Rich S.
User avatar
Rich_S
 
Posts: 708
Joined: Tue Aug 24, 2010 11:19 pm
Location: Baden, PA, USA

Re: Incidental Issues

Unread postby Kali » Sun Nov 27, 2011 2:32 pm

That *is* the animation; removing it won't cause any issues. The fact that it's one animation means we can't stop individual fans though. You can't easily edit it unfortunately - it's generated from a different format source file when the model is built, the only way to edit it is with a hex editor.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Incidental Issues

Unread postby Rich_S » Sun Nov 27, 2011 2:55 pm

OK, thanks for the info Kali.

Regards,
Rich S.
Cheers,
Rich S.
User avatar
Rich_S
 
Posts: 708
Joined: Tue Aug 24, 2010 11:19 pm
Location: Baden, PA, USA


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron