A few more months of Game Dev study
Posted by: Owen, 01 Feb 2015 01:21
Another semester done and dusted. Here’s some of the stuff I've made in the three modules of Game Systems, Narrative Design and Game Programming in my part-time BSc Honours Degree in Computer Game Development course at DIT.

Most recent first.

Game Programming: Pac-Man
Finished just this last weekend and presented in the first class of the new semester this week was our Game Programming assignment. The brief was relatively straight-forward; make a 2D game in Unity, taking inspiration from a classic game, creating as much of the game in code as possible. I took that as a challenge! I decided to revisit a past failure in order to make a pixel-perfect procedural Pac-Man. Not quite inspiration, but a full out clone.



The only Unity primatives I used in this project are Quads, and they're just to there to hold the textures. Those texture don't actually exist until the game is running

To give an example here is Pac-Man's death animation

There are 11 distinct frames of animation there. Here is how those 11 frames are represented as data in code.
Code:
protected int[,] pixelDeathData = new int[SIZE,SIZE]{
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0,35, 0, 0, 0, 0,35, 0, 0, 0, 0, 0},
{ 0,29,29, 0, 0, 0,35, 0, 0,35, 0, 0,35,29,29, 0},
{ 0,22,29,37, 0, 0, 0, 0, 0, 0, 0,35,29,29,22, 0},
{28,22,22,22,36, 0, 0, 7, 7, 0, 0,29,22,22,22,28},
{27,19,19,22,22,29,13,12,12,13,29,22,33,34,19,27},
{26,18,39,39,17,16,15,14,14,15,16,17,18,18,18,26},
{11,25,10, 5, 5, 4, 3, 2, 2, 3, 4,32, 5,10,25,11},
{21,24, 5, 5,31, 4, 3, 2, 2, 3, 4, 4,32, 5,24,21},
{ 0,40,24,31, 4, 3,30, 8, 8,30, 3, 4, 4,24,40, 0},
{ 0, 0, 0,20,23,31, 9, 1, 1, 9,31,23,20, 6, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};


And here is how that data is past to the custom "Painter" function that creates those frames, using the first and last frame as examples...

Code:
Texture2D f1 = Painter(pixelDeathData, new int[]{1,2,3,4,5,8,9,10,15,16,17,18,19,22,29,30,31,32,33,34,36,37,38,39});

Texture2D fl = Painter(pixelDeathData, new int[]{30,31,32,33,34,35,36,37,38,39});



All perfectly clear, right. Right?!

Okay, so that may need a little explanation. Lets take the case of a very simple 2x2 4 frame animation

Starting with the first frame (yellow on top row) we define our two-dimensional array, pixelArray, as:

{1,1},
{0,0}

If we were then to use our Painter function now we'd get back that first frame

Code:
Texture2D frame1 = Painter(pixelArray, new int[]{1});


But we can't actually use the function yet as we need to enter the data for all the frames beforehand (which is the entire point, use one array instead of four).

So on the next frame there are four different states a pixel can be over the two frames:

{1,2},
{0,3}

0 off for both frames
1 on for first frame but off for second
2 on for both frames
3 off for first frame but on for second

This means the function call for the first frame changes slightly
Code:
Texture2D frame1 = Painter(pixelArray, new int[]{1,2});
Texture2D frame2 = Painter(pixelArray, new int[]{2,3});



And so on, until we have all frames. For this simple example it only take one extra step
{1,2},
{4,3}

so all four frames can be defined
Code:
Texture2D frame1 = Painter(pixelArray, new int[]{1,2});
Texture2D frame2 = Painter(pixelArray, new int[]{2,3});
Texture2D frame3 = Painter(pixelArray, new int[]{3,4});
Texture2D frame4 = Painter(pixelArray, new int[]{1,4});


For such a simple case that is pretty straightforward, but for eleven 16x16 frames it gets really unwieldy, especially if you need to debug your mistakes. If I were to do it again (and I might just do that to try and complete the game) would be to treat the binary version of the integer values in the array as a third dimension (where each bit represents the state for a particular frame). Then bit-shift off each bit one frame at a time.

Overall I'm really happy with what was submitted. I followed the Pac-Man Dossier as closely as I could trying to replicate everyting from Ghost AI to Pac-Man turning around corners. I even coded in the effects of a buffer overflow from the original arcade cabinet (where when ghosts are attempting to find a spot x tiles in front of Pac-Man, that spot will also be x tiles to the left if Pac-Man is facing up).
But as a port it is not feature complete (missing bonus fruit, warning flashing on ghosts exiting frightened mode, ghosts do not use a pseudo random number generator with path finding in frightened mode [they just use their scatter home target], no cut scenes). There are also a few bugs, the most noticeable being if ghosts are in the middle of exiting the ghost house when Pac-Man eats an enigizer (causing the ghosts to enter Frightened mode) then those ghosts won't move at their full speed for that level on exiting Frightened mode.

Can you spot the differences? There are many


So I may revisit this one to finish it off. And it's something I'd recommend to anyone who is starting to get in to making games; as a Journeyman exercise try and recreate a classic game as closely as you can, replicate everything from movement and scores to menu screens (though not necessarily procedural asset creation). It gives you a good appreciation of what it takes complete a game (without the uncertainty of your own game design decisions getting in the way).

The game can be played here, and the source of the unity project can be downloaded here.


Narrative Design: Saturn Descending

Next up, Narrative Design. For this module we had to create a mini text adventure game using a program called Twine, which makes these types of text games.

Twine games are somewhat known for more personal or thought provoking games (like Depression Quest). So I wanted to take this opportunity to kind of do the same and create a main character that experiences social anxiety, so that the player gets a feel for what someone in that situation might go through (although it may be a bit over exaggerated at times, or drift off into general anxiety). There are elements in there that reflect me of a few years ago and even the slightly better me of today (stutters are annoying!)

The story/game itself is a bit so-so; pacing is a bit off, some character interactions aren't earned, and there isn't enough for the player to do to direct the story. But I guess it is what it is... a product of a deadline.

Takes about 5-10 minutes to play through, with different content in places depending on the choices you make.
Saturn Descending [Warning! Contains trace amounts of Science-Fiction!]

Game Systems: Prototypes, oh so many prototypes!

This module started out by introducing the basics of Unity and then quickly moving on to making a prototype to a set theme each week.

But before the avalanche of prototypes we had to make an atmospheric environment, with a beginning and an end. So I decided to try a low-poly volcano, where you can see your destination from the start but not the full path you have to travel to get there.



There is no game here, just an environment to travel through, hopping from one pad to the next.

Peace:
Then came the prototypes, first up was the theme "Peace". For this I decided to make a game about the apparent 'keeping the peace' or maintaining equilibrium in the nuclear arms race.

Balance of Power [Play Here]

Playing on the side of the US (didn't have time to set up the USSR to be played) you have to assemble your ICBMs in order to maintain your stockpile of warheads, but if you work too fast, or too slowly, you'll tip the scales and trigger a nuclear war. This was the most 'complete' of the prototypes as a game.

Oppression:
Next up was Oppression. I'm marking this one down as a failure, due to limited time, and not much worth sharing although I did demo what little I had in class, which can be seen here (may or may not display correctly due to shader shenanigans).

Change:
This was by far my favourite as it combines two things I really want to learn more about, Shaders and real-time mesh deformation.

Double-click and drag to deform [Play Here]

This is one I'll be working on more in the Game Production module this semester, fleshing it out in to a real game.I'm thinking it'll be one where you have to stretch or compress the terrain in order to create veins of resources within the mountains


The Sun/Son:
Next was "The Sun" or "The Son" if you preferred. I decided to go for Son and made the beginnings of a simple game about inheritance.


Here you combine two shapes to create a child shape that takes properties from both. Missing from this is a target shape that you would try to create after a number of generations from the supplied starting shapes.

Completeness:
This was another relatively simple one due to lack of time. Completeness brought to mind diminishing returns. The goal here is to try and fill the screen with the circles before they turn yellow. Growing the circles slows the rate at which they change colour, but the larger they become the less effective they are at slowing the change.

[Play Here] (r to reset)

There is no victory condition so you just 'play' 'til you lose.

Wrath of Kitty!
Last, and not quite least, is week 6. For this we could take the theme from Ludum Dare, Dublin GameCraft game jam (both of which were that weekend) or... some other theme that was mentioned that I've completely forgotten. For Ludum Dare it was "Game all on one screen" and for GameCraft it was "Wrath of Kitty". Since I was attending GameCraft I went for the Kitty.


This wasn't too successful a game jam for me (yet again), so this is pretty simple. You play as the baby and you have to pull the tails of the cats, without letting any of them see you otherwise they all startle and run away.

So that's it. All the stuff I made last semester. Some a bit meh, others I actually liked how they turned out for the most part. On to another 3 months of making!
Tags: Games, Programming, GameCraft, DIT, Game Jam, me me me
Comments: (1)
Game Jam and taking control of anxiety
Posted by: Owen, 04 Sep 2013 03:17
For August the theme for the Dublin One Game a Month group was “Give Up”, a topic near and dear to my... slightly malfunctioning head.

I had written a little bit in the past about my then recent discovery and self-diagnosis of Social Anxiety Disorder [in brief: Social Anxiety can be considered the irrational fear of public embarrassment/being judged in a negative way way. Everyone experiences this to one degree or another, which is perfectly normal. It is when it becomes persistent, affecting day-to-day life over a long period that it gets classed as a Disorder; anxiety over anticipation of social interactions becomes debilitating]. I've since had that diagnosis confirmed, been prescribed medication to help, albeit the smallest of doses, and come to realise just how much I've allowed it to take such a firm grip of my life. It has affected my capacity to work (directly and via a knock-on impact on self-confidence in my abilities), I've allowed friendships to evaporate and it generally has made me stall in many regards. Oh, woe is me, etc. etc.

This is something I obviously want to change, although irrational fears are not always so obliging. I figure one of the best ways to start is to rob it of one of its most potent weapons, the reluctance to even acknowledge its existence to others. So when the theme of “Give Up” came around, I saw this as a chance to create a game featuring Social Anxiety, at least in part. I wanted to have a character that can become so overcome by anxiety that they have to quit that game and run away, thereby achieving a “hollow victory”; they feel the relief of avoiding their fears but ashamed of having run from them (thematically at least) and therefore causing the other players to fail at their group task. A slightly superficial representation, but enough to get the point across and give the player a taste of the experience.

So along the lines of “write what you know”, I decided to make a game called “Game Jam”; a cooperative tabletop game where the players have to collectively complete their game projects before the end of the day. But some of the players could be playing for their own personal goals that could prevent the group from winning, with different character types having different types of goals, one of which being the Socially Anxious player type.


This wasn't just a #1GAM game, I was also doing it as part of a game design workshop I was taking part in. So that and the fact that this was a somewhat personal project, I kinda went all out on this one. A lot of coloured paper and printing and gluing to mounting board and cutting, so much cutting, hundreds of tiny pieces worth of cutting (and one finger). If nothing else, it looks pretty.

It'd been half played in the workshop without characters and goals, and it felt a bit stale (to be expected) and half played, at the #1GAM meetup at dubLUDO, with everything more or less in place. There the players seemed to like it, pausing only to go play some Johann Sebastian Joust, which ended up taking so much time - because it was so much damn fun! - so we never got back to the game. What was noticed was they the players were rapidly approaching a point of stalemate where it would have been harder to make progress. So changes I'd probably make would be to accelerate advancement in the later half of the game, which would also simulate the mad rush near the end of an actual game jam to get your game finished.

But there probably won't be much more work done on it; August and workshops are over, so it's on to other things. What I'll likely do is make a few tweaks at some point and bring it along to the next Dublin game jam event and see if anyone is interested in having a go.

Here's the rule sheet I had typed up for the game.


You are attending a 24(?)hr game jam event

Your goal as a group is for everyone to complete their game project before the end of the day (one turn for each hour of the event)

At the beginning of the game each player blindly selects:
A skill point counter for each of the 4 skills, Design, Code, Art & Audio.
A Charisma counter
A game board
A character sheet
A Goal card

At the beginning of each turn players choose to 'work' one of their four skills, taking a number of skill tokens for that skill equal to their skill points plus any modifiers.

They then all select turn counters from the bag; these will indicate the play order for that turn.

On their turn, a player can choose to apply their skill tokens to their game board or trade them to another player who has not yet taken their turn.

If a players Charisma score is at least 2 greater than the Charisma score of another player, then they can force that other player to trade, otherwise the other player has the option to refuse to trade.
If players trade, then both players will have used their turn (returning their turn counters to the bag).
After trading the players apply the received tokens directly to their game

When applying a token to a game, if a highlighted marker is filled, then the player will take a chance card and follow its directions.
If a chance card makes the player miss their next turn, then their current turn ends (cannot take additional chance cards)

Each skill bar on a game card has two Polish markers. These can only be filled by obtaining Feedback from another player. This requires the player to trade with another player, receiving the appropriate skill tokens and then changing them for Star tokens.

Some players will have received Personal Goal cards, this allows them to win the game for themselves, instead of the group. A player can 'win' a personal victory by fulfilling the indicated requirements on their Character card.

Tags: #1gam, Game Jam, dubLUDO, GameCraft
Comments: (0)
A site about my fumbling my way through programming, astronomy, game design, life... and everything else geeky.
Blog Post Categories:
Games (20)
Programming (17)
Flash (14)
Metaplace (11)
Fog of War (6)
playtest (4)
Trinhex (4)
Blockdown (4)
GameCraft (4)
Astrophotography (3)
DIY wedge (3)
me me me (3)
Pompetaire (3)
Canon 10D (2)
Tile Tactics (2)
site (2)
hacking (2)
#1gam (2)
Game Jam (2)
DIT (2)
NexStar 6SE (1)
Canon 40D (1)
Moon (1)
timelapse (1)
SCIENCE! (1)
tog.ie (1)
gamedevelopers.ie (1)
IGSDublin (1)
Save the Zombies (1)
dubLUDO (1)

www.oscan.net
oscan.net (2021) All Rights Reserved.
[Login]