As you might or might not know, I am one of the founders of BatCat Games, the important word about that sentence is games. The fact that we make games put a series of differences into our production that doesn’t generally affect non game software development cycles.

For a start art and animation are key in a game, so are visual effects. In build server terms, that generally means two things: It requires space(for content building) and quite probably a graphics card (for the visual effects). Our ideal solution would be to have a virtual machine per supported platform , but we found that none of the virtualization software (VirtualBox, VMWare, etc) virtualizes the graphics card reliably (if you found a way, please let me know)  so we are running our server on a non virtual machine.

The objective is to build the whole game, tools, etc. at each commit. There are a series of tools available in the market at the moment that allows you to do just that. For example: TeamCity, Jenkins, CruiseControl, Hudson.. etc. There is a good comparison matrix here.

We chose TeamCity, mostly because we know it, we find it easy to use and it is free.

Our setup

Our code is based around XNA and monoGame (recently on version 3).

We have many projects: a game and engine project, a tool, a library and the content builder. This means we have a diverse project output. For example, in the case of the content, we are not interested in the actual build results (yet) however we are interested in knowing that it did build, and to report errors if it didn’t.

The game and engine project reside in one solution and have many unit tests. We need the build server to not only build the project and after that run the unit and integration tests. Initially I set this up using psake (a tool that does the build with PowerShell) this is a great solution if you want to have a one click build, so I gave it a try, I found that setting up the tests assemblies was a manual process and that to get psake to talk to TeamCity nicely it would take more time that I had. So I tried running the build directly from TeamCity, and it was easier and I didn’t loose to much flexibility so, I had to go for that solution (however is a decision I will revisit shortly).

Capture

Setting up each of the steps took me approximately 10~20 minutes if done this way. There are a few things that I want to improve on, however the end result is that in a very short time I can have a new project building and reporting.

Some of the disadvantages of the process as it is are:

  1. If I want to change the build type I need to do it manually, in this case, the target test assemblies will need to be updated
  2. At the moment we are using dropbox as our way to distribute the builds, it is a process some members of our team really like because they just get the new binaries and they can choose when to update (so that there is no friction). I would prefer if the tools would just auto-update, but this is working for the moment.

Summary

As you can see the server setup is not perfect, there is loads to improve on, but setting this up from early on has proven very helpful. It allows us to have a one click build and a functional way to deliver our tools and product to the people in our team.

Note: This post was cross posted to gamasutra, Thanks to Kris  for her help.

Advertisements

I’ve been playing with mono for android the last few days. I have also tried it about 2 years ago. It was a good tool then, and it got much much better.

Getting started is pretty simple, you download the installer, install. It will install all prerequisites for you on your machine. Allegedly this failed the first time but worked the second time, I had a log to look at to give me some idea of the problem.

Once I got set up I started reading the documentation. Not only it was in place, but also, it was written to the right level (i.e. assumes you are a smart individual), I then moved on to pricing, 400 usd ouch, but I will come back to this. If you don’t activate the product  you can test on the emulator. It gives you some sort of idea of what the experience is like. The emulator is slow, and brittle, but that is something we should talk to Google about.

At this point I started going over some tutorials, using both monodevelop and VS just for the fun of it. The main thing I miss from VS when I’m in monodevelop is resharper Sad smile. I had no real troubles getting  on with creating a little app (a games reviews collector) .

I went ahead and bought the license, activated and pushed to the device and it is much faster than using the emulator.

One gotcha was that I wanted to write files and then be able to access them via USB, I kept getting a file permission error, I needed to set up the permission on the manifest file, it wasn’t obvious to me, but that is ok. All the information I needed was here.

Deployment to other devices is also pretty simple, you build the app on release mode and use the *-Signed.apk, there are other ways to deploy here.

Mostly the reason for this blog post is that I was a bit surprised with how good an experience it was (so far) .

Next I will be working with some eventually connected storage, I heard good things about Parse.

I gave myself a pomodoro to finish this post, so I’ll have to talk about pricing in tools some other time Smile.

Till the next time


So, after the last post, where I introduced Directory truncator, I present you some extra work I have just committed. My plans for it from the previous post where

  1. Logging and or console output so you know what happened, I couldn’t so far decide on what is the best approach or if I want to choose one, so I ll do that tomorrow .
  2. On error, proceed to the next file/folder.
  3. Have a StartsWith parameter(on both methods), so that it only deletes files or directory that start with
  4. Turn it into a service

So, this is what happened,

  1. After thinking a little bit about it, I just went for NLog, it does what I need it to do for the moment. Logs need no test, so I added a few log messages, there is probably some log messages missing.
  2. For this one, I ended up making a decision I’m still mulling over. I needed to test that if there is an error on file delete, the process will log and keep going. How to do that? well, I created a thin wrapper around the file system, as far as I could see it, there was no other way to simulate the scenario of you have two files to delete and one of them is deleted before we get to it. I have yet to do this for TruncateByDirectory.

This is all for today, and since this is probably the last post of the year. Merry New Year!!!


Recently I needed some code to truncate a directory of files or folders, for example I wanted to remove files or directories given a max number of files or directories. Polyhedral 'foam' by truncated octahedraThis is a common task when you have backups and you don’t want every single backup since forever, but you want to keep the last 5 ones. Another common scenario is when you have builds and you only probably want the last 10 (particularly if your build is used only by 4 people that seat across from you).

Anyhow, I have written similar code in the past and I know I will probably need something that does the same thing in the future, so I created a super small library and I put it on github.

I think the tests explain better what the code does than I do. So have a look.

There are a few things that I want to add to this project

  1. Logging and or console output so you know what happened, I couldnt so far decide on what is the best approach or if I want to choose one, so I ll do that tomorrow .
  2. On error, proceed to the next file/folder.
  3. Have a StartsWith parameter(on both methods), so that it only deletes files or directory that start with
  4. Turn it into a service

There are probably more things that could be done with it, but honestly, that is all I need.

Comments, questions or any feedback welcome!

Note: The image above is totally unrelated but I found it looking for truncated. What I found interesting about it is that the article this image relates to is about the Wearie-Phelan structure, this structure inspired the Beijing National Aquatics Centre and other cool stuff you can read here.

Happy holidays


I needed a psd content processor and found one here it is based on the EndoEngine. The one available depended on XNA 3.1,  I did some clean up on the project and made it available via my account on github.

We (at BatCat Games) are working on a Content hot loader that will be available open source soon (at the moment it doesn’t really work ) it will probably include this content processor.

The code comes with a sample game that displays a Photoshop file as a texture.


This is not a big one but it’s good to know.

I was spiking a little thing in a new XNA 4.0 game project and then attempting to include a png into the content folder, the file was there, I could see it (using show all files menu) but when using the context menu “Include in project” nothing was happening. Why?

Capture

First I thought maybe the file type is not supported, but PNGs are. Then someone pointed out, is this a project on a Reach Profile? textures larger than 2048 are not supported, this was a large sprite-sheet. So, I changed the profile of the project and I was able to Include the file. Smile

Happy Monday


A reading diary is my way to discuss with myself what I think about the book as I read it. It probably has errors of different kinds.

Some notes on the remaining of Chapter 1

  • F# intro, how its mostly functional but supports some OO features
  • How C# incorporates functional ideas.
  • Reading about declarative programming, these made no sense
    • Definition of declarative programming style. Logic without the details… mmm ok lets see how this goes
    • Functional means not only we can add new commands but also new structures
  • Code, finally a code example came about and it was all cleared up
  • Concurrency friendly application design, I was expecting the how but I got a birds eye. Patience
  • The section on how functional style shapes your code is cool, as it details how your code will (hopefully) slowly change. It highlights
    • the fact that OO design is still useful,
    • it helps simplifying some patterns
    • make the code more readable (this I m not so sure about, I’ve read code from people who started learning functional programming and on my view the code was less readable and harder to follow, particularly on tests)
  • Section 1.4 is all example based. Not mad about the fact they used WPF for one of them(not a fan), but no biggie, it gets the point across anyway . The author obviously wanted the reader to understand what declarative and imperative means and understand the difference
  • I can start to see how this style of programming could be really beneficial
  • Got as far as the recursion samples with C# (2.2.3)

 

That’s all for today. It’s been hard to find time to read up on this.