The blog is being migrated and merged with multiple Imphenzia blogs so the format and content will be inconsistent for a while.

Astrofighter.Net - Update 13 October 2011

I'm tired now. It's 1:53AM and I only sleep about 4 hours per night. Too excited to go a sleep =)

It's now been roughly five weeks since I started with Astrofighter.Net and I estimate that I may have put in 150-200 hours during the five weeks. I've been off on paternity leave but that still requires a lot of work with a 1.5-year-old and a 2 month old, so it's mainly been when the kids have gone a sleep that I can work on the project, between 8pm and 2-3am.

I realize that I haven't made it easy for myself since I am, with this project, learning Unity, learning C#, learning network game development, and learning object oriented development all at once. The only object oriented development I have played around with before is BlitzMax, but I never really created anything with it.

Since my last update I've got a lot of development done. It's not so much game-play wise because I decided to ensure that I got a menu system and game state machine running so I don't bump into any troubles further down the line. To be more specific, this is what I've done the past 2 weeks:

  • Design a custom GUI for Unity to suit my space-look

  • Developed a menu system which scales to any screen resolution
    (still a lot of menu items to put in, but the menu framework is all there)

  • Developed Pilot account management with a PHP/MySQL backend so you can create and login to accounts seamlessly from within Astrofighter.Net

  • Account creation and session validation for Pilot accounts so a server can verify a token for the pilot in order to secure the integrity of statistics for pilots

  • Developed a Game State Manager that takes care of transitioning between scenes and game states, such as Menu --> Host Game --> Start Server --> Load Level --> Prepare For Match --> Play Match --> Show Results.
    The Server issues all the state changes and the clients follow.

  • Redesigned the class structures separating out a GameStateManager class (state management), GameManager class (player management), MatchManager (match management), etc.

  • Developed a flexible Settings class so game settings can be loaded / saved / accessed in the game and in the menu system

Today I also had a look at UnityPark uLink that are offering a nice scalable solution for networking in Unity. Ironically enough it does much of what I've put a lot of effort into developing in terms of account management and backend server communication. I may, or may not, decide to switch to uLink depending on findings down the road... but I may have to pre-purchase the uLink indie license because they have a limited deal on it until end of October.

Here's a video from today showing some of the menu GUI, player account management (with PHP/MySQL backend), and game state handler switching from menu, to "prepare", to "match":

Unity menu GUI in multiple resolutions

Today I've spent a lot of time trying to get a nice resizable menu for Astrofighter.Net and it's been a bit of a struggle so far.

My first approach was to use Matrix4x4.TRS to create a scalable 4:3 ratio menu GUI based on a coordinate system of 1600 x 1200. For wide screen resolutions I would simply add an offset to make sure the 4:3 menu system is always centered. It worked quite good in higher resolutions but as soon as a fairly mid-range to low resolution was used smaller fonts became pixelated and unreadable. How unfortunate because the matrix scaling was a one line solution.

I'm now working on my own approach. It basically still uses the 4:3 ratio menu with padding being added to the sides for widescreen resolutions. The difference is now that I recalculate the Rect positioning and width/height using my own function basically doing the same as the Matrix4x4.TRS scaling. The difference is that I now also manually set the font size using the same scale, but with an integer, so the font always looks crisp.

The status now is that I've got a nice resizable GUI with crisp fonts in any resolution. It's quite a bit of extra work but I think it's worth it.

If you are interested in the code - please let me know. I'll probably make it available in the Unity wiki or forums once I'm finished.

Unity 3.5 and Menu Flow

I've been occupied with fixing up my Yamaha WR250F for the upcoming race, Ränneslättsloppet, on Saturday:

  • New oil and oil filter

  • New air filter with NoToil air filter oil

  • Changed to the enduro tires I also used on Stångebroloppet in July (with new inner tubes)

  • Fitted the coolant reservoir again (engine it runs hot in races like these ones, three hours of slow movement isn't great for the engine that relies on fast flowing air through the radiator)

  • Fitted new hand guards

  • Removed the indicators and number license plate

  • Fitted the race numbers

Here's are some clips from the 2008 year edition of Ränneslättsloppet... Let's hope it isn't too wet this year =)

What about Astrofighter.Net then?

I've also been working on Astrofighter.Net during the past couple of days but most of my work has been shuffling around boxes in Visio to try to get the menu flow and GUI design in order. Even thought this is a fairly small game I want to make sure that the lobby screen, ship selection, hosting options, etc. is very easy to understand. I hope it's worth the time spent on getting it right =)

I'm also looking forward to Unity 3.5 which is scheduled to be released in late 2011. The conference "Unite 11" which is currently being held demonstrated some of the new features and I found quite a lot of useful information in this blog post.

Even though there are some really visually impressive features coming in Unity 3.5, I am looking forward to the new GUI / UI very much. I don't particularly like the limitations of the GUI in the current version of Unity and it would really make things easier if the new GUI Editor is available before I have to have a go at making the final menu system for Astrofighter.Net.

Apparently there is Subspace

Today I was also contacted through my ImphenziaGames YouTube-account by a couple of guys who play a game called Subspace.

I wasn't aware of this game although I now understand 1) it's been around for a long time, and 2) it's a 2D multiplayer space shooting game.

Both guys asked me whether Astrofighter.Net is influenced by Subspace and at the moment it isn't. In fact, there is no influence from any particular space shooting game and I have deliberately not researched any "competition" as I didn't want it to cloud my ideas for Astrofighter.Net.

Due to the nature of my game, and in comparison to Subspace, there will probably be less players on a server in Astrofighter.Net. I will, however, based on how much I can optimize the networking code allow for as many players as possible. My current goal is 16-32 players and since I use rigidbody physics (instead of simply moving objects using velocity and direction) the game uses a fair amount of bandwidth.

I now have most aspects of Astrofighter.Net sorted out in my mind so it's mainly a matter of making it happen. This is a one man show and I do the development, 2D graphics, 3D objects, textures, music, sound effects, and web development by my self so it'll take some time.

Feel free to contact me if you think there are "must-have" features in a game like this. I will consider any input I get, but be aware that I may not necessarily be able to (or want to) implement them =)

Menu flow of Astrofighter.Net

The importance of a flowing menu system

Today I prioritized looking at the menu flow of the game. If there was anything I learned from Beat Ball 2 it was that I shouldn't take for granted that a menu makes sense - especially with assumptions like "people will probably understand." Many won't.

The reason why the menu system in Beat Ball 2 is confusing is because I added features "on the go" without any proper thought to it. I've got a chance to get it right in Astrofighter.Net from the lessons learned before.

Flowchart the menu

I've created a flow chart today that contains all the menus: Main Menu, Find Game, Host Game, Options, Lobby, etc. For each screen and item in the menu I think very carefully about:

  • Does the flow between screens make perfect sense?

  • Are the options labeled correctly?

  • Is every screen absolutely necessary?

  • Is every option absolutely necessary?

I'm putting effort into this process now because how I continue with development of fundamental building block of the game and game states (menu, lobby, match, etc.) depends heavily upon the menu and game flow.

What bout the menu design?

The actual design of the menu is secondary in comparison to the flow. Of course, it's important with a visually pleasing menu, but it can't harm ease of use and navigation.

Even though I am focusing mainly of the menu flow rather than the actual design I made a proof of concept main menu screen. The idea is space oriented with high contrast where white text is always clickable and orange text is always a title of a menu / section. Menu navigation will be to the left and context and buttons will be to the right.

[caption id="attachment_447" align="aligncenter" width="620" caption="Astrofighter.Net Main Menu Draft"][/caption]

Free game but registration for statistics

As you can see in the main menu draft picture you can see a "pilot profile" which is essentially a player. First of all I will, most likely, make the game free for every to play. If a player wishes to record statistics (such as kills / deaths / weapon use / ranking etc.) the player will have to "Register" the pilot for a small fee. There will be a lot of communication and database handling to store all the information and hosting the service to enable the statistics feature costs money so I think it is only fair to charge a small amount to offer this functionality.

I am also putting a lot of effort and resources into Astrofighter.Net at the moment with some sacrifices such as lost social time and sleep =) For this reason it will also be required to be a registered pilot in order to pilot all the different ship types.

That's my idea anyway - but everyone will be able to enjoy the game whether you wish to register your pilot or not =)

Platform support

I'm developing this game with the Windows platform in mind but from what I understand it should be easy to compile the game for Mac OS X as well. And not only that, I read great news on the Unity3D web site that Playstation 3, Xbox 360, and Wii support is around the corner and unless Sony, Microsoft, and Nintendo make it very difficult for me to launch the game on their platforms it would be very cool to have it run on consoles as well as computers.

I don't plan to support Linux at the moment. Linux are for servers.

Added homing missiles to the array of weaponry

Just a quick update today - I've just added support from missiles with optional homing / seeking functionality to Astrofighter.Net. The homing feature will need some tweaking though, have a look at this video =)

I'm going continue with development for another couple of hours now.