Monday, July 21, 2014

Making An Impression

Time for some arts and crafts!  Let's jump right into getting a mold for the top half of a cartridge case...

Model

An original Tandy cartridge case seems like the obvious place to start.  It certainly meets the required measurements for the cartridge slot on the computer.  Plus, there are circuit board designs available that fit the standard case.  Hopefully no over-zealous Tandy lawyers will be coming after me!  Anyway, the intellectual property concerns over a plastic box should be limited enough to make that unattractive...hopefully...

One "interesting" part of this design is the sliding door that covers the PCB card edge.  This poses a couple of difficulties.  The least of the issues is that it requires a custom spring to shut the door when the cartridge is removed from the computer.  A bigger concern is that the shape of the door itself has multiple overhangs that make it difficult to mold.  Also, the door has a slot cut into it, which either further complicates the mold making process or requires a step to machine a slot in the pieces I produce.

Making a new spring might not be too hard?  And using a two-piece mold may solve some of the shaping problems.  But extra effort and clever mold making seems like an unnecessary complication just to produce such a superfluous piece.

So, I will eliminate the sliding door and produce a bottom part of the mold that just leaves the PCB card edge exposed.  I think that the PCB is sufficiently recessed so that the case will still protect it while being a lot easier to produce.  One issue is that this would leave an opening in the top part of the case that looks a bit unfinished.  In order to fill that, I have used some modeling clay that I have hand-sculpted into a shape that looks a bit more intentional.  Not exactly machine precision, but it serves the purpose. :-)  A little more clay was used to fill-in some holes that I don't want as part of the mold.
Case Top Model Read To Be Molded
Prep

Before we pour the mold, we need something to contain the poured silicone.  I started by drawing the outline of a box on a piece of engineering paper.  Obviously the measurements of the box are big enough to surround the cartridge case, but they also leave some space around the sides and on top to give the silicone mold some strength and stability.

I laid the paper on top of a chunk of foam board.  This craft material is strong enough to provide some structural integrity while pouring the mold, plus it has a non-porous surface that will keep the silicone in place during the pour.  I used a hobby knife to mark the corner cuts through the paper.  This was followed by using the hobby knife and a straight edge to cut-out the boundaries of the box.    Also, cuts were made along what will be the exterior edges of the bottom in order to facilitate bending-up the sides to form the shape of the box itself later.

One last step before building the box is to glue the model into place along the bottom.  This is a crucial step, because the silicone has enough weight to move the model around during the pour.  Also, the silicone could get beneath the model and essentially ruin the mold be encasing the model and forcing you to cut it apart just to retrieve the model.  Something like that will most likely render the mold unusable, so glue the model down to avoid it -- I used glue dots!

The final step is to fold-up the sides of the box and secure them into place.  For that, I used my wife's trusty hot glue gun.  Lots of "craft" people use this for everything, and it is handy stuff.  Just be careful -- not only can it burn you like a soldering iron, the hot glue will stick to you while it burns!  And it pulls body hair when you try to remove it from your skin...ask me how I know! :-)

Case Top In The Mold Box
Pour

Now it is time to pour the mold.  The product in use is a mold-making silicone.  There are a variety of options here, but for this I have chosen a product designed to be extra supple.  This helps in modeling overhangs and undercuts, and it also is a bit more pliable when it comes time to remove objects from the mold after casting...

The silicone comes in two parts, the base and a catalyst.  This product comes in a "1 pound" size, which is a lot more than I need here.  But, using it all means no messy measurements and it gives some extra "heft" to the mold.  Plus it means that I can just use the product container for the mixing and pouring.  This is my kind of recycling! :-)

It is important to mix the base and catalyst thoroughly.  A poorly mixed pour may not properly harden, ruining the mold.  The mixture has a long "work" time, so there is no need to hurry.  Be sure to stir until you get a consistent color, in this case, pink.

Once thoroughly mixed, the silicone can be poured into the mold.  It is recommended to pour slowly from one corner of the box.  I think this is intended to limit the amount of air bubbles in the mold.  Nevertheless, air bubbles will get into the mold during the pour.  Some will bubble to the top naturally, but others are happy to cuddle next to the model and ruin the mold...

There are a number of techniques for removing air bubbles, including encasing objects in a vacuum bag to remove air.  A somewhat simpler method is to shake the bubbles out.  I use a vibration table designed for use in dentist offices for making dental molds.  These can be had on eBay for a price that may or may not be reasonable, depending on your perspective...

After 20-30 minutes, most of the bubbles will have shaken their way to the surface of the silicone.  I got a bit impatient and used a tooth pick to pop all the big ones, but that probably isn't necessary.  Anyway, the product shown here has a cure time of 18 hours.  At this point the mold has to be set aside and allowed to harden.

Poured Mold Starting to Cure
Extract

The final step is removing the mold from the box and extracting the model from the mold.  Start by breaking the glue joints holding the sides of the box together.  This is not at all difficult, but sometimes it is necessary to trim some of the silicone from the edges of the box either to shape what will be the bottom of the mold or just to keep from damaging the mold itself.

Once the mold is removed from the box, it is common to find some overflow silicone has oozed over the edges of the model.  Using a hobby knife to trim the ooze helps to clean-up the edges at the top of the mold.  At this point, the model can be extracted from the mold, revealing the impression left to be filled by plastic resin later.

Silicone Mold Ready For Plastic Resin
So, that covers the process of making a silicone mold.  The process for making the mold for the bottom of the cartridge case is similar enough that I won't bother with documenting that.  The next step will be pouring some plastic resin into the mold -- be sure to stay tuned!

Tuesday, July 15, 2014

Achievement Unlocked

Very few games for the Tandy Color Computer (CoCo) 1 and 2 had any sort of in-game music.  I presume that the case is the same for the Dragon, since the game libraries for the Dragon and the CoCo were essentially the same.  Many had some sound effects or even a tune or two, but CoCo games generally halted the game action while sounds were played.  Not too long ago, I was only aware of a couple of CoCo games that had continuous in-game music.  Now I know of one more -- Fahrfall!


Hard Time

The CoCo did not have any sound hardware beyond a couple of ways to driver the speaker directly from the CPU.  Where other machines had POKEY or SID or some variant of the AY-3-8910 to do the heavy lifting for audio, the 6809 was the CoCo's sound chip!  This provides some flexibility, but it does make producing audio a burden for the programmer...

I had feared that having in-game music would require a lot of hand-crafted code modifications to perfectly time audio updates according to cycle counts in the instruction stream.  Fortunately, there is enough time left in each frame to produce a reasonable (YMMV) audio stream.  The time spent running the code produces a low-frequency hum in the audio, making the overall sound seem a bit like the speaker is behind a fan.  The tone probably horrifies a lot of audiophiles, but I think it is a clear win versus no sound at all!  I hope others agree...

Another Beta

I was a bit apprehensive about releasing another beta.  It is no secret by now that I would like to do a cartridge release of Fahrfall, and I am a bit afraid that I might cannibalize my market by releasing a nearly complete version to the world for free.  Still, I want everyone to enjoy the new Fahrfall and more testing never hurts!

Real fans will still want the cartridge.  Besides, a few less cartridges sold will mean a few less cartridge cases for me to make!  Anyway...I may still squeeze in a feature or two before a cartridge gets released... ;-)

http://www.tuxdriver.com/download/fahrfall/beta-2/

Halftime

Today marks the middle of July, so we are half way through the Summer Challenge.  So far I have made good progress on my code development, but done very little documentation on the "arts and crafts" part of the project.  I definitely have some stuff to show there, and I think this seems like a good time to pivot in that direction.

So, get ready to learn a bit about casting plastic, sanding, drilling, applying stickers, etc...and as always, stay tuned!

Friday, July 11, 2014

Fahrfall Is In Beta!

I guess it is about time for another little update.  I don't have a lot of info that I'm ready to share, so I guess I'll have to share some code for the Fahrfall fans to fondle... :-)

You Beta, You Beta, You Bet...

I'm liking the way things are looking, so I figured it was time to do a beta release.  Fahrfall Beta 1 has the following features:
  • Pace quickens over time
  • Rate of scoring increases over time
  • Rate of scoring doubles while Fahrve is falling (i.e. not standing on a platform)
  • Variety and frequency of platform appearance changes has increased significantly
So, basically this is the same version as I described in my previous updates.  It is available for download here:

http://www.tuxdriver.com/download/fahrfall/beta-1/

Sounds Of Silence

Beta 1 doesn't have any sounds (annoying or otherwise) that the Alphas didn't have.  I'm still working on some things in that department -- I think Fahrfall's fans will be pleased!  I'm know that I'm excited...

I'm not sure which direction I will go this weekend.  I'm definitely having some fun with audio, but there is the physical part of this project to cover as well.  Which to cover next?  Well, I guess you'll have to stay tuned... :-)

Tuesday, July 8, 2014

Gameplay Improvements

Well, July continues apace...I guess it is time for another update on Fahrfall's progress.  Things are looking up!  After getting my feet wet with some low hanging fruit, I moved-on to some slightly more difficult features.  For the most part, these are inspired by the past couple of years of playtesting at public events...

Pick Up The Pace

I think that Fahrfall's biggest weakness in the past has been its constant, somewhat...slow...pace.  The most common question I get after someone has tried Fahrfall for a while is "does it get any faster?"  I think that the steady pace actually leads to a lot of games ending due to the player losing mental focus...

The reason that Fahrfall has had a steady pace is because the timing of the platform movements has been driven by decrementing a counter until it hits zero.  The value of that counter was fairly small, so any adjustment of it caused big changes in the speed.  Therefore, changing the speed of the game during play was too jarring to seem reasonable.

In order to change that, I reimplemented the platform movement timer to increment by a variable value.  The movement happens when that timer count overflows.  Since it takes a reasonably big value to overflow a counter in a small number of increments, that value can be adjusted a lot more easily for a wider range of possible movement speeds.  This technique allows me to make small increases in the platform movement speed as each new platform is introduced, causing the game to gradually speed-up over time!

As the game speeds-up, playing gets a bit more difficult.  It doesn't seem fair to still award the same number of points per unit of play when the game runs a lot faster!  So, I used the same "overflow timer" technique to modify the timing for the scorekeeping.  Now the scoring becomes visibly faster as the game progresses until it tops-out at a blinding pace! :-)

Change Of Scenery

I always wanted the platforms to change as a game of Fahrfall progressed, but I had trouble determining what algorithm should drive that change.  I did modify the alpha releases to change the platforms from one solid color to the next every 64 platforms or so, but that was still a bit boring and a good player would have little trouble "wrapping" the color cycle.

The mechansm for changing the platform colors and patterns was built into Fahrfall long ago, with each platform's data structure holding pairs of graphics data representing the tops and bottoms of a platform section.  The new algorithm implemented an 8-bit LFSR where 3 bits chose one color, 3 bits chose another color, and the last 2 bits chose a pattern.  Patterns include solid parallel lines, segmented lines in alternating colors, a "checker board" pattern, and a fourth pattern that throws-in some black blocks to look a bit "twisted".  Any of the first three patterns might also look like a solid color if both color choices match.

With the new color/pattern algorithm in place, I made Fahrfall choose a new platform color/pattern every 32 platforms.  This gives a nice (albeit minor) reward to the succeeding player and helps the player to keep track of the game's progress.


Can You Hear Me?

One thing that I have always wanted to have in Fahrfall is in-game music.  Very few games for the CoCo have in-game music, and even the sound effects tend to stop the action while the sound is played.  The CoCo audio hardware completely depends on the CPU to do the heavy lifting either of feeding audio samples to the DAC or of flipping the 1-bit "beeper" output.  Realizing these facts had convinced me to put in-game audio on the "nice to have" list for Fahrfall, but nothing more.

Still, the desire was there.  Fahrfall is timed around the vertical sync output from the VDG, which is used to do most of the graphics work while no image is displayed.  There is some work done during the active display, but there are a lot of cycles still free.  I decided to experiment with playing tones _only_ during that free CPU time.  The segmented audio wave that resulted sounded a lot rougher than a constant pure tone, but it was good enough to make me explore some possibilities...

One option that I am considering is to play some sort of sound effect to add to the game's ambiance.  I was able to put together a little sample of one idea after some experimentation yesterday.  I like it, but I'll probably do something a bit different in the final version.  Nevertheless, I thought you might enjoy a taste of my thumping beat. :-)


Several people seem a bit apprehensive over that beat!  I think they might get used to it, but it doesn't really matter.  Like I said, I'll probably do something at least a bit different in the final version.  Still, I do like how that audio makes me feel when I play Fahrfall -- it is like playing Fahrfall at a rave!

Anyway, this is getting a bit long...I'll keep working on some audio options and I may have another gameplay item up my sleeve.  Plus, there is still the "arts & crafts" aspect of this project to explore...I guess you'll just have to stay tuned! :-)

Friday, July 4, 2014

Back In Action

We are now a few days into the Retrochallenge 2014 Summer Challenge, and I have been having a little fun with Fahrfall.  Nothing too dramatic so far, but enough has happened that it is probably time for an update...

Retool & Regroup

In earlier blog posts I had mentioned that I used an assembler called mamou.  That assembler was derived from the assembler which Motorola originally provided on their long gone Freeware BBS.  My friend Boisy Pitre took those sources some time ago and added a variety of features for targeting the  BASIC environment of the Tandy Color Computer (CoCo), and the OS-9 operating system.  FWIW, Boisy named mamou after a town near his home with a connection to his family and childhood.

The mamou assembler is relatively simple, but it has done the job for me.  Nevertheless, Boisy has wanted to retire mamou for some time -- I may be the last user!  Another CoCo user named William Astle has developed an assembler toolchain called LWTOOLS.  Some time ago I promised Boisy that I would try using lwasm, the assembler from the LWTOOLS package.  I am now making good on that promise.  Along with the switch to lwasm, I have also done some Makefile clean-ups and some other housekeeping.

Some readers probably know that I am a Fedora contributor, and that Fedora is my preferred computing environment for day-to-day use.  Given that, I have taken the opportunity to package LWTOOLS in Fedora.  So, any budding CoCo software developers out there can now install LWTOOLS with a simple yum (or dnf) command.  Let the retro-coding begin! :-)

Bugs & Low Fruit

The "random" number generation in Fahrfall is done with a software Linear Feedback Shift Register (LFSR).  This is a mathematical construct that generates a distribution of numbers that can be used to create the illusion of random numbers.  This code was simple and effective, and I had reused it when I created Sluzzle.  Later, I discovered a bug in the LFSR code in Sluzzle.  I fixed the code there, and this week I checked-in the equivalent fix in the Fahrfall code.

When a game of Fahrfall starts, there is an interstitial screen that gives some simple instructions before the game begins.  That screen shows for about three seconds, but that seems to be too long for the most impatient players.  As a first new feature for Fahrfall, I wanted to add a check for a button press to cut that timeout short.  But at first, it didn't work -- the keyboard input routine always reported a button press.  It turns-out that the keyboard routine was not properly reinitializing a variable -- it only worked previously because of luck!

One other simple feature actually changes the scoring.  Until now, the scoring in Fahrfall essentially had been just a timer -- the score accumulated based on the length of the game and nothing else.  Fahrfall already keeps track of when you are falling versus when you are riding a platform.  So, I modified the scoring code to double the points accumulated while falling.  Hopefully this provides some incentive for more daring play... :-)

Prototype Package

For some time, I've been toying with the idea of releasing Fahrfall as a ROM cartridge.  A number of other retro platforms have had homebrew cartridge releases, and they seem to be a rallying point for the various retrocomputing and retrogaming communities.  It would be great to do a homebrew cartridge release for the CoCo, and I plan to do some experimenting toward that end as part of the Summer Challenge.  I'll do a post or two about that later...

Beyond the cartridge itself, people seem to appreciate a nice package for such things.  It turns out that the CoCo cartridge width is a good match for a VHS case, and such cases are still available relatively cheaply -- make sure to get the ones that don't have hubs!  The length is way too long for a cart, but a piece of foam board can be used as a spacer to keep the cart from sliding around.  Also, many VHS cases can hold an insert to add instant graphics for a good looking game package.


So, there is a little sneak preview of the goal...looks cool, eh?  Now I just have to whip Fahrfall into release-worthy shape, and figure-out how many cartridges I can make.  If you want to see how that turns-out, then you'll just have to stay tuned!

Monday, June 30, 2014

Fahrfall Revisited

A bit more than two years ago, Fahrfall was a winner in the Retrochallenge 2012 Winter Warmup.  Since then, I have shown Fahrfall at three VCF events, four mini Maker Faire events, three CoCoFEST! events, and a number of other small events here and there.  Many people like the game, and some people absolutely love it.  Still, I've always felt that Fahrfall remains unfinished.

The Retrochallenge 2014 Summer Challenge starts tomorrow.  I already intended to participate, and I even had a few other good ideas brewing this time around.  Still, at some point I got a couple of brainstorms about some possible improvements that I could make to Fahrfall.  I don't think that I will necessarily be able to have exactly the features that I envisioned two years ago.  But, I do think that I can make some significant improvements and have a better game than what we have now.  So, I've decided to return to Fahrfall for this summer's Retrochallenge competition.

In the meantime, I've also been putting some thought into how to produce Fahrfall game cartridges.  Writing the code and even producing circuit boards never seemed like big problems.  But, shaping plastic has been a bit of a mystery to me.  However, I have recently learned a bit on that topic and I hope to share some of that over the coming weeks.  I like the results I've been getting quite a bit -- I think you will be impressed!

So, improvements to Fahrfall combined with some arts & craft work -- fun for the whole family.  There might even be more surprises along the way.  If you want to see how it turns out, then you'll have to stay tuned... :-)

Thursday, January 31, 2013

More Alphas

Wow!  It's been a long time.  I guess I got a little burnt-out after all my Fahrfall-related activities last year.  But, at least I could have posted the updates that I actually made!

Alpha 2

In preparation for the Burlington Mini Maker Faire in 2012, I implemented a few new features:
  • keyboard control of Fahrve, including both CoCo and Dragon keyboards
  • an interstitial screen when starting the game
  • a Hall of Fame screen for collecting high score information
I have made a fresh rebuild of the Alpha 2 code available here:

http://www.tuxdriver.com/download/fahrfall/alpha-2/

FWIW, this is also the same version of Fahrfall that I had on display at VCF East 8.

Alpha 3

In advance of Maker Faire NC 2012, I had a few more changes:
  • improve the wording on the interstitial screen
  • improve the workings of the Hall of Fame screen
  • make the platforms change color as the game progresses
I have made a fresh rebuild of the Alpha 3 code available here:

http://www.tuxdriver.com/download/fahrfall/alpha-3/

I assure you that with this version, great fun was had by all... :-)

Coder's Block

I still maintain that I am not yet done with Fahrfall.  I have a few minor improvements in mind here and there, but mostly I want to add some in-game music.  I even have a few tunes in my head!  The problem I originally had was that I knew that playing music would require some precise timing, and that inserting code to do that would make it difficult to make further changes to the game.  Now there are few changes that I really want to make, so I guess that excuse is no longer valid.

I am not sure when I will get back to Fahrfall either for adding music or for any other new features.  By now I already have a few other projects in mind or in progress.  Maybe I should add support for my rotary controller to Fahrfall? :-)

In any case, I still think that I will be back to Fahrfall before too long...do stay tuned!