csanyk.com

video games, programming, the internet, and stuff

YoYoGames announces license portability for GMS2

YoYoGames have announced in an update to their GameMaker Studio 2 FAQ that the beta for GMS2 for Mac OS X will be coming out in the near future. No exact date has been given yet. But their announcement also mentions that the Mac edition will be available to users of GMS2 who have already purchased a license for the Windows edition, at no extra charge.  In other words, purchasing a license will entitle you to run GMS2 on whichever platform you prefer, and you don’t need to decide that at purchase time, and you can change your mind at any time, or even switch between OS X and Windows boxes.

GMS2: License FAQ

This seems to align with the GMS2 license model, which ties your GMS2 license to your YoYo Account, not your computer.

I think this is great for longtime users who wish to get off of Windows PCs, and are willing to switch to Mac.  I only wish that YoYoGames had plans to port GMS2 to Linux, as had briefly been floated back in 2014.

Nintendo announces Switch launch date, price

Yesterday, Nintendo had their big announcement about their new console, Switch. It will be $299 on March 3, region free, online play will be paid, launch titles have been announced. The Joy-con controllers are more sophisticated than initially shown in the teaser video Nintendo released a few months ago. Joy-con have motion control and “HD” vibration features, and even a camera on the right side. Onboard there’s only 32GB of storage, which is expandable with SDHC the built-in screen is “only” 720p (which to be fair is plenty on a handheld screen, and should help with battery life to a degree) but does support touch.

The new Zelda title looks amazing. New Zeldas always do, but this one really does look very impressive. The new Mario looks a bit weird, like they put Mario in a GTA world, or that Halloween episode of the Simpsons from years ago, where Homer went through some dimensional warp and ended up in the 3D world. But also amazing. It won’t be out until later this year, unfortunately. There will be other sequels — surprised? Splatoon 2 is happening, as expected. Mario Kart 8 is being revised somehow and brought along for the Switch. Surprisingly, no word on whether Super Mario Maker is going to be ported as well. It really should be.

The biggest criticisms of the announced launch titles are how few they are, and that not enough Big Names have been announced. It seems Nintendo may be playing a game to maximize sales by spacing out their major releases so that each gets full attention.

I have some new questions. Because the Switch hardware is so reconfigurable and flexible, how will games adapt to it? Will Switch games be designed with the intent that the Switch be in one particular configuration in order to play them? Or will they have multiple modes, which can be played depending on which configuration you have your Switch in at the moment? I imagine it will probably be a bit of both. Although, if it drives costs up to make the software flexible enough to handle whichever mode the Switch is currently in, that could end up backfiring as developers target one specific mode only per title. How will supporting all of these different modes with one game work for developers?

There’s been a certain amount of WTF and ridicule following the announcement among Nintendo naysayers. Accessories for the Switch seem to be pricey. Over the last few months, since the initial announcement, there’s been a considerable amount of second-guessing among gamers. Initially the Switch seemed very exciting and innovative, a do-it-all, go-anywhere console with loads of innovative features and potential, but that initial impression wore off quickly as gamers wondered just how good the graphics and battery life would be, and what sort of capability the hardware would have relative to the competition.

Does Switch offer enough to get me to buy one? Maybe… Zelda: Breath of the Wild is the most attractive draw to the new console for me, by far. If they had Super Mario Maker, and maybe a new 2D Metroid game, that might be all it takes for me to put it on my want list. Hmm, how about a Super Metroid Maker? Or Mega Man Maker? Or literally any 8-bit franchise maker for that matter? I’d buy Switch in a heartbeat if they had something like that in the works. The small number of titles at launch isn’t that small, although the number of games that actually interest me is.

That’s a concern, but I’ve rarely been an early adopter when it comes to videogame consoles. My first console, the Atari 2600 had been out for several years before I was old enough that my parents bought one. I had no input into that decision, but it was a happy one. I think we got our NES in 1987, after a year of the Atari 7800, maybe we got a SNES the year it came out, the N64 came out when I was in college and my brother had one but I didn’t play it all that much compared to when I had free time.

I wouldn’t have bought myself a GameCube, which came out when I was probably the least interested in videogames that I’ve ever been in my life, but I received one for Christmas one year, 2002 or 03, I think, and didn’t buy a Wii until they stopped instantly selling out of stores…

I still haven’t, and likely won’t, buy a Wii U, ever, despite how much I’d like to play with Mario Maker.

And while I thought the Switch had an exciting design when I saw the trailer video for it a few months ago, I don’t feel all that excited about it. It’s capability as a mobile game platform doesn’t do anything for me — I’ve never been into mobile gaming. Its reconfigurable controllers are clever, but I don’t know that they truly offer anything new. And the multiplayer aspect, which seems to be another big part of Switch’s appeal, doesn’t do much for me, because I’ve always been more of a solitary gamer. For much the same reason, I haven’t been very into network games, either.

I just haven’t found much compelling about AAA games, really, for many years. A few exceptions, to be sure, but probably not even 1/year. I’m pretty deeply rooted in the old school, you might say. These days, I’m much more into retro-styled indie games, like Shovel Knight, Hyper Light Drifter, and Daniel Linssen’s brilliant Ludum Dare platformers, and classic 8- and 16-bit era games.

These days, I find I just don’t care as much for 3D games, analog joysticks, and voice acting and cutscenes in videogames. These things can be done well, but are so hard to do well, and age so poorly, compared to 2D games with low-res graphics, which seem timeless. Truthfully, most modern 3D games either feel crude and lacking in polish, or else cookie-cutter affairs lacking in soul, offering little that their predecessor didn’t also.

As such, I don’t feel that Switch is necessarily aimed at me. That’s fine. I’m pretty niche in my interests, and am served well by my existing library, as well as by the indie market. And I don’t know that that’s a miss on Nintendo’s part. I expect that if the exclusive titles are there, Switch will be a hit. But if Nintendo don’t get a lot of great first-party hits, and attract a strong lineup of 3rd party developers to release games on their platform, it could be a repeat of the Wii U.

I fully admit I know nothing about videogames as a business. I really liked the Ouya, and I still do. Time will tell.

Getting ready for Game Jam Weekend, part 2

Take inventory

Ahead of the weekend, it’s good to take a personal inventory. Conceptually, I like to break this into three main areas: Skills, Tools, and Supplies.

Skills

Skills are your personal abilities, your strengths that you will bring to the project. Are you a good designer of rules and systems? A good programmer? Visual artist? Audio designer? If you don’t really know what your strengths are, it’s time to reflect on what your capabilities are, and think about how they might be applied to the project. Even if you think you know what you’re good at, or what you’re going to be doing, it’s good to review everything you know how to do, just in case you might have overlooked something or taken it for granted.

Really, just about any skill can be useful in game development. It’s not just design, programming, art, audio, and project management. Things like math, physics, psychology, humor, and acting are all important skills that have obvious application to different parts of game development. Be open minded and creative, and ask your friends what they think you’re good at or what your strengths are. You might be surprised by what they see, that you wouldn’t have thought of.

Tools

What are you working with? If it’s equipment, get it all together before jam weekend and make sure it’s in good working order, that any cables or accessories that you need are not lost, and so on. Musical instruments, microphones, game controllers, and any other hardware that you can think of should be on a list, and packed up ahead of the Jam weekened. Do you need batteries? Are they charged? Do you have enough of them?

If it’s software, check for updates and make sure it’s installed and launches, that the license is activated, and so on.

Are there other things you can set up ahead of time, like your version control repository, project website, mailing lists, etc? Get it together ahead of time.

Supplies

Supplies are things that you’re going to need for the weekend that are consumable. Things like food, sleeping bag/blanket and pillow, toilet paper, etc. Or things like paper, pens/pencils/markers, and post-it notes. Or game pieces like dice, pawns, cards, and so on.

Make a list, and get everything together ahead of time. If you’re running around last minute, you’re going to forget something, and at the very least you’ll be more stressed out than you would be otherwise. Preparing everything ahead of time means you can relax, clear your mind, and focus on having a productive weekend.

Set goals

Although I said in my previous article that you should approach your physioligical preparation for Jam Weekend like you’re gearing up for an intense athletic competition, a Game Jam really isn’t a competition. The experience is what matters, not just the outcome. Failing is fine! It’s only a weekend, and part of the reason it’s only a weekend is to set the stakes low enough to allow you to take risks. So take them! Do something that might not work, or that you’re not good at, or that you haven’t tried before.

My first Global Game Jam, I wanted to simply complete a project in a weekend that was playable. I didn’t care how good or bad it was, although obviously I wanted to put my best effort into the project, and did. But my main goal was to have something to show for the weekend that I could call “finished” and show to others. That was a fine goal to have.

But there are other goals that you could have. And it’s entirely up to you what those are. Just think about them, and let them guide you. Your goal could be to work with or learn about a specific tool or technique that you have never used before. Or you could make your goal be to make the best game you know how to make, and so focus on execution rather than learning or experimentation, sticking with what you know and what you do well, and simply be as productive at what you’re already good at as you possibly can.

Your goal could be to focus on team work and collaboration, or on being a good project planner/coordinator. Or your goal could be to have a good time, or to ensure that someone else has a good time with their first jam experience, by creating a positive atmosphere and giving encouragement. Maybe your goal is just to find out whether this is something you can really do.

There are many, many dimensions to a game jam, and you can set goals respective to any of them. It doesn’t matter what your goals are, it matters that you have them.

Teaming

I see basically three approaches to participating on a project: solo, on a team, or as a freelancer.

Solo developers, do everything for their project themselves. This works well if you’re well rounded enough in your skills inventory to handle everything yourself. But most people are strongest in one or two skill areas, and are weaker or nonexistent in other areas. It can be limiting to work alone, or it can be liberating. But it all falls to you.

A Freelancer is a jammer who focuses on a particular skill, and provides services to as many teams as need it. This often works well for musicians or artists. Rather than remaining a dedicated resource for a single team, they will work on several projects. This keeps them busier than they might otherwise be. Oftentimes the artists are idle in the early stages of a project, prior to the game design being at a point where it’s ready for the artists to start working on things. And often they can finish the assets for a game quickly, and then have little else to do, and so are able to provide assistance to other projects.

Teams are when a group of people work together on a project. If you’re teaming, either you’re aware ahead of time who you plan to work with, or you’re not.

If you know your team members ahead of time, that’s great, because you can plan and coordinate and prepare ahead of the jam. Just knowing what your capabilities and skill levels are helps, but it’s also good to know what your goals and tastes are. Get together and go over your skill and tool inventories and figure out what your team’s strengths, weaknesses, goals, and interests are.

Get an idea of what role each team member will play, and then each team member can focus their preparation more narrowly in support of that role. If you have more than one programmer, make sure they’re on the same version of the tools that you’re using, and that you all have access to the version control repository that you’re using. Pre-jam is a great time to do stuff like set up your web site, your version control repository, Trello boards, Slack channels, and so on. Make sure that everyone on the team has access to any common tools that they will need to function on the team, and that they have at least some familiarity with them.

If you don’t know who you’ll be working with, and just go into the weekend intending to work with whomever has an interesting project and needs help, you can still prepare by getting to know the people who’re going to be at your jam site ahead of time. Make friends, and see who you might feel like you can work well with.

You can also prepare inwardly, too, and work on your presentation skills, and social skills. Practice pitching ideas, focusing on being brief, interesting, and persuasive. It can be hard to articulate ideas and explain them to other people, but practicing doing that can help.

A good exercise is to think of a game that is familiar to you and that you like, and describe it in less than a minute to someone who has never seen the game before in a way that would give them an understanding of the game and make them want to play it. Or focus on one aspect of a game and explain why it is successful at what it does. Being able to clearly describe a thing that does not yet exist is a critical skill in the early stages of developing a game. If you can do this clearly, succinctly, and compellingly, it’s more likely that you’ll be able to get others on board and aligned with your ideas.

It’s equally important to be good at listening to the good ideas of others, and to be able to negotiate compromises. Think about what it means to be a good listener, a good mediator, and a good conflict resolver and problem solver.

Another critical skill for teaming is managing the team and the project. How do you keep everyone on track, keep tabs on what each member is working on, and ensure that what they’re working on will integrate with the other pieces the team is working on? Communications should be ongoing throughout the weekend, with frequent check-ins to report status, verify that everyone understands what is needed and who’s responsible for it. How do you like to hear feedback? How can you help someone to understand what you’re telling them when they’re not clear?

In short, think about all the interpersonal dynamics of working with others, and ask yourself what kind of person would you want to work with. Remember that when you’re working with your team, and be that person! Thinking about it ahead of time will help you hit the mark, and avoid getting caught up in being short sighted in the moment.

Getting ready for Game Jam Weekend, part 1

Global Game Jam 2017 is coming up soon. I’ve been talking with my fellow game developer friends about how to prepare. It seems like a good topic for a blog post or two.

Preparing mind and body for the game jam

In this article, we’ll cover the mental and physical preparation you should think about doing ahead of time, and during the weekend, to maximize your performance and your potential.

Approach Jam Weekend like you’re getting ready for a major athletic competition.

(Normally this means a season’s worth of training on specific skills and physical conditioning, but we only have a few days, so I’m going to skip that part of it. It is what it is.)

A game jam is more a mental activity than a physical one, but the same ideas apply. Just as you would prepare for a chess or poker tournament, or a triathlon or ultra-marathon, you should strive to enter Jam Weekend at your peak. That means healthy, well rested, energized, and in top condition.

Be well rested and well nourished. Jamming for a whole weekend is seriously taxing on the mind, and the brain needs energy and rest, just as the body does.

Sleep

DO count on getting good sleep during the weekend.

Some people will stay up all weekend, but I don’t recommend it. You’re more productive when you’ve gotten adequate rest. If you can’t sleep well at the Jam site, and it’s pretty unlikely — there’s a lot of noise and chaos and activity going on at all hours — I recommend going somewhere you can get good sleep when it’s time, and if that means off-site, then so be it.

“Crunch time” is a common anti-pattern in software and game development, and is almost always unnecessary and detrimental in the long run. In the short run, people can and do get away with it — mostly when they’re young enough that their bodies and minds are able to withstand such stresses and recover from them.

Because it’s only 48 hours, a lot of people treat Jam weekends like they’re crunch time, and will stay up 36 or even 48 hours. I did that during my first Global Game Jam (in 2011) and learned from it that I wasn’t a 20-something college undergraduate who could pull consecutive all-nighters anymore.

My brain was determined to complete a project by deadline, and due to buggy beta software corrupting my project files, I ended up having to start over twice, redoing my entire project, which really sucked, and meant I basically had no choice but to stay up all weekend or else drop out, and I elected to stick it through to the end.

I finished my project, but my mind was not working anywhere near optimally during the last 12 hours or so, and at times I could’t keep a train of thought going. I’d stare at the keyboard trying to remember what I was trying to do, and what the next step was. If I’d just taken a couple hours for a power nap, I probably would have been better off, made fewer mistakes, and gotten more done. Although my project compiled and ran, I discovered that it was buggy and unwinnable, and had to fix it after deadline. Every project is likely to be buggy, of course, but working under extreme sleep deprivation is only going to make that worse.

Still, some people do seem to thrive on short term sleep deprivation, and become more creative, more focused, or just more crazy, and if that’s you, and you know what you’re capable of, do what works for you.

Nutrition

Eat good food beforehand, and bring or order good food for the weekend.

At my local Global Game Jam site, there will be food provided, and probably they’ll take orders for delivery from somewhere, but a lot of it is junk food or comfort food, and not necessarily what’s best for being well nourished. So consider doing better by yourself.

Preparing a healthy balanced meal is a lot better than eating convenient junk food and caffeine. I wouldn’t dream of specifying a recommended diet, but if you don’t know what’s healthy, look at physical trainers and what they recommend for athletes. A lot of starchy food like pasta or potatoes can be good for storing energy. Fresh vegetables and good lean protein is also an excellent choice.

You don’t want to spend a lot of time on prep and cleanup during the jam, so if you don’t have non-jammers supporting you with food service, then either order out for yourself, or prepare meals to bring that you can reheat easily.

No outside distractions

It goes without saying, perhaps, but try to have your outside life well in order so that it doesn’t intrude on your weekend. Anything can happen of course and if you have to bow out due to some family emergency or something, well, you do what you have to do. Always have your priorities in order, and follow them. If something comes up, hey, that’s life. But plan ahead, and do what’s necessary to keep your plate clear so you can focus on the one thing, and keep yourself free of distractions and other responsibilities as much as possible.

Galaxian is a triumph on the Atari 2600

As a child of the 1970’s, I’ve been attracted to arcade video games since I was tall enough to reach the controls. This was 1981-84, during the heyday of the arcade’s Golden Age, a time when games like Pac Man, Dig Dug, and Galaga were new, hot, and everywhere. Grocery stores, gas stations, seemingly anyplace people might spend time, you’d find a couple of arcade games, ready to suck the quarters out of anyone who passed by.

Just slightly older than these games were the ever-popular Space Invaders, and its evolutionary next step, Galaxian. Although these titles were top shelf games in their day, I found that I didn’t enjoy them very much.

Space Invaders was just frustratingly slow at first, but then sped up to an unfair pace by the end, and I could never manage to destroy that last invader on the first wave. You had to have perfect aim to hit it, and it moved so fast it was seemingly impossible to track, so you had to be lucky. If you missed, the slow-moving missile took forever to disappear at the top of the screen, and you couldn’t fire again until it did. Usually this delay meant your death, as the hyper-paced final invader would reach the ground, ending your game. Plus, it was black and white. It felt old. I respected it — even then I could tell that it was a important game — but grudgingly, I had to say that I just didn’t enjoy it that much, although I wouldn’t have admitted it to anyone back then.

Galaxian, too, was a game I found too slow and frustrating to play at arcades. It seemed like the next step in the vertical space shooter. Graphics were now in color. A formation of aliens marched back and forth across the screen, but this time instead of descending toward the earth, they stayed at the top of the screen, while one by one, or in pairs, individuals would peel off from their formation and dive bomb you. Their bullet patterns and flight paths seemed to make it all but certain that they would hit you if you didn’t hit them first. I could usually survive for a while, maybe clear a screen, but it never failed that if I happened to miss a dive bombing enemy, it would corner me in the side of the screen and crash into me, or hit me with too many bullets to dodge. You could always dodge one, but there’d always be another one following up, and your first dodge would put you right in its path. It seemed unfair, and so, not very fun. I always gravitated toward the games that I could last a bit longer on, so I could get my money’s worth out of my quarters.

I had a cousin who owned an Atari 5200, and played Galaxian on it once or twice while visiting them. The 5200 port was a very faithful reproduction of the arcade experience, not exactly arcade-perfect, but nearly so. I still didn’t care much for it, because it suffered from the same shortcomings. It wasn’t as bad to lose at home, since it cost nothing, but I still preferred to play games that felt fair.

It never entered into my mind that maybe I just wasn’t very good at Space Invaders or Galaxian. But probably, I was. Ok, not probably. I sucked. But in my defense, I was like 6, and just tall enough to reach the stick and see the screen. But back then, I blamed arcade games for being “greedy” in contrast to home consoles, which seemed to reward players with longer games that were still challenging, but more fun because they weren’t so brutally ass-kicking hard.

I never played Galaxian on the Atari 2600 back in the day. I’d played the 5200 version and was impressed with its arcade-quality graphics, and I remember seeing the pictures on the back of the box on the 2600 version, and being unimpressed. Since I never particularly enjoyed the game, I didn’t have any interest in owning it on the 2600, never knew any kids who had it in their collection, and so never played it. At some point, we had an Atari 7800, which had Galaga, the sequel to Galaxian, and one of my very favorite games, so I played a lot of that.

I’m not sure when exactly, but at some point I picked up a copy of the 2600 port of Galaxian, probably a few years ago. I recognized it was a significant title in videogame history, and so I wanted it for my collection, despite not having favorable memories of it from its heyday.

I finally got around to playing it today, and came away very impressed. Here’s a video review so you can see what it’s like:

The 2600 port plays much better than I remember the arcade. The motion is extremely fluid, which, considering the limitations of the Atari 2600 hardware, is nothing short of amazing. Maybe I’m just better at videogames than I was at ages 5-8, but I found that the game felt very fair, with divebombing enemies that are actually dodge-able. I’m sure, the horizontal aspect ratio of the screen plays into this somewhat, as you have more room to dodge, and also your shots that miss take less time to leave the screen, meaning that you can fire follow-up shots that much faster.

I was always a fan of vertical shooters of the Atari 2600, my favorites being Megamania, Phoenix, Threshold, and Tac-Scan, and Space Invaders. Galaxian is every bit as good as the best of these, and is still fun to play even now.

Playing Galaxian tonight, I found that my strategy was different from how I played the arcade original some 35 years ago. My old strategy was to try to shoot the enemies still in formation. They were easier to hit, since they didn’t swoop or shoot at you, and it seemed to me safer to eliminate them before they could turn into a threat. I’d try to shoot the divebombing aliens as they flew over me, and dodge out of the way of them and their shots, but mostly I concentrated on blowing away he ranks of Galaxians in formation, much as I approached Space Invaders.

My new strategy was much more successful, and rewarding: I ignored the galaxians in formation, since they don’t do anything that can hurt me, and focused on the divebombing aliens. It turns out, this has many advantages. First, by focusing on the divebombers, you are focusing on the only thing in the game that can threaten you. Shooting them is a much more reliable way to avoid them than dodging. You will need to dodge sometimes, but if you focus on developing skill in shooting the moving enemies, it gets pretty easy to pick them off before they can collide with you. The green Galaxians are simple, slow moving, and easy to hit. The purple ones are harder to hit, but with a little bit of practice the timing becomes easily mastered.

Hitting divebombing enemies in mid-flight makes you safer in two ways: enemies are destroyed before they’re low enough to collide with you, and they can’y get all their shots off. Typically, you’ll hit them as they cross ahead of you, and so you’ll be moving in the same direction, to track them, and the shots they do get off will fall harmlessly behind you, and by destroying the alien as it passes directly above you, you prevent it from getting ahead of you where it can drop bombs that would be dangerous to you.

Additionally, by hitting them as they’re diving toward you, your shot has less distance to travel, which means that you can get off more shots — since you can have only one shot on the screen at a time, when they hit something low on the screen, the shots don’t have as far to travel, meaning they hit the target sooner, meaning that your bullet is consumed and you can then fire another shot more quickly. If you miss one of the bombers, you might still end up hitting one of the galaxians still in formation, especially early in the stage, which isn’t so bad either. But the lower your shots are when they connect with an enemy, the faster you can shoot.

This in turn sets up a rapid flow of firing, hitting a dive bomber, then hitting the next dive bomber with a rapid follow-up shot. Once mastered, you can mow through the entire formation in quick succession in this manner. This turns out to be very enjoyable. You feel more skillful, since you’re targeting the fast-moving enemies, getting more points for them, and it looks more risky, since you’re often hitting the enemies pretty low on the screen, when it looks like they’re most dangerous — but at the same time you’re actually playing the least risky style of play. Of course, that’s what skill is — finding the right pattern of actions to minimize your risk, while doing what looks the most daring.

It’s clever, because the more intuitive way to avoid risk would be to try to avoid the dangerous enemies and attack the enemies that aren’t a threat. But counter-intuitively, when you focus on the dangerous enemies, and take the aggressive approach of destroying them rather than running from them, it minimizes the risk they pose to you, while the enemies that aren’t a threat remain a non-threat.

At this point, I recognized what a truly well-designed game Galaxian for the Atari 2600 is. I’m curious to see whether this strategy applies to arcade Galaxian. Since I don’t have ready access to an arcade with Galaxian in it, the next best thing is to watch a YouTube video of a skilled player.

And it looks like this is indeed the strategy to employ, although this player also has enough time to target plenty of enemies still in formation. I think the 2600 and arcade versions are different enough in their game play that they feel like different enough that while the basic strategies are more or less the same, the specifics are different. In the arcade, there’s much more space between the bottom of the screen, where you are, and the top of the screen, where the enemy formation is. But ultimately, I think the Atari port gives you less time to target the enemies in formation, forcing you to spend most of your time focusing on the swooping divebombing enemies.

In any case, Atari 2600 Galaxian is a fantastic game, and if you’re into vertical shooters is a must have, being one of the finest examples of the genre on the Atari, as well as an outstanding port of a historic and classic game.

GameMaker Studio 2 impressions: Object editor

The most notable change in the Object Editor is that sub-windows are “chained” to the main form, in what YoYoGames is calling “Chain view”.

GMS2 Object Editor

The idea is that different parts of the Object editor should all be visible, not overlap each other, connected visually.

The main Object window shows the object’s basic properties: the Name, Sprite, Collision mask, and Visible/Solid/Persistent/Physics properties, as you can see. Chained to it are the object’s Events, and the Code Editor (or DnD Editor) will be chained off of the Events sub-panel. If your object happens to be a Physics object, or has Parents or is a Parent, then the Parent and Physics sub-panels will also chain themselves to the main Object editor form.

GMS2 Object Editor chain

This takes some getting used to, and occupies quite a lot of space on screen, which for users with smaller displays can make it a problem to work with Objects inside of a Workspace.

Fortunately, Object Editor windows, like any other window, can be broken out of the main GMS2 window and maximized, to fill up the entire screen if desired. Users will either love or hate Workspaces and Chain View windows, and if you’re one of the ones who hates them, you’ll need to get used to breaking the editor out into its own window and maximizing it, as this seems to be your only recourse for now. There’s a few Preferences in the Text Editors section that will make this easier for you, should you want to configure them:

GMS2 Text Editor Preferences

The GameMaker Community Forums have been very active in discussing the UX issues created by the new UI, though, so don’t be surprised if YYG do make a few changes in future updates.

DnD or GML?

The Object Editor comes in two flavors: Drag-n-Drop (DnD) and Code Editor (GML). Which variant you get is currently determined when you create a new Project, but you can switch at any time. Most users will probably prefer to create GML projects and work in the code editor, but beginners, younger users, and non-programmers may prefer the DnD option.

Probably the most important feature of either variant is its interface for defining actions in your Object’s events.

I’ll be focusing mainly on the GML version, since that’s what advanced users will use. But briefly, Drag-n-Drop has been completely overhauled in GMS2.

The new Drag-n-Drop system

Vastly expanded in GMS2, there are now DnD equivalents to just about every function in GML. Unfortunately, this means that there are vastly more icons needed to represent all of these new DnD actions, making them harder to learn. Similar to Chinese or Japanese, where every written word has its own symbol, there’s a DnD icon for every GML function. While it’s reasonably easy to pick up a DnD library with a small number of actions, this quickly becomes unwieldy as the number of actions grows. Unfortunately I expect this will have the undesired effect of making DnD too complex to use for beginners and non-programmers, making it questionable how valuable the DnD system will be in the future. Learning to code by typing out instructions isn’t that hard, and is arguably the better way to learn in the first place. But it’s nevertheless true that for certain people, they feel intimidated by programming or typing, and an intermediary step of using DnD like “training wheels” until the new user has an understanding of GameMaker’s fundamentals and is ready to move on to GML, has been one of GameMaker’s defining features.

In GMS1.x and earlier, DnD Actions were iconographic representations of special GML functions that started with action_ for example, action_set_hspeed(number). These functions were mostly redundant, being equivalent to other GML functions and expressions, for example hspeed = number;

The action_ GML functions are obsolete in GMS2, and are no longer needed. DnD Actions can convert directly into GML with a single menu command. This is a one-way conversion, and should help users who want to “graduate” from DnD programming to GML programming. Formerly, in previous versions of GameMaker, there was no way to convert DnD to GML code, other than to manually re-write everything. If you try to convert GML into DnD, rather than a sequence of DnD actions, you’ll get your GML code wrapped up in an Execute Code DnD Action, and the Object Editor will switch to DnD mode, allowing you to continue programming with DnD actions. While not particularly useful for advanced GMS users who are already familiar with programming in GML, it’s a nice improvement to the way the DnD system works.

GML Code Editor

The new GML code editor is still somewhat rough, but shows promise of numerous improvements. Indenting is standardized, to 4 spaces per tab by default, although this is configurable, and there are subtle guidelines showing where tabs will align to in the background. Row lines are numbered, again configurable if you don’t want to see them.

GMS2 Code Editor

The most obvious difference is the new color coding for syntax. This may take a bit of getting used to, but at first I found that my code looked very rainbow-y, and I found this to be somewhat of a distraction at first, but after a few days I found that I had adjusted. Every color is customizable, if you want to bother with that.

Auto-completion and hinting is improved in the new editor. All project variables, macros, etc. are included, not just the built-in GML keywords.

GMS2 Code Editor AutoSuggest

The completion hints at the bottom of the Code Editor window are very helpful to remember all the arguments that must be provided to a function, in the right order. And for any scripts which you author, if you use JavaDoc commenting, you can provide hints for your own functions as well.

GMS2 Code Editor Completion Hint

Rough Edges

Cursor navigation keys are either different from standard Windows text editors, or else not yet fully implemented. I’m accustomed to, and very reliant upon, using Home|End|Page Up|Page Down|Shift|Control|Arrows to move the cursor about the window, to select text, and for copy/pasting. In the GMS2 code editor, these keyboard shortcuts do not all work as expected, which can be pretty annoying.

In most text editors, Home and End keys will make the cursor jump to the 0th or last position in a row, or if Ctrl+Home|End is pressed, the 0th or last position in the file. Presently, Home and End do not appear to be supported at all in GMS2.

The Arrow keys move the cursor around the document one character at a time, and if Shift is held down, the characters that the cursor passes over are then selected. Holding Ctrl down will speed the cursor up, moving it a word or a paragraph at a time.

For some reason when selecting text using Ctrl+Shift+Arrow, with the horizontal arrows, the selection gets “stuck” at the beginning/end of a row, and will not advance beyond that unless Ctrl is briefly released. This is a relatively minor annoyance, but should nonetheless be corrected. Normally, Ctrl+Shift and the Left or Right Arrow key will select to the next word, and will wrap lines if it reaches the end of a line.

Up or Down Arrow will move the cursor up or down a row, and with Ctrl+Shift held down, should move up/down to the next blank line. This is standard behavior in pretty much every text editor I’ve used in Windows, or Mac OS for that matter, but it is not the behavior in GMS2 at the time of this writing. I am hopeful that this will be addressed before the end of the Beta.

But by far the biggest thing that users are complaining about in the Community Forums has been the way the IDE wastes space in its default configuration, due to the way Workspaces and the Chain View UI work. Fortunately, breaking out the Code Editor into its own, maximized window is an easy workaround to this problem, and largely addresses it to my satisfaction.

Apart from these issues, I like the new UI for the Object Editor, and the Code Editor very much.

GameMaker Studio 2 licensing is de facto subscription-based

Today I had a bit of a reminder, of something that has been gradually coalescing for some time. And since it got my attention, I thought it might be a good time to talk about some specific things, and some far-ranging points as well.

It started innocently enough… I launched GameMaker Studio 2 today, and got an error message:

GMS2: license expired

I clicked Retry, and was prompted to log in with my YoYo Account. I supplied my credentials, and…

GMS2 authentication failed

Something must be wrong with their authentication backend for the IDE, perhaps? My login credentials allow me access to the website, so I know that my credentials are good. I logged in there, and reviewed my license, and my license duration says “permanent” although at the moment apparently there’s something wrong and my license is “expired” according to the software.GMS2 permanent license

I eventually got in by doing a password reset. I’m still unclear why I was able to authenticate to the YYG website, but not GMS2, using the same known-good credentials, but resetting did the trick. I’m back in.

All’s well that ends well, right?

Implications

“OK, so what? What does that all mean, and why should I care?” you might ask.

What it means is this: Despite the label saying so, my product activation isn’t permanent. At the very least, it’s subject to YoYoGames continuing to exist, and having their licensing service up and running, and contingent on my software refreshing some authentication token periodically.

If that can’t happen any longer, for whatever reason, then I lose access to the software that I paid for. And that’s disturbing!

(To be fair, this had been the case under GMS1.x as well, all along, although previously in GMS1 license activation wasn’t explicitly tied to a user authentication. GMS1 users had to have a network connection in order to refresh their product license, which needed to happen about once a month.)

Moreover, although YYG have been quiet about it, all the groundwork is laid for them to switch to a subscription-based model, at a point when they decide the time is right. My guess is that probably this will happen a few years from now, once the consumer software market has accepted SaaS — if and when that happens. I believe it is more “when” than “if”, at this point. The average consumer doesn’t care or understand enough to make it a matter of “if” any longer.

We could quibble if we wanted, but what I’m getting at is that what YYG call a “permanent license” I will call a “permanent subscription.” The license is activated by virtue of the account authentication, and if this ever breaks or is revoked, the software is not usable.

The vendor controls the version numbers, so they can play the game that when they want to break the promise of permanent licensing, all they have to do is release “GMS3” which will be a new product, and thus not bound to the old licensing terms in the way that 2.1 or 2.9 or 2.x would have been. YYG have already done this — they amended the terms of the GM:S Master Collection license, which originally had a provision entitling users who purchased Master Collection to all new versions and modules that YYG released, without qualification; later this was changed to “within the 1.x sequence”. So Master Collection owners would have to pay for GMS2 when it came out.

That’s the thing with these license agreements; the vendor can change them at any time, and users have little choice but to go along with it. This is a major reason why I view click-through agreements as false contracts. In real contracts, one party cannot change the terms of the agreement on a whim, without the consent of the other party. In the world of click-through license agreements, this happens all the time, and users have little choice but to accept it, or stop using the product. Very often, users aren’t even aware of the terms, before or after the change. It’s almost meaningless to the user, because they have so little say, so little power, that there is little to no benefit to them in understanding the agreement that they supposedly are agreeing to.

So of course YoYo would amend a previously stupidly over-open agreement to close a loophole and provide necessary limitations. Of course, that’s just the way business is. Businesses need to make money, and if they don’t make money, they stop existing. Restaurants may offer free refills, but if you go back the next day they make you buy a drink again. But you have to be careful when promising things that are unlimited, permanent, or infinite. The reality is, nothing like that ever exists. Customers should know better than that. It doesn’t stop them from complaining when they discover that in reality there are limits, impermanence, and finities.

To be clear, I don’t mind paying for new versions when they are released, just as I don’t mind buying a new car when my current car is worn out and needs to be replaced. I fully recognize that paying the company for new products enables it to continue developing those products, and I want to support that. But I want to own the car that I own! I don’t want to have to buy a new car every single year, regardless of how much use I have gotten out of my car, or how well the car still works. I don’t want to lease or rent a car, or pay a taxi service to drive me about when I need to go somewhere. I don’t mind that these are all options — I simply believe that consumers should be able to choose freely what makes the most sense for them, the choice that provides them with the greatest value.

Subscription-based GameMaker: someday

Nevertheless, it seems very plain that at some point in the future, YYG intend to switch to a subscription model. This could be the day all casual game developers will be done with GameMaker. I expect that YYG are well aware of this, and will be very careful about how and when they do it. Just as it makes little sense to pay for a gym membership that one only uses a few times a year, it will be hard to justify subscribing to GMS as a software as a service if the service is not used often enough. YYG will want to retain those users.

Well, perhaps they’ve thought of that as well. In Help::About, there’s an interesting statistic that they display for you, counting how long you’ve been running the IDE:

GMS2 time in IDE

Potentially, then, this means that YYG are in a position to offer GMS2 on a metered basis, charging users not on a subscription basis, but on a consumption basis. This could feasibly make it affordable for casual users to pay for the software hourly, and if they use it enough, it could then cap the cost and cut over to a subscription for the whole year.

Let’s say YYG’s business target is to extract, for example, $100/customer/year on average from all users. Professionals will pay considerably more, in order to gain access to “pro” features that they need to do business, such as additional build targets, access to the Marketplace, etc. Pro users are their “bread and butter” so they focus on delivering products with features that will attract and keep the pro segment of the market happy.

These features are by and large attractive to non-professional users as well, and especially to students and other users who have aspirations at turning professional at some point. Cultivating future pro users is very important to the continued success and growth of the product. So YYG will do well to subsidize the student/apprentice developer with professional aspirations.

But a lot of game developers are not releasing games professionally. YYG know this very well. YYG know that casual game developers won’t go for paying an annual subscription that amounts to $100/year. That amount sounds like a lot of money to many people. Many of their users still complain about YYG raising the cost of GM8.x from $25 to $40, and then introducing GM:S at a $99 price point. A lot of GM:S users still only use the free version of the software, and likely will never willingly spend any amount of money on it. YYG know that some users may only use GameMaker for a few hours a year, perhaps amounting to a few days of total usage at the most.

And yet, if you amortize a cost of $100 over the course of a year, it’s just about $0.27/day. In the early 1980s, people would pay quarter just to play one arcade game for a few minutes. $0.27/day sounds much more reasonable than $100/year, even though it’s the same amount. YYG can tap in to the casual developer market as a revenue source by softening the psychological barrier to paying $100 all at once.

So, to bring them in as paying customers, YYG can provide a metered pay option, and if they decided to charge $100/year for the software as a subscription, and to create a perception of “value” for the $100 annual expense, maybe they charge $1/hour or $1/day or $10/month for metered users — something higher than the “bulk” rate of $100/year, but something still reasonable that a casual developer will (perhaps grudgingly at first) accept. At $1/hour, a heavy user would hit 100 hours quickly, and at that point they would be better off cutting over to the annual subscription model (and if YYG wants to keep customers happy, that cutover should happen seamlessly), but a casual user who maybe puts in a weekend game jam or two a year will come close to 100 hours of use in a year, and YYG can still extract close to their goal, by hitting them with the metered cost.

And maybe this is even good. The videogame marketplace is choked with free product produced by, it seems by now, millions of developers, very few of whom are able to make significant income at it. Maybe the barriers to enter that market are too low right now, resulting in glut and pain and low quality products. Maybe easiest to use tool with the largest number of users should be priced out of the reach of people who aren’t really serious and really talented, enough to be able to create truly viable games. Maybe there’s some silver lining to that.

I’m not against YoYo making money, and if this keeps their lights on so they can continue to develop the product, then good for them…

But…

In the pre-SaaS subscription days, software companies would generate the revenue they needed by scheduling a major release to occur (roughly) annually, and sell permanent licenses for that version. More or less users felt forced to upgrade annually in order to stay current, and the vendor would offer an upgrade discount to soften the blow, as well as provide new features, improved user experience, bug fixes and support as the incentive to buy into the annual upgrade.

The crucial difference was that software activation was permanent, and wasn’t dependent upon a service that needed to be up and working. This meant that users could opt not to upgrade, if they didn’t feel that what the vendor was offering was worth upgrading. Often, causal users would choose to remain a few versions behind, rather than pay for the upgrade. In some cases, this was due to not liking the direction the vendor was taking with the product, and very frequently it was due to the fact that software bloat meant that older hardware had a hard time running the latest version of a product, but could run an older version very fast.

The downside of course was that permanently activated licensed software was prone to piracy, and over the years the sales lost to product activation circumvention has been a vast, but literally uncountable figure. Software developers know this and network-managed licenses tied to accounts that are ultimately in the control of the vendor seems to be the final solution.

YoYo have not announced any plan to actually switch to a subscription model, but all the infrastructure is in place for them to switch to it at any time, and I expect that they will at some point. The writing is pretty much on the wall at this point. That day may not be in the near future, but it is probably inevitable that it will happen. Even if it doesn’t happen, users’ “permanent” licenses are anything but, so long as the user must authenticate to YYG’s product activation service on a regular basis, and may be subjected to termination if YYG deems they have violated ToS or EULA provisions. Or if YYG decide they want to stop supporting some old version of the product. Or if they go out of business, or get hacked, or whatever else.

To be clear, it’s not that I have a believe that YYG want to “screw” their customers; it’s that they have the power to do so, whether or not they ever actually exercise this power. No user wants this hanging over their head, and most tolerate it only because they’re unaware, and those who are aware tolerate it only so long as they aren’t bitten by it.

To be sure, it will never be the case that all GameMaker users will agree with every move that YYG will make with the product, and every time they do anything, there will be some users who will complain. Sometimes, some of them will have a valid point, that they are being screwed. Companies inevitably screw customers when it is not profitable to serve them.

My point is, historically it’s always been possible for disgruntled users to continue using the last version of the product that they were happy with. And for now, this continues to remain the case. Only, as of now, it only continues to remain the case for as long as YYG elect to allow it to.

Evolution of the status quo?

And, really, End User License Agreements and Terms of Service Agreements have always held such provisions, haven’t they? Users who do not agree with EULA/TOS are supposed to not use the software. Only, this was less enforceable before use of the software was tied to an account that you have to authenticate. This created both slack which allowed the users to get by even when they didn’t agree to every last term in an agreement, and tension when vendors could discern that agreements were not 100% adhered to, and felt that this was harmful to them.

That unresolved tension is in a slow process of snapping, and it’s the users who are bound to lose. I can say this with certainty, because software users are like any group of consumers, and consumers are averse to becoming organized an acting in solidarity, while businesses can only remain in business by being organized and being focused. Sure, on occasion people may raise their collective voices loud enough to be heard on issues like Network Neutrality and SOPA, but this is always a precarious, ad hoc affair, where the public’s interests are protected at the last minute, as though by a miracle. Companies can afford to play a long waiting game, and like a constrictor snake, squeeze a little bit further each time, never relaxing, until the prey is exhausted and expires. The bottom line is this: computers and software are becoming increasingly more like appliances, and less like tools. The only recourse users have is to stop using; if enough users do that, then they can kill a product. Of course, killing a product in no way creates a better, or more agreeable one. All user “victories” end up being pyrrhic in this sense. So in the end users are still screwed in a “take it or leave it” proposition. At a certain point, the only freedom attainable is to be your own programmer.

The alternative is for vendors and users to respect and support one another. To the extent that this happens, I guess we can say that software-based service companies will be successful. But really, I strongly suspect that users, much like medieval peasants, can tolerate a great deal of oppression and famine before they will revolt. So the existence of a market for software is not by itself sufficient proof of a free or happy market.

EULA/TOS agreements have for a long time now been treated as though they are contracts, even though the reality is that they fall short of being a true contract in numerous ways. Oftentimes, software usage agreements have provisions which are not legally enforceable, but including them is a “nice try” on the part of some lawyer who seeks to erode the public’s rights in some way that allows corporations to consolidate their power over the individual. Very often these “nice try” measures go unchallenged, and once they’ve been around for a while, there’s precedent for them, and suddenly they’re seen as “valid”. They go unchallenged, because users could ignore them without penalty, and pressing the matter in the courts was expensive and risky at best, not because they’re accepted. But by not challenging them, over time they become accepted and normalized.

I’ve never been happy about this state of affairs. Even as a kid, I could always smell something rotten about the idea that you could buy something and not actually own it, but only the limited right to use it under certain specific terms, which you could only agree to or not, with no provision of negotiation. It creates an unequal relationship where one side has nearly all the power, and the other side has very little, other than to boycott.

For this reason, I’ve always felt that licensing was a bogus business model, and that software should be owned outright by a customer who purchases it, with all rights that are implied by that statement. This belief comports much better with the values of the Free Software movement than it does with commercial software, and so for many years I’ve preferred to use Free software. For the most part, though, I’ve been a pragmatic believer in “best tool for the job” and if that meant the best software was commercial/licensed, then ok, but if it was Free/Libre software, then so much the better.

Wider ramifications

I see developments like this taking place in the world of commercial software, and in response I feel more strongly drawn to Libre software. But I don’t think that Libre software is necessarily the right use model for all software development, and I also don’t think that Libre software can protect all users freedoms.

For example, it’s difficult to see how a libre use model would work for entertainment software or art software. Where the point of the software is to provide a very author-controlled experience for the users to enjoy, certain software freedoms may not work. For example, the right to modify and redistribute modified software would mean, effectively, that companies could prey on indie developers who release an innovative game who assume all the risk of creating a novel experience, only to have it ripped off by a company who does very little innovation or risk taking, but positions themselves to exploit the creative work of others. Certainly, some user freedoms are important to preserve, such as the right to port an experience to other hardware, to create archival backup copies, and so forth, but I don’t necessarily feel that all user freedoms must be granted by a developer who is using software as an artistic medium, where the fact that the product is, contains, or uses software is incidental to the product being sold as an experience. It is fun, and allowable, and good, to enable users to create mods of games, but not a requirement or necessary in order for that software to be considered a work of merit. And playing a modded game is not the same experience of playing the original game.

And Libre software doesn’t protect all freedoms: we’ve all seen Libre software used in ways that abuse users rights. For example, much of the internet runs on a platform of Libre software, but provides a closed service to users which does not respect user freedom. I am only able to use Facebook, under Facebook’s terms; I can’t stand up my own Facebook service, which I might modify and redistribute. This despite Facebook being built on a stack of Libre software such as Linux, Apache, PHP, most of which are licensed under terms that say that users have the right to modify and distribute changes made to them, but that the source code must be distributed if the changes are distributed.

Web sites get around this by never distributing — “serving” the software is not “distributing”. You don’t install the source for Facebook on your computer and manage your own Facebook installation; Facebook is a service that you visit, on Facebook’s computer, and log in to it to use Facebook under Facebook’s terms. I’m not just picking on Facebook, they just happen to be the biggest website in the world right now. But pretty much every website ever has always worked this way: you can consume the service it provides, but you can’t own the software that provides the service, can’t install it on your own computer, can’t modify it to work the way you want/need it to, and are therefore subject to the terms under which it is offered by those who do own the service. And so, users are subject to these terms. And their data is collected, harvested, and used in ways that benefit the harvesters, not necessarily the users, and sometimes in ways which harm the users, or are counter to users’ interests.

The Libre software movement recognized a lot of end-user rights that are important, anticipated a lot of ways which those rights may be attacked, eroded, and compromised, but it failed to adequately safeguard all user rights against all possible attacks.

One could argue that by not doing so, it enabled the commercial internet to flourish into what is has become today. And while that’s true, that’s not an all-good proposition.

GameMaker data structures: a cautionary tale

I learned recently that when you are working with data structures in GameMaker, you have to be very careful.

When you create a data structure in GMS, the ds_*_create() function returns an integer value which is the id of the data structure. You then use this id whenever working with that data structure.

When you destroy the data structure, this frees up the memory that the data structure used, and the data structure is now longer accessed.

If you take that id and test to see if the data structure exists, using the ds_exists() function, it should return false.

The operative word being “should”. It doesn’t always.

Why not? Because, the GameMaker runtime reuses the ids, and if you create a new data structure, it will hand out that id that belonged to the data structure that was just destroyed.

To illustrate the example, we’ll use a ds_stack:

var a = ds_stack_create();
ds_stack_destroy(a);
 
var b = ds_stack_create();
show_message(string( ds_exists(a, ds_type_stack)));


You would think that ds_exists(a, ds_type_stack) would return false. But it doesn’t, because ds_stack b just moved into ds_stack a‘s old address.

Apparently the correct practice, which is not mentioned in the manual, is to immediately clear the value of a after destroying the ds_stack that it points to, like so:

ds_stack_destroy(a);
a = undefined;


If you do that, then a no longer points to an address that can potentially be used by another data structure, and you’re safe, even if b has the same address as a once did.

Of course there’s still a problem if multiple variables all point to that same destroyed data structure. This is probably a somewhat rare circumstance, but could possibly by the case in some circumstances, for example if you have a global variable, or controller object, holding a data structure that is accessed by multiple instances of some common object. Keeping track of every variable that references the destroyed data structure and clearing all of them when the data structure is destroyed is not an easy thing to do.

Update: Thanks to @YellowAfterLife for the very clever tip!

In other words, do this:

//original declaration:

a[0] = ds_stack_create();
//aliases
b = a[0];
c = a[0];

//destroy the data structure AND clear the variable
ds_stack_destroy(a[0]);
a = -1; // this destroys the array a[], and therefore kills b and c's references to it

d[0] = ds_stack_create();

ds_exists(a[0], ds_type_stack); //returns false
ds_exists(b, ds_type_stack); //returns false, despite not knowing to clear b
ds_exists(c, ds_type_stack); //returns false, despite not knowing to clear c
ds_exists(d[0], ds_type_stack); //returns true

Actually, don’t do that. I just tested it, and it doesn’t work. I must have misunderstood @YellowAfterlife or maybe he didn’t think through his advice carefully enough. I’m currently waiting for an answer on this, and will update it with something that does work, or a full retraction, once I have it.

It’s debatable whether the re-use of handles like this is in fact a good practice, but at the moment it’s the way GameMaker works, and has worked, for years. To some extent, re-use is probably impossible to avoid entirely, but the discovery that they are re-used so soon after being freed is a bit of a shocker.

More information.

The worst code I’ve ever written

Over at the GameMaker Community Forums, there’s an amusing thread where people confess to the worst code they’ve ever written. Since GameMaker is often used by newbies, it’s pretty common to see some hilarious WTF moments in code.

My favorite has been:

if fps < 60 { fps = 60; } //Fixes any performance problem!

If you’re not familiar with GameMaker, fps is a read-only variable that the engine updates to indicate the number of frames per second the engine is making. If it’s below room_speed (often 30 or 60), the game appears to stutter or lag. This happens when the hardware can’t keep up with the demands of the software…. so naturally the way to fix this to simply assert that fps is meeting target! ROFL!

I think that this code would actually compile and run without throwing errors in old GM. Despite being a read-only variable, GM would allow you to overwrite the value, not caring because the engine would simply re-calculate fps and update it again on the next step, and nothing adverse would happen. But if you were drawing fps to the screen, you would see “60” — even though the game might be lagging.

Here’s my own story:

When I was working on my game Alamogordo for Ludum Dare 29, I wanted to replicate the font used by the Atari 2600 in the game E.T. 
 
I had not heard of sprite fonts before, and had never used them. So I improvised my own system. First, I fired up E.T. in an emulator and took screen captures of the score, taking care to get all 10 digits that I would need. I then cut out the numbers and put them into a sprite resource. As I recall, I had problems with the selection size not always being the same, or being exactly centered, so it took quite a bit of time just to get the sprite set up so that it was the right size for all digits, and all the digits were positioned the same relative to the sprite origin.

Next, I wrote a script that took a number that I passed into it, converted that number into a string, then took each digit in the string and ran it through a switch statement, matching the value in the substring against a case that drew the right sub-image of my sprite that held the images of all the digits, and correctly offset them from one another, to draw the score on the screen. Only… no, I didn’t even do it like that! I actually used div to get the ones, tens, hundreds, and thousands digit, and then used that value as the subimage index to draw the sprite.

It worked beautifully, and at the time I thought it was brilliantly clever, but that there had to be a better way if only I had the time to RTFM.

I was using the variable name “finds” for storing the score because the player’s score goes up whenever they uncover something as they dig through the Alamogordo landfill, finding it, and you got a certain amount of points for each find you discovered.

///Create Event:
finds = 0;
image_index = 0;
image_speed = 0;

ones_digit = 0;
tens_digit = 0;
hundreds_digit = 0;
thousands_digit = 0;

///Draw Event:
ones_digit = finds mod 10;
tens_digit = finds div 10;
hundreds_digit = finds div 100;
thousands_digit = finds div 1000;

draw_sprite(sprite_index, ones_digit, x, y);
draw_sprite(sprite_index, tens_digit, x-sprite_width, y);
draw_sprite(sprite_index, hundreds_digit, x-(2*sprite_width), y);
draw_sprite(sprite_index, thousands_digit, x-(3*sprite_width), y);

At the time, my inspiration for the game was very last minute, I hadn’t even intended to produce a project that weekend, but the idea came to me Sunday and I ended up putting the game together in literally about 10 hours altogether. So I was just pleased that it worked on the first try. I had literally no time to experiment or read through the manual in the hopes that I would find a proper way to do it!

Lol! I recall writing that code, running it, seeing that it worked, and saying “Right, then! Good enough!” and moving on to the next thing I had to do. It’s fantastic sometimes what you can crank out when you’re only concerned with finishing on time, and don’t care about things like correctness or maintainability.

Truth be told, this is probably not my worst code I’ve ever written, but it might be the worst code that I’ve written that actually did what it was supposed to do.

Epilogue: I later learned about and used a sprite font in my Ludum Dare 36 game, Ancient Technologies. It was a much nicer way to draw the score to the screen!

GameMaker Asset: Rolling Average

In creating my last tutorial and demo, I needed to calculate the rolling average for the fps so I could measure performance differences between Instance Pooling and Create-Destroy.

It turned out that the functions for setting up a rolling average were pretty simple, yet were a pain to do well. So once I got them working, I decided to make them into an asset for GameMaker: Marketplace, so they’ll be easy to re-use in any project, with any series of numeric values, and so I can share them with the community.

Calculating a rolling average over a series of streaming values is now simplified by these new functions:

rolling_mean_create()
rolling_mean_destroy()
rolling_mean_add()
rolling_mean_read()
rolling_mean_size()
rolling_mean_resize()

Rolling Average on GameMaker Marketplace (free download)

Rolling Average on itch.io (free download) (free download)

Full documentation

csanyk.com © 2016
%d bloggers like this: