A Good Egg Named Alice – Physics and Design of the Egg in Contraption Maker

By Kevin Ryan

Posted on May 16th, 2016

aliceEgg

Alice rolls down next to Eggclops.

One of the parts in Contraption Maker is an egg. I’m going to write just a little here about its gestation and implementation.

I was looking through some old emails and chats to refresh my memory and found the chat listed below. The egg was originally going to be a breakable ball, but I decided to make it an egg instead.

eggChat

I thought that an egg would have more whimsy and character than a ball. It is obvious what it is to the end user and it is also very obvious that it is fragile. In addition to that it also has a different rolling motion than a ball has which gives the opportunity for more variety in the puzzles created.

One thing that I wanted to do to give the egg more personality was to have multiple versions with different names. And each of them also had a different look so they looked better and would give a more varied look on the screen than just a single white colored egg. Here are all the eggs along with the pop up window that lets the user select which egg to use.

cmEggs

Current batch of Contraption Maker eggs.

One other nice side benefit was that I was able to name the eggs after friends and acquaintances and let them be in game – if only as a egg. Once I had the egg implemented it seemed only natural to have it attract the dog Tinker if it broke.  Once you’ve added a new part then suddenly more possibilities open up about how it can interact with all the other parts in the game. As you add more and more parts you end up with a rich cacophony of interactions between them all.

Here is a short animation of how the egg attracts the dog when it breaks.

dogEgg

If you look underneath the hood you’ll see that this is accomplished by a method in the egg class that is called when any other part sees it. If the calling part is a dog then the egg returns the dog attract info, otherwise it returns NULL which means no attraction.

CMPartAttractsInfo *CMPartEgg::getAttractsInfo(CMPart *part)
{
    if (mCracked && (part->mType == PART_DOG || part->mType == PART_SCAREDY_DOG))
        return &sDogAttractsInfo;

    return NULL;
}

This is the structure that is returned to let the dog know how attractive the egg is to it. Since the dog may see multiple other items besides the egg, it is up to the dog’s AI to take this attracts info along with any other attracts info it gets from other parts and then figure out what to do. (I’m formatting code below to look okay within this blog post.)

// Constructor for the attracts info returned
// - Att postfix is the attracts values
// - Rep postfix is the repulses values
CMPartAttractsInfo(
   int minDistFrontAtt, int maxDistFrontAtt, int minDistFrontRep, int maxDistFrontRep,
   int minDistBehindAtt, int maxDistBehindAtt, int minDistBehindRep, int maxDistBehindRep,
   int priorityAtt, int priorityRep,
   bool canLookBehind, bool shouldRun, bool edible,
   int repulseHighPriorityDist=FLOAT_TO_INT32(50))

// The attracts info for the egg attraction for dog
// Only attracted to eggs in front of it that aren't more than 230 units away
static CMPartAttractsInfo sDogAttractsInfo(
   FLOAT_TO_INT32(0),FLOAT_TO_INT32(230), 0,0,
   0,0, 0,0,
   ATTRACTS_PRIORITY_ONE,ATTRACTS_PRIORITY_ONE,
   ATTRACTS_CANT_LOOK_BEHIND,ATTRACTS_SHOULDNT_RUN,ATTRACTS_EDIBLE );

One last thing on how the design evolves. These are all “good eggs.” If there are “good eggs” then shouldn’t there be “bad eggs?” It is on my internal list of parts to someday implement. Bad eggs would be smelly and repulse lots of other creature/character parts.

In closing here is the code that implements the egg:

CMPartEgg.h

CMPartEgg.cpp

 


Collaboration and Trust in Work and Life

By Kevin Ryan

Posted on May 6th, 2016

This is going to be a very short post about what I was just thinking about while taking a short 25 minute walk along one of the trails near our home just now. I got a email this morning from my long time friend and off and on work colleague Jeff Tunnell. It had a few suggestions about making my blog better from the titles of the posts and also about the content. Some of what he wrote echoed what my wife had told me the other day. Now I’ll definitely be doing some of his advice, maybe not all of it, but I’ll sure consider all of it.

So as I was walking along through the drizzling rain we are getting here right now, it got me thinking about collaboration. Jeff felt comfortable sending me suggestions along the lines of “hey here’s what you can do a little better” and I was fine receiving them. I think that is the result of long time collaboration that has built up trust. Although I think our personalities are such that it was probably there almost from day one.

I’ve been blessed over the years to work with a whole bunch of talented nice folk. Two of them were Jeff and Damon Slye who were at Dynamix with me as co-owners. They started it up. As I walked along thinking about how people interact in good and bad ways, what popped into my mind was this one scene in a game that Damon and I had planned for David Wolfe: Secret Agent. Somewhere along the line as development progressed, Damon told me that Jeff was really uncomfortable with the scene and preferred it didn’t go in there. Not “Jeff says take it out.” It meant a lot to Jeff, we took it out.

I’m thinking that is one reason Dynamix did so well, because there was mutual respect and trust. Oh, it did help that Jeff and Damon are super talented, basically the best at what they do. But it seems that there needs to be more present than just that; and our willingness to listen, change, and improve – collaborate in a good way – made the sum greater than the whole of its parts. And now here I am collaborating with Jeff and his latest company, Spotkin, on a game (Contraption Maker) over 30 years after we met. And my son is working with Damon at Mad Otter Games on their Villagers and Heroes game.


Inspiration – How I Designed a Hole in Sierra’s Bestselling 3D Ultra Minigolf

By Kevin Ryan

Posted on May 5th, 2016

Designing in a Meadow

I used to do quite a bit of computer game design work at a meadow near Kaiser Pass which is up around the 9,200 foot level of the Sierra Nevada Mountains. It’s about 40 minutes from our home at Shaver Lake. This was back in 1997 and I would sit with a yellow pad sketching down ideas and hole layouts for 3D Ultra Minigolf Deluxe while my kids would run around and have fun. It was a good work environment.

kaiserMeadow1

Kaiser Meadow – Kids way off in distance on the right. Wife and toddler in foreground at left.

It was a neat place for the kids because there were a lot of frogs and if we came at the right time of the year there were also tadpoles or big groups of frog eggs. I can remember coming up to the same meadow back in the 1960s when I was their age.

kaiserMeadow2

Looking for frogs in one of the ponds.

Because it is at such a high elevation it would get very cold at night so things could freeze over even in the late summer. Depending upon the winter there could also be snow patches until late in the summer too.

kaiserMeadow3

My son finds some ice.

So I got to sit outside in a beautiful environment and work on my game.

Eventually I’d have to go inside and sit down at a computer in my home to get the ideas into a specific digital form. It has been like that for me lately in that I can get a lot of creative work done, or inspiration on how to solve a problem, while just walking through the forest or even just driving somewhere in the car. For the minigolf game the “sit down at computer and implement” step would involve creating models of each hole in 3D Studio Max. I’ll write about that process a few paragraphs down.

 

Raindrops and Opening Screens

The idea for the opening of one of my very first published games, Black Belt (not the Sega game of same name), came back in 1983 when I was driving home from college in Oregon to my parent’s house. Somewhere near the Oregon-California border it started raining big fat occasional raindrops on my windshield and the way I wanted the opening title screen for Black Belt just magically occurred to me.

So when I got back to my apartment in Eugene across from Beall Music Hall (which I recently learned is pronounced “bell” not “be-all”) I implemented the idea. It is nothing awe-inspiring or great or anything, but the genesis of the idea seemed pretty neat to me and I’ve remembered it. Ha, someone uploaded it on YouTube, so you can see the opening here:

I suppose writing is like that too in that you can come up with general plot ideas, characters, situations, etc. anyplace, but eventually you have to sit down at a computer (anyone still use a typewriter?) and write down the specific words that make up the story.

 

A Minigolf Hole

The drive up to the meadow at Kaiser took about 50 minutes and on the way we’d drive past the Shaver Lake dam and the marina. The road there curves along the lakeside and I suddenly saw an alignment of geography that could be used as a hole in my game. When I got up the meadow that day I sketched out a design for the hole while thinking of any technical challenges that various elements would cause. Here is a view of the area courtesy of Google Earth:

marinaGoogle

Shaver Lake marina and highway 168 along lakeside.

And here is the sketch of the minigolf hole:

marinaSketch

At this point the next work on a hole would be done in my home office where if I thought the concept was okay and had enough fun elements then I would spend a few days creating a playable 3D model of the hole. I would putt around on it, making different adjustments so that it played well and adding and/or removing different elements. Fun to play and works? Okay, good, keep it. Otherwise it goes into the trash.

The 3D model that I’d make didn’t have any of the artwork detail, only the shapes need to make the hole playable. The following scans are from the artwork design document. There would be three views of a hole: overview, tee, and top down. The top down view also had a very general description. (Sorry, printed them in black and white back then):
marinaPlayablePolys
marinaPlayablePolys2

After making sure that it played well the last step was to get a concept drawing done of the hole that could be used by the artists who would be rendering out all the artwork. I was very lucky because I worked with Don Carson on this project. He designed Mickey’s Toontown in Disneyland and a bunch of other stuff. Click here to see some of the neat things he has made. And some more here in Part Two. Really click – his stuff is awesome. His blog is here and is worth following. I always knew that the concept artwork that I’d get back from him on any of my games would be just amazing! Here is the concept he drew for this hole:

 

marinaConcept

Unfortunately I can’t show you how this hole turned out in the game because it wasn’t implemented. My design had 18 holes and I got them all to the playable state and Don did concept artwork for all of them, but because of budget issues only 9 of them were actually rendered off and put into the game. The rendering of all the artwork took a long time. Below is the Moon Base hole so you can get a sample of what a final hole did look like.

We had musical themes for each hole and that really added a lot to the atmosphere. Chris Stevens along with Ken Rodgers creates the music and sound effect. Chris has gone on to win multiple Grammy awards. Hit the play button and you can hear the moonbase theme.

 

Dynamite Cows

So we come to Dynamite Cows. I live high up in the mountains and will occasionally make trips to Fresno, the closest large town, to do shopping. When driving through the foothills I’d see lots of cows in the fields. One day for some reason the thought popped into my head, “How about herding cows with dynamite.” I actually spent some time developing a product from that idea. Here is the title screen. Sorry again, don’t have anything but black and white printouts with me now. I’m sure I have source code and nice real art backed up somewhere on a CD.

 

dynamiteCowsTitle

Here is a very rough first pass at a game play screen.

dynamiteCowsGameplay

And here are a few of the cows. Wish I had a color version of these screens.

dynamiteCowsCows

Mercifully (for end users) I never got past some very preliminary work on this one. It was fun for me though and sort of a joke. “Mooooves” “Cowleidoscope” – shakes head. It is the nature of the beast to have things that don’t pan out. If you never have failed projects perhaps you’re not challenging yourself enough?

I’ll end with this little story from a biography of G. K. Chesterton.

Restaurants and pubs, in fact, not newspaper offices, were much more likely places to find Chesterton writing his articles. Charles Masterman remembered one such Fleet Street restaurant where Chesterton used to write articles,

mixing a terrible conjunction of drinks, while many waiters hovered about him, partly in awe, and partly in case he should leave the restaurant without paying for what he had had. One day…the headwaiter approached [Masterman]. ‘Your friend,’ he whispered, admiringly, ‘he very clever man. He sit and laugh. And then he write. And then he laugh at what he write.’

That seems to be the key for me. Enjoy what you do so much that you can laugh as you do it. My work has never felt like a job.