Simple Mod Tutorial - Part One - Model Prep

Simple Mod Tutorial - Part One - Model Prep

Resources to get you going on your new project, or to help you over some emergent problems during your development cycle.

Moderator: Moderators

User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Simple Mod Tutorial - Part One - Model Prep

Post by Pressure Line »

Part One, Model Preparation.

Requirements:
Unit creation tank model, available here
Wings 3D, Available here
Upspring, available here
DXTBmp, available here

Alright, we have made a tank model, uvmapped it and textured it. What do we do now?

Image

1) The first step is to separate the parts out, we need to do this so we can animate things like the turret turning and the barrel elevating. Select the entire model in object mode, enter the RMB menu and hit separate.

Image

2) Now we are going to recombine the pieces that dont need to move independantly. Still in object mode select the track objects and the main hull of the tank. Using the RMB menu, combine these objects.

Image

3) We need to rename the objects to make things easier for us later on. In the Geometry Graph window, RMB on the name of the piece you want to rename and select the Rename Option. **VERY IMPORTANT** you must name your pieces with all lower case letters, or this will cause trouble with the script.

Image

4) Our model is ready to be exported out of Wings and into UpSpring. From the File menu go into the Export submenu and hit the ? next to the 3D Studio option. Ensure your options are set as below, and hit OK. Save your model in a convienient location. (I use a folder on my desktop)

Image
Image

5) Keep wings open for now, but minimise it if you are running out of screen space. Its time to fire up Upspring. From the File menu, select the Load option, find and load your model (dont forget to switch it to be looking for 3ds files) When the dialog box appears asking you "There is more than one mesh in this model, what do you want to do?" select the second option "load all objects as childs of an empty root object"

Image
Image
Last edited by Pressure Line on 26 Apr 2009, 10:10, edited 4 times in total.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

6) Now its time to set up our object hierarchy. First we need to swap the empty object UpSpring made for us with the base of our tank. To do this we select the object called 'base' and the one called '**whatever**.3ds' and hit the swap button.

Image

Now we just need to rename the piece we swapped to something useful like 'flare.' Now cut the flare object and paste it into the barrel. Do the same with the barrel and the turret. Now we have our hierarchy set up, but if we try to animate it now it will look very strange.

7) Object origins. These are the points the pieces of our model rotate around, as well as helping to set their default positions. Remeber how i told you to keep Wings open? Well now we need to bring Wings back up and see where certain parts of the model are. First part we need to find is the end of the barrel, which should be at co-ordinates 0,18,18 (x,y,z). With the flare object selected, and the 'Only move origin' checkbox selected move the flare to the end of the barrel, and move it a small amount (0.25) in front of the barrel end. Repeat the same procedure for the barrel and turret. **HINT** start at the end of the hierarchy and move down the list, its much easier this way.

Image

To help, i will provide you with the co-ordinates for each piece, but its a good thing to practice getting them from Wings unless you have a very good eye to get the origins in the right position. The barrel should have its origin at 0,18,5, the turret at 0,18,0, and the base at 0,5,0.

8) Now we need to set up the model radius and height. these define the unit's hitsphere and where the healthbar sits respectively. Go to the 'Model' tab. For now we are going to leave the centre alone, and move straight to the Radius value. But before we do we want to be able to see the size of the sphere in relation to the model, to do this click on the 'YZ' box in the side-on view of the tank and select the 'Draw radius and height' option, I also like to do the same for the 3D view. Now hit the 'Estimate button below the Radius text box.

As you can see its huge, far too big for our little tank. A value of 16 suits the size of the unit much more, but now its far too low! so we go back to the Model Centre boxes and fiddle with the values. Its ok left/right and front/back, we just need to move it up a bit, 5 units or so will do.

now we need to set the height so the unit and healthbars etc will display correctly. Checking back in Wings we see the top of the turret is 22 units high, i like to add a little padding to the height value, so lets set it to 22.5. We now have a big yellow line extending to just above the top of the turret.

Image

Its time to save our model as an s3o. File, Save model as. save it as whatever you want, but with no spaces in the name, and you MUST add the .s3o extension onto the end.

9) Ok, we are done with Upspring for now. Minimise or close it, we can also close Wings. Its now time to prepare our texture for use in Spring. To do this we need to add an alpha channel to the texture, or it will just turn out 100% teamcolour. Open up your texture and save it as a greyscale bitmap. Colour everything that you do not want teamcoloured black, everything you want teamcoloured colour in shades of grey, the lighter the colour the more teamcolour it will have. I am just going to use 100% teamcolour, which is white on our new texture.

Now we open up DXTBmp. This is a nice easy program that lets you easily add an alpha channel, as well as convert to different filetypes and set mip levels (but lets not worry about that for now k?)

Load our main texture file. In the 'Alpha Channel' pane on the right, click the little picture of a folder with an arrow coming out. this lets us select the bitmap we just made as our alpha channel. Load it in, now our texture is ready to save, for the sake of simplicity save it with the same filename as our s3o, so in my case unittutorialtank. In the DXTBmp file menu choose Save AS, and select the "Targa with Alpha" option. Close DXTBmp and re-open Upspring.

Image

10) In UpSpring's 'Mapping' tab, browse for your 'Texture 1' file and open it. Under the 'Texture Mapping' menu, select 'Show UV Mapping.' In the UV Mapping View go to the 'Edit' menu and select the 'Flip UVs' option. The tank will now look a little strange, but better it looks strange in UpSpring than in game right?

Image
Image

Under the Object menu, head into the 'Recalculate Vertex Normals 3DO Style' submenu. Select the All Objects option. This sets up the unit for SPring's shading. For now lets just use an angle of 0, so each of the faces will be shaded separately, we wouldnt usually do this on a spring model, but this model is so blocky it isnt going to make a difference.

Image

Save the model, and congratulations, you have prepared a model to be used in a Spring game :D

**edit** oops, left out some info for step 7 x:
Last edited by Pressure Line on 11 Dec 2007, 08:13, edited 2 times in total.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

Additional Notes: If you have trouple loading the textures from the .wings file, the texture .tga, and alpha .bmp can be downloaded here
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

If you are using Photoshop you might consider using NVIDIA's DDS plugin as it saves the DXTbmp step and the UVs don't have to be flipped. But be sure to reduce everything to the background layer, it either stores actual alpha channels or layer transparency and using the former is adviced.
If you don't like the lossy DXT compression it can be turned off by the way, I'm using RGBA DDS myself atm.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Post by Pressure Line »

Cheers rattle! I don't know anything about PS, im a Gimp user myself.
yosemite
Posts: 49
Joined: 08 Aug 2007, 21:26

Re: Simple Mod Tutorial - Part One

Post by yosemite »

hey pressure line, i loaded my model but i don't know how i set the hierarchy from here, do i need to add empty to the base of my model?
Image


Is the base of the model the immobile part? if so it's the line named immobile part in the screenshot. ANd do i have to copy paste all the parts under base?


Also what the heck is flare?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: Simple Mod Tutorial - Part One

Post by rattle »

Would you mind posting in the right threads like the WIP thread or go make your own?
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Simple Mod Tutorial - Part One

Post by Hoi »

yosemite wrote:hey pressure line, i loaded my model but i don't know how i set the hierarchy from here, do i need to add empty to the base of my model?
Image


Is the base of the model the immobile part? if so it's the line named immobile part in the screenshot. ANd do i have to copy paste all the parts under base?


Also what the heck is flare?
flare is the point your unit will fire, base is the inmobile part, i know he wrote this a few months ago, but im just saying this so everyone that doesnt know it will understand it now
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: Simple Mod Tutorial - Part One

Post by KaiserJ »

i'm assuming that the next step then is to get some BOS scripts going on... any tutorials that can be linked to this thread?
User avatar
speedy55555
Posts: 4
Joined: 03 Oct 2008, 06:38

Re: Simple Mod Tutorial - Part One

Post by speedy55555 »

My browser can't find the upspring link you posted. :o :shock: :( Could you please fix it? :?:
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: Simple Mod Tutorial - Part One

Post by KingRaptor »

Note that in engine versions 0.82 and up, normals broken in Upspring due to resizing are automatically fixed by the engine (as long as the transformation was equal along all axes), so you don't need to worry about resizing stuff in Upspring no more.
Last edited by KingRaptor on 23 Dec 2010, 06:34, edited 1 time in total.
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Simple Mod Tutorial - Part One

Post by SpliFF »

Thanks for the tutorial.

It's missing a step though. You have to save your final UV map texture(s) to the unittextures/ folder in your mod or Spring will crash.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Simple Mod Tutorial - Part One

Post by Pressure Line »

That is/was to be included later, in a 'game/mod file structure' tutorial. Which would be part 4 (if it would really be needed?), after scripting (part 2) and the unit.tdf/.lua etc (part 3)
ironized
Posts: 172
Joined: 25 Jun 2007, 06:33

Re: Simple Mod Tutorial - Part One

Post by ironized »

hey pressure line, probably don't remember me.

any way, what are the chances of the scripting tutorial coming out any time soon?
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Simple Mod Tutorial - Part One

Post by Pressure Line »

That depends on how motivated I am feeling at any given moment. I have recently been made redundant (although curiously it is essential that I do my job and do it well...) so my motivation is hovering around absolute zero, so it could be a while.

As to the remembering thing... I have a photographic memory, I dont forget much (I do forget details, but can recall general info that lets me find the details) so yeah, I remember the name, but not anything about you :)
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

Re: Simple Mod Tutorial - Part One - Model Prep

Post by wilbefast »

Hi there - thanks for making this tutorial: it was really helpful!

I'm wondering if there's a part 2: I have my model team-coloured, with origins and hierarchies and, well, it's ready for... something. Not entirely sure what I do now...
User avatar
prankster
Posts: 62
Joined: 31 Oct 2009, 12:35

Re: Simple Mod Tutorial - Part One - Model Prep

Post by prankster »

Simple Mod Tutorial
thought this are games and not mods for the spring engine, aren't they?
kalda341
Posts: 101
Joined: 19 Nov 2010, 09:44

Re: Simple Mod Tutorial - Part One - Model Prep

Post by kalda341 »

This is the best tutorial so far. When is the part 2 coming?
Post Reply

Return to “Game Development Tutorials & Resources”