Tag: Game Maker

MUST!GET!EGG!

Inspiration strikes in unexpected ways sometimes. This morning while I was listening to the news on the local NPR affiliate, a story came on about an easter egg hunt in Colorado that was canceled this year because the year before, parents were out of control, being aggressive about making sure their precious child got an egg before they were all snatched away by the villainous other children.

I was so appalled by the story that I made the following snarky quip on Facebook:

MUST!GET!EGG! genesis

The imagery was so strong that I knew I just had to work up the idea into a full concept and design, and then build a game. I wrote up a little design document today and I liked it, so I put in a few hours this evening working on it, and it’s still very early but I think this will actually be a decent game when it’s all done, if I can make everything work the way I want it to.

So far it’s very crude, but in less than four hours I had playable characters roughed out. Here’s the shotgun-toting Hunter in action:

MUST!GET!EGG! alpha screenshot

One thing I noticed about this creative process is how satisfying it is to have an angry reaction to a news story and turn it into the inspiration for a creative work. This is how I know that I’m a game designer: when my first response to something is “Make a game out of that.” Doing it in response to something that makes me feel is what makes me an artist.

I also found the game concept itself very satisfying because it’s so inappropriate — it’s hard to get much wronger than having shotgun-toting hunters gunning for bad parents at an easter egg hunt to teach everyone a lesson. If this were done up as anything but a zany pixel-art graphics 2D game, it’d probably be disturbing and controversial. As it is, I suppose in the next few weeks or months if it gets noticed, it may end up generating some controversy, especially if the news media picks up the story of this game as sortof an echo of the original story.

The thing that makes me happy about this project is just how quickly I can work when I have a spark of creativity. My Game Maker craftsmanship continues to improve and I find that I can make things very quickly, which is essential for me. Unlike the experience I had with the Global Game Jam back in January — which was amazing in its own right — tonight I didn’t have to go through the agony of losing work due to a corrupted project file, and having to rebuild everything. I worked quickly, and got results quickly. I can imagine completing a full project like this in maybe <100 hours, which is fantastic.

Every time I pick up Game Maker and build something with it, I get a little more confident, find it a little easier, and learn a little more. It feels great.

Response to “5 Game Maker Cliches to Avoid”

This is a response to 5 Game Maker Clichés to Avoid. My intent is to provide some counterpoints to consider, not a refutation per se.

“Boxes & Circles Don’t Make Good Characters”

Agreed, but games don’t have to be about characters. Abstract games are a lot of fun, too. Of course, even abstract games need to have good graphics. Better do something really cool with that box if you want players to engage with your game and have a compelling experience.

However, it depends a great deal on what your capabilities and resources are. Good sprite animation is expensive. It takes skill, and time to master that skill. Not everyone has that at their disposal, and it shouldn’t stop someone from doing what they can with what they have. If you do it long enough, you’ll get good enough, or you’ll come into contact with others who have skills to complement yours. Many of them will want to be paid for their work, however. So if you’re not yet to a level where your games are generating revenue, it can be hard to attract a team of talent. And without a team of talent, it can be very hard to develop a game that will attract enough attention to generate any revenue. But if developing a well developed character is too expensive — by which I mean if it’s slowing down your progress or preventing it altogether — I say ditch it until it becomes affordable.

It can certainly add polish to a game to provide a well-designed character, but don’t let character development and emphasis on graphics take focus away from designing a solid core game play. For as long as videogames have been around, there has been an over-emphasis on the importance of graphics. Graphics make the strongest first impression, but it’s even more important to provide responsive, intuitive controls, a balanced system of rules, an appropriate challenge curve that neither frustrates nor bores the player, and an overall experience which compels the player to want to play again and try to do better than their last game. Graphics will oversell a poor game play experience, but players know when they’re having fun and when they can’t put a game down. If your amazing graphics draw more people in, you’d better have something to give them when they show up.

Perhaps the best situation is when your character design fuels and inspires your game play design. If you’re implementing character traits or behaviors, think about how those work within the game, to make them more than just dressing.

“Default Resources”

Changing the load screen and default icons requires a paid license, right? So I imagine that rules out a lot of student and amateur developers right there.

Well, if you’ve paid for the license, and want to be taken seriously, then you want to touch every aspect of the game you produce and make it “yours”. Including making your own icon and load screen.

That said, I’ve never played a game and said “Wow, they had such great progress bars!”

I think it’s a little sad and ironic that GameMakerBlog basically says that the key to making a good Game Maker game is to disguise it so people won’t think it was made with Game Maker. Game Maker is a decent platform for game development, and doesn’t get as much respect or recognition as it really deserves.

Sure, Game Maker has its issues and limitations, but many of these are due to it making compromises necessary in order to realize its strengths. It has a low barrier to entry compared to, say, C++ and OpenGL, but cannot offer the kind of performance that native code in a low level language can. But Game Maker does in fact serve its intended purpose very well, and in the right hands can yield amazing results. “Looks like it was made in Game Maker” really means “by an amateur who doesn’t know what they’re doing” and such a person working with other tools likely often doesn’t even get their code past the compiler.

So the large number of low quality games made with Game Maker is really a mark of success, after a fashion. After all, if you have a little limited success early on with your first attempt at making a game, it’s more likely you’ll continue to try to get better than. Before you can make a great game, you have to start somewhere, and Game Maker gives move aspiring developers their start than probably any other platform. Learning to do it better will happen in time, but once you’re there, I don’t see anything wrong with showing a little pride and/or gratitude about the tools that helped you get there. Maybe some great games that leave in the placeholder load screen would help enhance Game Maker’s reputation.

“Windowed Mode”

GameMakerBlog claims that making a game in Full Screen is easy and requires only a few lines of code. I would say that setting the game to run in fullscreen mode is easy, but getting that game to look right and perform well at any resolution in fullscreen is not as easy.

It’s possible in Game Maker to force the Display to a resolution the programmer decides the game needs to run at, but a lot of players will not like that. Having the program take over the display settings and change them is jarring and can be alarming, and if it doesn’t reset things back to how they were on exit, is extremely annoying.

Beyond that, if you make the decision to support multiple resolutions, you have a lot more work cut out for you. You must make decisions. How do you handle larger resolutions screens? Show more of the game? How do you size your rooms? Do you just stretch and scale them up for larger size resolution monitors? Do you use a black border? Do you dynamically re-position your HUD and re-position objects and tiles? Do you create static rooms to support every resolution you want the game to be able to play at?

My AutoFullScreen extension helps with the coding for setting the game to run in fullscreen mode and setting up a view sized to the display dimensions, but you will still need to decide what to do with your rooms, and possibly write some functions which change your room sizes on the fly, or else generate static rooms for every room in your game at every resolution.

What players really deserve is customizable settings. And Game Maker does not provide the developer with anything out of the box that you can just drop in to a project and be done with it. I would love it if I could just drop in a generic, skinnable room that provides basic graphics and sound controls, and maybe a set of widgets that allow other configuration settings, like changing the default control mappings, resetting high scores, and so on, a trophy room for achievements, and so on. That would be so nice.

Instead, the developer has to devote resources to building a “Settings” room, and then figuring out code to change all the relevant settings they want the player to be able to customize, and figure out a way to build useful interface widgets that the player can manipulate, then skin it all to make it consistent with the graphical theme of the game’s art design. It’s made even more challenging by the fact that Game Maker has no built-in user controls that you can simply drop into the room and put a little code into. You actually have to create sprites for sliders and buttons and checkboxes, and program them from generic objects. It’s *very* time consuming compared to what you get with other development environments.

Learning how to do all of this is a great exercise in learning how to program, but it’s such a common task (pretty much EVERY game needs this) that Yoyogames really ought to build in more for the developer to simply use rather than devote their resources to thinking about the problem, designing a solution, trying to figure out everything you need to figure out to do it.

“Pseudo-Companies”

This one I agree with entirely. The trend is emblematic of what young kids do when they get together and work on things. In part, it’s just learning by mimicry of what they see adult-run companies doing. Sometimes maybe it *is* adults, just trying to get a small design studio established but failing because that’s what happens 99% of the time. But it is annoying that these failed attempts can linger around on web forums and so on. It’s enough to make you wish that Yoyogames would provide a “kiddie pool” for students who are just starting out with learning programming, which they kindof do by providing a “Beginners” discussion board. Of course, message boards have the same policing problems that all discussion boards do.

Beginner questions should relate to questions developers have about using Game Maker, not a “help wanted” board for people looking to collaborate to find each other. One solution would be to provide such a board, and move the discussion there. Set the board up so that posts only remain visible for a set length of time, so that abandoned efforts to start up something don’t clutter the board.

In general, Yoyogames should try to find ways to help real efforts at start a game development studio or team succeed, rather than complain about all the failed efforts, abandoned projects, and people who are “doing it wrong.” Start by identifying what successful design teams have done to get off the ground and self-organized, and provide that information to help everyone, and maybe provide access to tools that will help facilitate that effort.

“Short Stories”

It’s not surprising that typical Game Maker games are small. Up until now Game Maker has not facilitated team development, and a solo developer can only do so much. As well, unless you really know what you’re doing with how you architect your objects and code, Game Maker projects tend to be difficult to scale up into larger games. Since all variables in Game Maker are “public”, there’s no discipline enforced on the developer by the tool to code in ways that keep things organized and manageable. “Spaghetti code” projects tend to result, and this hurts maintainability. Anything that hurts code maintainability will also make it harder for projects to grow beyond a certain point.

Beyond that, if you finish playing a game and feel like it was too short, the game developer has succeeded at leaving the audience wanting more. Sequels are the solution here. For a solo developer to invest a huge amount of time into developing a large game without first putting something out there to get a feel for how well it will be received is not a good idea.

It’s crucial, though, to be able to follow up the teaser with something fresh quickly. Failing that, some kind of level editor or player-moddable game can sustain interest. Unfortunately, Game Maker doesn’t lend itself to creating games that are easily moddable in this way. It’s certainly possible for this type of functionality to be developed, but it requires an advanced level of Game Maker knowledge, and again, a lot of time. Make this easier and put it within reach of Intermediate Game Maker devs, and perhaps we’ll see more of it.

Game Jam postmortem++…

I haven’t looked at my Global Game Jam project since the Jam ended, but I wanted to continue development and turn it into a more finished game. Over the weekend, I started.

Rushing and long hours hurt projects. (Duh.)

My intent was to refactor some things that I knew needed to be, but as I got into it, I ended up noticing more bugs that had escaped me during the Jam. Oh, how embarrassing. I’ll embarrass myself further by dishing the details here.

Bugs

  1. I thought I had fixed the Endian-ness of the Byte in the demo level, but as it turns out I didn’t. I fixed it in one place — the Create event — and forgot to make the same correction in the Step event — where the game spends 99.9999% of its time running. So, effectively I had it fixed only for the first 1/30th of a second of the game, and left it broken otherwise.Oops. See how code duplication can hurt you? If I’d refactored properly as I went along, the code would have existed in only one place, and fixing it the first time really would have fixed it.
  2. The victory condition check seemed to be broken. After I fixed the byte so that it was little-endian, I went back and played the level again, and sure enough found it easier (though it’s still difficult and largely luck-based) to get the Byte to output the ASCII character that matches the Clue. Only, something’s still not right… When I go hit the Executor switch, it’s still telling me they’re not matched. What gives?Well, it turns out the font that I picked, Joystix, renders identical glyphs for capitals and lowercase letters, making it a poor choice for my purpose. I might have noticed this if I’d been paying closer attention. The victory condition check actually does work properly, but since you have no way of discerning whether the clue is a capital or lower case letter, when you think you’ve matched it, you actually have just a 50-50 chance of being right.
  3. For some reason the logic switches sometimes get stuck “off”. This took the longest for me to figure out, because I kept looking in the wrong place. It turned out to be due to an improperly written switch statement which had one unhandled case that I didn’t account for.

Causes

So, these bugs really weren’t all that deep. Once found, the bugs were simple to fix. They were just mistakes that are typical of hastily written code that hasn’t been properly tested. Which isn’t to say that I didn’t do testing, just that I wasn’t able to do proper testing. I’m not sure whether to blame myself, the 48 hour structure of a Game Jam event, or Game Maker.

Well, the first two bugs were all me. They were logic errors on my part. I can blame the sleep deprivation and general rush of the Game Jam for contributing to my errors, but I really can’t have expected any tool I could have used to catch them. When I am exhausted, I make errors like this much more frequently than I normally do, and they become far harder for me to catch when I do make them.

I think this is a valid criticism of the Game Jam concept, but it’s also necessary to point out that Game Jam’s primary focus is not on producing quality code, or even quality games. So, to a certain extent, while it’s a valid point to make that building software this way isn’t the best way to do it, that doesn’t really diminish what is good about participating in a Game Jam. It’s foremost about experiencing the fun of building something cool. It’s also about showing that it’s possible to iterate very rapidly in game development. It’s about creativity and learning how to work effectively with small teams and limited resources. While code quality is important, and a development team could choose to make it a focus, it’s clearly an optional part of the weekend. Still, the better projects are more than likely going to be built with better quality code.

The third bug… well, ultimately, it was a user error with how I wrote my switch cases, but the lack of good debug tools in Game Maker do make it harder to find and fix errors. Game Maker really does not have proper testing and debugging features, apart from some very rudimentary variable tracing, and aborting and logging runtime errors, that’s all you get.

Prevention?

For the most part, the way you test in Game Maker is to run the project and try to set up the circumstances that you want to test, and watch closely as it executes and if something unexpected happens, try to infer from the behavior what is happening. If the program doesn’t crash outright when a bug is executed, it’s basically a perception check on the part of the tester to see if they bug is blatant enough to be noticed.

Subtle bugs, or rare occurrences, can be very difficult to detect. On top of that, it’s rather time consuming. And when you fix it, how you confirm that it’s fixed is more of the same trial-error process.

I’m not sure whether it’s possible to do Test Driven Development in the Game Maker environment. It might be, after a fashion. Like, there’s no way to set up a separate test suite project and rapidly have all events pass. But you could implement some functions designed to test your code, and then run them by sticking them into a special test room. It is possible to build yourself a “test room” where your test cases are set up in some defined, controlled manner and you can check each time you build to see if your latest changes to the project have broken any existing functionality. In fact, a good test room is a must with any complex game. But even then the test room will only help you to notice that a test fails, not tell you why it failed.

But even then, you’re probably not going to have total coverage. In some cases, a lot of of a game program’s behavior is actually emergent, rather than explicitly programmed, and I’m not sure how you could write a test routine for something like that.

Can bugs be good for the game development process?

Even if it is possible to reduce defects by using Test Driven Development in Game Maker, I’m not sure how feasible it is. Games are very complicated, and ultimately the real test of a game is how it plays, so to some extent all that time-consuming trial-and-error testing serves a purpose. It’s unlikely that any number of test rooms that you can build are going to be able to set up every single permutation that could possibly come to pass at runtime.

It’s easy to design certain aspects of game software, but designing “fun” into the game is not so easy. Often, what is fun is what surprises us, and what surprises us more than a program behaving in an unexpected manner? I’m sure countless times in the annals of game development, some unexpected program behavior was embraced as a feature or enhancement rather than classified as a bug and removed from the program.

Sometimes, Bug = serendipity

A good example of that from ASCIIboros is the way the player’s bit re-randomizes when you land from a stationary jump. The idea that the player even should carry a bit value around with him was something that came to me fairly late in the weekend. At some point, I realized that most of my bitwise operations required there to be some other value, since you can’t very well do Or, Xor, And, Add, or Sub with just a single value.

And where would that come from? Well, the easiest and most obvious thing to do was to make it a value that the player carries with them. I quickly implemented this, simply assigning a bit value randomly when the Player object is created.

I didn’t think about how the Player would change its bit value at first, but before it really even hit me that this would be useful and even necessary, the solution to this problem presented itself by way of a “bug” that I chose to adopt as a designed feature: When you jump vertically, upon landing the Player’s State Machine re-calls the bit assignment routine, resulting in a re-randomized value. Problem solved. Only, it was never a part of any design process.

I’m not saying that the bug was creative. But encountering this bug presented an opportunity which my creativity recognized, and found useful. Probably 99% of the bugs I fix don’t do this, but once in a while, they do, and sometimes they can be better ideas than the ones you I of deliberately. Now that I’ve adopted it and included it into my design, it’s no longer a bug.

Now, not all types of software projects want to have these kind of “accidental” design innovations come up during development. With game design, I imagine it’s much more allowable, since the game really doesn’t have to meet any specific real-world requirements; a game program’s output is the experience you have when you play the game, and as long as it’s more fun, that’s all that matters.

Of course you were writing business software, getting the output right is a lot more important, and probably needs to be defined in the designed much more carefully and precisely. It’s hard to imagine serendipity making payroll processing better, for example. Even so, if you’re too rigid with requirements and design, I think you’re closing yourself off to possibilities which are worth exploring when it comes time to muck about with code.

There are times when you can know ahead of time exactly what you want the program to do, and there are no questions that need to be answered during programming, or which you couldn’t have thought of ahead of time if you were just really, really smart. But perhaps those times are not as frequent as we might think. Particularly if “we” are Project Managers or Business Analysts.

Programmers are more than just adept at manipulating symbols to perform arcane calculations with mathematical precision. The good ones are often very creative thinkers in their own right. It’s important to recognize those types of developers and allow them freedom and to incorporate their creative process into your project management style.

And it’s not enough to include your programmers in the design phase of your development cycle (which you should be doing anyway). Sometimes design ideas present themselves during the process of building; we should be open to embracing good ideas whenever they present themselves. I’m not saying that all design innovations are going to be discovered through accidental defects in coding, either — oftentimes programmers will have good ideas come to them simply because they’re playing around with pieces of a project, and it’s a lot more stimulating to be playing with building blocks than it is to be looking at a blank design template.

If you haven’t played it yet, now’s as good a time as any to grab the ASCIIboros Demo from the Releases page and try it out. Windows only, sorry:/

Download ASCIIboros

speed = s/invaders_count;

Another Space Invaders HTML5 update. The only thing I did with this build was fix the speed increase. It dawned on my after watching video of the original that the speed increase was gradual, not that it picked up at specific numbers of Invaders remaining. Reading about it on Wikipedia, I learned that the original Invaders were actually constrained in speed by the hardware, and that as you destroyed more of them, the CPU had fewer things to do so took care of updating the remaining ones in the phalanx faster and faster.

I still have yet to implement the bunkers; it’s not straightforward to do destructible sprites, and I haven’t yet looked into methods for accomplishing it yet, but apart from fixing the high score glitch that’s all that’s left.

Oh, I suppose I could give extra lives after a certain number of points scored, if you insist.

Play Space Invaders HTML5

ASCIIboros submission for Global Game Jam 2012

The “theme” for Global Game Jam this year was the Ouroboros, the mythical snake that eats its own tail in an infinite, recursive cycle of death and rebirth.

Ouroboros, the snake that eats its own tail

What a freakin’ cool theme that is. Seriously.

I ended up working solo on an idea that I had. My first thought was to make a platformer where you loop through a single level infinitely as you are chased by the “snake head” that eats the level behind you. Each time through the level, things you do in the last pass through cause some change so that the level, while still recognizable as itself, has gotten more difficult. Next, I thought that rather than make the level more difficult, it could be a puzzle that you’re stuck in until you do the right thing to escape, much like the later castle levels in the original Super Mario Bros.

I had never made a platformer before, but had enough experience in Game Maker that I felt confident I could pull something off. To facilitate rapid solo development, I embraced lo-fi graphics. They’re cheaper and easier to make, and without a team behind me I wouldn’t have much time to do more. My friend Steve Felix from the Cleveland Game Developers meetup stepped in and helped me by producing the run and jump animations, based on my original stick figure. Everything else in the game is all me.

The lo-fi look is a nice homage to the 8-bit era, and lends itself to thinking about low-level computing. You feel closer to the metal when you have fewer bits to make reality out of. This led me to my idea for the core mechanic of the game.

Binary and Source Download Here

Global Game Jam ASCIIboros project page

(more…)

Notacon 9: A Game, Any Game

Notacon is an annual technology conference held in Cleveland, Ohio that I have been going to for the last few years. This year’s conference, Notacon 9 runs from April 12-15, 2012.

I spoke last year at Notacon 8, and enjoyed it so much that this year I’m putting together another presentation, a crash course in Game Maker, AND organizing an event for the weekend, called A Game, Any Game. A Game, Any Game will be a 72 hour sprint to develop a working video game.

I took a little inspiration from Ludum Dare and Global Game Jam, and a little from the fact that too many of the people I’ve met through the Cleveland Game Developers meetup still have not built a finished game. I want to give everyone who participates the opportunity to get past that milestone in a weekend, and feel that sense of accomplishment that makes you feel so good.

As its name implies, A Game, Any Game is intended to be very open-ended. We’re aiming to provide a venue and encouragement, and just enough structure to give participants the traction they need to create a game in under 72-hours. It is not a competition; the idea is simply to make a game, any game, and get it completed in the 72 hours we have during the conference. Participants are encouraged to use any and all tools that they have at their disposal to make their game, and if they have never done anything like it before, they’re invited to attend my talk, Game Maker Crash Course. People can choose to work on whatever ideas they feel like working on, but if they need some help brainstorming, I’m going to come up with something to help seed the clouds.

For me, it’s going to be really interesting to see how many participants we can attract, and how many finished games we can produce. This is the first time in a long time that I’ve tried to organize something like this, and I think the key to it being successful will be promoting the event effectively to get people interested in doing it, and then making their experience great.

I think I have more ideas on how to make the experience (hopefully) great than I do on how to promote. Aside from blogging about it here, tweeting my fingers off, and telling everyone I know, what else can I do? I’m asking anyone who’s reading this to spread the word. Tell anyone you know who might be interested about Notacon and the A Game, Any Game event. If you use Twitter, the hash tag #n9agame will be used for any business related to A Game, Any Game. You can follow my tweets as well @csanyk.

Safe Zone extension for Game Maker

I have completed my Safe Zone extension for Game Maker, and made it available.

Altogether, here’s what we now have:

SafeZone.gmk – the original proof of concept, which creates a non-wrapping, square safe zone around the protected object.

SafeZone2.gmk – improved proof of concept, which creates a circular safe zone which wraps around the protected object.

SafeZone5.gmk – Further refined, now the function incorporates parameters which control whether the wrap applies in the vertical or horizontal directions, or both, or neither.

SZ5.gml – the raw .gml of the script code written for SafeZone5.gmk

SafeZone_1_0.gex – The Safe Zone extension, v.1.0, based on the SafeZone5 code.

SZ_GEX_demo.gmk – a demo project which incorporates the .gex rather than scripts.

This extension could use further refinement, as it assumes that literally anywhere else in the room is safe to place the new instance. If you have solid objects in your room, or multiple other objects that you do not want to collide with upon spawning the new object, this obviously will not hold true. But for certain types of games, such as single-player free-flight games, this should be quite useful.

Wrapping safe zone spawn in Game Maker

I got a working demo of a safe zone spawn which works with wrapping rooms. I refined my technique for determining the safe zone, and now instead of being a square, it is circular.

I like this approach, it works pretty well. Basically, rather than trying to literally “wrap” the safe zone around the edge of the room, I create five safe zones. They are at protected(x,y), protected((x+/-room_width), y), and protected(x,(y+/-room_height)). In my instance_create loop, I merely determine whether the new instance’s candidate x,y location is within some distance of any of these five points.

The current script I wrote up is working, but it just uses a distance in pixels. My original approach calculated a distance automatically, based on the size of the objects’ sprites, and a padding factor, which I liked. I’ll likely create a version of this script that works that way in the next day or so, when I have a moment, and then package the whole thing up into a .gex for distribution.

Until then, the .gmk source is already up on the site.

One other note: One of the annoying things about Game Maker is that when you write a function, you can only return a single value. In most other languages, you can create classes of objects, which can be used to encapsulate as many values as you like, and return the entire object. Game Maker kindof lets you do this, but you have to create a Game Maker object, which it a bit more literally object-like, in that it carries some baggage with it. I think that my function would be more useful if it simply returned a set of (x,y) coordinates without actually creating an instance there. But I can’t return both x and y — a function can only return one value. I could return the id of an instance of an object, however, and simply spawn an empty, spriteless object at those x,y coordinates, and allow the developer to either change that instance into whatever kind of object they needed there, or else grab the x and y values from the object and destroy it. It’s an idea I’m toying with, not really sure which way to handle it is best at the moment, but it’s fun to play around with ideas.

Spawning objects outside of a safe zone in Game Maker

In Game Maker, it’s non-trivial to spawn a new instance, avoiding collisions with existing objects in the game. This can make it tricky to create games with “fair spawning” so that the player isn’t automatically killed when a new, randomly-placed instance springs into existence.

It isn’t terribly complicated to work around this problem, thankfully. Basically, the approach I take is, knowing the x,y coordinates of the instance or object that you want to want to avoid collision with, and the size of that object’s sprite, you can define a “safe zone” around the instance you wish to protect.

I’ve whipped up a quick demo in Game Maker 8, showing a technique which seems to work pretty well. This is a very simple illustration of the approach, and could be refined further to handle wrapping the safe zone around the edge of a room, or to handle enemies of randomly varying sizes. To make it easier to understand, I’ve actually created an object to represent the “SafeZone” . This is unnecessary, as the dimensions involved can simply be calculated on the fly, using the right GML.

Source .gmk.