Unity Progress
Iām now fully committed to the Spaceteam rebuild.
Itās a big investment in the future of all my games and the sooner it happens the better. Iāve been wasting too much time tracking down obscure bugs which will soon become irrelevant, so Iāve stopped development on the 1.8 branch until the new version (2.0) is ready.
Sorry to everyone currently experiencing crashes, youāll have to wait a bit longer for a fix. Thanks for your patience!
In the end I decided to go with Unity 5 and Iām really enjoying it so far.

The UI system makes it easy to scale and anchor elements so they work at different screen sizes. This was a pain to get right before and annoying to test, so the new system is a pleasure to use.
The Particle system is powerful enough that I can directly recreate most of the effects I was using.Ā I can now use Animations for some sequences I was previously doing in code.
There are handy built-in features like Serialization and JSON parsing that I get for free.
And I love being able to easily make custom visualizers and editors that work right in the Editor.
Here are some more notes on how Iām using Unity:
Project Setup
- Iām using C# for the CaptainsMess networking portion and Javascript for the game code. But Iām considering moving everything to C# so I can get full debugger support (Iām assuming you canāt do source-level debugging in Javascript?).
- I useĀ Sublime Text 3Ā on the Mac as my script editor, but Iām also looking at Visual Studio CodeĀ which has some nice integration features and debugger support. VSCode also works much better with C# than with Javascript.
- Iām trying to use plugins from the Asset Store as much as I can. These are the ones that have sparked my interest so far:
- I2 Localization. I have 12 languages to support!
- xARM. Useful for testing multiple screen resolutions on different devices (iPhone 4, iPhone 6, iPad, Android tablet, etc)
- Google Sheets for Unity (GSFU). Handy for getting simple data tables into the game, like level progression.
- TexturePacker Importer. I already use TexturePacker to make sprite atlases for the Cocos2d version so I assume it will help here as well, although Unity has some built-in sprite packing so maybe I wonāt need it.
- Editor Console Pro. Search, filters, and colours for the debug console.
- VSCode. Integration for the VSCode editor.
- PlayMaker. I had heard good things about this tool so I wanted to check it out. I like being able to create state diagrams that not only provide a high-level view of the game logic but are also functional. I still havenāt decided whether Iāll use it in production.

Networking
- At first I looked at the Photon framework but it turned out not to be a good fit for Spaceteam. Most of their services are online rather than local and if I want to use their Redistributable Server license it seems Iād have to pay for every 500 users, which is totally untenable for my needs.
- My current plan is to just use the built-in Unity Networking. I donāt have to pay for it and it covers most of what I need already, so the CaptainsMess libraryĀ may end up being a relatively thin wrapper around it.
- The main classes Iām using are part of the High-Level API:Ā NetworkManager and NetworkDiscovery
- The NetworkManager class can start a server or client but has no discovery
- The NetworkDiscovery class can broadcast and listen for other devices but has no server/client code
- For the initial connection Iām also usingĀ NetworkLobbyManager and NetworkLobbyPlayer
- These classes already track āslotā (ie. player index) and āreadyā state so I donāt have to
- The main thing Iāll have to add is the ability to search for games as a server and client at the same time. The current system only supports one NetworkManager object so Iāll have to work around this with some lower-level code.
- This networking system seems to be quite new and Iāve encountered a few weird bugs and idiosyncrasies but theyāre pretty minor so far.
- Luckily, Unity has made the source code available which makes it much easier to debug and modify:Ā https://bitbucket.org/Unity-Technologies/networking
General Tips
-
Remember to set āPlaymode Tintā in Editor prefs so you donāt lose changes you make in Play Mode!
-
Donāt name Prefabs the same as Instances!
-
If youāre doing things with a networked Player object remember to check isLocalPlayer to avoid redundancy and confusion.
-
Changing a child object name after animating its properties breaks the connection and marks it āMissingā.
-
Reference for mixing C# and Javascript:
http://docs.unity3d.com/412/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html
-
Extend data classes from System.Object if you want them to be inspectable in the Editor (add [Serializable] in C#)
-
You canāt define generics in JS, but you can use them (with dot before brackets: List.
instead of List ) -
Use builtin array[] in Javascript instead of ArrayĀ if you want to see the items in an inspector.
I know that a bunch of you already know Unity so maybe you can help me answer some questions that I have.
My Questions
- Can I rearrange folders in Assets or should all extensions/plugins live at the root level? Iād like to put packages I download from the Asset Store into a subfolder but whenever I update something it wants to import it at the root level.
- Any tips for using the Animation Controller system as a regular state machine with transitions triggered in code? (eg. for abstract game states like Lobby, Setup, Intermission, Playing, etc). And if I do this should I be using āTriggerā parameters or just go directly to the state with Play(āStateNameā)?
- If I have a bunch of unique objects (eg. UI screens like Title Screen, Credits Screen, etc.) should they all exist in the scene and get Activated/Deactivated as needed? Or should they only exist as prefabs and get Spawned when needed?
- How do you ādiffā scene files in source control (I use Git) to find out what changed? Iāve found some methods for saving them as textĀ and plugins that claim to solve the problem but it seems like it could be error-prone. What do you recommend?
- Is there an advantage to separating things into Scene files if your game has very little content like mine? Will it be ok to have everything in one scene?
Iām officially on holiday now but Iām looking forward to continuing the project when I get back.
Thanks for listening and Happy Holidays!