How To: Open the same Unity project twice

When making my first networked game in Unity, I found a way to keep two copies of the same project open at once. Unity will usually only open the same project one time. In a networked application, this means that you either have to build the client or server application, then run as the other side within Unity. Not only is this a hassle, but you can only debug one side of the program at a time.

Being able to have the same project open with two Unity windows allowed me to develop much faster.

The key to having the project open twice is to have two project directories that point to the same source files. A Unity project has three sub-directories: Assets, Library and ProjectSettings. Everything the developer creates goes in Assets and Unity controls the other two directories. So, to have two Unity windows into the same project, you have to create two project directories that share the same Assets directory.

I did this in Windows 10 with Unity 5.3. I’d expect this to work for Windows 7+ and Unity 5.x.

  1. Create your project in Unity. Get everything setup the way you want it. Exit Unity.
  2. Copy the whole project directory: Use the GUI -OR- xcopy /e/h Game GameCopy
  3. Delete the Assets sub-dir In the new project directory: Use the GUI -OR- del /s GameCopy/Assets
  4. Link the original Asset directory to the new directory: (in an elevated command prompt) mklink /j GameCopy/Assets Game/Assets

Now you can bring up one Unit window on the Game project and another on the GameCopy project. Any asset changes (code, scenes, graphics, audio, prefab, etc) that you make in one Unity window will show up in the other Unity. The only thing that isn’t shared are project settings.

Remember that you don’t actually have two copies of your assets. Any changes/additions/deletions in one directory are done to both!

In Linux/Mac, I’d try a soft link first and see if that works. If that fails, make a hard link.

Terra Mystica

I’ve completed a touch table conversion of the board game Terra Mystica. In this game, players lead a faction in a race to terraform and settle the map. Each faction is unique with different costs for building, abilities and desires for terrain type. These differences along with random bonus tiles makes every game different without any luck or hidden information.

FullBoard

Continue reading “Terra Mystica”

Muck

Late last year I finished a real-time game for the touch table that I called “Muck”. It is an economic game for two to six players that plays in a half hour. The game is modeled off the board game Brass. I’ve considered converting Brass directly, but it only plays four people, it has hidden information and we really aren’t playing it much anymore.

Muck

Continue reading “Muck”

Touch Table Caverna

I’ve finished converting Caverna for the touch table and PC. This was the second game that I’ve made using the Unity engine. It is also my first Unity game that used touch for input and it is probably the largest game that I’ve ever converted. Space was very tight and I spent a lot of time laying out the graphics:

Caverna is a game for one to seven players by Uwe Rosenberg. It is a worker placement game where you manage the farm and cave dwelling for a family of dwarfs. The game is similar to Agricola where the occupations and improvements are replaced with rooms which are available to everyone and there is a new expedition mechanic.

The game is a lot of fun to play, but it takes 30-45 minutes per player and there are lots of pieces to move around. My goal for this conversion was to speed up the play time as much as possible. I’m also hoping that the single player is as much fun as the single player version of Le Havre.

Continue reading “Touch Table Caverna”

Microsoft Windows Text-to-Speech for Unity

*EDIT 7/15/2019* I’m updating this post with my latest code and to remove the dependency on UniExtensions

I’ve made a wrapper around the Windows-only Microsoft Speech API for use in Unity. The Microsoft Speech API is a Windows COM capability that first appeared in windows Vista. It is an easy way to get text to speech in a windows application.

This post will go through the steps of making the C++ DLL and the C# behavior for Unity. If you don’t care about the “how” and just want to use the plugin skip to the end for the download and usage instructions.

Continue reading “Microsoft Windows Text-to-Speech for Unity”

Mongoose for Unity

Mongoose is a C library for embedding a simple web server in another application. We used Mongoose for all of our web-enabled Torque games and I wanted to be able to continue using it for new games in Unity.

There is an existing extension called UniWeb which provides a web server in unity, but their code doesn’t support web sockets. I’ve just built Mongoose in windows, but it is Linux and Mac compatible as well. However, it wont support any of the mobile platforms.

This post will describe the steps for building Mongoose 5.6 as a windows native DLL, then wrapping it for use in C#, and finally including it in a Unity project.

Continue reading “Mongoose for Unity”