Author Topic: Tutorial: Prefabs for Blockade Runner!  (Read 7818 times)

Micah

  • BR Developer
  • 3D Artist
  • *****
  • Posts: 141
Tutorial: Prefabs for Blockade Runner!
« on: April 23, 2012, 11:39:48 pm »
We've gotten some requests to make a tutorial on how to import a custom prefab (object) into Blockade Runner, and as I started writing this tutorial last night, Blockade Runner modder Keptin had already made a video series detailing not only how to import a prefab into Blockade Runner, but also how to model and texture it as well.

My thoughts: "Thanks Keptin! Now I don't have to make a written version." I was almost done with it though and decided it'd be good to have both versions.

So check out Keptin's video tutorial here (and here for part 2) or read the tutorial below to find out how you can add your own custom object to Blockade Runner!

This tutorial involves the following:
- 3D Studio Max (Blender and Wings 3D are not supported for direct import into Blockade Runner in 0.55.1, but will be included with 0.55.2)
- Photoshop CS4
- nVidia DDS Plugin

You can alternatively use:

Free Modelling Software:
- Blender(click here to see export settings)
- Wings3D (click here to see export settings)

Free Texture Editors
- Gimp

Free DDS Converters
- DDS Converter 2.1
- DDS Plugin for Gimp
- Aorta(untested with Blockade Runner)
- (any application that can export to "DXT3 | 8bit alpha" should work)

THE BEGINNING

For this tutorial we're going to add this new laser gun.



We'll start by making sure that the object is in the correct position in the 3d modeler.



For Blockade Runner to position the object correctly we'll need to position it in positive space.  Relative to the grid center it would be above (positive Z), to the right (positive X), and away (positive Y).

Now we want the laser gun to take a total of 3 voxel spaces in Blockade Runner.  Make sure you set the unit scale in 3dsmax to be units instead of meters, as each unit in 3dsmax is a centimeter inside Blockade Runner! (100 centimeters=1 voxel)

To make sure the object is within the space we want we'll change the grid spacing to 100 units (Grid & Snap Settings > Home Grid).

Now we can scale the object to whatever voxel size we want, in this case one voxel wide, one voxel tall, and three voxels long or 100 x 100 x 300 3D Max units.




The top and bottom flange do go past our intended space but I want the object to be stackable and small enough to put in small spaces so we'll leave it alone.




ADDING THE FILES TO BLOCKADE RUNNER

Next, we'll go to the folder ../Blockade Runner/Content/Prefabs and create an all new folder. We'll name it something related to the object that's easy to remember (we have to refer to it in a minute), in this case we'll name the new folder "lasergun".


Now we'll export our model as an .obj into our new lasergun folder, and make sure we name it "model.obj". (Blockade Runner uses just the folders to differentiate between the prefabs so the object doesn't need a specific name besides "model.obj")

Next we'll get the model's texture set up. Make a new texture in a texture editing software, and make sure it is exactly 256x256.  Save the texture as a DDS. The format needs to be "DXT3    ARGB      8 bpp | explicit alpha" and must include mipmaps.  Save the texture in our lasergun folder as "texture-diffuse.dds"

<- Test texture

We'll follow the same steps to get the object's normal map, saving in the same folder, and naming it "texture-special".



Now that we've got our Model and texture finished we can move onto actually adding the prefab into Blockade Runner!


LET BLOCKADE RUNNER KNOW IT EXISTS!

Blockade Runner automatically detects how many voxel spaces our object will take unless we give is specific instructions. Our Laser Gun object will automatically take up a 3x1x3 voxel space because of the top and bottom flange in this case.



We want it to take up 1x1x3 however, so to make sure Blockade Runner knows what size we want our laser gun to be, we'll use a settings.xml. Go back to ..BlockadeRunner/Content/Prefabs and go into the "TV" folder. Copy the settings.xml there and paste it into the lasergun folder.



Open the settings.xml using notpad. The <size> section is where we instruct Blockade Runner what voxel dimensions our Laser Gun prefab is. Under Width=" we'll put in 1, under Height=" we'll put 1, and under Length=" we'll put in 3. Now the model will take up a 1x1x3 area in Blockade Runner. Success!



Finally, we'll add the prefab into BR. Go to BlockadeRunner/Content/Data and open the Solids.xml with notepad

The Solids.xml is responsible for all of Blockade Runner's type of blocks and prefabs (with the exception of frame), each line under <Solids> represents a voxel block or object and its name, description, model path, and things of that nature.



Copy the bottom most line within the <Solids> category, then paste it at the end of the list (before </solids>) Now that we have a copy of a prefab's properties all we need to do is change the model directory, description and name.

The name at the start of the line is what will display in game, so here we'll rename it to "LASER_GUN" (without the quotes). The underscore translates to a space in-game.

Next we'll skip to the end of the lasergun's property line to change where it is getting its model from. We're looking for is Modelpath="", not to be confused with TexturePath="" which is already "texture" (which is what we named our textures).

The Modelpath="" is already directed to ../BlockadeRunner/Content/Prefabs and just needs the final directory of where the model is. So we'll put the name of our Laser Gun's folder into the quotes, it should read ModelPath="lasergun".

To make sure we can actually find our Laser Gun after we add it to Blockade Runner we'll go to the Category="" section of the line (near the middle). We'll rename it to the appropriate weapons category, Category="W_Weapons".

Now we'll give it a new description, find the DescLong="". This is what we'll see when we hover over the weapon in-game. We'll keep it short and just insert "It's a laser gun." into the quotes.

We could also change the mass and other options but this will do for now.

Now we're all set to see it in-game. Save the solids.xml and enter Blockade Runner.

Now when we go to the Offensive category, then to the weapons sub-category we can see our brand new laser gun prefab.

Kind of looks like a fish. :)

There we are, all done!

And be sure to check out Keptin's video tutorial!
Part 1
Part 2
« Last Edit: April 28, 2012, 01:35:01 pm by Aaron »
"Could any man alive resist a fresh banana?"

keptin

  • Founder
  • *
  • Posts: 17
Re: Modelling Prefabs for Blockade Runner!
« Reply #1 on: April 24, 2012, 05:54:36 am »
Thanks for the plugs and the tut; the more tuts the better, I always say!

mamastoast

  • Founder
  • *
  • Posts: 1010
Re: Modelling Prefabs for Blockade Runner!
« Reply #2 on: April 25, 2012, 07:38:54 pm »
Been testing importing random models I had lying around into BR, and it seems rather easily done. However this .DDS format is simply annoying. I don't have photoshop so I have to rely on GIMP. This means I have to get this plugin, however nowhere is it explained how on earth I'm supposed to install said plugin, the .exe files keeps claiming GIMP is not installed, and the readme is in freakin french :/.

Aaron

  • BR Developer
  • Creative Director, ZanMgt
  • *****
  • Posts: 2018
  • Available on the IRC from 9:00am to 5:00pm (EST)
    • http://www.zanmgt.com
Re: Modelling Prefabs for Blockade Runner!
« Reply #3 on: April 25, 2012, 07:52:34 pm »
Try DDS Converter 2.1 and just convert .PNGs to .DXT3's.  Make sure mipmaps are enabled!
Stop by the IRC and say Hi! -- Online Dev Chat

MrVorgra

  • Founder
  • *
  • Posts: 1401
  • RAWR!
Re: Modelling Prefabs for Blockade Runner!
« Reply #4 on: April 26, 2012, 04:02:38 am »
google translate will help you  8)
Real Men drive vehicles without knowing how fast they are moving or how much fuel remains in the tank.

mamastoast

  • Founder
  • *
  • Posts: 1010
Re: Modelling Prefabs for Blockade Runner!
« Reply #5 on: April 26, 2012, 10:12:51 am »
no :P it wouldnt, it said to put it somewhere, sadly the french word describing where didn't translate ^^

Bladecatcher

  • Founder
  • *
  • Posts: 459
Re: Modelling Prefabs for Blockade Runner!
« Reply #6 on: April 27, 2012, 12:50:36 am »
Been testing importing random models I had lying around into BR, and it seems rather easily done. However this .DDS format is simply annoying. I don't have photoshop so I have to rely on GIMP. This means I have to get this plugin, however nowhere is it explained how on earth I'm supposed to install said plugin, the .exe files keeps claiming GIMP is not installed, and the readme is in freakin french :/.

I did this http://en.wikibooks.org/wiki/GIMP/Installing_Plugins and it seemed to work. However, I'm having trouble with the prefab I made. I followed the steps in the tut, and the prefab actually seems to be in the game; i can select it, place it, and it's solid, but invisible. I've tied using my own test texture and a texture form another prefab, but I always get the same result. I'm using Blender to make the model and GIMP for the texture.

I should probably mention that i just dl'd Blender yesterday and have no idea what I'm doing, so it very well may be a noob problem... :-\

Aaron

  • BR Developer
  • Creative Director, ZanMgt
  • *****
  • Posts: 2018
  • Available on the IRC from 9:00am to 5:00pm (EST)
    • http://www.zanmgt.com
Re: Modelling Prefabs for Blockade Runner!
« Reply #7 on: April 27, 2012, 02:33:51 am »
Been testing importing random models I had lying around into BR, and it seems rather easily done. However this .DDS format is simply annoying. I don't have photoshop so I have to rely on GIMP. This means I have to get this plugin, however nowhere is it explained how on earth I'm supposed to install said plugin, the .exe files keeps claiming GIMP is not installed, and the readme is in freakin french :/.

I did this http://en.wikibooks.org/wiki/GIMP/Installing_Plugins and it seemed to work. However, I'm having trouble with the prefab I made. I followed the steps in the tut, and the prefab actually seems to be in the game; i can select it, place it, and it's solid, but invisible. I've tied using my own test texture and a texture form another prefab, but I always get the same result. I'm using Blender to make the model and GIMP for the texture.

I should probably mention that i just dl'd Blender yesterday and have no idea what I'm doing, so it very well may be a noob problem... :-\

Did you follow the Blender Export settings?
Stop by the IRC and say Hi! -- Online Dev Chat

Bladecatcher

  • Founder
  • *
  • Posts: 459
Re: Modelling Prefabs for Blockade Runner!
« Reply #8 on: April 27, 2012, 03:23:32 am »
It worked! YAAY! And now that I can actually see what I've been working on, I can start to figure this crap out!

And let me just say that, at least for me, the User Manual for Blender is absolutely useless. It tells me what everything does in great detail, but it doesn't actually tell me how to do anything. It's like teaching someone how to drive a car by telling them what every little part inside the engine does.

Anyway, thank you SO much! Now, on to Youtube for video tuts and/or my community college's incomprehensible website to see how much a 3D modelling class is!

Aaron

  • BR Developer
  • Creative Director, ZanMgt
  • *****
  • Posts: 2018
  • Available on the IRC from 9:00am to 5:00pm (EST)
    • http://www.zanmgt.com
Re: Modelling Prefabs for Blockade Runner!
« Reply #9 on: April 27, 2012, 10:12:35 am »
YouTube tutorials would probably be better than the documentation at this point.  ::)
Stop by the IRC and say Hi! -- Online Dev Chat

Bladecatcher

  • Founder
  • *
  • Posts: 459
Re: Tutorial: Prefabs for Blockade Runner!
« Reply #10 on: May 01, 2012, 08:19:09 pm »
I've been trying to make a small prefab wing in Blender, but I'm having a weird problem with it. For some reason, it won't mirror to the opposite side of the ship. I can get it positioned perfectly on the left side of my ship, but when I go to put it on the right, it refuses to flip the 180 degrees. Even if I hold down the RMB and the green preview lines up the way I need it to, once I release it, it will flip in the opposite direction so that it is orientated the same way as the wing on the opposite side. Oddly enough, I can place the wing on the bottom of the ship and it will mirror just fine on the top. I've tried using it with Symmetry mode on and off- same result each time.

I'm not sure if it's a problem with Blender, BR, or if I'm just stoopid.

MrVorgra

  • Founder
  • *
  • Posts: 1401
  • RAWR!
Re: Tutorial: Prefabs for Blockade Runner!
« Reply #11 on: May 01, 2012, 08:33:24 pm »
try another entity
Real Men drive vehicles without knowing how fast they are moving or how much fuel remains in the tank.

Micah

  • BR Developer
  • 3D Artist
  • *****
  • Posts: 141
Re: Tutorial: Prefabs for Blockade Runner!
« Reply #12 on: May 03, 2012, 01:32:15 pm »
I've been trying to make a small prefab wing in Blender, but I'm having a weird problem with it. For some reason, it won't mirror to the opposite side of the ship. I can get it positioned perfectly on the left side of my ship, but when I go to put it on the right, it refuses to flip the 180 degrees. Even if I hold down the RMB and the green preview lines up the way I need it to, once I release it, it will flip in the opposite direction so that it is orientated the same way as the wing on the opposite side. Oddly enough, I can place the wing on the bottom of the ship and it will mirror just fine on the top. I've tried using it with Symmetry mode on and off- same result each time.

I'm not sure if it's a problem with Blender, BR, or if I'm just stoopid.

Hmm, that's definately a new one. We don't have symmetrical placement with prefabs yet, but I haven't heard about the object not rotating even when you place it without symmetry.

We'll look into it.
"Could any man alive resist a fresh banana?"

Bladecatcher

  • Founder
  • *
  • Posts: 459
Re: Tutorial: Prefabs for Blockade Runner!
« Reply #13 on: May 03, 2012, 02:57:53 pm »
I think I've fixed it. It seems that I had it placed wrong in Blender. It was placed within the positives, with the leading point of the wing (the forward most part of the wing when placed on the ship) facing up (Z axis) and the outside edge facing forward (Y axis). I re-positioned it so that it lays flat and the leading point faces forward along the Y axis, as it would when placed on the ship, and sits in the negative on the Y axis. 

Micah

  • BR Developer
  • 3D Artist
  • *****
  • Posts: 141
Re: Tutorial: Prefabs for Blockade Runner!
« Reply #14 on: May 04, 2012, 10:09:36 am »
I think I've fixed it. It seems that I had it placed wrong in Blender. It was placed within the positives, with the leading point of the wing (the forward most part of the wing when placed on the ship) facing up (Z axis) and the outside edge facing forward (Y axis). I re-positioned it so that it lays flat and the leading point faces forward along the Y axis, as it would when placed on the ship, and sits in the negative on the Y axis.

Awesome! :D
"Could any man alive resist a fresh banana?"