➟ Go back to August 2008.
➟ Proceed to October 2008.
| In these blog entries, you will find information on the things that I am currently working on. Whatever you read in recent entries does not necessarily describe things that are available for public download. The sole purpose of this blog is to inform you about the progress on development which will eventually - that is, in the future - result in an actual release of those features. Do not mistake this blog for a changelog. |
Work on the customizable controls is done now. All commands can be fully customized to be used by keyboard keys, joystick axes, joystick buttons and joystick hats, while the same command can be assigned to multiple controls at the same time. Special support for full-axis joystick commands has been integrated to easily map the power, brake and reverser controls to a single joystick axis. Every command can be mapped to any device, and thus the analog nature of a joystick axis could be used to move the camera with greater precision, just to make an example. As for the default keyboard mapping, many keys have been remapped to result in a more organized keyboard mapping than before, with the most important commands at easy-to-access spots, and seldom used controls to be used with keyboard modifiers.
The option to select a joystick threshold (deadzone) has been added. Additionally, joysticks can be activated or deactivated with a single click in the options menu.
The toppling and derailment code has been reworked a little to include the cant of a curve in the calculations. As a result, a train can now easily derail if the cant is extreme, and will not derail as easily if the cant is moderate and toppling occurs. As a consequence, the train can sustain slightly higher speeds on canted curves. Furthermore, toppling, collisions and derailments can now be optionally turned off in the main menu.
Even though the interface is not yet complete, version 0.8.7.0 has been released today as a preview to 0.9.
A layout bug in the joystick attachment preview has been fixed which prevented the correct display of multiple joysticks in the box. Furthermore, as Windows Forms creates a layout bug for the TabControl elements when using large fonts, I needed to write a manual layout code in order to circumvent the bug.
The default height (as in Track.Height) for the beginning of routes has been changed from the incorrect value of 0.3 to the apparently correct value of 0.0 in order to fix a compatibility issue for routes not defining a custom height at the beginning of the route.
Previously, train motor sounds went mute when the train traveled above 160 km/h, which is the default maximum for which sounds are defined in basically all existing trains. This has been changed now so that the last table entry for which sounds are defined is used when the speed is higher than 160 km/h.
The texture manager has been given an overhaul. Even though it was previously capable of loading textures only when needed and unloading them when not needed any longer, this was done synchronously with the execution of the program, resulting in constant loading lags for texture-intensive routes. Now, textures needed are flagged as such, while a background worker thread loads the textures mostly asynchronously, including loading from the hard disk, adjusting texture size to powers of two, replacing the transparent color with adjacent pixels, blurring the image and recoloring it for glow textures, and so on. As GLU (OpenGL) is not thread-safe concerning passing texture data, the transfer to OpenGL is done synchronously by the main thread in the next frame, increasing the texture manager's complexity thereby. It seems that even on a single-core processor, the load lags have been eliminated this way. When a texture is queried to be loaded but not finished loading, it can only show up solid-colored during that time, which is not usually a problem as there is extra viewing distance behind the background image, so that once the texture is finished loading, the associated object might still be outside visual range, thus minimizing the number of resulting artifacts.
The date parser used for some route file commands has been changed to accept hours, minutes and seconds outside of the ranges 0-23, 0-59 and 0-59, respectively. Hours can now also be negative to represent days before the day the simulation started in. Furthermore, the Track.PreTrain command now checks the time values passed to it to ensure an ascending order is used, which is required for correct behavior of the invisible pretrain. In the case a non-ascending order is used, the time values will be corrected and a warning message is generated. These measures fix behavior of signals suddenly jumping to red, which in fact was correct behavior, but was caused due to a pretrain jumping unpredictably in the route as a result of non-ascending time values being used in the Track.PreTrain commands, be it due to date parsing issues or otherwise.
Warning messages were previously generated for X files having a different version but 0302, since that version is what the parsing model and the templates are based on. However, as version 0303 is the predominant version used in existing material and seems to still work most of the times despite any differences between the two versions being unknown, warning messages are now suppressed for version 0303 files.
Interior view camera restriction has been finally added. The restriction disallows rotating the camera, zooming out and moving beyond the boundaries of the cab. Of course, camera restriction can be turned off, but is enabled by default. Furthermore, support for narrow aspect ratios (< 1.0) has been added to the panel parsers.
Support for the Unicode minus sign (U+2212) has been dropped from the number parsers. Much work went into writing articles for the homepage and the forum.
Today, all work went into writing articles for the homepage and the forum.
Work has started to convert the train-based sounds to car-based sounds in order to allow for each individual car to play sounds.
The conversion of the train manager and other areas in the source code is finished. All trains and all cars can now emit sounds, meaning that the air compressor for example will not only play on different cars but the driver's car (provided that train has the equipment of course), but also on the previous train. The sound manager is responsible for managing the audible ranges and to start and stop playing sounds via OpenAL, which can only handle a limited amount of concurrent sounds.
Problematically, the amount of sounds which can be played simultaneously in OpenAL is rather limited. The exact number is said to be hardware-dependant, but unfortunately, not directly queryable. On my main test system, I can only play 14 sounds before any additional sound will not play. Given the motor sounds, loop sound, compressor sounds, run sounds, flange sound, etc. even only a single car can produce, this number can be quickly reached. Now that the other cars on the train also emit sounds, the number is often exceeded, resulting in sounds playing in an unpredictable manner. When OpenAL support was introduced in openBVE, it became obvious that the number of sounds to be played concurrently needed to be limited in some way. As OpenAL uses a quite realistic approach in attenuating distant sounds, these sounds basically never really become mute even when very far away. Thus, radii were introduced for all sounds. When the distance to the camera exceeds the (inner) radius of a sound, the sound manager will start to fade the volume to zero until the outer radius is reached. Outside that radius, the OpenAL sound will be stopped and only started to be played again when the distance to the sound is below the outer radius again. Previously, the outer radius was hard-coded to be a certain multiple of the inner radius. However, while the number of sounds which OpenAL can play simultaneously is sufficient for one car plus environment sounds, the behavior has now been slightly changed in order to allow for other cars to work, too. Once the sound manager detects that too many sounds are playing concurrently, it starts to reduce the outer radius. When few sounds are playing, the outer radius is increased again. An equilibrium can now form with a certain combination of sounds ordered to play and the outer radius. The number of sounds after which the outer radius is reduced is currently around 12 in order to leave a few reserves for unexpected new sounds like horns or notch changes. Additionally, the inner radii, which are hard-coded for all the kinds of sounds (e.g. motor sound, flange, point, horn. etc.) are currently being overhauled to better suite the new requirements. Nonetheless, unless there are systems which can play at least 32 sounds at the same time, sound support might not be satisfactory given the amount of sounds openBVE needs to play simultaneously.
The gradient profile has been implemented, which is shown in the route selection part of the main menu. Furthermore, version 0.8.8 has been released today.
The train run and flange sounds have been reworked in the way they are played. Theoretically, all of the various run and flange sounds can now be played simultaneously per car, which is used to blend from one sound to another whenever the run or flange sounds change in the route. The result is more pleasing than the previous implementation which simply changed between sounds instantly. As point sounds are now played per axle, the position in 3D space has now been adjusted for the front and rear axles to play the point sound from the correct location each. Also, a slight alignment issue has been fixed for panel2.cfg cabs which got the up/down angle based on the Origin and Center values slightly wrong.
Some further corrections have been made to allow toggling between window mode and fullscreen mode where previously, lighting and fog posed problems. An additional bug occured when camera restriction was turned on while the view was not headed forward, where the forward viewing distance did not get updated.
The Route.AccelerationDueToGravity, Route.Elevation, Route.Temperature and Route.Pressure commands have been added in order to define the various athmospheric attributes which influence air resistance and the speed of sound.
Initial work has been made regarding the driver evaluation and scoring system. So far, the scoring system includes rewarding the player with credits for every station stop at whose station the plater is expected to stop, while giving penalties for incorrect stop, being late, but also for exceeding the speed limit, driving with open doors and passing red signals.
The scoring system has been added passenger discomfort and premature departure penalties. Additionally, the score can now be displayed and the bonuses and penalties can be temporarily shown in a similar way to the messages. Both messages and score have been given a smooth fade-in and face-out using transparency effects.
First preparations have been made to reorganize the loading stage. Today, the message dialog which is currently used to display warnings and errors upon loading has been optically reworked into a loading dialog box which is intended to show the progress for loading the route and train. However, this new loading screen is not functional yet.
Some visual fixes have been made to the main menu when using Mono.
The loading stage has been completely reordered. After starting a game from the main menu, the new loading screen will now show up and route and train are loaded. The progress is indicated for both of them, where the train progress is fairly linear, the route one not so much. The loading process can be canceled at any time, but when complete, the dialog either remains to display errors or opens the SDL window (OpenGL). The simulation then starts within a second or so.
Furthermore, it was previously quite distracting that some panel elements, namely digital numbers and pilot lamps, only loaded once needed, which could lead to white areas appearing in the cab for a short time at any point during the simulation. The behavior for those elements has been changed now so that they are all loaded as soon as the simulation starts.
All in-game interface parts have been given smoother animations. The scoring system has been supplemented with penalties for toppling and derailments.
The page for reviewing the last game has been designed for the main menu, though it is not functional yet. The black box recording system has been partially implementing, recording time, position, speed, acceleration, power handle position and brake handle position every second. The black box output can be saved as CSV or formatted text.
The main menu page to review the last game has been made functional. The logged data for scores and the black box are now saved upon quitting the game and shown in this page upon opening the main menu again. The data can also be saved to external files on this page.
Some more refinements have been made to the main menu and the scoring system. Additionally, the Options.ObjectVisibility command has been implemented for route files to define how objects should be disposed of.
The documentation has been further worked on and with it, the readhesion device can now also be disabled in the train.dat.
A bug in the panel2.cfg parser has been corrected which previously prevented custom colors from being applied at all.
Some minor refinements have been made to the various constants currently used in the train.dat loader regarding the automatic air brake.
The three driving modes Arcade, Normal and Expert have been added and can be selected in the main menu. The scores and black box now save tokenized representations of text messages in order to allow for the same log to be exported into different languages in the future.
➟ Go back to August 2008.
➟ Proceed to October 2008.
|
|