Using Git

Posted by hibes on

Git is a version control system that has quickly become very nearly the industry standard for keeping track of code changes over time.

Because of the complexity of the Git workflow, I highly recommend only interacting with Git via the command line (either git bash, cmder, or cygwin).  It really helps to understand what each action you’re performing will do.  You will likely get into a mess or two along the way, but there is always a way out.  Feel free to reach out if you get stuck.


My first choice is Cmder.  It is pretty comprehensive as far as terminal emulators go.  When you’re downloading cmder (from here), be sure to Download Full so that you get git bash and other tools with your install.

It just downloads a zip file that you can extract wherever.  I’d recommend creating C:\cmder and extracting it there.

Once you launch it, check out the settings by right clicking on the title bar and clicking Settings.

A couple options I’d change:

  • Startup->Specified named task->{bash::bash as Admin}
  • Keys & Macro — Filter on duplicate active — set hotkeys or memorize existing
  • Keys & Macro — Filter on splitter — set hotkeys or memorize existing
  • Keys & Macro->Paste — make sure multi-lines is enabled for both Ctrl+V and Shift+Insert

Git bash

Git bash is a more minimalist option, it basically just installs a terminal emulator hooked up with git and almost nothing else.  It looks like it installs a GUI now, too.  It should be pretty straight forward to install.


If you don’t know what you’re doing, I’d steer clear of Cygwin, though it’s pretty impressively powerful.


Setting up Dev Tools

Posted by hibes on

This is part 1 of the series.  In part 2, we’ll cover more setup like CodeMaid.

There are a few things that I like to knock out right after launching Visual Studio for the first time.

The tabs vs spaces debate is useful, but not really in the scope of what I’m trying to accomplish here.  So I’ll just point out where you change it, and say that lately, I’ve preferred tabs since everyone can choose their tab size (the number of spaces for a single level of indentation) that way.  These instructions are intended to provide a starting point for setting up to work on the MMORPG project.

Changing Tab Size:

  1. Open Tools->Options
  2. Expand Text Editor
  3. Expand All Languages
  4. Click Tabs
  5. Select Indenting->Smart
  6. Set Tab size to your preferred size (I prefer 2, but 4 seems to be most common)
  7. Set Indent size to the same size
  8. Click on the radio button next to Keep tabs

Enabling Line Numbers

  1. Open Tools->Options
  2. Expand Text Editor
  3. Click on All Languages
  4. Click the checkbox next to Line numbers until it shows a check mark

Curly Braces

Curly braces can also be a point of contention, but my preference is to _always_ put the curly brace on the same line, rather than waste all that screen real estate on a newline between a definition, and the implementation below.

public void Start() {
 // Do stuff

// Same line above vs new line below

public void Start()
 // Do stuff
  1. Open Tools->Options
  2. Expand Text Editor
  3. Expand C# (Can’t control for all languages, so we’ll only modify C# since that’s all we’ll use.)
  4. Expand Code Style
  5. Expand Formatting
  6. Click on New Lines
  7. Uncheck every single box except the last 3

Cast spacing

I prefer casts to have a space between the new datatype and the existing variable or data for optimal readability.

int y = (int) x;

// Space above vs no space below

int y = (int)x;
  1. Open Tools->Options
  2. Expand Text Editor
  3. Expand C# (Can’t control for all languages, so we’ll only modify C# since that’s all we’ll use.)
  4. Expand Code Style
  5. Expand Formatting
  6. Click on Spacing
  7. Scroll down to “Set other spacing options” and check the box labeled “Insert space after cast”

Unix (LF) Line Endings

  1. Navigate to: http://www.grebulon.com/software/stripem.php#download
  2. Download Add-in only – installer for VS 2017 (thanks to Damien Clark), Source code (thanks to Sylvain Doremus)
  3. Close Visual Studio
  4. Run the *vsix file
  5. Reopen Visual Studio
  6. Tools->Strip’em
  7. Select Unix (LF)
  8. Click OK

Add Visual Studio Components

  1. Find the Visual Studio Installer (press and release the Windows key, then search for Visual Studio Installer by just typing)
  2. Left click on the installer in order to open it
  3. After it loads, click Modify (if it’s not available, click update first, then click modify)
  4. Click .NET Desktop Development
  5. Click Individual Components
  6. Find NuGet Package Manager in the list, check the box
  7. Find Testing tools core features, check the box
  8. Follow on screen instructions to finish modifying
  9. Close the installer

Add Zeromq, Newtonsoft Json, and MySQL.Data

For additional info, maybe try http://www.what-could-possibly-go-wrong.com/unity-and-nuget/

  1. In Unity, ensure that Edit->Project Settings->Player->Api Compatibility Level is .NET 4.6 and Scripting Runtime Version is Experimental (.NET 4.6 Equivalent)
  2. In Visual Studio, Click Tools->NuGet PackageManager->Manage NuGet…
  3. Click Browse
  4. Search netmq
  5. Click NetMQ by NetMQ
  6. Check the top project
  7. Click Install
  8. Click Ok
  9. Search Newtonsoft
  10. Click Newtonsoft.Json by James Newton-King
  11. Check the top project
  12. Click install
  13. Click Ok
  14. Search MySql.Data
  15. Click MySql.Data by Oracle
  16. Check the top project
  17. Click install
  18. Click Ok
  19. In Unity’s Asset folder, delete all lib subfolders except ones named amd64 or net45/net40

Build the Utilities subproject

  1. Browse to the folder where the Unity project is stored
  2. Open Utilities/Utilities.sln
  3. Click Build->Build Solution

I’ll keep this updated as I modify other settings in the editor.


Beam Attack Using Spellcasting Gestures

Posted by hibes on

In many video games involving spellcasting, your character uses gestures for different spells.  I thought it would be neat to implement gesture based spellcasting with the HTC Vive controllers.  You can see my first implementation here.  I’ll put together another video shortly with the latest event driven implementation, which is much more generic so that it will work with many other ideas for gestures.

In order to cast this beam attack, I drew from Dragonball Z for inspiration.  If you put your controllers down by your waist as Goku does when casting his Kamehameha attack, then click, then move the controller out in front of you and click again, you will shoot out the beam.


Cops vs Orcs

Posted by hibes on

Cops vs Orcs was a game that Robert Britt and I worked on starting in October 2015.  We completed development around May 2016 and released the game on the iOS and Android app stores shortly afterwards.

In CvO, you play a cop running and jumping endlessly from platform to platform shooting donuts at orcs.  We had several additional features in mind including powerups, additional cosmetics, etc., but we quickly determined that the ad supported model wasn’t going to work for us unless we were to gain huge numbers of subscribers in the first couple months.  All in all, developing this game was an incredible learning experience, and it was the first solo projects I had ever seen through to completion.