Sunday, March 14, 2021

Queen’s Challenge - part 3 of 6

 Part 3 – Brute Force

Brute force approaches to solving problems are often the first approaches tried when attempting to solve a problem. Computers are fast, so why not just try all the possible solutions until we find one that works? As we will see shortly, while brute force solutions work, they are very inefficient making them infeasible for many problems.

A brute force solution for the Queen’s Challenge game would be to simply try all possible combinations until you find one that works. If I didn’t have my animation framework this would be trivially easy to implement, but by showing each step as I am, the work is a bit more complicated. Without the animation, the brute force method would look something like this:

Q0 = assigned_location
For q1 in range (1..58):

For q2 in range(q1..59):

For q7 in range(q6..64):

If (valid layout) break

Doing updates using steps is a bit trickier as we don’t have nested loops so will need to manually track the loop.  If you recall, a for loop is essentially just a macro for making a while loop with a counter. This concept can be easily extended to supporting nested loops by simply holding an array of loop indexes and updating them appropriately. This means that to implement our animated version of brute force solving we first need to set up an array of indexes, which we already are doing to hold the positions of the queens.  The reset method would then look something like this:

    reset() {
        this.locked = this.game.queens[0].y * 8 + this.game.queens[0].x;
        let spot = 0;
        for (let i = 0; i < 7; ++i) {
            if (this.locked !== spot)
                this.moveable[i] = spot;
            else {
                ++spot;
                this.moveable[i] = spot;
            }
            ++spot;
        }
    }

With the loops properly set up to skip over the locked spot if it is in one of the other seven queen’s starting position, we now can focus on the looping. This can be a bit confusing as while there are 8 queens, one is locked so we only have 7 counters (0 through 6). We need to loop backwards through these to find the lowest counter that needs to be updated. Remember that for a loop to go to the next element, the loop inside of it must have reached it’s end condition and for that loop to reach the end condition the loop inside of it must have reached it’s end condition and so on until the inner-most loop has reached it’s end condition. If a counter is incremented, but has not reached it’s end condition then we can break out of the updating loop as we know none of the loops above it need to be changed yet.

    nextMove() {
        let pieceToMove = 0;
        for (let i = 6; i >= 0; --i) {
            let nextPos = this.moveable[i] + 1;
            if (nextPos === this.locked)
                ++nextPos;
            if (nextPos < (57+i)) {
                pieceToMove = i;
                this.moveable[i] = nextPos;
                break;
            }
        }

Once we have updated the outer-most loop that have reached their end conditions, all the loops above it would be restarted so we simply loop from the outermost updated loop to the end of the list of loops to set them to their next starting state which would be one greater than the previous counter unless the locked queen happens to be on that tile.

        for (let i = pieceToMove+1; i < 7; ++i) {
            let nextPos = this.moveable[i-1] + 1;
            if (nextPos === this.locked)
                ++nextPos;
            this.moveable[i] = nextPos;
        }
    }

We now have our brute force implementation completed. This can be ran and we can watch the computer solve the game. This might take a while. After watching for a few minutes, we can readily see there is an obvious problem with our initial brute force approach. Most of the time, we are in an obviously invalid state as multiple tiles are on the same row! A quick fix could speed this up but how long will the brute force approach take?

To go through the complete loop, which is not necessary as a solution would be found way before then, we would need each of the loops to complete with the inner loops having to run multiple times. There are 7 variables looping through 57 possible positions on the board so a rough approximation would be 57^7 for 1,954,897,493,193 though because loops are going through progressively smaller counts, we would only have 994,596,970,221 iterations. On today’s hardware, we could probably process this number of moves quickly if we weren’t animating them but that is still a huge number of board positions that need to be processed. If we increase the board size, this grows ridiculously quickly. 

So the next step on improving the solver is simply enforcing a constraint on where the queens can be placed. This will be our next step and will dramatically reduce the number of moves. The source code is available on github https://github.com/BillySpelchan/BlazingPorts but may contain spoilers of future versions as I am going to be updating the repo as I work on the remaining parts of this series whenever I find a bit of spare time.


Sunday, February 14, 2021

Queen’s Challenge - part 2 of 6

Animated Solver Framework 

Solving a game tends to be where things get challenging as often any brute-force method is going to require an exceedingly large number of trials to find a solution. That is pretty much the case with the Queen’s Challenge puzzle. More advanced approaches need to be used. For this series, we want to compare different approaches which is easiest if the user can see how the solver is solving the problem so we are going to need an animated solver framework which we will be roughing out today. Next, we will implement a brute force solver. Part 4 covers a smarter version of the solver. This will be followed by quite common approach of a backtracking solver. The final part will cover a more complicated approach using constraints.

We know that there are going to be 4 different solvers so we will want to create a base solver class so the game can simply call methods in this class to get the next step in solving. To simplify the solver, we are going to represent positions on the board as a single number so 0 through 7 would be the top row, 8 through 15 the next row and all the way to the last row. Complicating matters is that we do have one locked queen and seven queens that we can place. This can be set up as a locked variable and an array of moveable queens.

class BaseSolver {

    constructor(game) {

        this.game = game;

        this.locked = game.queens[0].y * 8 + game.queens[0].x;

        this.moveable = [0,1,2,3,4,5,6,7];

    }


While we are not doing anything with it now, the solver is going to need to be able to reset itself and set up the initial position of the queens based on the current position of the locked queen. While this is a bit of a kludge, we will assume that the game’s Queen[0] will be the locked Queen.

    reset() {

// TODO

    }

At this point we came into a bit of a dilemma as I am thinking that placing the queens on the board could be handled by the game when running the solver. Ultimately, since I may want to show additional information about the state of the solver (I don’t know as I am writing this as I am working on the code so this is as close to live coding as my blog can be) I figure the placing of the pieces on the game board will be the responsibility of the solver. 

    placeStepOnBoard() {

        for (let i = 0; i < 7; ++i) {

            let qx = this.moveable[i] % 8;

            let qy = Math.floor(this.moveable[i] / 8);

            this.game.queens[i+1].changePosition(qx,qy);

            this.game.queens[i+1].setVisible(true);

        }

    }


The heart of the solver will be making the next move. This will be where the solver looks at the current state of the solution and advances to the next one. This approach is a bit more complicated than having a solver just to try and solve the problem as with a traditional solution you could simply have nested loops, but this will have to infer the loop state from the positions. By having a separate step function for our solver, however, lets us do the solution in discrete steps which can then be rendered so the user will be able to see the solver working, which is the whole point of this exercise.

    nextMove() {

//TODO

    }

Finally, the user may be impatient with the solver and start a new game or switch to a new solver in which case we will want to stop the solver. This allows the solver to remove any visual aids from the board if we actually have any.

    stopSolver() {

//TODO

    }

}


To implement the solver, we are going to need buttons for starting a solver. These are simple enough to add as it is simply GUI code placed in the game’s constructor. While here we will also set the current solver to null to indicate that there is no solver being used.

        this.solver = null;

        this.solveBruteButton= new SLLTextButton("brute",

            new SLLRectangle(530,200,100,30),

            "Brute force", 3);

        this.solveBruteButton.setClickHandler(this);

        this.addChild(this.solveBruteButton);

The code for handling starting the solver is placed in our buttonClicked method and simply calls a startSolver method that we are going to need to write. This simply shuts down an existing solver before setting the solver to the new solver and calling that solver’s reset method. We are using timeouts for animation instead of animationFrames as 60 fps is way too fast for watching the solver so a lower speed is desired.

   startSolver(solver) {

if (this.solver != null)

this.sover.stopSolver();

        this.solver = solver;

        solver.reset();

        setTimeout(this.nextSolverStep.bind(this), 10);

    }


We need to run the animation until the board is solved (or interrupted, but we will fix that later). This is very simple matter of going through all the queens and seeing if any of them are in conflict with an earlier placed queen.

    isBoardSolved() {

        let solved = true;

        for (let q = 1; q < 8; ++q) {

            let queen = this.queens[q];

            for (let i = 0; i < q; ++i)

               if (this.queens[i].isCoordinateBlocked(queen.x, queen.y))

                   solved = false;

        }

        return solved;

    }

Finally, we have our main animation loop where we draw the board and then check to see if the board is solved. If not, we get the next move and set a timer for the next redraw. 

    nextSolverStep() {

        this.solver.placeStepOnBoard();

        if ( ! this.isBoardSolved()) {

            this.solver.nextMove();

            setTimeout(this.nextSolverStep.bind(this), 250);

        }

        draw();

    }

While this framework is simple enough, we now need to get a solver working properly so that we can see a solution as it is happening. Next post I will look at the most basic – and least useful – of the solvers. Namely using brute force. While it will not be a useful method for solving, it is a good starting point and should let us discover if there are any issues with our framework. I am writing this as I write the code so let’s hope things go smooth and that the article is short enough that I can do some additional cleanup work! 


Friday, January 15, 2021

Queen's Challenge - part 1 the base game

 It's a new year so lets do something different, sort of. I am going to try something a bit different over the next several months. This month I will be going over the creation of the game, which is normal enough. One feature I want to add to the game is a solver. I figured it would be both interesting and informative to go over the techniques for solving the game ranging from brute force to smart brute force to backtrack solving to constraints. Each method would build off the other and would be added to the game.

Whar game am I talking about? Queens challenge is a chess puzzle, though no knowledge of chess is necessary to play. The goal of the game is to arrange 8 Queens on an 8x8 Chess board in such a way that none of them can capture another Queen. Originally this was a Flash game, but I have rewrote the game in JavaScript. The game is on my spelchan.com site with the source code on my repository (link here). 

The game uses my SLL library but could have easily been written from scratch. The game consists of two classes. The Queen class extends SLLImageLayer making it effectively a sprite. The purpose of this class is to hold position information for the Queen. A simple method for determining if a provided board location is in conflict with the Queen is provided. 

class Queen extends SLLImageLayer{
constructor(x,y,locked) {
super("queen", QC.playerQueen, QC.QueenClip);
this.changePosition(x,y);
this.setLocked(locked);
}

changePosition(x,y) {
this.x = x;
this.y = y;
this.moveTo(QC.boardOffsetX+this.x*QC.tileSize,
QC.boardOffsetY+this.y*QC.tileSize);
}

setLocked(b) {
this.locked = b;
if (b)
this.setImage(QC.lockedQueen);
else
this.setImage(QC.playerQueen);
}

isCoordinateBlocked(x,y) {
if (this._visible === false)
return false;
if ((x === this.x) || (y===this.y))
return true;
return (Math.abs(this.x - x) === Math.abs(this.y-y));
}
}

This is a very easy method as one simply has to check against the list of existing Queen’s to see if any of them are directly horizontal, vertical, or diagonal from the Queen that is being processed. If this happens to be the case, then the queens are in conflict. 

The game then consists of randomly placing the first Queen on the board. We can then let the players add other Queens by clicking on the desired tile on the Chess board. To make things simpler, we create a highlight rectangle that will follow the mouse and will check to see if the tile the player is over is valid. Once eight pieces are on the board, the player has won.

Not very much too the game, but solving the game is a bit tricker. Next month I will adjust the code so that we can use a solver to solve the game. This will be done in a visual way so that it will be possible to see the moves that the computer is trying so that the different methods of solving the game are better emphasised.


Tuesday, December 15, 2020

Marvel's Avengers

 I was going to start a series on Making Queen's Challenge followed by a series of articles on the techniques for solving that problem but that will wait until next year. It has been a long time since I wrote a game review so decided after a long invigilation session to relax by writing a review for Marvel's Avengers. I also posted this on Steam.

I received Marvel Avenger’s for “free” with the purchase of my laptop so I can easily say that I got my money’s worth out of the game. While I occasionally will play the occasional shooter, I am not really a fan of action oriented games which is why I quickly gave up on  Final Fantasy XV and will likely never bother with the remake of Final Fantasy VII. Perhaps it is my infamiliarity with looter shooters that kept me playing this game despite mediocre reviews. There is a lot wrong with this game, but even though the cons outweigh the pros, I am giving this game a very marginal thumbs up but only because despite all the flaws I am still playing this game and somewhat enjoying it. Perhaps if I played the better loot shooters first or if I didn’t prefer solo gaming my opinion would differ. 

Pros

Marvel. While not as good as the Lego Marvel games, it still lets you be some of your favorite heroes.

Thor. My least favorite Avenger’s character is one of my favorite characters to play so they must be doing something right! 

Good mix of ranged and melee combat. The variety of attacks and booster powers makes combat, even when overwhelmed, fun to play.

Great graphics. 

Great campaign. While it is a bit too PC, the story was not what I was expecting so rather enjoyed the story line. 

Cons

RPG Elements are pointless as the game scales with your level. This also means that poor players can’t over-level in order to reduce the difficult of the game. That said, as the power level is based on your equipment, you may be able to cheat this flaw by putting on low-level equipment then switching in your good equipment once you have started the mission.

Easy isn’t. This could be my lack of reflexes, but more likely it is because the designers made this game for existing loot shooter players so expect a familiarity with that type of game. Hint to designers, if the player is already playing on the easiest level, DON’T PROMPT THEM TO TELL THEM YOU CAN CHANGE THE DIFFICULTY IF THE GAME IS TOO HARD! It would seem to me that most game companies don’t bother testing their games on people who are new to the genre. In the long term this is why genres die out because new players can’t play the games due to entry difficulty and older players get bored of them.

Timing puzzles. If it were up to me, all timing puzzles would be optional! This wasn’t overly bad until you get to the Kate DLC which requires you break a lock then shoot targets on either side of a cell within an exceedingly short time limit. It took me over half an hour to get by the 3 cells locked this way.

Poor navigation. Having a marker tell you that to get to your next objective requiring you to travel through a wall or mountain isn’t very helpful. Waypoints have existed in games for decades now so there is no reason you couldn’t  put a waypoint in the hard to see tunnel so you can find it and not waist time backtracking to find a path around the mountain.

Chimera sequences require you wander around the airship (or anthill) to complete some vaguely specified objective which wouldn’t be bad if the layout wasn’t so awful. Finding the harm room and interrogation room took way too long and were really pointless tasks as the harm room missions are accessed in the war room once you have found it. No clear directions also was frequent during missions. 

Chest nearby? This message came up frequently but most the time I couldn’t find them.

Ms Marvel as main character. Perhaps because I am not familiar with this character. Perhaps because I am old and male so can’t relate to being a fangirl. Escaping the park was by far the worst part of the campaign, which is sad because it is right near the beginning. Once you get other characters the game gets way better, even when you have to use her.

Multiplayer seems repetitive.  Thankfully you can play multiplayer solo by using bots. That said, the missions I went on were very similar to each other and to the campaign sequences. Yay I get to smash more reactors which spawn hoards of enemies!

Bots not good at multiplayer tasks. It might be more fun with other people rather than bots, but as I am poor at these games don’t want to inflict my bad gaming on other players. That said, when you have sequences that require human players spread out, the bots don’t quite seem to understand the objectives meaning when you have to control 3 points on the map things become annoying.

Mobs attacking are harder than boss fights! I get that combat is the point of this game, but this tends to be far too many enemies attacking you at the same time making most combat a test of reflexes rather than on strategy.

Black Widow Boss Fight was exception to above requiring me to exit the campaign and level up outside of the campaign before giving it another go and even then lost another dozen times before I was able to get through this awful fight. Granted, I was also unable to complete the Harm training so could be that I simply can’t use this character properly.

I am sure I missed a few points. 

TLDR: If you like Marvel heroes, this is fun but has a lot of flaws so wait until on sale.


Sunday, November 15, 2020

Porting a Game in Zero Hours

 


Way back in 2014, I participated in a game jam called the Zero Hour Game Jam, with the idea being that you had to write the game between 2AM and 2AM when the times switched for daylight savings time. This “missing” hour would we the time you wrote your game in. The rules were “there are no rules.” Wanting to keep the spirit of the Jam, I decided to do my coding during the jam, but allow myself to prepare artwork beforehand. While I did not have to do the same thing with the port, as the time switch was happening on November 1st and because there is talk of getting rid of daylight savings time (had something called Covid-19 happened, it is possible that there wouldn’t be daylight savings time in BC as voters overwhelmingly want to get rid of it as it serves no practical purpose but does pose medical problems to some people) so this may be the last chance I have to do a game in 0 hours. While there are Zero Hour jams running this year, I opted to do my own Zero Hour Port where I take my original Zero Hour game and re-write it in JavaScript so it will be playable since Flash is no more.

My rules for this port were simple. Pre-Jam preparations were allowed which simply consisted of using my old copy of Flash to create a sprite sheet of the assets in the original game and to convert the resulting JSON file from this sprite sheet that was generated into my own condensed format. A sample of my JSON format is shown below. I am also allowing myself to use my Vampire Attack game from last month as skeleton code to quickly hack out a working game.

ZHAtlas = {

    //"ContinueBtn": {"x":0,"y":0,"w":350,"h":82, "over_x":358,"over_y":0,"down_x":0,"down_y":90},
    "KeyABtn" : {"x":0,"y":0,"w":94,"h":84, "over_x":102,"over_y":0,"down_x":102,"down_y":0},
    "KeyDBtn" : {"x":204,"y":0,"w":94,"h":84, "over_x":306,"over_y":0,"down_x":306,"down_y":0},
    "KeyQBtn": {"x":510,"y":0,"w":94,"h":84, "over_x":612,"over_y":0,"down_x":612,"down_y":0},
    "KeySBtn": {"x":714,"y":0,"w":94,"h":84,"over_x":816,"over_y":0,"down_x":0,"down_y":0},
    "KeyWBtn": {"x":918,"y":0,"w":99,"h":84,"over_x":0,"over_y":92,"down_x":0,"down_y":92},
    "KeyEBtn": {"x":214,"y":92,"w":94,"h":84,"over_x":316,"over_y":92,"down_x":316,"down_y":92},
    "continueBtn": {"x":418,"y":92,"w":216,"h":50,"over_x":642,"over_y":92,"down_x":0,"down_y":184},
    "Zombie": {"x":448,"y":184,"w":546,"h":656},
    "backdrop": {"x":0,"y":848,"w":512,"h":256}
}

As you can see by looking at the above JSON code, objects in the games are named and given information about coordinates and size. Buttons also have additional coordinate information for their over and up states. The sprite sheet is too big to put here but is available in the git repository for those of you who wish to view it.

Once the missing hour started, I copy and paste code into a new project. The HTML boilerplate is pretty much unchanged just with some redundant code removed and the name of the game and script changed. The js file linked to from the html file really doesn’t need too much to be copied from Vampire Attack. First I paste in my JSON file and turn it into an object, that is the one thing I do love about JSON. Then I copy the button class and turn my ScreenHandler class into the game class. I am figuring that I can simply have the title screen and win/lose screens built into this one screen, which in hindsight was a bit more work than I expected.

Drawing the backdrop is trivial so for my rendering routine I simply draw the backdrop image. Then, which is not shown in my final code, I want to make sure the buttons are rendering properly so I render all of them using a for loop. The button class uses a callback mechanism so implementing the handler is trivial. For quick testing the handler just displays a console message but game logic will be going here shortly.

With the user interface implemented, it is time for the gameplay. This involves the zombie moving toward the player. Here is where I wish that more time was spent examining the original code for doing this. While writing scaling code is trivial, having the zombie at the center of the screen didn’t look very good as the zombie was floating in the air. The obvious quick fix for this problem is to shift down the y coordinate. This solves the footing problem, but as we are scaling at a constant rate the zombie appears to slow down as it starts reaching the player. Playing a few times it is a bit surreal but sort of like what you would experience as your adrenaline started kicking into overdrive so figured I would leave this alone unless there was time at the end to fix it.

Now clicking on a button adjusts the zombie distance, and when the zombie is far enough away we log a win. If the zombie gets too close we log a loss. The problem is that all the keys will let the player run, making the game too easy. This is easily fixed by picking one of the keys at random and only rendering/accepting that key. This meant that keyboard support had to be added which isn’t hard. The keyboard handler for key down looks at the key being pressed and checks to see the character is the same as the expected character and if so calls the player step method for moving the player. The button handler does likewise so we have both keyboard and mouse/touch suppprt.

    playerStep() {
        this.zscale -= .06;
        this.cur_key = Math.floor(Math.random()* 6);
        if (this.zscale < .1)
            this.nextScreen(); // note this was a console log earlier
    }

At this point I am thinking that I am almost done and will be able to add sound, music, and maybe even fix the zombie motion. First, however, we need title, win, and lose screens. Choices here are to cut an paste the screen handling code from Vampire Attack and have different screens. Or as there are just messages to display I could just do everything within the existing screen. Feeling the later would be faster, I opted to go for that approach. I don’t think it ended up being faster and added some ugly code to my project so was ultimately a poor decision.

To add a title screen, a showTitle flag was added. When set the title text gets shown. A playing flag determines if the game is in progress. If the game is not being played, a separate message (for winning, losing, and extra title text) will be shown. To handle the transition between the different states, a next screen method was written as shown below. This code gets called whenever a screen transition should occur which includes winning, losing, clicking to return to title, and starting the game from the title.

    nextScreen() {
        if (this.playing === true) { // game ended
            this.cur_key = 6;
            this.playing = false;
            if (this.zscale >= 1) {
                this.message = "You have died!";
            } else
                this.message = "You Escaped!!!";
        } else if (this.showTitle === true) {// game starting
            this.cur_key = Math.floor(Math.random()* 6);
            this.zscale = .5;
            this.showTitle = false;
            this.playing = true;
        } else { // return to title
            this.cur_key = 6;
            this.message = "Billy Spelchan's Zero Hour Game port";
            this.showTitle = true;
        }
    }

Once I finally finished the screen transition logic there was few minutes left but I was too tired to continue so the sound effects, which probably could have been added in only a couple of minutes, was dropped and I figured I would go to bed and put up the game when I woke up.  The code for this game is available in the git repository for those who are interested. Not sure what will be next month, but I do have an interesting multi-part series where I create a game then demonstrate different approaches to solving that game. If I have time to do a Christmas game (slim but non-zero) then I will do a postmortem on that game otherwise I will start the new series.

Thursday, October 15, 2020

Making Vampire Attack 2020

 Vampire Attack was a simple Halloween game I wrote in Flash a long time ago. This revision of the game is just like the original Flash version except that instead of having 13 waves of attacks, I opted for an infinite attack with the spawn rate of the bats slowly growing until it becomes overwhelming. The big concern I had with porting the game is that the current versions of my SLL library do not support rotation. This meant I had to decide between using a library like Create.js that does support rotating sprites, adding that feature to SLL, or writing the game from scratch. Obviously the third option would be insane, so that is what I opted to do. In my defense, that was not my original plan it is just what ended up happening.

My thoughts when starting on this game was to play around with rotation to see how it worked and if it was not going to be overly complicated then I would incorporate it into SLL but in the unlikely even if it was going to be overly complicated then use Create.js as a last resort as this Is a personal project so my NIH Syndrome is welcome here. I had never played with rotation but recalled reading about it in the canvas specifications. The problem with the WHATWG documentation (https://html.spec.whatwg.org/multipage/canvas.html ) is that trivial things, such as rotation as it turns out, tends to be made to sound far more complicated than they are and finding out trivial things, such as how to set the origin that the rotation revolves around, tend not to be trivial to find. Perhaps it is just me, but translate(x,y) is not the obvious way to change the origin of rotation. I suppose it does make sense in a mathematical sense, but I am a programmer because I am not great at mathematics (and all of the problems I am having in Graduate School are due to my lack of math skills). Needless to say I started playing around with trying to rotate a rectangle as shown in the code below. Really, not very difficult. You just set the translation to your origin point then set the rotation (in radians) and then draw the object relative to the new origin.

        ctx.save();
        ctx.fillStyle="#F00";
        ctx.fillRect(50,50,50,50);
        ctx.translate(75,75)
        ctx.rotate(Math.PI/4);
        ctx.fillStyle='#00F';
        ctx.fillRect(-25,-25,50,50);
        ctx.restore();

Once I figured out how to rotate a rectangle properly, I wanted to get the code working with  images. As I already knew that for the game’s graphics I was just going to use the Flash game’s assets that were exported as an image map so I just needed to modify the json code to use my own vastly condensed format. My older Halloween Liche port had the code to handle the format already so to speed up testing I just used the code from this. I quickly had bats on the screen and a rotating player. Implementing shooting and moving bats was not hard and the next thing I knew, there was a nearly finished game.

A bit of fine tuning and we have our Halloween game for this year completed. The source code is being added to my repository at https://github.com/BillySpelchan/BlazingPorts . Enjoy.

Wednesday, September 16, 2020

JS13K Postmortem

 Due to family matters, I simply did not have time to finish my entry for the JS13K competition. I am still, however, going to do a postmortem. 

What Went Right – Good Idea

The theme for the competition was 404. This is the Page Not Found error code for HTML pages. The idea I had was a stealth game where you need to find your way out of a procedurally generated multi-level dungeon while avoiding being detected by the 404 inhabitants. Ideally, assuming I could squeeze it into 13k, I would have used my ray caster to  have the game in 3D using a procedurally generated rock texture. The sprite for the enemy would be generated using simple drawing commands then made into a sprite sheet.

To make sure the game was completable I was going to write a utility to play through randomly generated levels keeping the seed to the levels that could be completed then use the seeds for level data. This is related to my thesis work as part of my work involves creating solvers for playing through procedurally generated platformer levels.

Mixed Blessing – Components Completed

Parts of the game had been completed before hearing the bad news about my father but because I never actually got to finish the game, I consider this to be mixed. Perhaps I will be able to use the code in a future project. Three things were completed before hearing the bad news. I had a random number generator (based off of PCG) so reseeding would be possible. This is necessary for JavaScript as there is no was of seeding the build-in random method. I had my map generator for generating the levels. And I had the texture generator for generating the rock texture and with parameters and color changes this would have even allowed for variety between the map levels.

What Went Wrong – Family Matters

Things have been totally nuts over the last few weeks. With bad news regarding my father, relatives have been visiting in case they don’t have another chance (a real possibility but as this is a private matter I will not go into details). Combined with having to drive to different cities to take my father to appointments and dealing with lawyers and accountants my spare time was next to none. Then the fridge died and needed replacing. So needless to say, the real world was not kind to me so the only choice I had was to cancel the game development which is sad as I think if I could have pulled off what I wanted to accomplish it would have been a great entry.

Not sure what I am going to do next month. Probably a post-mortem on porting my Vampire Attack game from Flash to JavaScript, but going over my texture generator is also a possibility.