Sunday 18 March 2012

The Rocket Launcher

Every shooter needs a BFG.  In this case it will probably be this rocket launcher.


That was the concept I drew a few weeks ago.  I've been thinking about it for years, on and off.

3D modelling, as I've mentioned before, takes a long time.  The time spent at the computer to turn that idea in to the the finished model ready to use in game has taken over 20 hours of work.


Where possible I want to use off the shelf models to save time.  I have managed to find plenty of sci-fi environments that will be ideal for my levels but there are no sci-fi weapon sets that match the style of the game I want.  In fact there are hardly any sci-fi weapon models at all and even less that are of low enough poly count to use in my game.

The above model has a few over 2900 faces.   I would have been happy with anything less than 4000 polygons but I like to keep everything to a minimum.  In my opinion the more important bit is the quality of the texture.

The time works out at about 6 hours modelling, 6 hours UV unwrapping and the rest of the time creating and applying the texture.  I mainly use GIMP for that with lots and lots of layers.  At the moment I'm using a 2048x2048 texture but if the Xbox 360 struggles with too many of those I'll drop it down to 1024x1024 before the game is released.


And There's More...

I managed to sort out some bugs on the next bit of code I'm looking at.  I want to be able to test multi-player without dealing with the networking troubles at the same time.  Therefore I need split screen.


The screenshots are all taken on the PC and I use an Xbox game pad connected via the wireless adaptor for one player and the keyboard for another.  I managed to sort out a bug which had been preventing it from displaying on the Xbox 360.  Now I know the concept works on both the PC and the Xbox I can sort out the other details.

On the Xbox 360 the names in the top right corners of each view show the GamerTag names.

Despite it not being anywhere near finished my wife and I still found it great fun on the Xbox to run round the level together shooting at each other and the alien.

It's starting to feel like a game rather than just a project.

Saturday 10 March 2012

3D Modelling Reminders - UV Unwrap

I spend most of my time writing XNA code so when I return to modelling I have to remember the best techniques from the last time I created a 3D model.

I am sure I have put a few other reminders on this blog but while I'm creating what I hope will become the rocket launcher for Diabolical: The Shooter I am going to write down a list of key points as reminders for next time.

This is not a tutorial it is a list mainly for my own benefit that may point others in a useful direction

I tend to use a trackball for modelling rather than a mouse.  I find it more precise.  I use a cordless Logitech one and reassign the middle mouse button to both of the extra keys on the mouse.  This makes moving about in Blender much more reliable as my thumb is used to push on the buttons.  Works for both mice and trackballs.

There are some design choices that I make that may not be applicable to everyone.  These models are used in game so draw performance is important.  To maximise that I am trying to produce the models with the minimum number of draw calls which means using the minimum number of separate texture files.  For nearly all models I want to only use one texture no larger than 1024x1024.  For some I might use 2048x2048 and for small objects I go as small as possible without spoiling the result.  512x512 or 256x256.

The basic list of things to do:

1.  Create each part of the model as a separate object in Blender.
This is helpful when UV Unwrapping the model to be able to do it in small chunks.

2.  Just before UV Unwrapping create a vertex group for each object which contains all the vertices for that object.
This is useful because at some point it is easier if all the objects are merged in to one mesh.  Having a vertex group for the previous separate parts makes minor adjustments easier.


3.  Carefully mark the seam for UV Unwrapping.
Think about how the 3D shape can unwrap to be flat with the minimum of stretches.  Remember how you want the material to flow and try to put the joins out of sight.


4.  Select the same uv texture as the other objects.
Typically each object reverts to new.  Just change the drop down in the UV Image Editor window.

5.  I tend to find I am working in edge select mode for uv unwrapping.


6. Use the basic UV Unwrap option from the Mesh menu.


7. I am rarely happy with the immediate result so change the options from the context menu.
This is where Blender's interface becomes a little confusing.  The required menu only appears AFTER the Unwrap function has been completed and it tends to appear hidden at the bottom of one of the side menu bars.
The first time I use it I have to open the properties window and scroll down until I find it.  From then on it is where I want it.


The default settings are likely to have produced a twisted result which may be better in some ways but which I find difficult to texture.


8.  Before doing anything else change the Unwrap Method to Conformal and see if the result is going to be easier to texture.
Sometimes it is and sometimes it isn't pick whichever looks best.


I've already written a separate post just on that bit:
http://blog.diabolicalgame.co.uk/2011/10/uv-unwrap-in-blender.html


9.  Resize the UV so that everything will fit on the texture without overlapping.
Difficult to do at this stage because you can only see the individual object.  Make a guess and later on merge all the objects in to one object so the UV map can be arranged properly.

I find swapping between keeping the UV map and edit mode in sync or not in sync is useful for manipulating the UV.


In UV Sync mode use 'L' in a 3D view window to selected linked sections of the model.  They will highlight in the UV edit window making them easy to find, scale and move about.



You can temporarily move stuff off the texture to keep it out of the way while you manually reposition maps to get the best fit.



Including typing this blog it has taken me nearly 6 hours to UV unwrap the model and manually lay that out on the texture.  That's it for now.  I need to get on with creating the texture image.