Friday, June 17, 2016

Why this action game dev made a visual novel

I just add these pictures for prettyness
I got into gaming because of Sonic the Hedgehog for the Sega Megadrive and Gamegear, I love myself a fast-paced arcade racing game, with Trackmania, Extreme G and WipEout as some of my favourites and even in modern gaming I can have my adrenaline fix whilst racing in a GTA-like game or any faux retro arcade game. Imagine my surprise when I was staring at my own design for a scripting engine and thinking: "You know what? I should make a visual novel!"

What brought me to this wild conclusion? Let's back up a little. Even though I finished a computer sciences degree at university, I make my games in Unity. I could make my own game engine, but why re-do something that has been done better by others before? With Unity as an engine base, I can make even more awesome games than if I had to build the graphics part myself. Unity is very suitable for 3D action games and that's why it is my engine of choice. With standard assets and scripts you can build a prototype within the hour.

But, as with any existing engine, Unity can not be tailoring to every possible kind of game you might want to make with it. What I was missing was a decent way of scripting. Sure, Unity has a great object-oriented scripting system, which is great when you want to handle many pieces in a game environment, but a story script does not work that way. Many things working at a time makes a story confusing. What you want is something more monolithic, guiding the program and player in a certain direction. What you want is something called a structural scripting language, something like BASIC.

More pretty pictures!
"Whaaaat?! Surely you jest, claiming BASIC is better than C-sharp!" You might be right in most cases, but story-wise it's a different matter. Object oriented scripts have other problems when it comes to writing stories. First, if you slip up in its syntax, your script won't compile. This is devastating for your flow of writing! A structural language, on the other hand, has more room for errors, which benefits the writing of the story. Second, if you want to make your story even slightly non-linear, you want to jump around between lines. Sure, there is a 'goto' command in Unity, but suffice to say you'll go to coder-hell if you use the C command we shall not speak of.

Fortunately, Unity has an asset store that can get you any kind of asset, script or functionality you desire. Unfortunately, none of them felt right. There's a lua framework, that mostly focuses on moddability of games and there are several visual novel toolkits that do little else. However, none give me any tools to script events in a game field, which, as an action-fan, kind of saddens me. The final level on the spaceship in Sonic 2 would be less impressive if you just teleported there, the scenes in Tomb Raider with Miss Natla made the spelunking feel extra mysterious and anyone who played Final Fantasy 6 (or 3, maybe not an action title) will remember how awesome it was to see that asshole Kefka be blown apart bit by bit in the end. Also, yes, I am excluding over-scripted games, so I can make my point.

So, with all the existing systems being unsatisfactory, I set out to make my own scripting system. These were the requirements I had for the system:
  • Portability to every platform Unity provides, so everything had to be built from scratch
  • Modularity, it should be easy to expand and easy to use for multiple purposes
  • Easy localization for text and speech
  • Communication with the playing field, start animations etc. at given times in the script
  • GUI handling, let the new script handle menus, because Unity's GUI handling is so atrocious, it needs a complete post of its own.

I call it: the Story Engine.

What could all these pretty pictures be for?
If you've done it once, building a scripting system is pretty easy, provided you consistently keep using modules and functions the way they are supposed to. To put it in proper English: I blatantly copied the insides of a computer: I made a C script to store values (memory), a C script to execute commands (processor), a C script to handle the GUI (monitor, mouse and keyboard), a C script to hold and interpret my custom scripts (HDD?) and connected them withing unity like you would with a real PC. Add to this that the scripting language I botched together was based on assembly and it's a surprise IBM did not come knocking on my door. Luckily, this design is older than computers have been around, so I was in the clear.

The scripting language was the main focus for the system. A script for the system consists of a CSV or "Comma Separated Value" file. For easy parsing, I interchanged the commas with whatever this vertical line character is called: "|". That way I did not have to worry about quotes and commas in text. Another benefit of CSV files is that you can edit them in Excel or any other alternative.

Basic design of the system


The first row in the CSV file tells the interpreter what every cell in every column does.The top line of a typical script would be:

label cmd arg0 arg1 arg2 arg3 txt_en txt_es txt_fr spk_en

Every row in the Excel sheet holds 1 command. I won't go into too much detail, but these are the basics:
  • There are several possible commands possible for the cmd column. All commands are eventually handled by the 'processor' module.
  • Arguments for those commands can be put in the arg0-arg3 columns, if you want to use a command with more than 4 arguments, just add a column in Excel
  • The label column depicts labels for the goto and gosub commands to jump to.
  • The txt_xx column sets the text for any GUI element, like buttons, story-text or subtitles. A locale command can switch the txt column used for text with the language code used for xx.
  • spk_xx, for when spoken text is needed, holds the name of a sound file. Also switchable with the locale command. In this case, the budget only allowed 1 spoken language :(.

A little girl with explosives.
It only took me 2 days to design, implement the bare basics and have the first prototype running. However, a prototype is barely the beginning. If I wanted to use it, I needed to test it with something bigger and that's where the idea for a visual novel sneaked into my mind.

I have not been kind to the dating sim, the sibling of the visual novel, comparing it to a screwdriver to my eye, but I have always had a certain respect for the visual novel format in a story-telling kind of way. Text based stories easily break the "show, don't tell" rule, while on the other hand visual stories need to have everything shown, even dull conversations, or it breaks immersion. A visual novel can show a lot without description, while still leaving room for the imagination of the reader.

Also, a visual novel is perfect to test your scripting system with. Even though I did not know much about visual novels, I was happy to dive into that world and I met a lot of nice people along the way. If those people are reading this: you know who you are, you're awesome!

So, I made the first prototype of a Chapter in 1 day (12 hours in 1 day, so technically one and a half work day), a proof of concept demo with actual artists in a month (released as a demo much later) and today, as of writing, we release the full product. Introducing:

The logo of Detective Hank and the Golden Sneeze


Detective Hank and the Golden Sneeze is an interactive whodunnit visual novel with a different culprit on each playthrough. It uses almost all capabilities of my scripting system. Localization and voice acting are pending. As for now, I will keep on polishing the engine, as after release a lot of people are bound to bump into fringe-bugs.

It's getting crowded in here.
The fun part is: everything can be added in a matter of seconds (if you don't count actually making the extra content) and the code I wrote for this system can also be used for other purposes. Every module is interchangeable due to use of inheritance in C-sharp and can be linked to different parts of a game field. In other words: the code that moves the pictures on screen can later be expanded to move 3D models through a field or do all kinds of things.

Building this visual novel was a fantastic test for my scripting system. I found out a lot of parts did not work as I intended them to and, because the system did not need much expansion, the bugs were easy to isolate and fix. As I wanted more functionality for the novel, I got to experiment with inheritance and see if expansion of the base-code worked. And it did!

For the sake of just making a visual novel why didn't I just go with Ren.py or TyranoBuilder? I could have, but the pieces of code I hold now are so modular, I might just use them for every game I am going to make for the next couple of years. It was fun to build a visual novel to test both my engine coding and story writing skills and it definitely made me a better game developer. That's why this action-loving dev made a visual novel... and it might not be his last.

As of writing, Detective Hank and the Golden Sneeze is still awaiting the Steam Greenlight process, but it is already available on itch.io over here. If you want to try it out first, we have a demo available here.

Tuesday, March 1, 2016

Gley Lancer, the coolest game with the weirdest name

When I first came across Gley Lancer I played it on an emulator and how could I otherwise? It was released exclusively in Japan until it got released on the Wii in 2008. Now, this isn't going to be one of my "Oh, what a shame" posts, because its developer is still in business and still making money off of this game. This post is going to be an "Why haven't you played this already?" posts.

Gley Lancer might just look like any ordinary side-scrolling shooter and, in a way, it is. You move left to right and shoot bad guys until you get to the boss and shoot him to pieces. Yet, slowly, but surely, its awesomeness starts creeping onto you. Let me take you on the trip I had when I started playing this back in 1999.

Memory lane
When I first booted up Gley Lancer I was taken aback by the large intro. This intro was really, really long, but also very relatable: girl's father gets kidnapped, girl is sad, girl steals space ship to rescue father, you know, the usual. I didn't speak Japanese at the time and since I learned to, I haven't taken the time to translate the story, but I recon that's what the pictures meant. And then there was the first level.
First level and you get stuff thrown at you.

Gley Lancer features spoken text and its first line is "Stick to it and believe in your power." That first line sets the tone for the rest of the game. I played this in 1999 and spoken language was so common that its presence did not impress me. Yet, I was blown away by Gley Lancer's first level. The brilliance of Gley Lancer is not in its technical abilities, but its usage of its aesthetics.  The designers of Gley Lancer knew that the human mind can not block the brilliance of certain sights and that's why the first level has you flying through the ring of Saturn.

At first it looks like you are flying through an asteroid field, but then Saturn comes in from the right. It's a very simple level to learn you the basics of the game. Enemies come in gently, becoming more and more during the level and around the middle, you get asteroids thrown at you. Saturn fades away to the left and you arrive at the boss, which appears to be literally throwing the asteroids you encountered mid-level. It's a nice pay-off for a gentle beginning. The game is full off satisfying build-ups and pay-offs and the first level is just the beginning of a fantastic adventure.

LIGHTSABERS!!!
LIGHTSABERS! (insert SPACESHIP! reference)
While Gley Lancer has great pacing, it's not even its best feature. No, the best feature is that your plane can have FRIGGIN' LIGHT SABERS! Sure, the lasers, spread bombs and even flame throwers are awesome, but come on man! LIGHT SABERS! Nothing I can say can add enough to that. Gley Lancer has different ways of gun movement, one of which is a constant roll around your plane. In my first play-through I combined the roll with the light sabers and EVERYTHING EXPLODED! I was 13/14 at the time, it was the coolest thing I saw in games at the time and since then I've seen very few things surpass that.

And its awesomeness doesn't stop there. The game does its best to make you feel like a true hero. In the second to last level you have to save a ship from an alien attack. The boss of that level is shooting at a starship and you have to kill the boss before the ship is demolished. I have never seen the ship explode, but it can lose a lot of parts. It has 2 engines, a couple of middle parts and an escape pod, all of which fall off as you take longer to shoot down the boss. At my first play-through I (supposedly) saved the ship just barely, leaving just the escape pod. And when you do save the ship, a fleet of space-jet-fighters come in and congratulate you on your accomplishment. The best part? The higher you set the difficulty, the bigger the fleet.


Not for the faint of heart.
Kill it! KILL IT!
The game is not without its flaws. First of all: its art is not very consistent. At one time you fight aliens, but in one of the later levels you fly through ancient Greek architecture, which was a bit confusing. Also, the gun modes I mentioned earlier, there are 7 different modes: normal, reverse, auto-aim, 2way, 2way reverse, shadow and roll; but you can boil them down to 2: 'auto-aim' and 'why haven't you picked auto-aim?' Also, what is a 'Gley Lancer'? Usually I can re-translate Japanese errors in English, but I haven't got a clue what this should have been. (Grey Lancer? Grey Ranger? Glee?)


If its difficulty is a strong or a weak point is up for debate. Gley Lancer is easy in the beginning, but gets HARD around the third level and that might be off-putting. You will run out of lives FAST. On the other hand, some like it hard and 13 year old me didn't care, we had save-states in emulators in 1999. If you ever finish the hardest difficulty, you get a code at the end of the credits to unlock mania difficulty. At the fighter-fleet level, there will be so many fighters congratulating you, you can't see yourself or the ship you were supposed to save.

Have you played it yet?
So, have you played this game yet? Yes, it has some flaws, but it's one of the best I've played. I haven't even mentioned the music, which is awesome. It is still available for sale and if not to you, an emulator is never far away. Even if great gameplay doesn't convince you, let me just remind you: IT HAS LIGHTSABERS!

Tuesday, February 16, 2016

Sonic 3 would have been the best in the series, if not for this one mistake

Don't worry, this is not a fanboy post. Yes, Sonic is my favourite video game character. Yes, I am of the opinion that Sonic the Hedgehog 3 is better than 2, Adventure and Generations. But, I am perfectly aware that Sonic 3 had a certain problem and that is what this post will be about.

 

From the start

ZOOM!
Let's take a look at the beginning of the series. Nintendo had a lot of success with Mario for almost 6 years when Sonic came around. If you remember the loyalty wars between Sonic and Mario fans, you can imagine that Sega did a great job designing Sonic to make people doubt the leading video game protagonist for 6 years running.

The first game for the Megadrive (Genesis for those across the pond) was pretty sweet. Sonic ran really fast, but you could see in some levels that the level designers did not know how to implement speed. They improved on this in Sonic 2, there were longer stretches to run in and jumping did not feel slow. The best idea they had was adding the sidekick, Tails the flying fox, as an immortal playable character next to Sonic as player 1. This was the best implementation of couch multiplayer I've ever seen, because anyone could just pick up a controller and play along without player 1 being too annoyed

And then came Sonic 3. They took everything and improved even more. Tails could now lift Sonic to places he could not reach before. There levels were even faster and the theming was better thought through. To top it all off, Sega release Sonic and Knuckles, with which you could play Sonic 3 AND Sonic and Knuckles back to back with Sonic, Tails or Knuckles. As a little kid, my mind was blown.


Bring on the classics!


This place has its own expletives.
And yet, if you ask, most Sonic fans will almost never cite Sonic 3 as the best in the series. Almost no youtuber (at least not my favourite ones) has made a Sonic 3 video and someone makes one, they are just walkthroughs. Why?

I will now give you 5 words that strike fear in the heart of any Sonic 3 player: Carnival Night Zone's Spinning Drums. For all the things Sonic 3 did well, there is 1 great mistake that undid all of them. Somewhere in the second half of the Carnival Night Zone level Sonic is locked in a small room with nothing but a spinning drum in a hole where you supposedly need to get through. You can not evade going into the room. You will enter and you will spend there more than 10 minutes. After those ten minutes, Sonic dies of a so called 'Time Over.' The torture is slow and the carnival music makes it all the worse.

These spinning drums are not a menace on their own, they are scattered across the level and sometimes Sonic will land on them and they will bounce. When you get locked in that room, that is what you are going to try: jump on the drum and try to get it through the hole. This will not work, you can get it halfway through and you will be able to make a huge jump, but you will not be able to get through.

No reason for this screenshot,
this game is just beautiful
If you want to enjoy Sonic 3, I've got 1 tip for you: use the up and down arrows on the gamepad. That is what you are supposed to do. The stupid thing is, the game does not give you ANY visual cues on it. Sonic does not bend his knees and at first the drum only barely moves up and down, but surely and steadily it will move 3 screens up and crush Sonic on the ceiling, if you are not careful. Why did Sonic Team put this in the game and why implement it like this? Everything else is intuitive and sleek, except for this part.

What happened?

Of-course, I haven't got the answers, but here is my speculation: it's a mix of things. First of all: the drums follow a complicated rule using a kind of acceleration we associate with standard physics nowadays. By locking Sonic in the room, the creators made sure you could not see past this complicated piece of game engineering.But that does not explain the lack of visual cues.

Pics or it didn't happen, am I right?
Let me sidetrack a little. I've got a portable Sega Game Gear in the attic that I got for my 7th birthday. The screen is burned and I keep it for parts for when my second Game Gear will finally break. On this Game Gear is a sticker I put under the screen when I was 10. On that sticker you can still see the number of the Sega Mega Phone. It's a telephone number you could call if you got stuck in a game for 1 Gulden per minute, about 0.45 Euro/Dollar cents.

And that is what went wrong. Those days, the internet was not yet widespread and what was on it, usually did not involve walkthroughs. Several 'information hotlines' sprung up during that time to help you with your games if you were stuck. With that information being hot business, it helped that new games would bring in money for them too. I will not say that the spinning drum room was deliberate, but with a game bound for release and thinking the info will be readily available, Sonic Team will probably not have wanted to fix that mistake either.

Except, nobody called those numbers as our parents would not let us. Most people just gave up on Sonic 3. Buying Sonic and Knuckles and combining it with Sonic 3 did not help much, because Sonic would still get stuck in the spinning drum room before you could get to the Sonic and Knuckles level set. The Knuckles level set did not contain the spinning drum room, as if the developers knew.

One tip to the perfect game

The spinning drum mistake should not have been made, it's a stain on an otherwise perfect game, but it does not have to spoil your enjoyment. If, despite my rambling, you still want to try out Sonic 3 with the Knuckles expansion, remember this: use the up and down arrows when you are stuck and you are in for one of the most awesome games in history.

Tuesday, February 9, 2016

The Playstation 3 that never really was, was so awesome

BTW: this is not the 60GB. Can't you tell?
Imagine a Dutch boy going to a game store in a neighboring city, anticipating his new console and finally meeting the grandiose that is the Sony Playstation 3 60GB. "I had go through a lot of trouble to get this thing," he says. "I know," the shopkeeper replies, "we even get people from Groningen (far side of the country), just to get this model." Now imagine that boy nearing his 30's and this event happening last year, because that is me.

Although I hate the stereotype of us Dutch being cheap, I did not want to shell out the 800 Euro's required to purchase the system on launch. I was happy with my PS2, but I had mostly be playing PC games before that and I did not mind going back. Unfortunately I missed out on the awesomeness that would be the PS3.

It has been almost 10 years ago, but do you remember all the features that would be in the original PS3? Backwards compatibility spanning back to the PSX era, communication with the PSP, Linux installation and it's possibility to play Blu-ray make it an absolute behemoth of a console.

Unfortunately these features did not only come with a price tag. Sony had to do them right in order for them to stick around and they let that one slip. They had to cut down on features to save on costs, not only because of the material used in the product, but also to save on labor. Since I finally got my hands on the original PS3, let me break down some of those features on why they are awesome and what went wrong.

The backwards compatibility

All playable on the 60GB version
Let me start by telling you that the backwards compatibility on the PS3 was awesome! Remember that the PS1 released in 1994, so on release of the PS3 you already had a library of games 12 years big. With the PS3 not yet at its end of life, that accumulates to 21 years today! Also, these games are possible to view over HDMI and the PS3 takes care of the image scaling for you. With the wireless PS3 controller you add extra play comfort. I would play all of my old games on it, if not for one of several major drawbacks.

You can't load your saves from the previous playstations. Yes, the PS3 60GB has a memory card slot, but somewhere along the design line something was misinterpreted and that slot was changed from a PS2 type to one of those multi-card readers you find on those (now) old PC's. You also cannot connect any old PS2/PSX controller. I can perfectly imagine why this happened, cutting costs among others, but it does not end there.

The PS3 is region free (perfect slogan), but the PSX and PS2 are not. Probably for commercial reasons, they kept the region locking. It makes perfect sense to make a console region free: you make 1 type for all regions, but if you design your backwards compatibility to keep the region lock, you are still building different consoles for different regions.

It is obvious why the backwards compatibility was scratched first, it was the most expensive, but it is such a shame. If they had taken a better look at the design, they might have kept it. Then again, if you know a bit about computer architecture, you'd know how hard backwards compatibility can be, but I'll save that for another post.

Linux compatibility

I am out of puns, insert punguin here...
You might not care to remember, but the PS3 had the possibility to install the Linux operating system. I have not tried this myself, since I did not want to jeopardize my collectible PS3, but I have played enough with Linux to be really excited to try it on another PS3 someday.

Although it was cool, this feature really gave me the idea Sony wasn't really thinking in the design phase. Mainly for these 2 reasons:
  1. Practically no gamer uses Linux
  2. Any OS, but especially Linux, gives the user full access to your hardware.
It wasn't a surprise the Linux feature was the leak that eventually made the PS3 crackable and Sony even removed it with a system update. It's a shame, because the PS3 processor had some new stuff not common in PC's. There's a lot to say about that, but I'll save that too for another post.

Communication with your PSP

We take the PSX hardware and make it portable.
What shall we call it?
Has anyone tried this? Did you know you can play games on your Playstation Portable from your Playstation 3? No? Well neither did I. You can also swap out savegames from your PSP to your PS3, so you can continue a game at home on the big screen after you've played it on the road.

I got my PSP last year too and I had that thing soft-modded before you could say "hey, isn't that be piracy?" The irony of it all is that I only play legally purchased PSP and PSX games on it, the PSX games being the original disc softwarematically mangled on a PC to be stored on the PSP memory stick. This last feature was never fully developed by Sony, because a hacker group found out before the release of the PS3. Again, it's a shame, because it works so well.

Then there is remote play. Long before Valve's Steam had a streaming function, you could stream your PS3 contents to your PSP. Yes, you heard that right, you can go to the little men's (or women's) room and play Playstation games on your PS3! You can insert a PSX disc in a PS3 60GB and have it streamed over Wifi!

Unfortunately, Sony thinks the PSP does not have enough sticks and buttons, so the PS3 downright refuses to play most content, including PS2 and PS3, but also Netflix and any other app you might have installed, which leaves remote play to be nothing more than a remote PS3 savegames-manager. Then, there is the problem of the PSP not being able to connect to WPA2 wifi (most modern routers) and its chip is barely fast enough to stream. You can play an RPG, but do not try a racing game, the delay is just a bit too much. Add to that that Sony never really pushed remote play for developers and you will therefore probably never use it.

Enjoying the PS3 nonetheless

Even though Sony did not polish a lot of its features, the original 60GB is a hackers dream come true. The amount of features is a rabbit-hole I'd love to dive in some more and I definitely will. To end on a high note: although most of these features did not come out as much as we'd hoped, at least Sony has learned from it. They now know better what works and at least they continued the remote play feature to PSvita and PS4. I haven't had my hands on a vita yet, but it seems it can connect to a PS3 as well. Just to keep a combo going, I'll save that topic for another post.