When at a plane I usually get a lot of pain when the plane starts to descend. I never knew why, but now, thanks to my diving lessons I know what’s happening and how to act on it. The pain comes for the air pressure inside the ear. Just like when under water, the pressure change makes all the pain that we feel. What we need to do is to clear the amount of air, and new new air that will enter the ear will be at the correct pressure and it won’t hurt.

To do so, you’ll need to follow one of the several methods listed at wikipedia.

When someone reviews our product

November 10th, 2009

It’s great when someone that we don’t know reviews our project and makes a great review of it. The article really shows that the author took the time to properly play and learn the game, and he made a great analysis of it, concluding on the pros and cons of the game, which I agree:

Pros:

- Graphics-centered interface
- Simple yet very addictive battle system
- Very accommodating community.

Cons:

- Not joining the competitive battles takes out most of the fun
- Some game systems are too familiar and is better done by other browser games
- Moving and exploring takes a lot of time.

OpenSSL Love

November 2nd, 2009

Just got to an article that says everything I’d like to say about OpenSSL. It makes me think about the definition of software quality. At first sight, OpenSSL’s code seams a mess, but the point is: it’s one of the most used libraries out there, it works, it’s stable and it’s reliable. But using it is a major PITA.

Cross-platform .NET

November 2nd, 2009

I’ve had a lot of feedback on my running mono article. The majority of feedback was something like: .NET isn’t cross platform, Mono is evil, MS is evil. How can someone say to me that .NET isn’t cross platform when I have an average sized product running out of the box on MS .NET and Mono? I used to participate on a lot of discussions about this a couple of years ago. But then I realized that it was more productive to actually do something instead of discussing these kind of issues.

What makes a Java application cross-platform? Will a Java application be cross-platform if use reference resources like: c:\MyApp\MyApp.ini? And if we have a file named MyApp.ini and get it like getResource(”myapp.ini”)? And if we use specific operating system resources?

The same goes for .NET applications. If the developers are careful, it’s easy to have a cross-platform application. Having a desktop application is hard, that’s true. Microsoft made Windows Forms very Windows specific (using stuff like windows handles), and it’s hard for Mono to make a cross-platform Windows Forms implementation. But there are other alternatives, like GTK#. Even so, I realize that this issue is the least cross-platform of .NET.

But on a web/services scenario, Mono is as cross-platform as you can get.

Running Mono - an Overview

October 29th, 2009

We’ve been using Mono for the production server of Orion’s Belt for a couple of months now. On this article I’d like to share our experiences using Mono. We developed our project fully on Windows with Visual Studio 2005, and at a time we started to consider Mono for a production server. Do note that the Orion’s Belt team has a Windows background, and little experience administrating Linux machines.

Here are the web applications that we are serving with Mono:

Step 1 - Preparing the Server

The game is running on an Ubuntu server. We downloaded the source code and installed it manually. We could have used the packages, but that isn’t versatile enough. Packages aren’t always up to date and we find them hard to manage. For example, how could we have two versions of Mono installed and choose which  to run? How could we always have an up to date version? To fix this problem we chose to install by source, having as a guideline the Parallel Mono Environments article. This was great because we could change to use Mono from SVN or a specific version, just by changing some variables. We wouldn’t want to install a new version, getting problems, and having a bad time to rollback.

We use FastCGI with Nginx to serve the game. Nginx’s really cool, and very easy to configure and manage. We also installed MySQL. Not considering Mono, all the other necessary software was very easy to install and configure, with the help of Google of course. We managed to get the server displaying ASPX pages easily.

Step 2 - Running the Application

The Orion’s Belt project is fairly big, and after some months coding fully on Windows, the move to Linux was peaceful. We had some file case issues, but that was it. We have a NAnt script that creates a deploy package, and we were able to upload it to the mono server and run it. There were some problems at that time, sometimes Mono’s web server would throw compile errors while compiling ASPX pages. But fortunately, at that time, Mono implemented Precompiled ASP.NET web sites in Mono. We incorporated a step on NAnt to precompile the deploy package and everything was faster and we didn’t get those errors anymore.

Other problem we had was the mono web process and the resources it used. Going to 600-900Mb RAM and wasting a lot of CPU, even at idle time. So we started to kill the process from time to time. Sometimes the process would die unexpectedly, so we also started to use supervise, to supervise mono’s process.

There are also some other issues we got along the way: touching Web.config isn’t as stable as it should be. And also when we deployed new versions, mono would not behave properly, it would shutdown or just stop responding. So, we got used to just kill mono when we deployed or needed a reset. It’s very easy, you just kill mono’s process, and supervise will bring it up.

Supporting multi OS makes your code better

It may sound weird, but it’s true. We had a lot of bugs showing up only on mono. For example, we use NHibernate and everything worked fine on Windows, but on Linux sometimes it didn’t. We found out that we needed a flush here and there. On Windows it worked, but on Linux it wasn’t that permissive.

Using Mono brought an interesting mindset to the team. Every time there was a problem, we’d blame it on Mono. But the majority of times, it was our code that wasn’t up to it.

The Linux issues also made us create specific guidelines for file case, forced the use of Path.Combine and related methods. We also tried MoMa, the mono’s problem reporting tool, but we didn’t find it to be that useful on our situation.

Running the Tick

The game’s tick runs every ten minutes. It’s a very heavy process that loads a lot of data from the database, operates on it, and then persists it. This process needs a lot of RAM and CPU to run, and it’s a good performance test. On this specific process we find Mono to be very lacking. If running the process on Mono would take 60 seconds, running the same process on the windows development machine, connecting to the production database, would take 30 seconds. And the development machine is worst than the production server.

However, for the cost of a Windows license, we could buy a great machine just for tick processing. Would it be worth it? We don’t know at the moment.

Conclusion

Preparing the Mono environment was fun and interesting, and the issues we got from porting the code were minimal. We did need some help, and I find the mono list not that friendly to newcomers, but Google provided the help we needed. Even so, it’s not easy for developers without experience administrating Linux machines to prepare mono. There are always some issues here and there, that we’d know how to fix on Windows, but that we loose a lot of time figuring it out on Linux.

Although mono’s behaving nicely most of the times, we don’t find it as stable as a Windows machine. Even so, it’s a great option, that’s for sure. I already have a slicehost account with an ubuntu+mono running all my private ASP.NET sites. It’s cheaper and runs really well.

But for the production server for the game, we aren’t convinced yet if we should continue using mono or not. Maybe we’ll release another server using Windows and then we’ll have a good performance comparison showcase.




This one was a hard one to guess. But it's something like:

C#:
  1. DbConnection conn = Entities.Connection;
  2. DbCommand cmd = conn.CreateCommand();
  3.  
  4. string spname= "DoSomething";
  5. string entities = "Entities";
  6.  
  7. cmd.CommandType = CommandType.StoredProcedure;
  8. cmd.CommandText = string.Format("{0}.{1}", entities, spname);

You need to go to the edmx file, right click, add -> function. The tricky part on this was guessing the Entities.DoSomething name for the stored procedure. Nuno did the guessing part.

This works on MS SQL Server 2008, don't know if it's available on other version. If you want a full raw SQL export with data, go to the database options, Tasks -> Generate Scripts and on the Script Orions select Script Data.

World of Goo Birthday Results

October 20th, 2009

The guys at World of Goo have just released the results of their pay what you want for World of Goo campaign. I don't know if they are just developers or have a background in marketing. But one thing's for sure: they made a hell of a job promoting the game. And it's amazing how one year later they manage to sell so much of the game... again!

The method is very simple: allow anyone to buy the game for any amount. And it worked. And now, they released preliminary results and and charts about the sales. I guess this article will be mentioned on a lot of places, and that the sales for this promotion are far from over...

Google has no face

October 16th, 2009

I use a lot of Google products: the search engine, docs, gmail, picasa, analytics, chrome, etc, etc. And I'm satisfied. But a problem in picasa web albums that I'm having brought to my attention something interesting: google has no face. We can't contact google, we don't get feedback from google, nothing. I registered a bug, and I got no follow up from the google staff. Note that google doesn't even allow comments on their blogs. There's a completely blackout posture regarding the costumers.

This posture is understandable. I manage a small scale project and I know how much noise we can get. Google has a good approach on this (like so many other companies): it provides a forum for help topics and there are always senior users that answer the basic questions, leaving only the complex ones unhanded.

Although the lack of direct customer support, google products aren't known for their bugs. So I guess they have strict error handling policies and statistics and they focus on that. No one answered me, but I guess all that internal server errors I'm getting, are being monitored by someone and will be fixed in time.

Even so, it's interesting that a company that focus so much on making collaborative and communication tools, doesn't communicate with their user base.  Guess they don't need it. I remember I once switched banking services exactly to have better customer care. I didn't care that the new bank was smaller and weaker, because that meant that the bank would value me much more as a client. And that was what I wanted.

It seams that as companies start to grow, they loose interest on pleasing every customer. Why would they, they have so many of them. While small companies have a strong focus on the customer, because they need all the customers they can get, and can't afford to loose any.

Sins of a Solar Empire

October 12th, 2009

The other day I played with a friend of mine Sins of a Solar Empire. Sins is a great 4X RTS sci-fi game. We like a lot of games like Civilization, but the new Civs are so slow on modern machines. This Sins was a great surprise, nice graphics, great gameplay, lots of fun. Later I searched for the game's site and I found out that the game was elected as the Game of The Year on several important sites such as IGN or GameSpy, winning against games like Fallout 3 on some sites.

This is really interesting. The game is pretty, but not that pretty. Here we have a game that won because of a great game design. This should be a lesson to a lot of game development companies out there.