Tuesday, October 30, 2012

3DC to Railworks - Locomotive: Blueprinting Part 3

3DC to Railworks - Locomotive: Blueprinting Part 3
by Jerry "SMMDigital" Conaway


< PreviousIndexNext >


459. We are now going to be working in a sub-division of the Locomotive Blueprint called "Children". I don't want to make a new Engineer character, so I'm going to reference one from RSC in my blueprint. This is called "aliasing" in game parlance. Now we cannot put the reference directly into our source blueprint, as the Compiler will try to export it and we will get an error because it doesn't exist in the Kuju source folder. What we will have to do is place the reference in our blueprint AFTER it is exported using RW_Tools.


NOTE: In the Blueprint ID field, you can actually fill in the path all the way to the filename extension (ex: ".xml"). It will export that reference as long as that extension is not included.

INFORMATION: Aliasing is the process by which we link objects from other Kuju rolling stock to our own so that our locomotive can use it. Some in the NitVulture community look down on this practice, saying that it is a cheap short-cut for a locomotive creator. The people that say that usually have contributed nothing but hot air to the game. My thinking on this is that unless you buy the core Railworks program, this locomotive that we are making would be useless. So as far as I'm concerned, whatever came in the box with the game is at our disposal, right? Now aliasing to third-party or aftermarket downloadable content is a different story...

There are a few drawbacks to using aliasing files that you and the end user or your product should be made aware of. One is that you cannot completely fill out the path names in your source Blueprint. As I said before, if your Kuju source folder does not contain the files that you are referencing in your blueprint, the Compiler will throw an error when you export the locomotive blueprint. You will have to fill in the full path on to the .bin file using RW_Tools AFTER you export the locomotive. The second drawback is that if RSC ever decides to move or rename the files that belong to the default locomotive you are using, you will lose sound capability until you correct the file paths in the blueprint. Also, if the game cache is reverified and everything is set to default, it may uncheck your "RailSimulatorUS" box in the scenario and any files your locomotive uses from those folders would be unavailable until you recheck the box.

If you have any reservations about using the default Kuju files in your locomotive, you should stick to making all of your own files.

460. Next we are going to get into audio creation for our unit, starting with the horn. To start out with, in our Source folder, in the C398\Audio folder, we are going to create another folder called "RailVehicles". Inside of that, create a folder called "Diesel", inside of that "C398", and inside of that a folder called "Cab". Once again, I don't know the reason why all of the nested folder setups, i'm just following what RSC has done.

461. Inside of our Cab folder, we place our three sound files for the horn; a start, mid, and end sound file.

462. Right click on the Cab folder, and from the menu, choose "New Audio Control". From the pop-up box, choose "Generic Audio Control".

463. My explanations for what we are about to do is based on a partial understanding of the process. The best thing you could do for yourself right now is make sure you have a copy of the "Audio Creation" section of the RS Development Docs open, as well as a copy of the Audio Controller for a default locomotives open in RW_Tools.

The first thing we want to do is to put in the main Horn sound we have in the Cab folder. Click on the "Sound" tab, click "Insert First", and choose "Single Sample Sound".

464. Some of the data you will be entering includes the name of the sound, whether it is looped (in this case it is), the Priority of play (just in case your sound card needs to start dropping sounds), the main volume, whether it changes pitch, at what distance the horn begins to fade, at what distance it is faded completely. Then, in the last field, you copy the file name of the sound file in the Cab folder, and place it in the field.

465. The same procedure is followed to enter the second sound. Notice though that Looping on it is false. This is a small snippet of the horn at the beginning of it's cycle, so we don't want it to repeat.

466. And our last sound to be added to this blueprint is the Horn End sound.

467. Now we will add a sound curve to the files. From what I understand of it, this makes the sound play at different levels depending upon the time of day. This makes just a little sense, being that sounds sound different depending upon humidity, air temperature, and wind. Again though, I'm referring to another locomotive blueprint and the Dev Docs for guidance on creating this control.

468. As for the curve modifier, I have no idea what this code does. I'm just looking to another locomotive blueprint and following it's direction. Do note though that the Controller name is "Horn" - the sound that we put in earlier at the top of the blueprint - and the Modifier name is "Horn Volume", which we created in the "Curve" section. Redundant? Confused?

469. Instance Group is a little more understandable. In these fields, we tell the controller how many times we want a certain sound ("Horn End") to be played at the same time. What we have basically told the controller that it is to play no more than once consecutively, and if the game tries to play the sound twice, reject the new instance.

470. Now we are going to create the final instructions. This part of the Horn we want to loop. So, while we are holding the handle down in the cab, the horn will play over and over. We insert a Loop control. In the first field, you see the word "both". This statement means that the horn will be heard inside AND outside of the cab. The second field is just the name you give to the Loop. The third field is the sound this Loop controls, available from a drop down. The fourth field refers to the Modifier Chain we filled out, which refers to "Horn Curve". The Controller name is important - the name here should be the name of the Controller in the Engine Blueprint. The rest of the information meanings can be gleaned from the Dev Docs.


471. Next we do a triggered one shot sound for the Horn Start. 1. Both, 2. Name, 3. The name of the earlier input sound, 4. No modifier, 5. The Controller name, 6. Info from the other blueprints.

472. The end of the horn gets two one-shots, the last one with slightly difference values. When we are finished with this, the Blueprint is saved and renamed.



473. Now we have to create a new sound blueprint to reference our Horn controller. The first part of the blueprint references the Audio Controller we just finished making. Ignore the highlighted area, as we don't need an IGS file to reference this blueprint.


474. Back in the Locomotive Blueprint, we need to reference our newly created Horn under the Child Object section.

475. The next insertion will be for the cab sounds. A click is a click, and most sounds for these "analog locomotives" inside the cab are generic, so I'm going to alias the sounds on the locomotive to the default SD40. However, even though we are using ready-made sounds, we aren't going to get off easy here. There are more controls in the C398 that in the SD40, so we are going to have to create a new Sound Controller and Sound Blueprint to tie those extra controls in. Also, I want radio chatter, which the SD40 does not have by default.


476. Once again in the Cab blueprint, right-click and choose "New Audio Control". From the pop-up box, choose "Generic Audio Control".

477. What you need to do next is open up a copy of the SD40 Cab audio controller (or whatever default locomotive you are choosing) using RW_Tools to open the proxybin file, or a plain text editor to open the proxyxml file.

478. Now copy the sound values EXACTLY as you see in that blueprint to your new blueprint in the BP editor. However, do not copy the file path names. We will have to do that later with RW_Tools.

We could take an easier route and simply copy the SD40 audio controller file to our Asset folder and then add our own sounds to it, but the only way to really learn and get a grasp on this stuff is to do it line-by-line yourself.


Copy any curves or modifiers that may be involved.


Copy Loops and Oneshots.

479. Once you have copied all of the default SD40 values to the new blueprint for our locomotive, we are ready to begin attaching our controls and sounds. At the bottom of the Audio Controller blueprint, insert two more Triggered One-Shot sounds. Set both to play inside only.

480. In the name field, I'm going to put "Ditchlight 1".

481. For this control, the sound that the wiper lever makes when it is flipped will be sufficient.

482. The name that goes into the Controller field is the name of the Control derived from the Engine Blueprint.


483. The trigger type tells the sound controller what to do when this particular Control is activated in the game. In the top fields, if the switch is flipped to it's on position ("Value Increase Past" - .01), then the "click" sound is activated. The bottom fields activate the switch again if it is flipped to it's off position.

484. Now we add two more triggered one-shots for the rear ditch lights.

485. To add the Radio Chatter sound to our cab, after we place our chatter WAV file in the correct directory, we will need to go back up to the Sound section of our controller blueprint and create a new Single Sample Sound. Fill out the information fields, and since the file is located in our Source folder, we can go ahead and fill in the Path name information as well.

486. We need to put in a Time of Day volume curve and a modifier chain, according to the D9 audio controller.

487. Finally we tie it all together as a looped sound.

488. After saving this Audio Controller, we need to make another sound blueprint so that we can tie these sounds to the locomotive cab.

489. And after making the Audio Controller and Cab Sound Blueprint, we reference it in the Children section of our Locomotive Blueprint. Now you need to make sure that you are completely finished adding sounds, curves, modifiers, loops, and one shots to the Cab Audio Control, because once it is exported, we will need to make changes to it in RW_Tools. If you have to re-exported it from the Blueprint Editor after that time, your RW_Tools changes will be overwritten and have to be re-applied.


490. Remember that we had to leave the Paths to the sounds we are aliasing from the Kuju SD40 blank? Well at some point after we export the Locomotive to the game, we will have to fix this. You will need to go to the Asset folder where your exported audio controller if for the Cab audio files for your locomotive, and using RW_Tools, open up your cab audio controller PROXYBIN file. Or, as seen in these photos, you can open up your cab audio controller PROXYXML file with just about any text editor.


As you can see from this example, we are missing the paths and file name references to the files we need to make the sounds.

491. The references to the file paths that we need are located in the Audio Controller for the default locomotive we have chosen to model our Controller after, in this case, the SD40. Open another instance of RW_Tools and navigate to the folder where the default controller is located. Open the PROXYBIN (or PROXYXML with a text editor), and one-by-one, select and copy this path reference to your locomotive's Audio Controller.


492. Once you have filled in all of the Kuju references, your sound controller is fully aliased and sounds are assigned to your locomotive cab. Because any future changes to this controller in the Blueprint Editor will wipe this blueprint out when you export, you need to make a backup copy that you can simply drop back into place and not have to go back through and re-alias all the sounds.

One oddball thing about PROXYXML and PROXYBIN files is that they both must be in place in order to function correctly. So whether you made changes to the XML or the BIN file, you will need to make the changes to the other as well. This is easily done by using the SERZ application located within the Railworks folder. Here, I've moved a shortcut of it to my desktop. Simply drop a copy of your PROXYBIN file onto the SERZ application icon, and a copy of the BIN file will be made and converted to PROXYXML. The process works vice versa as well, with an XML being converted to PROXYBIN.


A video of our cab sounds in action. Some of them are a bit muted, so I will need to go back and make some adjustments to the controller.

We are going to finish up the Sound section of our Locomotive Blueprint by creating an Audio Controller and Sound Blueprint for the locomotive external sounds. The external sounds of a locomotive are as important as it's paint job or the parts it's made out of. While most locomotive sounds are pretty generic (wheel squeal, ticks, etc), a well experienced ear can tell what kind of locomotive is on the lead of a train, without even seeing the unit, just by listening to the sound of it's horn or prime-mover. All of them seem to be different. An SD60 sounds like a slurred machine gun, while an SD70Ace sounds like a hydro-electric generator. A C39-8 sounds like an old out-of tune Harley compared to it's successor, the C40-8, even though their production is only separated by 3 years. So, even though we are aliasing the SD40 sounds for this locomotive, I've had to come up with Prime Mover sounds that are specific to the C39-8 to pull off a more believable unit in the game.

493. Just like we did for the cab, I'm going to start the external sounds by making a new sound blueprint and copying over the values from the default Kuju ES44 locomotive. It has all of the sounds that I need for this unit.

494. When I get to the values for the Prime Mover and Compressor sounds, I copy the same values from the ES44 but substitute my own sound files for these values.



495. I have no more custom sounds to fill in, so I finish filling in the sounds, curves, modifiers, instances, loops, and one-shots with default ES44 information. Save the file under the name you will use for your Audio Controller.

NOTE: Remember that just as the case was for the Cab sounds, we cannot export the path names for the sound files that we aliased to the Kuju ES44 because we do not have those files in our Source folder. After you export the locomotive, use the same method that we described for the Cab audio controller to copy the path and sound file names from the ES44 Proxyxml file to our Audio Controller.

496. Create a generic Sound Blueprint that will reference our Audio Controller.

497. And finally, reference the engine sound blueprint in the Children section of our Locomotive Blueprint.

498. I almost forgot - we need to make a Cab Occlusion blueprint. This blueprint is created in the Cab folder, and basically notches the sounds down just a little bit when you are playing from inside the cab.


499. In contrast to the Pain-In-The-Keaster sound blueprints and audio controllers, putting in particle effects from diesel exhaust is quite easy. RSC has already done the hard work on this, providing plenty of options for your diesel or steam smoke. The only problem is that we will have to alias it, so we won't be able to completely fill out the blueprint until after we have exported the locomotive.

500. In order to install the children that will come to be the projected locomotive headlights, the first thing we need to do is go back to 3DC and create a placeholder object to identify our different types of lights. This object doesn't have to be anything fancy or have any special textures or shaders. It just needs to be able to be referenced by our soon-to-be created spotlight blueprints and the Asset Editor. When you finish it, export it as an IGS file.


501. I'm also going to create a simple shape for a point light and export it. After export to your work folder, transfer the two shapes we just made and their texture file to a new folder to be created in the Source folder. In the "Default" folder, create another folder called "Lights". This is where the two shapes and texture goes.



502. In the blueprint, fill in the name sections, make the blueprint "exclude from browser list, and move down to the Geometry ID section. This is where the reference to the spotlight shape we just made goes.

503. The numbers that you see here are pretty generic for our light. You can play with this stuff to shape the light and give it whatever color you like. When you are finished, save the blueprint and preview it to see what effect you will get when it is placed on your locomotive. Export the blueprint when you are done previewing it and have made any adjustments you wish to make to the blueprint.


504. Create a new Point Light blueprint in the same way as the Spot Light BP was created. Use the round ball for the placeholder on this one.

505. For what the game calls "Taillights", I made a smaller version of the original spotlight shape and placed it in another SpotLight Blueprint with different parameters.



< PreviousIndexNext >


Published with permission from Jerry Conaway, 2012

No comments:

Post a Comment