Archive for January, 2009

Pantograph sparking

Posted by Anthony_B on January 25, 2009 at 22:00

openBVE / X-City South screenshot - see video belowThe latest additions to Cross-City South v1.4’s collection of animated objects include sparking effects between the pantograph head and the contact wire. These spark objects aren’t just small points of blue with emissive properties, but they flicker and flash, and through the use of a large surface with a mainly translucent blue sunburst gradient texture with emissive properties applied to it’s mesh, appear to illuminate anything behind the surface, creating quite a nice effect, especially in low light or at night. Through the use of texture shifting, yellow sparks also appear to fly off the pantograph head.

I originally wondered if this effect should be included in an animated car object along with the animated doors, wheels and so-on which are already planned, where the meshes with spark textures are positioned at the centre of the pantograph head, and perhaps flash depending on the speed of the train. However, my routes feature overhead lines which are registered and staggered (i.e. they zig-zag from left to right where appropriate), which could render the sparking effect less effective if the spark itself doesn’t appear near enough to where the contact wire is touching the pantograph head at a particular location in the route. Including the spark objects in the route itself rather than the car object allows me to overcome this little problem and align the spark with the contact wire, even if it takes longer to add the objects to the route. The animations are controlled using the Distance[i] variable, but with a very low distance specified, so the sparking is only visible for a short time as the centre of the referenced car is within around a metre of the animated object’s insertion point. The spark csv objects themselves are offset along the z-axis, so as the referenced car’s centre passes the animated object’s insertion location, the spark is displayed where the pantograph is located instead. As with the animated vegetation, I’ll include this effect at station areas, and points of interest.

A new video is available below to demonstrate the effect; I’ve included it as part of a compilation of my previous videos and uploaded the full video to YouTube this time. It’s available in YouTube’s High Definition format (embedded below), and a link to the high quality version on YouTube can also be found below, if you don’t have the downstream bandwidth or a fast enough CPU/graphics card to watch the higher resolution content smoothly.

Video: Demonstration of animated object based sparking effects, along with a compilation of previous openBVE videos:

» Link to YouTube page (HD – best quality) «
» Link to YouTube page (High Quality) «

Fewer updates and unseen work…

Posted by Anthony_B on January 25, 2009 at 21:00

There aren’t as many progress updates at the moment, partly due to hardware upgrades and operating system re-installations, etc, but that doesn’t mean I haven’t been busy; rather there’s just been quite a bit of work which is either “under the hood”, or merely a continuation of features I’ve already talked about. For example, I’m still implementing transition curves throughout the Cross-City South, however I’ve also updated most of the curve radii after determining the likely values from aerial photographs of the route (thanks to » this thread « at the Trainsimcentral forum). Quite a number of curve radii were too large previously, and the route is looking more accurate now as a result of the changes, but it’s taking time, as changing the curve radii also means the overhead wire object rotations are no longer correct and don’t join up with each other any more, and all these objects need to be re-aligned, which is rather tedious and time consuming.

I’ve also been editing the route file as I proceed through it, re-arranging the code and commands to make the file easier to read and navigate through; not just to make the work tidier and weed out bad code, but also for the benefit of anyone wanting to more easily edit the route after it’s released, create new diagrams/scenarios/activities if so desired, etc. Previously I simply placed all commands at a particular line number on the same line; this meant that scrolling vertically through the route file in a text editor is easier and quicker for me (which I spend more time doing as a rule), however when numerous commands are placed on the same line, despite me usually making some effort to group and order them, this can make it harder to find a command and edit it, and also I gather, makes it harder for others to feel comfortable editing it too, as it seems too complicated. This time, I’ve compromised and placed groups of related commands on their own lines, so for example, catenary related commands are placed together on their own line; scenery, curve and railtype, or pointwork related commands are all placed on their own seperate lines, etc, making it easier to locate a command, without the route file becoming excessively long.

I’ve also now re-introduced the marker images which used to feature in the BVE 2 versions of the route, and it’s nice to have them back again in » openBVE «. One of the main tasks in the immediate future will be taking the animated features I’ve demonstrated so far, and extending them throughout the length of the route, rather than just the test locations which are featured in the videos, along with creating more detailed geometry for the 323’s exterior car objects, and preparing animated components like wheels, wipers, doors, and perhaps other things too.

3D lineside vegetation with wind and turbulence effects, animated butterflies, new Autumn textures and leaf fall

Posted by Anthony_B on January 7, 2009 at 22:00

I’ve been working on some more animated objects for Cross-City South v1.4 and » openBVE «; this time, I’ve tried something I’d wished I could have achieved ever since I created the grassy embankments for the Watford Junction to Rugby route, and hence even long before the openBVE project was started; namely animated lineside vegetation which sways in the wind, and responds to the turbulence created by the passage of the player’s train. One criticism pointed out to me in my routes is the use of 2D lineside trees, which becomes a problem when viewed side-on as is now possible with openBVE’s camera views. Rotating the trees appropriately is one way to reduce this problem and is ideal where performance is important, but I wanted to try using 3D trees just to see how well they worked; so I’ve now created largely 3D trees, which include trunks and branches, as well as foliage clusters, with each component animated appropriately to create quite a nice effect, hopefully bringing some of the beauty of nature to life in the route.

I was originally planning to release the new scenery as part of the Watford Junction to Rugby project, however I’ve now decided to include this in Cross-City South v1.4 instead, which will be released sooner than the aforementioned route. The Cross-City update is proving to be a far more significant upgrade than I originally planned, which does mean Watford to Rugby will be delayed again (I had said privately, that by April I might be closer to finishing it, but this is unlikely now–sorry), so I thought it might be better to have some of it’s features brought forward and included as part of the next Cross-City release instead.

The newest preview video includes photo-realistic Summer and Autumn objects, textures, and higher resolution backdrops, and features grass, foliage, flowers and bushes which sway gently in the breeze, but which as mentioned above, also appear to be disturbed by turbulence caused by the passage of the player’s train, achieved easily by using the Distance variable (which currently provides the distance from the player’s train to the animated object), along with an additional rotation function with associated damping. I’ve also created some animated butterflies (which are simply adapted from the flashing level crossing light available in Michelle’s » DemoRoute1 «, with different objects, a faster refresh rate and extra translation functions applied), which complement the new plant life and animated birds in the Summer routes. The Autumn trees also include falling leaves which gently sway back and forth in the breeze as they float to the ground, which adds a little more fun to wheelslip scenarios. Emoticon Smile

These animated vegetation objects are loaded via Ground and Dike commands so can be cycled and repeated respectively, and a reasonably fast PC will likely be needed for full enjoyment; however to keep framerates higher, the use of animated vegetation will probably be limited to maybe 300m lengths of route at locations like station areas, signals which could be held at red whilst enroute, and various points of interest (see below for more information). Waiting for departure at a station, or for a signal to clear from red, needn’t be so dull in future. Emoticon Smile In between these selected locations, static, but nevertheless 3D trees will be used, probably along with static versions of the grassy embankments although using animated versions may be possible performance wise; I’m not sure about this yet. You can’t easily appreciate the animation from the cab when travelling at speed anyway, so it’s not really a problem. Further away from the track, simple, non-animated 2D trees will be retained (but rotated and placed carefully to minimise the 2D appearance), as openBVE is primarily a cab-view simulator of course.

Download openBVE / X-City South video - please use the YouTube links to the right
Video: Demonstration of 3D animated vegetation and turbulence on passage of player’s train, animated butterflies, new Summer and Autumn textures, and Autumn leaf fall effects. Also includes the swinging cables and flying birds » previously demonstrated «.

Note: This video is now included as part of a compilation on YouTube.

« [YouTube “High Quality” version] | [YouTube “High Definition” version]

Hardware upgrades, performance, and detail levels

Posted by Anthony_B on January 7, 2009 at 21:00

Every time I upgrade the system on which I develop routes, I find that new options and possiblities always arise, and I can add new objects or textures to take advantage of the extra processing power, and step-up the quality of my routes accordingly. I’m planning on a major upgrade in just a few months which will let me find out just what I can get away with where Watford Junction to Rugby and openBVE are concerned, and this will likely be a Core 2 Duo E8x00, along with a recent graphics card. However, I treated myself to an interim hardware upgrade at Christmas, to help support my add-on development for openBVE during the next few months. I felt that my aging AthlonXP 2400+, 1GB DDR-266 system with GeForce 6600GT 128MB AGP graphics card, on which I’ve been developing routes, was finally beginning to hold me back too much as I explored the extent to which I could utilise animated objects in my routes.

Cross-City South v1.4 and Watford Jn to Rugby are now being developed on a dual core Athlon64 X2 4200+ system, with 2GB DDR2-800 dual channel RAM, along with a Radeon HD 2600 Pro 256MB PCIe graphics card (» see here for details «), which has enabled me to add more animated objects to the Cross-City than I’d have considered reasonable while developing it on the old system; while the extra performance makes little useful difference on more simple routes as framerates were already high, I’ve measured a 30-50% performance increase in terms of openBVE’s framerates when the new animated scenery objects I’ve just shown are used, making what was previously just about acceptable, now enjoyable. The new hardware is hardly cutting edge technology though, so hopefully enough openBVE and Cross-City South users will have hardware that’s of a similar specification, and can enjoy similar levels of performance to that which I will enjoy when Cross-City South v1.4 is released. The double track (Weedon Line) section of the Watford Jn to Rugby Maximum Detail route has never really been a problem performance wise, but in openBVE I’m also now getting up to 15-20fps on some of the more complex four track sections, where I got 8-15fps before typically, and loading times are down to 21 seconds, while they were at 49 seconds previously. The “normal” version of the route which will actually get released should be pretty trouble free by the look of things… Emoticon Smile

Where Cross-City South v1.4’s new scenery is concerned, what I plan to do is simply add as much 3D lineside vegetation as possible while maintaining around 30fps @ 1280×1024 resolution on the new system; tests I’ve conducted so far reveal that I should be able to easily include static grassy embankments and more simple static 3D trees throughout the route, along with the selected areas of high detail, animated 3D vegetation and trees as shown in the video, in locations as outlined above. I’ve also done some optimisation work on New Street for Cross-City South v1.4, and New Street framerates are now up to a very acceptable 24fps on the new system, and I’ll try my best to maintain this level of performance as the route develops.

For openBVE, I don’t think I’ll offer much by way of “Detail Levels” as I have done in the past for my BVE routes; at the moment I think there will be a high detail version which is essentially what I’ve described above, and a standard version which will include a few less animated objects and maybe some more geometrically simple objects too. I will also update the BVE 2 and 4 versions of the Cross-City South with some new textures as well, as time permits.