Episode 2: The Framework

In this post I’m going to talk bit about how and why I chose my programming language, IDE, and framework.

JavaScript

When I started this project, I was familiar with a number of languages including Java, C++, and PHP, but I had recently spent a lot of time using JavaScript for some web stuff, so I was kind of in the JavaScript zone. In addition, I really liked the idea that I could just upload the game to my website and let people play it in a browser, regardless of platform. I also love the fact that rebuilding my project means saving a text file and refreshing the browser. The console is also pretty awesome for debugging.

For these reasons I chose to use JavaScript as my programming language.

Sublime Text

I’m going to say something controversial right now. I use Windows. I’m sorry, and I regret it every time I talk to other programmers. I know I should have a MacBook Pro and be using the Linux terminal for everything, but I’ve always owned a PC with Windows, and I never used the Linux terminal until university.

Anyway, I had used Nodepad++ and other text editors in the past, but a friend had recently told me to check out Sublime Text, so I did, and I liked it. Sublime Text lets you open multiple files at once, save projects, search and replace in multiple files, customize colors and highlighting, and much much more!

Phaser

As I mentioned in the previous post, I had never used a game engine before, so I really had no idea what I was looking for. I basically Googled “JavaScript game engines” and quickly chose one that had good examples and documentation.

Having only used Phaser, I can’t really speak about its strengths or weaknesses. However, it seems easy to use, especially for 2D sprite-based games like Zyrian. I’ll talk more about Phaser in future posts, including examples and everything.

Episode 1: The Idea

In future episodes, I’ll be breaking down individual components, mechanics, features, techniques, and lessons, but now I’m going to talk about the reasons and ideas behind Zyrian. But before I do, let me give you a better picture of where I was at heading into this thing.

I began programming casually in my early teens after stumbling upon an old book on QuickBASIC. Before returning to university in 2014, I had a decent grasp of simple programming concepts like variables, conditionals, and loops, but I knew nothing of software design, algorithm analysis, and object-oriented programming. I had dabbled with Visual Basic, but I still only knew one language.

After a year and a half of both classroom and self-directed learning, I knew a lot more about programming. However, I still had no knowledge of game design. I didn’t even know what a game loop was. The only “games” that I’d made were either text-based or point-and-click and were borderline unplayable.

Like many amateur game programmers, I had previously confused making a game with making a game engine. I couldn’t help it – I really wanted to know how things worked. But after listening to tutorial after tutorial tell me to use an existing game engine, I decided to give it a try. After little to no research, I chose Phaser – an open source JavaScript framework.

Okay, now back to the reasons and ideas behind Zyrian.

The Why

I don’t know if I ever explicitly contemplated the reasons for making this game, but if I had, they would have been something like this:

  • Learn to use a game library
  • Improve on some of Tyrian’s features
  • Make a game that people might actually play
  • Finish something

After numerous half-butted attempts at creating games over the years, this one was different. I had some education behind me, I had a plan, and I was motivated to make something I would be proud of.

Now I’ll talk about some of the main ideas I had about the game I wanted to make.

Features to Keep

There’s a lot of cool stuff in Tyrian. In addition to the beautiful graphics, interesting content, and a neat power consumption mechanism mentioned in the introduction, Tyrian also has engaging music, satisfying sound effects, a simple and effective menu, front and rear weapons, shields, sidekicks, and alternate game modes (including two-player).

I didn’t want to include every feature. After all, some of them seemed pretty advanced for a newbie. I also didn’t want to make my game too similar to the original. Here are the features that I decided were important to keep:

  • Two sets of weapons
  • Power consumption mechanism
  • Shields and crash damage
  • Items, money, and shopping

Numbers & Stats

As a fan of role-playing games, I love stats. I love equipment, leveling, talents, and skills. And so one of my ideas was to bring RPG elements into the scrolling shooter genre, like how Borderlands brought it to the first-person shooter.

Although Tyrian has some RPG-like features, it gives only vague indications about stats and numbers, so it’s extremely difficult to determine whether one item is superior to another. This is mostly true of the weapons, which are by far the coolest and most important items in the game. I believed that incorporating more RPG elements would add depth to my game.

Randomization

Another feature often associated with RPGs is randomization, and I wanted to use it in the game. The main areas that I thought would benefit from randomization were the items, enemies, and missions. This would make the gameplay experience a lot more diverse, which would increase the replay value. I also thought that it might be easier to create a random mission generator than to create dozens of missions.

Item Balancing

In addition to randomizing the items, I also wanted to balance them.

If you’ve ever played Tyrian, you probably know that you should begin the game by upgrading the Pulse-Cannon (which you start with) and getting the Sonic Wave. These weapons aren’t just great for the first mission, they’re great throughout the entire game.

This really sucks, because the game has a ton of other cool weapons, but almost all of them are worse than the Pulse-Cannon and Sonic Wave, and many of them are just terrible.

Economy

Another issue that becomes clear after playing the game for a while is the diminishing value of money.

Early in the game, you’re careful to kill every enemy and pick up every coin in order to gain as much money as possible. And this has a big impact on the game, because it means you can upgrade your weapons and buy other cool stuff.

But once you’ve maxed your weapons and bought the best ship, shield, generator, and sidekicks, there isn’t any reason to get more money. And this makes the game noticeably less fun. Many other games are guilty of this as well, including award-winning modern titles.

I wanted to make sure that the player always wanted to get more money. I thought that randomization, levels, and scaling would help.

Factions

One design idea I had was to introduce factions to the game. Factions would determine the appearance and stats of items, have their own reputation or currency, and also make the story a little more interesting. I decided on five factions:

  • The corrupt empire
  • The angry rebels
  • The peaceful pagans
  • The neutral traders
  • The marauding warriors

I didn’t know what to call them, so I just used some placeholder names of Empire, Revolt, Preserver, Freelancer, and Eclipse.

Mission Maker

I also thought it would be cool to let players design their own levels. I had no idea how it was going to work, but I thought I’d try to make a graphical mission maker and incorporate it into the game somehow.

This post may make it seem like I had everything planned out and knew what I was doing, but all I had was a huge list of ideas and no idea how to implement anything. These were just the core ideas I knew I wanted to have in the game.

Stay tuned for more!

Introduction: Cloning a Classic

Tyrian is a top-down scrolling shooter released in the mid 90s, and it’s one of my favorite games.

It was developed by Epic MegaGames, which produced memorable titles like Jazz Jackrabbit, One Must Fall: 2097, and Solar Winds. Tyrian is beautiful and polished, filled with interesting and diverse enemies, worlds, and weaponry. It also features an interesting mana mechanic that uses generators and power consumption.

into-gameplay

Having grown up playing video games as a kid in the 90s, it’s hard to separate the appreciation for a well-crafted game from nostalgia, but if you’ve never experienced the wonder of DOS games, I highly recommend installing DOSBox and heading over to Abandonia.

I could go on about how much I love Tyrian, and I will in future posts, but the point here isn’t simply to praise the original game, but rather to document the creation of a new game – my game.

Before I talk about this new game, you should probably know that I’m an amateur programmer who enjoys thinking and talking about games more than actually playing them (and I enjoy playing them very much). Rather than tell you my life story, here are some of my stats:

  • Born and raised near Vancouver, BC
  • Can eat the same thing every day
  • Diploma in Computer Information Systems
  • Married with a cat and no kids
  • Terrible at remembering dates
  • Awesome and remembering movie and TV quotes
  • Fisherman and fan of mixed martial arts

Now that we’re close friends, let’s talk about my game.

About a year ago I began writing down my game ideas in a text file. After accumulating over one hundred pages, I finally began to bring one of the ideas to life, and thus Zyrian was born.

game-ideas

That’s right, I called it Zyrian. I chose this name because I wasted a lot of time trying to think of an awesome name, but I couldn’t.

I’ve started many programming projects over the years, and like many amateurs, I finished very few of them. Also like many amateur programmers, I tend to spend more time thinking of cool new features to add rather than working on existing ones. And after working Zyrian for about a month, I dropped the project to pursue other interests.

After watching some presentations on the importance of finishing projects and developing a portfolio, I decided to force myself to finish Zyrian. So 6 months later, I picked up the pieces.

On a side note, it becomes clear just how bad your code is when you have to dive back into an old project.

It’s now 5 months later, and I’m still plugging away at the game. I’m not sure how close I am to being finished (probably because I’ve never done something like this before), but I’ve definitely come a long way.

This is this the story of the making of Zyrian – a Tyrian clone made by an amateur programmer who’s never published a game. I’ve learned a lot so far, and I hope I can pass on some of that knowledge to you.