Packt Press announces Game Maker 8 Cookbook

http://www.packtpub.com/game-maker-8-cookbook/book

I am contributing to this book as a technical reviewer, and it’s my first time getting credit in a publication, so I’m kindof excited and happy about that.

[Update 1/11/2013: After several months of delays, I have heard from the publisher that this book is about to be canceled. However, I am now working on reviewing a book on GameMaker: Studio from the same publisher, which looks like it’ll be a much better book.]

Unearthed Treasures of Childhood

I’m cleaning out my home office today… well, let’s say this week.

For most of my life, I have been a packrat, and a fairly disorganized one at that. I have always been very sentimental about things, and would keep reminders of events, and basically never threw out anything that I had worked on when I was a kid. Most of that stuff got kept for a really long time, far longer than it was useful, if it even ever was useful.

But after a certain point, keeping everything gets to be a burden. A few years ago, I started to recognize that this was a problem and that I needed to do something about it. I have a very strong instinct to preserve and archive things that are important to me, either because they express some idea that I find compelling, or because they help to define my personality or could be used to explain myself in some way that would be persuasive or understandable to others.

Anyhow, in my office I have piles and piles of old papers, drawings and things I wrote for fun in childhood, school assignments, newspaper clippings, comic strips, receipts, artifacts from memorable experiences, and outright junk. I’m working on going through it all and purging as much of it as I can stand to part with. Mostly it’s not hard, it’s just a lot of sifting and it’s time consuming.

It’s a bit embarrassing for me to admit this. If you’ve seen Hoarders, that could be me. I say “could be” because that’s easier than admitting that it is me. I’m definitely not that bad, and definitely not as bad as I used to be, but it’s taken me some time. I just had a realization and asked myself what I was doing, and from there it’s just been a matter of prioritizing when I can go through the accumulation of decades and get rid of things. Most of the time I am busy or obligated and haven’t gotten to a lot of it. But I have free time this week so it’s happening.

Anyhow, going through my piles of junk, I came across my original concept drawing for the Boobie Teeth game! I thought that it had been lost to the ages. But here it is. I’m blown away. Finding it here is surreal. I have no idea how it came here from my mom’s attic, where I know it had stayed for many years. But I must have retrieved it at some point, put it aside, and forgotten completely about it.

It’s 3 pages of wide format fanfold line printer terminal paper. Someone in my family would bring lots of it home and give it to us for scrap paper which we could draw on the unused side. The printing on the used side has 1982, which helps establish the date — likely the drawing would have been done some time around 1982-83. This means that I must have been 7 or 8 when I drew up the concept, not six.

The game concept is also quite different from how I reconstructed it from memory: Boobie Teeth is a space fish. Rather than eating other fish, Boobie Teeth primarily feeds on these alien creatures called Boobies, which resemble the ghostmonsters from Pac Man, only with legs. Actually, I recognize them as being “stolen” from a game I liked at the time, Fast Eddie for Atari 2600:

 

Fast Eddie for Atari 2600
Fast Eddie for Atari 2600, the inspiration for “boobies” in my original concept.

My game concept also featured some birds, called Boobie Helpers, who tried to help the Boobies avoid becoming Boobie Teeth’s prey. Also, there were two other types of fish in the game: An “older” species of the same genus as Boobie Teeth, which only eats plants, but which Boobie Teeth can eat for bonus points, and a “new” species which preys on Boobie Teeth. One of the more interesting aspects of the original concept was that the Boobie Teeth species was facing extinction. Only 12 fish remained. And when you died in the game, your skeleton would sink down into the sea bed, and become fossilized in the sediment.

I’m not sure how much of these unearthed revelations will end up making it into the finished game. They don’t entirely fit with the version of the game that I reconstructed from memory. I like the death->fossil concept.

As soon as I can scan the drawing, I’ll be posting it here for you to see. For now, here’s photo I took with my digital camera:

 

Boobie Teeth original concept

Original concept drawing for Boobie Teeth

Original concept description:

You are one of the 12 remaining space fish called Booby Teeth. These little space creatures called boobies are trying to eat you. There are booby helpers that look like birds. You have to eat the boobies from behind. There are 11 other fish that are in reserve. A new specie of Booby Teeth called the Booby Crusher. It is much bigger and it is trying to eat you because it doesn’t know any better. He is 15 mph faster than you. There is one last kind of booby teeth. It only eats plant life. You are trying to eat it like the Booby Crusher is trying to eat you. It swimsflies across every time you have played for 30 seconds. It is 1000 points the first time it flies by and it will stay there until the score on it is 0, then it will disappear. Every time it flies by its score gets lower. The gill on it is the 1 in 1,000. After that it disappears. It is 900, 800, and so on until it gets to 100. The score keeps splitting in half. If you clear the whole board of Boobies, Booby Helpers, and Booby Teeth that eats plant life, you have to find the fossil form. The more times you lose a remaining fish you have to find more fossil forms. When you find it, you have to pull it up with your mouth, then you will get a rougher landscape. The game starts all over again. (Later there are mountains and volcanoes.)

Using the controller: Pushing the joystick up makes the Booby Teeth go up. Pushing the joystick down makes the Booby Teeth go down. Pushing the stick to the right makes the Booby Teeth go to the right. Pushing the stick to the left makes the Booby Teeth go to the left. The fire button makes the Booby Teeth bite.

Scoring:
Common Boobies: 50 pts.
Tallest & second tallest Boobies: 100 pts.
Strongest Booby: 150 pts.
Shortest Booby: 125 pts.
Flying Booby: 250 pts.
Booby Helpers:
Baby: 300 pts.
Mother: 2,000 pts.
Fastest Booby: 350 pts.

Goal

Like just about everyone, I don’t have nearly enough time to do everything I need to do in my life, let alone what I want to do. I need to figure out what to do about that. I have some vague ideas, but nothing fully formed and ready to go. That’s pretty frustrating. Like, self taunting self that you’re losing at life frustrating.

But I do have a goal: I want to move from being a 9-5 guy into being a 24-7 guy. I don’t want to simply work 40+ hours a week so I can afford to keep living and maybe (ha!) retire someday. I want to take that time I spend working and put it into activities that are meaningful to me and happen to generate income. I’d rather spend all my time doing that than spending most of my productive hours working on someone else’s projects and try to cram my own stuff into whatever’s left over when The Man is done with me.

To summarize, I want to achieve a convergence of work, income, fun, and values. I got a good taste of it this month when I worked on my game project and delivered my talk at Notacon. I didn’t make any money doing it, but had I figured out some way of doing so, I would already have the life I want. As I see it, I’m pretty far from having that life right now. And, unless I’m smart about how I go about it, the more I work for The Man, the further from it I will get.

I don’t need to maximize my income potential; I’d rather not compromise doing what I love in order to make the most income I possibly could. I do need to make enough money to live on. I don’t necessarily need all that much to live, and could deal with making less, and working longer to attain it, as long as I truly love what I’m doing. Before getting too far along in this dream, I have to figure out how to make any money doing what I love, try that out, and get it to work.

What are the things a person needs to do to accomplish this? Why don’t they teach you this in college or high school, when it would be super useful?

Looking for advice here. This blog does have a comment feature.

“How I (FINALLY) Made My First Video Game” Notacon 8

The talk went very well. Several people I didn’t know came up to me afterward and said that it was inspiring, which means a lot to me. I tend to discount compliments from friends, which perhaps I shouldn’t, but I always throw out data that might be subject to bias.

I am posting my presentation slides here, for anyone who would like to download and read my notes. The talk was videotaped (do camcorders still use tape? No, I think we need a new word), and will be available on the Notacon.org archive once they have time to process everything. I’ll post a link when they do; might be a few weeks or months.

How I (FINALLY) Made My First Video Game – Notcon 8 2011-04-15

Edit: The videos that were embedded in the original powerpoint appear in this version of it as single frame placeholders. For the actual videos, I have them up on YouTube:

Development Stages

Builds 0.20 – 0.22 montage

Boobie Teeth 0.22

Boobie Teeth 0.22 is now available for download at the Releases page.

I figured out how to fix the bugs with the Feeder Fish, so they’re back in the game. The problem was rather complicated, and had to do with both Game Maker’s inheritance model AND the weird way that Game Maker can change an instance of one type of object into an object of another type. When Feeder Fish feed on each other, they eventually grow large enough to change into Fish. For reasons I still don’t understand, when the built-in function instance_change() is called, it results in a weird condition with the instance’s variables no longer being accessible to the application.

In my AI targeting code, this could cause a changed instance to no longer exist insofar as the Game Maker engine was concerned, resulting in an unhandled “unknown variable” exception being thrown. To work around the problem, I had to write my own code to handle the instance_change, and so it creates a new Fish, assigns it properties equivalent to the former Feeder Fish instance that it used to be, and then destroys the original Feeder Fish.

Further complicating matters was the fact that I had initialization happening in the Create event for the Fish object, which normally gives a new fish random values for its properties. In this case, however, the Create event initialization was blowing out the Feeder Fish’s properties which I’d just assigned to the new Fish. So to fix that problem, I had to remove the call to my initialization function from the Fish object, and am now calling it from outside after the Fish instance is created. The Fish Factory uses randomized values, while a matured Feeder Fish passes its original values. This works nicely, and I am happy with the result. The game is more fun with Feeder Fish acting as an attractive food source to the full-grown AI fish in the game, so I’m glad I was able to get this in before the demo at Notacon.

I also added a function to prevent fish from getting stuck on the bottom of the sea. Now if a fish swims and hits bottom, it changes course. I have seen on occasion a fish being spawned too close to the bottom and getting stuck, and will have to fix that in a different manner. I have been trying to work some safety checks into my level_spawn function to prevent the player from being unfairly killed and prevent fish from being spawned stuck in the sea floor. So far, though, this has proved tricky. I can’t simply check for collisions, because the fish’s sprite gets scaled up immediately after it is spawned, and in the first tick of the game when the fish is newly spawned, its sprite is still normal size, so an anti-collision check could still leave it too close when it spawns. As well, I can’t merely check for collisions with the Player, because I want to ensure that the Player has enough room to swim away from a nearby threatening fish. I had some experimental code that should calculate a safe clearance distance around the player and pick coordinates outside of this safe zone to place newly-spawned fish, but when I tried running it, an odd bug arose wherein the fish count function stopped working properly — I’m guessing fish end up outside the room where they can’t be seen or eaten, but I can’t see how that’s possible given how I wrote the code that checks for this. At any rate, level transitions will be a future development goal that I will work out in more detail anyway.

The game demo level is already pretty fun to play, so if you have not yet tried the game out, now is a great time to get acquainted.

Boobie Teeth 0.21

Boobie Teeth 0.21 is now up on Releases. This is most likely the last update that I will be releasing before the talk I’m giving at Notacon 8, so if you’re reading this consider it an advance preview of what you’ll see if you happen to be attending.

This release has numerous improvements over 0.20. I went through most of the script code that I wrote and reformatted it, and in some cases did some refactoring. As a player you won’t notice this of course, but it will enable me to work faster and release more frequently as I continue developing the game. I greatly simplified the collision detection, which has yielded some modest performance improvements. As a result of some of the changes I made, I had to temporarily remove Feeder Fish from the game, but I’ll be bringing them back in as soon as I can rework them properly.

Since playtesting this version, I am really moved by some of the emergent behaviors that I’ve observed. Granted, sometimes the fish do stupid things like ram themselves into the ground or continue chasing a fish they targeted that has since grown too large for them to eat. But I’ve also seen fish leaping out of the water, feeding behavior that almost looks like schooling (though it isn’t). The thing I like the most, though is a change I made to the fish’s “normal” movement behavior. Instead of moving at a fixed speed, it changes through a range of speeds every few ticks. This gives it a movement that is more characteristic of fish swimming, with a pulsating faster/slower speed to it. I find it emotionally compelling when I see a fish moving like this while being chased closely by another fish right behind it — it looks like the fish is struggling to swim as fast as it can, falling behind, going faster… sometimes they get away, sometimes the chase fish is too fast for them.

I have a lot more planned for the AI in the game, but for now it’s at a point where it is basically playable and you can get a decent feel for what the game is meant to play like. This is much improved over earlier builds where “dumb” fish simply moved horizontally at a fixed speed.

Three eras of searching the world wide web

A little late to the game and perhaps obvious, I know, but I was just musing and it occurred to me that there are perhaps three distinct eras for the way people using the world wide web have found information:

The Yahoo era: A cadre of net geeks personally indexed and recommended stuff for everyone to look at when you told them what you were looking for.
The Google era: A massive cluster of robots scoured the internet and figured out what web sites looked like they were pretty good and matched them up with what you told them you were looking for.
The Facebook era: Your friends find something cool/funny/useful/outrageous and post something about it, leading you to do the same.

Ok, so yes, that’s pretty obvious to anyone who’s been on the web and paying attention from 1994-onward or earlier. Predicting what the next era will be is of course the billion dollar question.

The obvious thing that comes to mind is that things will just remain this way forever, and of course this is false and just a failure of imagination.

The next most obvious guess at what the future will bring is to combine the stuff that happened in the previous eras in some novel way. The Facebook era is kindof like that — instead of a hand-picked WWW index managed by the geeks at Yahoo!, we have a feed (rather than an index) of links which our our social contacts (rather than a bunch of strangers working for Yahoo!) provide for us to check out.

So, perhaps just doing a mashup of the Facebook and Google eras would point to what the next breakthrough in search might look like. Let’s try that:

Mash1: Our social contacts create a cluster of robots who index the WWW and come up with a custom-tailored PageRank algorithm tied to what turns our crank.

Hmm, intriguing, but unlikely. Most of our social contacts probably don’t know enough about technology to do that.

Mash 2: The behavior of our social contacts is monitored by robots who analyze the information that can be datamined out of all that activity, and use it to beat our friends to the punch. Especially for marketing purposes.

Much more likely! What we’re doing on social networking sites is already closely watched and analyzed by hordes of robots. All it would take is for someone to come up with the idea and implement it.

And it’s a good enough idea that I bet there are already people working on this right now. In fact, there definitely are if you consider social media advertisers. But I’m also thinking about more general purpose informational search.

In fact, after I congratulate myself on what a clever prognosticator I am and hit Publish, I bet within 15 minutes someone will post a comment with a link to a company that’s doing exactly this.

I mean, of course I could save myself the embarrassment and google around and see if I could find that myself, but it’s so last-era.

I want to see whether the Facebook era will bring the information to me with less effort expended. It may or may not be faster than the google era, but faster isn’t always the most important thing — sometimes there’s a tremendous amount of value in getting information from a friend that could easily have been looked up through a simple query to google.

5… 4… 3… 2…

Boobie Teeth 0.20

Finally got hungry AI target and seek behavior working properly. Fish now get hungry and chase each other.

Download it from Releases.

Boobie Teeth 0.19

Boobie Teeth 0.19 is now up on Releases. I’ve skipped public release of 0.18, which had some experimental AI in it that proved buggy. 0.19 is mostly a cleanup release, where most of the script code has been re-written and documented better. There are a lot of new things in 0.19, as well:

  • Disabled unstable AI routines from 0.18.
  • Fixed Pause function to display “Game Paused” in center of main view when game is paused.
  • Fixed collision mask on fish sprites to prevent “close-call” collisions.
  • Major code refactor to replace drag/drop actions with GML code scripts for improved readability, reuse. This cleanup should make implementation of future features easier.
  • Menu and configuration screens partly implemented.
  • Game runs in Full Screen mode, automatically sized to the display.
  • Renamed constant “SURFACE” to SEA_LEVEL to avoid potential confusion with drawing “surfaces”.
  • Game reads settings from .ini file on load, checks values for validity, and rewrites default values to correct a corrupted file.
  • Game reads local stats from .ini file on load, updates file after each game.
  • Fixed a latent bug with the Fish-Fish Collision that resulted in fish sometimes mutually eating each other.

“Cannibalistic” AI Targeting for Game Maker 8

I’ve made an improved version of my 2D AI Targeting demo for Game Maker. My original AI Targeting was limited by the fact that an object could not target other instances of the same object type — doing so in effect would cause the seeker object to attempt to target itself.

The original AI Targeting routine used instance_nearest(), which works great if you are targeting an object of a different type. If you need to target the same type of object, however, instance_nearest() won’t help you, since the nearest instance of the same object is always self.

Using instance_nearest_extended by Kyle_Solo, I was able to come up with a routine that allows for “cannibal” AI targeting — that is, targeting an object of the same type as the seeker.

I struggled for a long time to use the instance_xth_nearest() method to accomplish cannibal targeting, which seemed to be suitable as it has a built-in criteria test, but was unable to get the function to work as desired. I’m still not entirely sure why, but I am guessing that it may be due to the “other” keyword being undefined or referencing “noone” when an object is not involved in a collision.

I ended up successfully completing the project using instance_nth_nearest and a bit of extra code which performed the criteria testing that I required. In order to get my testing code to work, I had to introduce a global variable to count the number of instances of the targeted object, so I could construct a loop to iterate over them using instance_xth_nearest(). I’m wondering if there isn’t a faster or more graceful way to accomplish this, but it works well for now.

In the video above, the Arrows target the nearest Arrow that is small enough for them to “beat”. The rule I am using here is that a bigger arrow must be 1.3x the size of a smaller arrow in order to be able to “beat” it, but this could be modified to some other condition by changing the can_beat() function. If a candidate target cannot be “beaten” the arrow considers the next nearest arrow, and so on, until all of the instances of the targeted object type have been checked. If no arrow is small enough to be “beaten”, the arrow flies in a straight direction.

Source .gml and a demo .gmk project is available at the Releases page; a .gex extension build will be released in the near future.