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


First week of "normal" work following my paternity leave is now in the past and I am enjoying a very welcome weekend.

Motocross practice at Uringe

Today I spent a few hours at Uringe, a great sand track south of Stockholm, where I tried to improve my motocross skills. It went fairly well with only one minor crash but plenty of fun. Bike collected some sand as you can see in the picture below - quite easy to clean with the pressure washer though....

Making Exlusive Music for Three Games

I've also recently had requests to create exclusive music for three different games. Two games for the mobile platform (Android + iPhone) and one game is aimed at computers and consoles.

Quite exciting because the music needed is of very different genres and it's a lot of fun to let the creativity take over and see where it leads.


As for Astrofighter.Net I've managed to make slight progress here as well. I've imported the low poly ship versions into Unity and I'm currently placing all the thruster and weapon mount points. Next will be texture mapping the ships and adding script code for the remaining weapon types.

The ships of Astrofighter.Net

Today was my first day back in my "normal" job as an IT Security Consultant and I'm coming back from a 7 month long paternity leave. It is with mixed emotions that I return because I've really enjoyed spending the time with my family and it has also enabled me to focus a lot on Imphenzia Music/Soundtrack/Games. But then again, you have to earn a living...

Anyway, I've finished creating the 8 types of spaceships to be featured in the game ranging from a light scout to a heavily armored and well equiped beast. The 7 weapon types I'm considering for the game is Blaster, Cannon (Gatling Gun), Plasma Gun, Rail Gun, Laser, Missile Launcher, and Mortar. Here is a preview video:

More prototype ships and weapons

Today I modeled the 8th spaceship and all the weapons. I created a low poly and a high poly version of each weapon so I can render "Normal" maps (bump maps) making the weapons appear to have a lot more polygons than they really do. I'll be doing the same for the spaceships as well.

Of course, the ships won't look like this in the game. These are just colored wireframe renders of all the prototype ships in low detail.

Top down view as they will be seen in the game (click for high res picture)

Here is a perspective view of the spaceships as well:

Finally, here is a detailed look at the weapons I created today:

Texturemapping these objects will take a lot longer than it took to model them. Each ship only took about 15-20 minutes each and the weapons took about the same amount of time. I can imagine it will take me a few hours to make the texture maps for each object though, ugh.

2:31am - I'm off.

Astrofighter.Net - low poly spaceships

Low Polygon Spaceships for Astrofighter.Net

Today I took a break from programming and decided to make some low polygon spaceships for the game. I don't have a lot of modelling experience but it's a lot of fun to let the imagination take over.  Here are the 7 ship models I've come up with so far:

When I create these models, I just start with a normal box, about 4x2x1 meters. Then I just extrude, extrude, extrude the faces in different directions to create the wings, the engines, the cockpit, and so forth. In addition to extruding I also move the vertices to create angles, but that's pretty much it. I use the "Symmetry" modifier in 3DS Max so I only have to model one side of the ship.

These models are very primitive, as you see, but for my top down view I think they will be quite sufficient. They will need texture mapping, normal mapping, and specular mapping as well which should make them quite decent.

I did 5 of these models tonight, the other 2 I created previously. A model of this low detail takes me around 15 minutes or so to create.

Off to bed now... I'll have to do some thinking as I'm considering two paths ahead for the game:

Should all the ships be quite similar in character but have small variations in terms of speed, armor, energy, weapon capabilities...

... or ...

Should the ships be very different in character making a defender ship slow and heavily armored with loads of weapons where as a scout is on the other end of the range being really light, fast, with low armor and weaker weapons...

Comments please - what do you think? =)

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.