➟ Go back to April 2008.
➟ Proceed to June 2008.
The default signals are now loaded and can be shown throughout the route, including the signal post. The state changes are not implemented yet, so all signals will simply show green at the moment.
The Track.Relay command is now processed, however as with the normal signal, it will currently only show the proceed aspect. Working signals are yet to come. Also, I created an article about the signals and uploaded it to the homepage.
I created graphics for the speed limit post, that is three backgrounds (straight, left, right) and the digits, and also the respective object files. However, the Track.Limit command is not implemented yet.
I refined the speed limit graphics and added the unlimited speed texture. Speed limits are now internally stored and applied and the limit post can be shown, thus the Track.Limit command is now fully supported.
Signals are now partially functional. When passing a signal, it turns red (or the lowest aspect it has).
Signals fully work now. When passed by the front car, signals turn red, when passed by the rear car, the previous block is released. The different aspects work correctly, that is, caution signals appear before stop signals, reduced speed signals before caution signals, and so on. Repeating signals also work. Departure signals correctly take the departure time of the corresponding station into account, that is, they stay red until the corresponding time has passed. Occupied blocks are also internally registered, so multiple trains can operate on the track, thus the internals are prepared for the pretrain. Therefore, the Track.Sig and Track.Signal commands are fully supported now (although no signal glow is shown yet).
The Route.Signal command is now available, and signals store the speeds applying for each of their aspects. The train also knows at which speed it is allowed to travel, both incorporating the speed limit (using Track.Limit) and the signal limit (using Track.Sig). Furthermore, the train spring has been revised. It now performs more realistic in curves and on turns, but could still be made better.
The Cube and Cylinder commands have now been reimplemented in the way BVE assigns their vertices and faces. This also allows for textured cubes and cylinders to work now.
The brake indicator, which was previously loaded as a TextureShifting section element with one big texture, is now loaded as a Cyclic section element with split textures. Previously, the one big texture could not be displayed correctly on all graphics cards and was shown as pure white in these cases, while it works perfectly now with individual textures. Also, the brake indicator is fully functional now, except for the hold brake state, as the hold brake is not yet implemented. The brake indicator textures are currently the only textures that are flagged as not to be unloaded by the texture manager due to the costly process of splitting the base texture.
The renderer has been reworked to increase performance, and in fact, the frame rates are about 20 to 40 percent higher than before on some routes. Also, the changes seem to have stopped the stutter that appeared on some routes even with high frame rates.
The LED-type speedometer has been implemented. Also, the digital speedometer now works correctly when the train drives backward, which wasn't previously the case.
The LED-type pressure indicator is now supported, too. This makes openBVE almost fully compatible with BVE 2 panels, with only the ATC support missing. Also, the digital indicator, which was previously loaded as a TextureShifting section element, is now loaded as a Cyclic section element with split textures.
I could finally resolve the camera misalignment that has plagued me for 9 days. When the train tilts in curves via cant or inertia, the camera is now perfectly aligned with the cab again. Additionally, I created the compatibility graphics for the stop post.
The Track.Stop command is fully supported, as the stop post can be shown now. Furthermore, textual output has been added which has basic support for Unicode text, thus providing international interoperability. As all major goals for version 0.3 have now been achieved, the new version will be made available within this week.
The marker image can be displayed now. Support for power and brake notch delays has been added. Additionally, the single handle type is available now.
The hold brake (抑速制御) and the const speed (定速制御) are now available. They might work in a different way compared to BVE, but the end result is similar. Also, error handling in the route parser has been modified to do some late-bound tests for Track.Form and Track.Crack in order to accommodate for rails that are introduced after the respective commands. All parsers (route, object, train, panel) now also employ support for arbitrary encodings (codepages), so legacy BVE files from around the world (Western Windows, Japanese Shift_JIS etc.) can be read on all computers if the correct encoding is provided.
I tested around 30 trains for compatibility and made a few changes here and there for actually quite good compatibility with BVE 2 trains now.
I conducted some further tests, this time around 20 routes. There are only minor problems, so all routes I tested almost completely work. Exceptions are the currently unsupported fog and some violations of mackoy's specifications by route developers.
I released version 0.3.0.0 today.
Based on the feedback I got from testers of version 0.3.0.0, I made changes to the electropneumatic type 'none' and the rolling on inclines code, and added the #DECELERATION statement for the BVE 1 type of train.dat. However the difference in the #ACCELERATION factor is not something I have figured out yet, so acceleration for those trains will be extremely different for now.
Rolling on inclines now seems to work fine compared to what BVE produces after I corrected an error in the code that resulted in twice the acceleration as what would be expected.
I converted all remaining error generations into late-bound checks when possible, thus Track.Wall, Track.Dike, Track.FreeObj etc. commands will work when the corresponding rail is introduced after the respective command. A warning message is however generated discouraging developers to code this way as it can lead to ambiguity. The error message dialog now also distinguishes between errors and warnings and uses appropriate icons for a visual aid. The changes made so far have been released as version 0.3.0.2.
I tested Simple DirectMedia Layer (SDL) for initial audio support and have implemented the sound manager, which similar to the texture manager, can register sounds, but only load them once they are needed. The Track.Announce command is the first sound that can be played. Unloading sounds to free memory is not yet implemented.
The Track.Sta and Track.Station commands can now play arrival and departure sounds. The train can now play door, emergency brake application, leave and compressor sounds.
I made a small adaption to the route parser which is now able to load routes more efficiently, which will mostly affect very long routes. However, very long routes having very many objects will currently require a lot of memory.
The various air and brake sounds, the loop sound and the three klaxons are now supported, too.
The pass alarm sound in both the single and the loop variant has been implemented, also the adjust sound.
I have decided to switch from SDL to OpenAL whose 3D positional audio system is better suited for openBVE's 3D world. Also, doppler effects, pitch changes and speed changes are a little hard to achieve (if at all) in SDL, however seem to be an easy thing to do in OpenAL.
I have created a Features: Audio section on the homepage.
After many hours of frustration, I could get OpenAL to work the way I want it to. The 3D system was simple to implement and didn't take long, and it is quite nice to listen to the train in surround sound in DD 5.1. The problem was that OpenAL did not load all wave files correctly, while SDL did. Now I managed to load the sounds via SDL and pass them to OpenAL for playback, which works quite fine. Additionally, stereo to mono conversion is possible this way (which is needed for 3D capabilities), and also OGG Vorbis support, possible also MP3, AIFF, VOC, MOD and MIDI. I even tested playing 6 OGG Vorbis music files as loop.ogg sounds, one for each car, and doppler effects provided out-of-the-box while driving high-speed. However, in this extreme test (the files are about 5 minutes long), the frame rate dropped about 15%. For normal operation, expect at most 3-5% compared to having no audio at all, but still having OpenAL loaded. For some unknown reasons, having OpenAL loaded gives a penalty of around 10% even without playing any sound. I need to investigate why. To be fair, the simpler SDL audio didn't seem to have any noticable impact on the frame rate, so it could be used as a fall-back for slower computers, just without the positional effects, and thus quite silly-sounding exterior views. Motor sounds, and all other with changing pitch don't seem to be possible with SDL in a simple way, so OpenAL will be the main audio implementation for now.
I successfully converted all sounds that have been implemented so far to the new 3D positional sound manager interface. The locations at which sounds are played is available on the homepage. The sound manager is only one file and can be exchanged for another one at any time. This enables using a pure SDL or a DirectSound implementation, if desired, without changing any other code in the game.
The $chr/$rnd/$sub preprocessor has been completely rewritten and is now able to handle nested commands, multiple assignments within the same expression and a new two-argument $sub command.
Currently, I have both a functional OpenAL sound implementation and a SDL-based implementation, and can switch between the two at will. For the latter one, I also implemented a simple sort of 3D effect by adjusting the volume for each sound and making use of stereo panning. Still, SDL will not be able to handle pitch changes that are necessary for BVE's motor sounds and the like, so it will not be a feature-complete implementation. For the WIN32 platform, I could consider writing a DirectSound implementation in the future. For now, OpenAL and SDL will suffice, and of course both are portable.
Work has started on a simplistic, processor-friendly AI. This AI (the human driver) can be used for the computer-controlled pretrain or the own train, if one wants to lay off or something. Currently, the AI can wait at stations for the departure time, close the doors, accelerate, decelerate and brake regarding the speed and signal limits and activate the emergency brake when passing a red signal. It cannot currently look ahead for speed limits, signals or station stops, though. These features will follow soon.
The human driver AI can now look ahead and brake in advance for speed limits, signals and station stops. It can automatically open the doors and then depart again, thus it is a virtual train driver.
Some adjustments have been made to the hold brake and the brake sounds. The AI can now also make use of the const speed and the hold brake systems. When trying to stop at a station which has a downward incline, the AI currently misses the stop point in some occasions.
The pretrain can be made visible and it uses the AI to drive. Currently, departure signals don't incorporate the pretrain schedule, so the pretrain will have to wait at stations as if it was the player's train, thus the player will always be late. I will adjust the signal system soon, but other than that, everything works extremely fine and I have not encountered any problems.
The signal system is now able to handle the pretrain's schedule. Also, the game is fast-forwarded to skip the time the pretrain needs to be in advance, which causes a slight delay upon loading the route if the pretrain is used.
A no-sound implementation of the sound manager has been created for the sole purpose of disabling the sound altogether. I have to admit that without sound, the frame rates are noticeably higher. Regarding the AI, should it for any reason pass a red signal (which should not happen anyway), it will apply emergency brakes and come to a complete hold, then it will continue driving with slow speed until the next signal. This is simply a precaution measure to not completely lock the player in such a scenario, which would render the ongoing game useless for the player. Additionally, it can be specified how many pretrains to use, so there can be more than one train ahead. The Route.RunInterval command is now supported, and it creates just a single pretrain.
The train manager has been adapted to hide train objects (exterior, panel, etc.) from the renderer when they are far enough away. This prevents a reduction of frame rates when for example the pretrain is used but not currently in visible range. Furthermore, some mathematical simplifications have been made in the whole game.
Previously, advancing the pretrain took quite some time, but has now been optimized to take only a minor amount of time. Also, I have started creating graphical representations for the handles and other indicators like the stop marker, instead of only using text.
When the effective ranges of marker images overlapped each other, there was ambiguity over which one to show, while now, multiple marker images can be shown at the same time to fix this problem.
The Track.Accuracy command is now available and is not restricted to integers from 0 to 4, but can use any floating point number.
A messaging system has been implemented to indicate when the route or signals limits are exceeded, to inform about the arrival and departure at stations, etc. Furthermore, the previous train can now be disposed of when it reaches the end of the track in order for the player to be able to pass an otherwise red signal. This also means that the previous train continues driving beyond the last station until the end of the track.
The Track.PreTrain command is now available and creates an invisible pretrain which is not accurately simulated, but simply interpolated along the scripted positions and timings. This makes the signalling system fully operational and enjoyable with simulated traffic in the form of simulated and visible trains (via Route.RunInterval) and scripted, non-visible trains (via Track.PreTrain). Thus, all main goals for version 0.4 have been achieved.
The distribution of motor and trailer car weight has been revised. The new algorithm uses pre-defined configurations for few cars and a symmetric distribution for more cars, and also takes into account whether the first car is a motor or trailer car as specified by the train.dat.
The human driver AI has been revised to employ less artificial timings and delays and also to make better use of the hold brake and const speed systems. It also performs generally better when driving down a hill.
Due to the fact that all goals for version 0.4 are achieved by now, I have released version 0.4.0.0 today.
A bug with klaxons and some other sounds has been fixed where sounds are prematurely stopped. Previously, when for example the music klaxon was stopped, it was still internally considered playing, and thus, when the user tried to play it again, it stopped another sound instead until no other sounds where playing. This has been corrected now.
There was a problem with the delay including control (遅れ込め制御) electropneumatic type brake system when the acceleration the motor could provide exceeded the amount of braking the brakes could provide, leading into full motor brake regardless of the brake notch selected. This also forces the AI driver to constantly applying and releasing the brake simply because brake notch 1 would already provide the full amount of braking brake notch 8 would usually provide. The problem has now been corrected. Additionally, the AI can now better handle trains which have only a few brake notches.
As some sounds, notably 8 bit sound, played with a higher pitch than usual, I have tried to improve the conversion process that is used when loading sounds via SDL and feeding them to OpenAL. However, my attempts were not successful. Instead, I try to load sounds via ALUT (OpenAL) again when possible. Some WAV files cannot be loaded this way and stereo sounds are also not supported, but the pitch is correct. Only when the sounds cannot be loaded via ALUT or are stereo, the sounds are loaded via SDL and converted to OpenAL as done before. This still makes some sounds incompatible because of incorrect pitch, but the number of cases in which this happens should have been vastly reduced now.
There was a bug in the panel configuration parser that did not discard comments correctly as was intended, which forced some statements to be incorrectly parsed. This has been corrected now and thus, comments are supported (and completely ignored).
Inaccuracy is now not as regular as it was before, and vertical inaccuracy has also been added.
Previously, the pretrain was forced to wait at the first signal when this signal was bound to a station's departure schedule, thus allowing the pretrain to leave only when the game started for the player, and thus, the pretrain "came out" of the player's train. This has been corrected now.
The bugfixes made so far have been released as version 0.4.0.1.
The first dynamically pitched sounds are available, namely the rub sound (rub.wav) and the track run sounds (runX.wav).
The flange sounds have been added. Neither of the three sounds implemented so far work in a similar way compared to BVE, but rather different.
The rub and run sounds are now basically similar to what BVE produces. The flange sound is currently played more often than BVE plays it.
The left and right spring sounds have been implemented. Furthermore, the point sound works now, too.
The previously missing brake sound for automatic air brakes is now played when the handle is set to the service position. A lot of adjustments have been made to the run, flange and rub sounds.
The motor sound has been implemented and includes the full table look-up for the P1, P2, B1 and B2 sounds that are stored in the train.dat. This makes all speed-dependent sounds more or less implemented.
The EB device (deadman's device) has been implemented, along with the Eb and Ats sounds. Also, the ATS lamps can be displayed and have working ATS, ATS RUN and EB states.
The Track.Transponder (or Track.Tr) command is now available and supports the S and SN types. The ATS-S and ATS-SN systems are fully operational and can bring the train to a complete hold if necessary.
I have created textures and objects for the five different types of transponders BVE 2 supports. The objects are automatically shown when using the Track.Transponder (or Track.Tr) command and use reasonable-quality textures for such small objects.
The first parts of ATS-P are implemented. The two ATS-P transponders are supported and the immediate stop can be performed. However, the brake pattern is not implemented yet.
A first attempt to implement the ATS-P brake curve has been made. The behavior is acceptable, but certainly needs to be fine-tuned.
Adjustments have been made to the ATS-P system, which now works similar to BVE, but not in the exact same way. Additionally, some missing sounds have been added, namely the ATS-P ding sound and the continuation chime for ATS-S, and the accidental departure transponder (via Track.Transponder or Track.Tr) is now also available and working.
Some more adjustments have been made to the ATS-P system and the behavior of the brake cylinder. Furthermore, the AI is now able to handle both the ATS-S and ATS-P systems, and it will of course always drive with the security system enabled.
Fog has been implemented and thus, the Track.Fog command is now supported.
Previously, the route parser sometimes confused indices in parantheses with the BVE 4 style of supplying arguments within parantheses and also with arguments which included parantheses themselves (like in file names). This has hopefully been resolved now.
The ATS/ATC lamps have been fully implemented and only show those lamps that are actually needed for the specific train. The ATC part of the speedometer can be displayed.
ATC is partially working now and the speedometer can show the current speed restriction. Switching between ATS and ATC is also possible manually.
Previously, when being in the exterior view, the doppler effect was totally different when being on the left side of the train than when being on the right side. This was due to a bug in the sound manager thanks to which the velocity of the camera (a vector) was wrongly assigned. This bug has been fixed. Additionally, the doppler effect was also applied to train sounds, which resulted in pitch changes even when being in the cab. For an open wagon, this is realistic, but for a closed cab, it is not. Therefore, the listener velocity is assumed to be zero when being in the cab, and non-zero when being in the external view.
The ATS-SN and ATS-P systems will now always assume a red signal when a transponder is encountered beyond the last signal. Furthermore, the ToAts and ToAtc sounds are now available and the Route.Change command has been implemented.
ATC is basically working now with only the automatic switch from/to ATC at stations and the incorporation of pretrains missing yet. The brake behavior is quite smooth now in contrast to ATS-P.
➟ Go back to April 2008.
➟ Proceed to June 2008.
|
|