Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

6. January 2012

 

 

 

Coming to Blender from other modelling packages, a few things are much less intuitive than you would expect.  I’ve been neglecting things from the art side of the fence for quite a while, so I am going to address that.  This post covers a couple handy tricks in Blender.  If you are a vet, these things will be “well duh!” items, but if you are new to Blender I think you will find them handy.

 

 

 

Insetting a polygon

 

This is a common enough task that is frankly rather irritating to accomplish in Blender.  An inset polygon can basically be though of as a polygon within a polygon, generally flush to the containing polygon.

 

Wow, that was a terrible description!  Lets use a picture instead.  This is an inset polygon:

 

imageimage

 

Here is how you create one.

 

Press Tab to enter Edit Mode

 

CTRL+Tab+3 for face mode

 

Select your face to inset

 

Hit E to extrude.  Immediately click the right mouse button.  You have now created a new face exactly over your existing face, with the exact same dimensions.

 

Now hit S to scale your face, and drag the mouse until it is inset as much as you would like.  Left click when complete.  And you are done.

 

 

 

 

Handy tip

One thing to be aware of when using the extrude tool, even if you hit escape or otherwise cancel, the face is still extruded!  Why? Beats the hell out of me, this seems like a really stupid thing to do, as it clutters up your mesh with overlapping vertices and edges you don’t need.  So if you are doing an extrude, after you cancel, make sure you undo it!


 

 

 

That’s not really an outrageous amount of work to inset a face, but it is enough to be annoying, especially for a task I do so commonly.  Thankfully, there is a plugin available to make your life easier!  I believe it started shipping in Blender 2.58, but I wouldn’t recommend quoting me on that!

 

 

Lets go ahead an enable that plugin now.

 

In the top menu select File –> User Preferences…

Select the Addons tab

Scroll down and locate Mesh: Inset Polygon, then enable it using the checkbox at the top right like this:

 

image

 

Now, if you want to keep this enabled permanently click Save as Default at the bottom left corner of the window:

image

 

Now there is an Inset Polygon tool available.

 

Back in Blender in the Mesh Tools sidebar ( press T if it isn’t currently visible ) you will now have a new option.

 

image

 

You will now be able to use the Inset command.  Once you click Inset, the below option will appear. 

 

Amount determines far inset the new polygon will be.

 

Height determines how far out the face will be raised.

 

 

You can inset multiple faces at the same time, but the results are “wonky”.  Which is to say, pretty much useless.

 

 

 

 

 

I find myself insetting quite often, in order to add details to my mesh, which leads to the next tip.  Creating a hole.  Consider a model like a gun, how exactly would you go creating the barrel of a gun?

 

 

 

Creating a hole in your mesh

 

 

So how exactly would you go about creating a hole like the barrel of a gun?

 

 

Well, start a new scene and inset just like we just covered:

 

image

 

Now hit the W key then select Subdivide from the menu that pops up.  This will subdivide the selected face into 4 sub-faces, like such:

image

 

For rounder edges, you can subdivide again.  Now we want to “round out” our square selection into a circle.  Hit the spacebar and type “Sphere” in the menu you want to select To Sphere:

 

image

 

Now move your mouse cursor to the right until your selection is rounded, like this:

 

image

 

Now press E to extrude and pull your new hole:

 

image

 

And now you have a rounded(ish) hole in your mesh!  For smoother corners, make more sub-divisions before you call To Sphere.

 

 

Straighten Vertices

 

Want to line up a number of vertices at once, here is how:

 

Select your vertices

image

 

Now there are a few ways of approach this.  First you can set a pivot to line up around.

 

To do so, hold down the . key and click where you want the pivot to be.  Such as this:

 

image

 

 

Now to move all the vertices to line up with the pivot point, you:

 

Press Scale, then the axis you want ( in this case red, or X ), then hit 0.

 

So, hit S then X then 0.  Finally left click to accept the changes.

And presto!

 

image

 

All the vertices line up along the selected axis.

 

You can do the same thing relative to the selected vertices.  In that case, select your vertices and be sure to move your pivot point back to either median or active element, using this option:

 

image

 

Now change the orientation to Normal:

 

image

 

 

So, if you chose Median Point and set Orientation to Normal, it will look like this now:

image

 

The axis on the widget determine which axis to align along.  Green is Y, red is X and blue is Z. 

 

Let's say you wanted to flatten along the z-axis.  Simply S(cale), Z then 0 and left click, and your results will be lines up along the Z axis. Like such:

 

image

Art

4. January 2012

 

 

 

Mobile development is certainly hot these days and as a result a number of mobile frameworks have popped up allowing you to target multiple devices with a single code base.  Problem is, it’s not just one or two frameworks we are talking about, more like 20 or 30, maybe even more!   Trying to pick the right one is a simply daunting task!  You need to factor a number of things in such as quality, features available,  price, languages supported and perhaps most important of all, the platforms supported.

 

 

 

Fortunately there is a tool that can greatly help.  This handy matrix at markus-falk.com breaks down many of the available mobile frameworks.  Down the left hand side are all of the various Frameworks, then across the top are the platforms they support, the languages you can program in, the features they support ( such as Accelerometer, Camera, etc.. ), as well as if it is freely available and if it is open source.

 

 

 

Snapshot of a portion of the matrix:

image 

 

 

 

 

He also provided a handy filtering tool, oddly named “Start Wizard”.  You can check off your criteria here and it will dynamically update the matrix to include only the frameworks that meet your criteria.  Here is the wizard in action:

 

 

image

 

 

 

Simply click the features you require, hit Find Framework and PRESTO!  a list of Frameworks compatible with your selection.   The list is by no means perfect.  First off, it is very iOS centric, but given that iOS is possibly the most popular OS for mobile development, I suppose this makes sense.   Perhaps most glaringly, it doesn’t tell you if the framework can target PC, Linux or Mac, which is a shame as that is a very important detail to many people ( myself included ).  Finally there are frameworks missing ( again, this goes back to the iOS centric aspect ), such as mobile web apps like Flash and Silverlight, or projects like MonoGame and ExEn.  Additionally all the C++ specific frameworks like SIO or Marmalade are absent as well.  I can understand why Flash and Silverlight would be left out, but then why was jQuery included?

 

 

 

 

Faults aside, this handy tool provides a wonderful starting point if you are looking for a cross platform mobile framework.  Even better, much of the results are populated programmatically, so the data should stay fairly relevant as time goes on.  Just be sure to keep in mind, other options exist!

 

 

 

So go ahead and check it out.

Cool Thing of the Week ,

31. December 2011

 

 

As the title says, the 9th part of our C++ game programming using SFML tutorial is now live. In this chapter we implement a caching solution for dealing with SFML game audio files. Along the way we learn a bit about C++ exception handling as well as touch on the subject of C++ templates. We also implement our second paddle and give it the most basic of artificial intelligence.

 

 

 

As the majority of this chapter is audio related, this image really isn’t all that impressive, but here is our current game in action.  We are very near to a complete game at this point and have covered most of the basics of C++!

 

 

pang9b

 

 

 

 

You can access part 9 by clicking here.  If you haven’t read any of the tutorial yet, you can access the table of contents here.  Again, any and all feedback appreciated.

Programming ,

29. December 2011

 

 

 

This week’s cool thing isn’t new, not even close in fact.  It is actually 3 years old and has a fewimage thousand alternatives, also freely available.  So then, why the hell am I show casing it?  Frankly because a) it’s damned good work b) programmers are always looking for alternatives to programmer art and this is the perfect source!

 

 

Without further ado, let me present to you a Free Airplane Sprite Pack (download link). Years ago, 2008 in fact, Gamedev user Prinz Eugn released a selection of hand painted airplane sprites for free use in this thread.  I mention it again because the links have recently been re-established.  The work is very good, much better than a lot of freely available sprite art and includes a number of angles and frames to work with.  Below is one such sample sprite sheet:

 

 

image

 

So, if you are looking at creating a 2D game and are looking for some artwork to start out with, this is a very good place to start.  It is a lot easier to keep yourself motivated when your game looks good.

 

Again, the download link.

 

 

EDIT: As was rightly pointed out in the comments, there is a condition on using the sprites.  If you use them in a released product, contact and credit the author.  I think you will agree this is a very small thing to ask.  For more details on the author, you can see more of his work here or you can ( or at least, could ) email him at prinz_eugn [@] hotmail.com.  Frankly, if you use his sprites even in a non-shipping project, I highly recommend you send him even just a quick "thanks man!" email.  In running this site I have received some of those and I can't begin to explain how nice they are to receive. 

 

 

 

 

 

Cool Thing of the Week

22. December 2011

 

 

 

I just received an email from Unity announcing the start of their 3.5 public beta.  Generally I wouldn’t get all that excited about a beta ( ok, that’s a lie, I love all things shiny and new! ), but this one is particularly big.

 

 

 

 

 

The biggest aspect of the new release is that much awaited deploy to Flash!  How much easier to deploy did Unity just become, considering the massive install base of Flash?  In addition to Flash, this release also adds the ability to deploy to NaCL ( Native Client ), Google Chrome’s new feature allowing native C++ in the browser.

 

 

 

On top of that, there is a new particle system “Shuriken” and perhaps even more exciting, a new built in pathfinding system, a much needed feature.  Re-written occlusion culling and built in LOD management, should both go a long way towards boosting performance, as will the now multi-threaded renderer.  Perhaps the best usability feature, is you can now multi select and edit items in the inspector! 

 

 

 

 

Full release notes available here.  I think it’s fairly safe to say this is the biggest new release in a very long time.  Good work Unity.  I don’t really have time for it, but I just can’t help myself at downloading this beta….  If you are like me and simply can’t resist the newest and greatest, go and download it now!  Amazingly enough, their servers seem to be coping quite well right now.

News

Month List

Popular Comments