Archive for August, 2013

26
Aug
13

VegaStrike

Controls

Controls

Vega Strike is an open world space exploration, trading and combat simulator much like the classic games Elite and Elite Frontier. I originally played the 0.43 release many years ago and I thoroughly enjoyed playing it, although that version had some annoying properties such as other vessels appearing out of no where! Fortunately since then the development community has been very active and the recent releases have fixed many bugs and added new content to the game.

The Basic Cockpit

The Basic Cockpit

The game is rendered in 3d using OpenGL acceleration. It supports many different levels of detail and shaders as well as an older rendering engine for those of us with older hardware. Most modern systems shouldn’t have any trouble getting a decent frame-rate, but on older machines it could be slow if not configured properly. Fortunately even some on board graphics and Atom based systems have been tested and have been able to run the game.

Approaching a Fighter Barracks

Approaching a Fighter Barracks

The artwork in the game is of decent quality and has been gradually replacing the older graphics from earlier releases. Additionally many new ships and other features have been added to the engine that have improved the visuals. There are however some visual aspects that could use work such as the vessel cockpits.

The sound and music in game are also quite nice, especially the music. A good professional job has been done for the most part, it just requires a bit of polish to bring everything up to the same standard.

Relay Station

Relay Station

The game is as I said inspired by the classic games Elite and it’s sequels which is reflected in the game play. You start out with a basic trading ship and some money which you can buy some cargo. So you have to start out as a trader in order to make enough money to buy a more capable ship. You can buy upgrades to make your starting ship a bit better in combat, but it’s really only sufficient to fend off pirates.

Asteroid Mining Station

Asteroid Mining Station

Eventually you’ll be able to buy a larger ship or fighter for combat duties. You’ll be able to buy a larger freighter if you want to move more or larger goods, but the downside is that the ship often is slow to maneuver and takes some time to accelerate. In buying a combat vessel you’ll be significantly faster, but won’t be able to carry much in the way of cargo. There are capital ships that are much larger, but they are extremely expensive and difficult to find.

Unfortunately there are many ships that can’t be purchased, and there are many weapons what seem unbalanced or difficult to use effectively. I’ve found the best kind of weapons to use currently are the beam weapons with auto-tracking in the mount. The development team seems to be aware of this, and it seems to be a result of many changes to the engine since 0.43 and the many new ships/weapons that have been added since.

Planets

Planets

Vega Strike being as unfinished and under development as it is, needs to be polished and balanced before reaching its full potential. Even so I’ve been playing it for some time and still found it to be quite fun. I’ve managed to accumulate a nice small fleet of ships including freighters and combat vessels, but have quite some way to go before I can take on a bigger combat job. Once you find a few lucrative trading runs, and get a basic combat ship flying you can take on any role you like within the limitations of your ships.

I’d recommend people use the latest release of the game that they can, or if you have the capability use the development version (available from subversion). This is so you can keep up with the latest data set updates and engine updates as there are constant improvements. It’s available on both Windows and Linux, I’m unsure as to whether it will work on other systems such as BSD or Mac OS.

20
Aug
13

Android and Singleton Classes

Recently in my Android programming escapades I found something interesting and bothersome in an API I had written. I had created a singleton class for the main renderer of my graphics API. With the first app I was making I had no problem, and it in fact was quite helpful and easy to write, after all each app using this API would only have access to one renderer.

The problem arose out of some strangeness with the Android VM. It turns out that static fields of a class can but not necessarily cross from one app to another, effectively sharing one singleton across more than one activity. This might not sound too bad but it can be a problem if you use an API in multiple apps and they happen to run on the same device. This can result in undesirable effects.

So I removed the singleton property from the renderer object, and thus had to pass it around in method parameters like a cheap whore. It’s not an ideal solution but it worked, and if you believe some people on the internet it’s probably a better design. Whilst there was minimal impact on the API, an app I was writing needed to be hacked a little to make it work properly. The funny thing is if there was a separate JVM or classloader for every instance of all apps it would have been fine to have the renderer as a singleton and it would work.

So why are singletons a problem on Android? It seems that there is a single JVM running all the Android apps together. This means that static variables (including singleton classes) can end up hanging around long after an activity ends. If a class is shared with another app they can end up using the same singleton class. The other half of the problem is the Android OS will sometimes destroy an app or use a different class loader for a new activity thus making the static/singleton unreliable for any kind of storage or communications across activities or apps.

So it’s best to avoid the use of singletons on Android.

There seems to have been some debate about singletons and their use. Whilst it is true that many programmers over use the pattern and they can be a problem, they do have a place in a developers toolbox. There are common interfaces such as OpenGL and others which cannot be accessed in an easily nice OO way.

OpenGL in particular is a good example, it is not thread safe and basically requires all rendering be done in a single thread. It also is not Object oriented and as such there is only one instance of it per application at best. Because of its nature it is essentially an interface to the hardware acceleration of a machine, which is better suited to a singleton/procedural style interface.

The thing with OO design is it isn’t suited 100% to all programming problems. There are in fact many instances where using an OO design is a bad idea, such as embedded systems and applications that require high performance. The trouble is all the OO loveliness comes at a performance and memory size cost, that luckily isn’t a problem for most applications. This leads to the situation where something OO needs to interface to something that isn’t, this is where singletons are a useful construct.

Something my Dad always said is “a bad tradesmen blames the tools”. It seems there are many people out there blaming the singleton as if it is at fault for being used incorrectly. Sure there may be many cases of people using it poorly, but that just means they are poor designers/coders. The singleton pattern is just a tool, used appropriately it can make your coding life easier, used badly it can make your life harder. This is true for all the basic design patterns, it’s up to the designers and coders how good their designs and code are.

19
Aug
13

Inside a Sunfire V440

This weekend I decided to take a look inside my second Sunfire V440 to see if there was anything obvious stopping it from functioning properly. When I got the other machine running I also tested this one and unfortunately it didn’t boot. I have a key to be able to put the machines in diagnostic mode, which I did. There were a large number of messages on the serial terminal that scrolled past quite fast. From what I could read it seemed like one of the processor modules is likely to have bad RAM in it or has failed itself. I had a look to see if anything looked obviously corroded and if a simple cleaning might fix it.

I took some photo’s of the inside for your enjoyment.

Continue reading ‘Inside a Sunfire V440’

11
Aug
13

Doom

Menu

Menu

Doom is a game that needs no introduction, but here’s one anyway. It was released back in 1993 only a year after Wolfenstein 3d. It pretty much blew away all the previous FPS games with better graphics and more frantic gameplay. At the time there were a large number of Wolf3d engine games (clones and otherwise) that faded into obscurity very quickly because of Doom.

There be zombies up there!

There be zombies up there!

I played the shareware version basically endlessly as a teenager on the Cyrix 166Mhz with window 95 on it. I also played the other episodes later as well as Doom II and built some of my own levels using a program called DCK and later Doom Builder.

End of Level

End of Level

The graphics engine is an significantly improved version of the Wolf3d engine. The engine is still based on a ray caster but uses a BSP tree to render a vector based environment as quick as possible. There are added features such as textured floors and ceilings and even the possibility of seeing the sky. Sprites are bigger, more detailed and can be seen from many different angles. Doom looks significantly better than the FPS games that were around at the time it was released. This of course requires a faster machine to render the game smoothly.

Long Shot!

Long Shot!

The sound is similarly very good. The monsters all snarl and breath as they walk around, so you can often tell they are around before you even see them. Gunshot, injury and death sounds are also very good, adding to the atmosphere and filling any battle with a roar of noise, like you’d expect. Music is another stand out and sounds very good on the sound blaster. It was written by Robert Prince (also known as Bobby Prince) who is famous for his very good Ad Lib music.

Radiation Pool

Radiation Pool

The game play is action packed with monsters around every corner. Fortunately you have plenty of good weapons to blow them away. In the first episode ammo is readily available for most weapons, but later episodes and in Doom II the ammunition supply can be much thinner on the ground.

Cha Cha!

Cha Cha!

The guns in Doom started the basic archetypes for guns in the FPS genre. Each weapon is useful in particular situations and when used correctly will maximize damage. With practice you’ll be killing monsters with finesse. The shotgun is the weapon I typically used the most as ammo is most common for it, followed by the chaingun. The rocket launcher is powerful, but difficult to find rockets for. The chainsaw is great for taking out the pinkies and spectres and doesn’t need ammo. Finally the Plasma Rifle and BFG are the best guns, but the energy cells are rare so you have to use them sparingly.

Chainsaw in action

Chainsaw in action

The monsters are also a standout as they aren’t all just a bunch of mindless zombies. There are demons that chase you down to chew on your face, and bio-mechanical monstrosities that shoot at you from afar with powerful weapons. Perhaps the most memorable for me (and perhaps my friends when we played co-op) was the Cyberdemon. It always took a lot of firepower to bring one down, and they are immensely dangerous.

Ambush in the Dark!

Ambush in the Dark!

Doom also pioneered multi-player death-match games, but myself and my brothers and friends actually preferred playing in co-operative mode. This added more enemies and sometimes nastier ones than usually found. I remember playing over dial up modem with a friend in college. You new we were all having fun when someone ran into a Cyberdemon and practically screamed in horror and delight at the same time. Me and my younger brother once completed all of Doom II in an afternoon on the hurt me plenty setting. We mostly played Doom II in co-op as it had more nasty monsters and was incredibly fun.

Rockets kick butt

Rockets kick butt

Doom is a game I keep coming back to and it seems that many other people do the same thing as it’s still played on the internet. There are now a ton of different ports for all the different platforms, some improving the visuals and others being complete rebuilds of the game. I personally like Chocolate Doom as it is as close to the original as possible.

05
Aug
13

Low Level Formatting Floppy Disks

QuickBASIC Manual and disks

QuickBASIC Manual and disks

Yesterday I re-aligned my old 5.25″ floppy disk drive from our old computer. In the process I was formatting and checking the alignment of the disk using software called ImageDisk by David Dunfield. My drive was behaving badly at one point and thought there were bad sectors at random points, due to the heads not being clean and connectors to the drive control board being dirty.

Normally with software provided in DOS (or windows for that matter) even re-formatting the disk would not fix this issue with the disk even if the magnetic media is in good shape. I found with ImageDisk I was able to redo the low level format of the disks.

There are a few different ways to go about doing this. ImageDisk has the function to format disks directly, but you have to know all the parameters for the disk format you’re using (or planning to). This is useful in the case that you have to format a disk for a system that uses an exotic system, like C/PM systems for instance. Unfortunately this doesn’t write a file system.

The second method you can use is to completely erase the disk using ImageDisks erase function then format the disk normally on the system you wish to use it for. I had mixed success with this as sometimes the format program didn’t always do a good job. It does work most of the time however and performs the operation in the fewest steps.

Finally the method I prefer is to create an image of an empty disk in the format you desire, and then writing that image to as many disks as you desire. In the process of writing the image the software also formats the disk. It may be prudent to erase the disk before hand if the new format is different to the original on disk. The downside is ImageDisk doesn’t check for bad sectors during the format and is not filesystem aware so you should run Scandisk or the equivalent for the system used.

These techniques have all worked for me, but they only really fix bad formatting on an otherwise good disk. So when a sector of a disks surface is genuinely bad this won’t magically fix the disk for you. It did surprise me however how many of my disks I thought were bad, are in fact actually sound media wise but just needed to be low-level formatted. It also pretty much only works on disks that are compatible with the IBM PC drives. Fortunately ImageDisk will handle many different formatting types and even 8″ drives, so most disk formats can be done with the software with the exception of a few like that used on C64 disks.

04
Aug
13

Aligning a Canon MD 5501 5.25″ FDD

Floppy drive minus shield

Floppy drive minus shield

A couple of weeks ago I mechanically serviced an old Canon 5.25″ floppy disk drive that came out of our old computer. As I mentioned here, the drive was in desperate need of repair and restoration. I decided to repair this particular drive mostly for sentimental reasons as it was the first floppy disk drive I used and learned programming with.

Firstly I had to make sure I had everything I’d need to make sure the drive was completely functional. It’s important to have some blank disks so you can test your new drives alignment without risking something with data on it. Another working floppy drive is a must as you’ll need to check that disks work in both drives correctly. Finally some software that tells you what track is under the head and how good the signal is. I found David Dunfields ImageDisk is perfect for that task as it gives a beep to tell you how good the signal is. This means you can hear the signal change as you manually move and adjust the head.

I ran the software with a good drive and a newly formatted good 1.2M disk, just so I could get a baseline and an idea of what I should get when the drive is repaired. Next I transferred the drive to be repaired into the machine so I could see what the current situation is. I used to software to move the heads back and forth to check that the mechanism was indeed completely functional with good results. The drive was however out of alignment as it was reading track 2 instead of track 0 where it thought it should be.

Every floppy disk drive has it’s own different mechanism for aligning the disks. Some of the older drives have a screw that you can adjust, others will be different. The Canon drive that I have is a one quarter sized drive, so it doesn’t have room for the older style of mechanism. In fact the stepper motor arrangement is pretty much the same as those of the newer 3.5″ floppy drives. My drive has two main ways of aligning the heads. It has a zero track sensor that can be moved after loosening a screw. It is basically and optical interrupter type sensor and is easy to adjust. The other way is to loosen some screws and move the whole head assembly. Fortunately I didn’t have to do that.

I remembered what my Dad had done to the drive. My Dad knows a bit about electronics and likes to fix things, and he did this a lot when I was a kid. I used to watch him work, and it’s part of the reason I like to fix things myself. Unfortunately Dad doesn’t know a whole bunch about fixing computer/digital electronics, including this floppy drive.

Dad was cleaning the old computer to get all the dust out. He took the drive out and cleaned the heads using metho like you do for tape recorders (which was the dominant audio medium of the time). In order to do this he had removed the upper head from the assembly to get better access. When he reassembled the drive he didn’t align the upper head with the lower one, and I found upon inspecting it they were a couple of millimetres out. Fortunately it was easy to fix, loosening a few screws, moving the heads and tightening. Appart from that he had actually done a pretty good job of cleaning it.

I finished aligning the drive by moving the optical sensor until I got the best result I could. But even though the drive was aligned it seemed to still find bad sectors randomly around the drive. I tried re-aligning it a few times to see if I could improve the situtation but couldn’t improve it. I found a few problems including the cable for the heads hitting the drives shielding. Still I couldn’t stop what seemed like random bad sectors. Each time I re-formatted the drive from scratch the bad sectors turned up in different places.

So it looked like there might be a problem with the heads themselves. I cleaned them with some metho and cotton buds much the same way as Dad did, but without removing the upper head. This seemed to yield better results, but not perfect. The heads in this drive are connected to the main controller board via some small cards in edge connectors on the board. I pulled these out and cleaned them carefully with medical wipes (they have isopropyl alcohol in them). This seemed to do the trick, floppies formatted and checked out with no bad sectors!

Finally to test the drive works with disks from other drives, I used the other drive to check the disks made by the one under repair and vice versa. They both were able to read and write to the same disks, and even both found the same bad sector on the main disk I had been using for testing. This is why I bought some “new” blanks, I was sure with all the fiddling I might damage a disk, turns out I was right to do so. The repair went so well, I’ve permanently installed the drive in my MS-DOS machine.




Blogs I Follow

Enter your email address to follow this blog and receive notifications of new posts by email.


Mister G Kids

A daily comic about real stuff little kids say in school. By Matt GajdoŇ°

Random Battles: my life long level grind

completing every RPG, ever.

Gough's Tech Zone

Reversing the mindless enslavement of humans by technology.

Retrocosm's Vintage Computing, Tech & Scale RC Blog

Random mutterings on retro computing, old technology, some new, plus radio controlled scale modelling.

ancientelectronics

retro computing and gaming plus a little more

Retrocomputing with 90's SPARC

21st-Century computing, the hard way

lazygamereviews

MS-DOS game reviews, retro ramblings and more...