Friday, June 1, 2012

Railworks blueprint replacer

Download the latest (jar) (current version: 1.35 2012.06.01)
Download the latest (exe) (same as the jar, so you still need java runtime, but the exe loader gives more memory for the program, and checks for java version, and works when the run paths in system aren't set, and nothing happens on double click on jar)
If you did everything as written here, and you don't get any error message, but the application still not works, try running it in admin mode, especially if you want to open files in program files, because windows have a "fantastic" access right management, so it may deny the file writing of this application there.

If you have a good idea for a new function to this program, feel free to write it in a comment below, or send me an e-mail with your ideas (found below on the end of this article).

If you like this program, and you want to thank it:
Updates:
January 15:

  • added a function to save and load the whole table with all cells (in case if you want to replace with same settings in different time, or just to save what you've modified to what)
  • added table control icon at the right top corner of table, to hide columns, pack table
  • some other cosmetic changes
January 16:
  • Added a version with fixed multithreading (multiple cpu core usage) 

January 18:
  • Fixed file choosing windows (now these store the last location) per session
  • Added config file making/loading, so you can set a default directory for the application, which will be saved to config.cfg next to the application, and will be re loaded at each restart

January 19:
  • Added "Assets" directory blueprint file tree view and file list caching
  • Added function to double click on blueprint files in tree view to set them as desired blueprint in selected table row(s) which got now green highlight.
January 28:
  • Some optimizations
  • Fixed file filter stacking bug at file choose
February 4:
  • Some optimizations, that causing 20x faster (really) replacing in big files (on smaller files fe. scenery you won't notice at much improvement, unless if you have SSD). Now serz-ing takes longer time than the replacing itself. (for example replacing all of the ~2500 signals and mileposts and speedsigns. on hagen-siegen before took ~2 min on my pc now it takes 10  sec.
  • Some bug fixes
February 7:
  • Replaced backup saving code with a newer implementation (older java file libraries have problems with windows file locking)
  • Added a tool to toggle, enable or disable shadow casting in light blueprints. Select a file or directory in assets file tree, then right click to open the popup menu. If a directory is selected, all light blueprints will be changed in directory, but not in it's subdirectories.
  • Youtube video about the new function
February 8:

  • Fixed serz problems on filepaths that contain whitespace characters
February 10:

  • Fixed misaligned blueprint data fill when columns were hidden
February 11:
  • Added automatic online checking for new version at startup
February 16:
  • Added track network offsetting (raise/lower tracks, by setting an offset), this setting can be found in "Tracks" menu. It will only work if there are tracks.bin/xml file opened, otherwise, it won't have effect.
  • Added object offsetting (raise/lower height per object types by setting an offset in table), these are found at heightoffset column in table.
  • For both, if you don't want to change something, just leave it on 0. You can use negative numbers too.
February 21:
  • Now height changing works on simple lofts, and road lofts too
February 22:

  • Bug fix at height changing, and some optimizations
March 20:

  • Added new feature: dav file decoding to wav. It does the same as Ben Laws's Dav Decoder, but here you can select and convert multiple files at once, and you can select directories too (where the program will search for dav files and decode them). You can find this new feature in Assets/Decode Dav files menu
May 1:
  • Added a version that uses exe wrapper, to pre set max memory usage, and checks for required java runtime version.
June 1:
  • Added new feature: zip to rwp. With this you can convert plain zip addon releases to rwp format. It works similarly like the dav decoding feature. You can select multiple files, or directories to convert. This feature can be found at Assets/Zip to RWP.

I've wrote a simple Java application to mass replace blueprint references in railworks data xml/bin files. I'm tested it on scenery tiles, and tracks.xml(tracks.bin) to replace signals, and tracks and track rules. But it will probably work on any railworks xml/bin files that have blueprint references. (it will work on those too that haven't got blueprint references, just won't list anything though)
For example i've replaced all kind of german signals on Hagen-Siegen route, to hungarian signals, in 5 minutes.
Short tutorial with new function
Light shadow cast switch tutorial
Another tutorial

You can raise/lower track network, or objectst too, and you can bulk switch on/off the shadow casting of lights in game.

And yes you can do some of this with RWTools(like you can with any text editors), but with those you can do a lot of mistakes. Search for blueprint copy paste the tags, missing character mistakes, etc, and you cant replace multiple different blueprint references at once.
The application is pretty simple, for those who know what is provider, product, and blueprintID, so basically what is blueprint in RW.
Usage:
  • File menu/Open files (you can select more but of course the processing will take longer time)
  • Select one or more blueprint types (trackbedrumble, trackrule, etc)
  • Click on Filter button to populate the table
  • Find what you want to replace, and fill(double click to edit the cells) the desired<something> cells with the desired new blueprint reference.  Or double click on blueprint file in the tree view.  If you don't want to change something, then leave it's "desired" cells blank, so the application won't touch them.
  • If you're done, then click on Replace items button, and the application will replace all of the blueprint references in the file(s) where you filled ALL the three cells (if desiredProvider/product/blueprintid is missing, it won't modify those references). The processing time will depend on how big is the xml you modify, how many things you want to replace, how many xml files do you modify. For example replacing around 30 different signal blueprint references and 2024 pcs of signal instances on Hagen siegen took about 30sec processing time.
  • If you have multicore cpu, the program can use any cores if there are enough xml files opened, as every xml processing runs in seperate thread. So if you have a quad core cpu, with one opened xml it will use one core, but if you opened at least 4 files, it will use 4 cores (i hope :D ).
  • Also you can sort the rows by columns, by clicking on column headers
The application makes backup(renamed with .bak extension) from original bin files. If it finds an existing backup file then it will create a new backup with an increasing number after the bak extension starting with 0, and the highest numbered will be the latest backup (fe bak, bak0, bak1, bak2...).
It may have bugs, if you find any feel free to comment it here.

Important: this program calls serz.exe to convert bin to xml and back, so you need to put a copy of serz.exe(it can be found in railworks directory) next to this program. Otherwise you can only open .xml files, but not .bin.
Another important thing: Always make sure that you've loaded the appropriate blueprint libraries in editor that you going to use for replace, or the replaced object won't appear, or won't work correctly.
If you load a lot of files (scenery of a big route), java can run out of memory (it uses max 330 mbytes max at 32bit, and 1 GB at 64bit). When this happens you will notice that the program don't responds for longer time, and the program window sometimes blinking. If this happen, try with fewer files per session. Or start this program from command line, or make a shortcut for it, with -Xmx parameter (case sensitive!) , something like this "java -Xmx3000m -jar replacer.jar" -Xmx3000m means java can use maximum 3000mbytes of memory.

For the application, you need a Java 7 runtime Download

And here is the application itself: Download rw replacer (if java is correctly installed, you can run replacer.jar like any other executable file. If you can't you can try to open a command line where the .jar is, and execute "java -jar replacer.jar" command.

Tips:
  • Tracks.bin in Networks directory of a route contains everything that is connected to track infrastructure (signals, tracks, track rules, track rumble sound, overhead wire blueprint references) other bins in there are self explanatory
  • Scenery directory have the scenery objects per tile
  • in scenario directories, by modifying scenario.bin you can replace rolling stocks too with this application.
  • write the replacing texts in the table carefully. Just a missed character, and railworks will fail to load that object.
  • you can search in table by pressing ctrl-f
  • if you experiencing freezes and after some time "Out of memory" (on console) error messages loading huge bin files like Northern Europe route's track.bin/ or a lots of bin files you need to set the memory that can be used by java higher(actually for northern europe 2000 mbytes are enough). This can be done by starting the program from command line (or make a batch file for it) with java -XmxNUMBER -jar replacer.jar NUMBER is the max size of memory that can be used by java. -Xmx3000m means 3000 megabytes (of course the limits of os, and java runtime are still in effect, so you can use settings over 2100 megabytes only if you have 64bit OS and you've installed 64bit java) Example batch for 3000 mbyte max memory usage (copy this next to replacer.jar, and run this bat file) or use the alternative exe launcher, see the link on the top.
If you have problems and you did everything as it written here, report it on kokszalami(at)t-online.hu email

You can freely distribute this program, so you're allowed to upload it on any free sites, but not on pay to download sites like uktrainsim. If you upload the program somewhere, please make a link to this article too, as source.

Monday, February 13, 2012

Railworks, TS2012 graphics performance and bugs

I'm not pleased with the updates too. Actually because i don't use anti-aliasing (railworks runs badly enough without that...), i didn't noticed ANY performance improvement under TSX mode (i do in legacy mode, but that's too retro looking), nor quality improvement.

I use medium shadows because as i said railwors don't runs like a dream on my machine, however games with much better graphics running on it with very nice frame rates (Skyrim at high settings with high res texture pack, BF3 at high, tropico4 at highest settings).
This medium shadow mode (and even high or highest) have very annoying problems. For example the flickering, and shimmering.
See this video about the shadow flickering: Youtube video

Also in TSX mode since the TS2012 update i notice flickering, z fighting on places where it wasn't in legacy mode, and not just on shadows, main geometry is flickering too! For example on german HL signal main/distant plates (red white or yellow white striped plates on signal post).

Also i've noticing (and not just me) a problem, when i switch to cab view from external, then the frame rate drops permanently, and isn't rise if i switch back to external view, only when i restart the scenario. This happens not just with br101, but with class47 cab too, and probably with every cab views.
The only improvements i see, is: faster load times, little less stuttering at tile loads (but still noticeable), plus the FXAA "hack" made official. But on the core graphics of TSX i do not notice any change.

Thursday, February 9, 2012

Failworks, aka DLCworks

Yesterday i get the update for TS2012 from steam. I wasn't so disappointed, because i got used to get nothing at these big long awaited patches.
This time (again) they promised performance updates, but nothing was improved except they built in to game the FXAA antialiasing (which was available separately as and external dll injector), and some performance improvements on "retro" legacy mode. But the shadowing and lightening performance and quality issues haven't fixed.
Since 2007 (release of rail simulator):
-loco physics is broken, and never touched since RS
-AI dispatcher haven't improved significantly
-brakes are unrealistic (worse than MSTS!) a 2km long train can release all wagon brakes in no time, while in reality it could take MINUTES, or at least tens of seconds.
-every patch caused at least a new bug which are mostly haven't fixed (for example brake notching in loco controls (it seems it works, on some locos, but it's just a workaround with lua scripting), broken lua script debugging, etc)
-endless stream of promises

Improvements? Let's see:
-career mode? Is it? I think it's just a mission scoring thing. it's not like a carreer.
-super-elevation? Not bad but far from reality. (irl the angle depends not only on curvature, but on permitted speed too)
-new graphics engine? Yeah, a very old directx9 engine replaced to a simply old directx9 engine (aka TSX) in !2011! (when even directx 11.1 came out), which have awful performance, and quality with shadows. Do i have a "junk pc"? Maybe, but i don't know why are all other games running at high graphics settings on my pc (including BF3, TES V Skyrim) without problems, and with MUCH nicer visual quality. Or maybe TSX engine is the junk, and not my pc?
- others... erm... i can't remember other improvements

Obviously the TS2012 game core, have a lot of flaws, bugs, and it's very inefficient too, and have serious limitations. But instead of hiring new coders to make it better, what RSC does? They hire MORE DLC, marketing people, but no any core coder.
While they keep saying that bullshit, that they "need solid financial foundations to improve the game". No they won't do this, they have solid financial state, but they use it to make more DLC. They never really though about really improving the simulation, they just say thing that the community likes to keep the hope alive in them, but those promises never will be fulfilled.

I've bought Railworks 1 in 2010, because i've believed in their promises, but nothing happened since that. Every time they say they will improve and fix this and that in next patch, and when the patch comes out (with at least 5 months of delay) we get the 10% of those that they promised for that patch.
At the last year i knew all of this, but i hoped they can change, but they can't.
Railworks 1, 2 ,3, TS2012 or whatever they call their patched Rail Simulator, will remain to be Failworks, or DLCworks.

But i still hope it will be better... which means there are too few train sims out there to choose from :(

Tuesday, January 31, 2012

Frightening discovery

Who are modding something for RW, probably know that it have very illogical things and erratic behavior, mostly at lua scripting.
But i've discovered a new thing, that i could not even believe before:
The OnControlValueChange function isn't activated if i'm using a control value with "interior push button" setting, but does if i use interior notched lever for example...
And again i've searched for scripting errors for a hour... but there wasn't any errors, RW is the error...