Category Archives: Tutorials

All my Tutorials can be found here.

S.W.A.P Tutorial: How To Host n Play

S.W.A.P Tutorial: How To Host n Play

I recently Made a short Video tutorial on how to host a S.W.A.P Server and play the game at the same time. You can watch it below:

For those who can’t watch a video here’s a text summary of the tutorial:

Due to an early design decisions the server is a dedicated server. To work around this so you can Play and Host at the same time on the same PC you need to: 
— Be using a PC that exceeds the recommended system specs. 
— Run the game in windowed mode, with Graphics Quality set to “Low”, at a resolution of 800×600. 
— Host a game and leave it running. 
— Run another instance of the game, this time select your desired quality settings and resolution, and run in full screen if desired. 
— Use this second instance to join the game. 

When hosting a server problems can arise due to any installed firewalls and/or you router. If others are having problems connecting to a server you are hosting check to make sure that you have allowed S.W.A.P. through your firewall and if necessary configured port forwarding on the router (by default S.W.A.P. uses port 8888). You can find further information on how to setup post forwarding for you specific router here. 

Advertisements

Using Version Control with Unity Free

With the recent release of Unity 4.2 the free edition has finally gotten the same version control features as the pro version (at least in regards to external version control, integration with the unity editor still requires Pro + a Team license). This post explains these what these features are, how they work and how to use them.

Anatomy of a Unity Project

Before I get into Unties version control features I’ll provide an overview the anatomy of a unity project.

  • Root: In addition to containing the folders described below the root directory of a unity project also contains the MonoDevelop/Visual Studio project/temp files. Unity generates these files for us automatically and so can generally be ignored by us.
  • Assets: The assets folder is where all your game assets are stored, including textures, materials, meshes, scripts, sounds, prefabs, scenes, etc.
  • ProjectSettings: This folder contains a series of text files corresponding to Unities project settings (Edit->Project Settings in the Editor).Library: contains metadata and cached data about the projects asset library. When you change the options of a game object or add a component in the inspector that information is stored here in binary format (at least in unities default configuration).
  • Temp: Used by unity to store Its temporary files. We can sadly ignore this directory. Continue reading Using Version Control with Unity Free

Lambdas: What are they and When to use them!

I’ve always know that Lambdas existed and had some idea as to what they were (inline functions right?); but I never really bothered to learn how to use them (and the few times I came across them i had no idea what I was looking at). It wasn’t until recently, while reading about the new c++11 features, that I finally came to understand what they are and how to use them.  With my more recent discovery that (unlike most new c++11 features) they can be used in Visual Studio 2010 I thought I’d share my new insight.

Because it took me a while to get my head around them I’ve tried to make this explanation as simple as possible so a relative newcomer to c++ can understand them. However I will point out that if you don’t know what function pointers are and how to use them your going to struggle with the lambdas.

Continue reading Lambdas: What are they and When to use them!

Tutorial: Multiple Windows with GLFW3 and GLEW MX

Introduction

I recently wrote a short demo program on how to setup a Multi-window Multi-context OpenGL demo using GLFW3. I thought I’d write a tutorial on how to setup this demo for yourself.

The tutorial is specific to MS Visual Studio 2012, however all the code and 3rd party libs are platform independent, so it shouldn’t be hard to port this to Mac/Linux.

The full source code is available here.

Update: Full source code for Visual Studio 2013 can be found here.

Background

GLFW3, the successor to the popular GLFW2 cross-platform window management framework is nearing release. Update: GLFW3 was release some time ago now. Among it’s new features is support for multiple windows (each with a separate OpenGL context). Seeing this i decided to give it a go.

The Goal is to draw the same scene to two different windows, giving each window a separate camera so they can see the scene from different angles.  for the demo we’ll use a simple rotating quad as the “scene”.

Using multiple windows involves solving several challenges, including:

  • Tracking which OpenGL Context is active.
  • Sharing Data between the different OpenGl Contexts (and therefor Window).
  • Being able to re-size each window individually and have the correct OpenGL Context update.
  • Closing windows at any time.

Continue reading Tutorial: Multiple Windows with GLFW3 and GLEW MX