Noble Master Games
Noble Master Games
Navigation
Categories:

Search:

Meta:

Archives:
Dev. Blog
Forums
 

Noble Master Developer's Blog

April 9, 2010

Animated Units for Age of Conquest III

Filed under: Development — noblemaster @ 10:42

Age of Conquest III will get a graphics overhaul. The goal is to add graphical depictions of armies as well as structures to give it a more game-like look & feel. The fortification display (currently checker board) will be replaced with an actual wall. The units will be displayed using actual icons of soldiers. Attacks as well as defenses will animated.

Small armies will be depicted with one soldier icon, larger armies using more:

  • Unit Size 1-999: 1 soldier icon
  • Unit Size 1000-3999: 2 soldier icons
  • Unit Size 4000-9999: 3 soldier icons
  • Unit Size 10000-19999: 4 soldier icons
  • Unit Size 20000+: 5 soldier icons

Attack animation for a large army (5 soldier icons):

The graphics production is financed by Android sales.

April 7, 2010

Downtime Detection /w Automated Restart

Filed under: Development — noblemaster @ 15:51

In order to prevent a future downtime, the next server release will contain code to monitor itself. A separate thread will poll the server every 30 seconds. If the server does not respond for 7 consequitive times, the server will be considered down and automatically restarted.

Possible reasons for a downtime include: running out of memory, database going down, loosing the connection to the database, file handles exhausted, other crashes and errors.

Although the code will not catch all server problems and will not be able to restart the server in all cases, it will still be able to take care of at least some of the cases listed above. The server monitor will be better than having nothing in place at all.

Java code to restart a computer:

String os = System.getProperty("os.name").toLowerCase();
boolean windows = os.indexOf( "win" ) >= 0;
Runtime runtime = Runtime.getRuntime();
if (windows) {
   // for windows
   runtime.exec("cmd /c shutdown -r -t 0");
}
else {
   // for Linux and Mac OS X
   runtime.exec("/sbin/shutdown -r now");
}

April 6, 2010

The Business of Running a Game Server

Filed under: Development — noblemaster @ 09:39

Business should be replaced by “woes”; the woes of running a game server. Given my estimates, it takes about 4x as much time to implement and run an online game compared to a single player game. Costs (=time investments)  include implementing a server, implementing client-server communication, setting up a server and database. An online game needs social networking tools to facilitate player-to-player communication including chat system, rankings and ratings, private messaging, clan system and game creating/management amongst others. An online server requires constant monitoring and maintenance. It needs to be backup’ed every so often. There is also a huge income difference between single player sales and multiplayer subscriptions (on Android) which make me wonder if running an online game is really worth the time? I could probably make about 10x more money in ¼ of the time implementing a new single player game as compared to running and maintaining a game server.

Generally, if the server is up & running, no one will notice. The opposite is true when the server goes down. There were some problems with the new server (Age of Conquest V3) where the game server would not startup after a computer restart. It appears, the database connection pool would be locked. Everything that wasn’t database related would still work (e.g. server socket).  It would only occur every tenth time or so, which made it difficult to track. I believe the problem was related to the Bitronix transaction manager which would not properly startup but go into a deadlock situation. Multiple threads would try to access the transaction manager at startup preventing it from fully initializing. The transaction manager is now force-initialized before everything else preventing it from going into a deadlock. Things worked fine so far; keeping my fingers crossed!

The latest is a “Too many open files” error that happened yesterday. It appears the server was running out of file handles preventing it to respond to anyone connecting. A file handle under Linux can be an actual file handle but also includes socket connections as well. From the looks of things, it appears the file handle limit was set too low at 1024. I upped the limit to 65535 handles which should hopefully do the trick?

« Newer Posts