A small RPG company
Arcade Machine

My son's cub scout den built an arcade machine. The internals were an old computer. The television for graphics and sound were donated. The machine was shown off at the Blue and Gold dinner and we intended to use it for recruiting.

Given that we wanted two player simultaneous games. That way we can have more people actively playing than a solo game. Ideally the game should allow someone else to jump in when someone dies so we don't have to wait for the other player to die. As a community service organization, we wanted cooperative games if possible and open source. Everything needed to be controlled by keyboard keys as that is what the X-Arcade controls pretended to be.

Unfortunately games with these qualities proved hard to find. Multi-player games often focused on network play. Playing on the couch with friends was sadly neglected by open source game developers. Super Tux Kart fit most of the features. It proved to be a little intimidating to start with a plethora of options but once they are playing the game everyone loved it.

Ostrich Riders

As maintainer of Ostrich Riders, I wanted to bring the game to the arcade machine. The first problem was that full screen didn't fill the screen properly. The program needed specify the view used in the game.

Unfortunately the game still had some problems on the arcade machine. When you beat the high score, you entered your name with the keyboard. You could technically enter a name since one of the buttons mapped to the enter key but it was unlikely someone using the arcade machine would know that. An arcade mode was added to the game which did not track high scores. A more permanent solution will require using the joystick to enter your name.

This was sufficient to make the game playable but it didn't allow the next player to jump right in when someone dies. In the arcade mode, I modified the game to always treat it as 2-player but the second player may not be alive. I added support for the 1-player and 2-player buttons which would add the player back in if they were dead.

The last change removed some menu items. Like many games, Ostrich Riders had an options menu which allowed you remap the buttons. A malicious user could change the flap button or map left and right to buttons instead of the joystick. Removing the option prevented potential abuse of the system.

Shippy 1984

For the Blue and Gold only Super Tux Kart and Ostrich Riders were available. I continued to look for a space shoot-em-up like Space Invaders or Galaxian. Fedora had a few games like that in the distributions. The one I found the most fun to play was Shippy 1984. The game is not the prettiest but the game play was excellent. It did however have multiple problems with running on the arcade machine.

Perhaps the biggest problem was that the game didn't support two players. But first I had to find the source code. The source code was included in Fedora's source rpms but the original web site was gone. I eventually found Ryan Broomfield's website. It had a newer version of the game but the program had lost SDL support and switched exclusively to Allegro 5. He had a common collection of routines he included in his games. Those routines required lua to compile even though Shippy 1984 didn't use lua.

Given the state of the code, I decided to start with the code used in Fedora. Even with that the code was not in great shape. I used indent to reformat the code so that it was more readable. The code was largely kept to a single file. Only allegro and SDL code were separated. The game had many weird decisions. The player had health attribute which was higher than one but a single hit killed the player. When you died the health attribute would be set to a negative value and incremented over time until it reached zero and then it would start the level again if you had more lives. Evaluating the current state of the game required checking multiple variables.

First setup involved converting Shippy 1984 to SDL2. The older version of SDL didn't stretch the image to cover the whole display when running in full screen. As mentioned the graphics code was mostly isolated from the rest of the code. It didn't take a lot of modifications to get that up and running.

Shippy 1984 used the movement controls to enter initials but that was a separate state after the game ended. To support two players, one player should be able to enter initials while the game continued. All game objects are stored in a single big array. Some fields like "special" have different meaning depending on the object. For players it stored if the player recently fired. As that only used one bit I was able to store if the player was entering their initials or was already done.

A lot of the work to add a second player involved determining what was player data. Data like score and when to get extra lives were stored in global variables and needed to be changed to arrays. There were lots of little bugs because something was missed. For example the game limited you to three shots at a time which was not expanded to be per player initially. Some refactoring was done to make the game state more understandable.

Deciphering the codebase of Shippy 1984 was more time consuming and difficult than Ostrich Riders. There is still a lot of cleanup which could be done but the game ran well on the arcade machine. Hopefully I will find more game which work on the machine without modifications.

Comments

No comments yet.




(optional, e-mail address only visible by admins)

Last modified: 2019-08-21, 17:48

© 2009-2019 Identical Games

powered by phpSQLiteCMS