EGO Experiment is finished

My rocky ~3-years-long path of building game with pure JavaScript

I’ve just finished development of this browser game, which I made with pure JS.

It was tough.

gameplay video

After all evenings and weekends spent on this trivial arcade's development, sometimes I ask myself - why I even started this?

Actually, I can’t say exactly. I began to work on it about 4 years ago and my initial motivation was just to learn JavaScript. But since then I managed to learn it quite good, participated in a few game jams, and hopped through several office jobs to current relatively high-paying front-end dev position. So, I suppose, my motivation transformed into desire of just getting it done.

I want to vent a little, and to share with you the story of this game’s creation.

If you are not interested, but want to try this free browser game about mind uploading and shooting red things - check this itch.io page:

But if you are interested in a tale of non-rational novice’s decisions, examples of ugly html5-gamedev hacks, and just casual human foolishness - welcome.

INTRO

It started about 4 years ago, when I decided to make a JS game. That time I was an aspiring front-end developer and just wanted to sharpen my programming skills. After reading some gamedev-related articles for novices, with all that advice like “scope small”, “first do something generic thing, like, Space Invaders, Snake, or Packman”, “take some engine or framework”, I decided to make everything by exactly the opposite way.

Why?

Actually, I don’t know.

I don’t remember.

I decided to make everything from scratch. Including complex physics engine (!). And I chose SVG as my rendering tool (!!). And, finally, I decided to create a game about boss-fights with geometric figures, every of each has its own unusual and complex behavior and attacks. And where player controls a rhombus, which travels through big 3d cube, with boss-enemy on its every side. (!!!)

Also, I had some crazy plot ideas in my brain, about man’s mind, which his collegue forcibly moved into a computer, and started to do cruel experiments with it. There was something about suffering, about personification of seven biblical sins by each of 9 bosses (I didn’t decide about two extra ones), about catharsis and player character’s enlightenment at the game’s ending… You got it, there were a lot of, ummmm, interesting ideas.

it was a strange stuff

In the end of this, I produced a gigantic pile of ugly code (which will never be re-used, definitely). I was also frustrated with my tries to implement my own physics system. I managed to make a very basics of gameplay and graphics, one of bosses... And, after all of this, I just gave up.

THE REAL BEGINNING

Two years ago I started afresh.

In fact, I really liked some of my original ideas. Minimalism, procedurally drawn graphics, transhumanistic theme of mind-uploading - I decided to keep this things in the game.

Several month were spent as I tried to figure out, how the core gameplay should look and feel.

One day, a simple prototype was hesitatingly presented to a close friend of mine, and he was asked to play a bit. He was interested, and seemed he liked the game.

how EGO Experiment looked that time

Actually, me myself was proud of how it was done so far, so this extremely reliable bestfriend-playtest was enough for me to continue working on it.

ALL STUNTS ARE PERFORMED BY (UN)TRAINED PROFESSIONALS, DON’T TRY THIS AT HOME

Just as in first unfinished game, graphics was made programmatically (not procedurally, but in a dumb and ugly imperative way). But at least, now it was drawn with canvas API, not SVG. At one moment, I started to consider using some game engine or at least rendering library, like Phaser or PIXI.js. But I chose not to do this, “because my game is so small and non-complex, what can go wrong with this simple geometric forms and primitive gameplay design?”.

And something has obviously gone wrong: at some point, it finally became clear for me, that visuals should be upgraded. Because without any improvements, with growing levels’ complexity and big count of enemies, game looked like a chaotic bleak mess of oversimplified, too “minimalistic” dots and lines, and it was hard and boring to play even for me.

So, some effects were introduced - basic animations, flashes, particles, glowings. All through pure canvas API, without even a bit of WebGL (I still use WebGL only for simple dynamic background and animated logo at the main menu).

Animations became one of my main “innovations”. For example, here is a way of their creation:

A fabric function gets an another, “rendering” function as a parameter, also it gets a number of frames. Than it invokes rendering function for each frame, gets a rendered frame of animation and saves it onto a virtual canvas. This way game gets a generated spritesheet, created on the fly and stored in memory.

(By the way - that’s how I learned, that Chrome can’t use canvas more than about 20 000 pixels in width. It will be funny if one day this knowledge prove useful.)

I shudder to think about painfull hours spent on implementing of some more-or-less complex animations. I was a hostage to my own wrong decisions already, when I had to animate appearing and hiding of this white lines - “synapses”, which re-appear with different animation after every player’s death.

So, graphics was not a very strong part of the game. Frankly, it still is not. It doesn’t work properly in some browsers (besides of Chrome and Firefox), it overloads CPU, while ignoring GPU, and it is incredibly overcomplicated and non-optimized. Even though today’s hardware forgive a lot of such sloppy work, you still may witness frame drops.

HOW I ALMOST DROPPED THE DEVELOPMENT

A bit less then a year ago, I asked myself: why does this game actually need a plot? It suddenly came to my mind, that an average arcade-shooter player leans more towards fast dynamic gameplay with constant “flow” and doesn’t care much about stuff like plot.

I made this assumption at the quite an appropriate moment - when all texts were done and even partially voiced by Chlora.

I made the decision - "the plot goes to hell". Also, I was very tired with this long development process, and then I said to everyone: “Ok, I am finishing this right now. I am sick of it. I am releasing game as it is right now, and starting to develop something nice, not a shit like this.”

But Chlora and my friend both answered to me something like this: “Hold on, dummy, are you serious? Game is almost ready. If are not sure about plot - just add a switcher at game’s menu, as an option to turn it off”.

It made sense, so I agreed and continued. Anyway, there was no real “plot”, only commentator’s lines, felt more like nice additional feature, which does not interrupt the gameplay and arcade “flow”.

FINALLY

Half a year ago, after another period of procrastination, I started again to spend my evenings and weekends on this game.

I also made a fresh look at the game and thought: “Wow it looks really cool! I should add some extra content - levels, enemies, texts. Then I will be able to even sell it somewhere, like, on Steam!”.

Inspired, I dived into my old work… And instantly decided, that I would not. I just had no strength to work with this ugly mess of spaghetti-code.

So, together with Chlora, we translated the game into English and she voiced the rest of texts.

I realised, that it would be cool to have an original music for the game, and also I was ready to spend some money on it. This is how we started to work together with Nafantemar. He made eight awesome tracks for our game, and I still a bit confused by the fact, that soundtrack he made is worthy of much bigger and more serious game.

And now, after several months of polishing and bugfixing, “EGO Experiment” is finally ready. Fuuuf.

Thank you for reading this. And play my game, if you haven't yet.

just look at this big boy at the center, I am so proud of him.
And of me.