December 27, 2015

A Study in Human Traditions: An Announcement

Hey, everyone.  Over the past few months, I've been working very hard on a particular project and have finally reached a critical milestone.  Today I'm proud to announce I'm releasing the first in a series of stories titled "A Study in Human Traditions" on January 8th.


"A Study in Human Traditions" is a series of interactive short stories following Simon, a scientist who needs your help to understand the stranger parts of human culture.  Help him decipher such ancient rituals as "Dinner Party", "First Date", and "Democracy", and perhaps learn something about yourself in the process.

I'm releasing Entry 1: "Hollowed Weed" on January 8th, with more entries to come in the following months.  Mark your calendars or other alternative time-tracking devices!

April 30, 2015

Rigid Body Simulation (Game Physics)



For this Game Physics project I tried my hand at a rigid body simulation, which for now remains incomplete.  Due to a combination of factors the simulation doesn't work as nice as I'd like - some of the math is a little fuzzy and collision resolution between bodies is jittery.
A good portion of the difficulty came from understanding the underlying matrix transformations and quaternion mathematics, which even now I'm still trying to figure out, at least from a math theory standpoint.  This contributed to the challenge of resolving collisions properly, as the process involves many matrix transposes and transformations, as well as some inversions.

I'm not too happy with the results of this project, so I'm going to attempt to fix these up within the next few days, hopefully with a slightly better understanding of the resolution process this time.

April 29, 2015

Component-based UI System (Project Postmortem)

An important project I struck out on this semester was the creation of a component-based UI system portable to other platforms.  I wanted to create something that scaled nicely and allowed artists to create beautiful layouts without having to write a line of code.  This worked out very well and has become one of the standout systems in my framework.

There were several important points I wanted to hit on with my UI system.  I wanted the system to be flexible enough to be portable to any other backend.  That is, I wanted something that didn't rely on platform-specific code to work.  While obviously the actual rendering is handled on a per-platform basis, the API had to abstract this out.  Additionally, I wanted to achieve some level of resolution-independence, particularly for mobile platforms.  Positions needed to be specified such that things could be anchored to the sides of the screen without writing code manually positioning it relative to screen size.  All this was intended to decrease the amount of time I spent re-implementing common structures across UI forms and create something that made it easier for designers and artists to create content without an engineer.

 My objectives, for the most part, were met.  I created a coordinate system composed of two parts - screen-relative and pixel offset - that allowed things to be positioned and sized uniformly across multiple devices and screen resolutions.  Retrieving the absolute position on the screen is as easy as multiplying the screen position by the UI size and adding on the pixel offset.  This made, for example, corners much easier to deal with.

I implemented a UI stack system which allowed forms to animate in a generic manner as well block touches to lower forms, which made the creation of message boxes much simpler.  Forms are depth-sorted, and elements from top forms can block touches to lower forms, allowing touchable elements to occlude deeper elements and prevent unwanted touches.  The animation system gives a generic way of making opening and closing animations for forms, allowing elements to slide, scale, and fade in a customizable manner.  This added a nice layer of polish to the game, particularly when we added easing functions.

Additionally, I created several common controls, including buttons, checkboxes, and radio buttons.  Finally, I implemented a slick tweening system, which allows each individual element to be rotated, positioned, scaled, rotated, faded, and color-shifted at will with very little code.  This is built on top of one of my existing value tweening systems and required a bit more work to implement without using expensive lambdas, considering that tweens of certain types were not allowed to overlap - I couldn't, for example, have two position tweens running on the same element without unwanted behavior.  Finishing this system added a nice layer of polish, giving us flashing UI elements, arrows that scale, buttons that pop up, and selection icons that shift around the map instead of teleporting.  The visual benefits of this system are immediately obvious and well worth the effort to implement.

After finishing this project, I've concluded that having a dedicated UI system helps cut down on redundant development time.  I created a system early on that made creating forms a five-minute process instead of a thirty-minute process, and while creating the system took time, the effort was worth it.  It also gave my Production game much more visual polish.  Another important lesson was that building this system does not necessarily mean that artists and designers will actively work with it.  I did not spend enough time introducing it to the people it was intended for, which led to me spending more time than I would like on the layouts instead of dedicated UI people.

Scripting Languages, Bytecode, and Feature Creep (Project Postmortem)

At the beginning of this semester I embarked on a small project to create a ZZT-OOP style language for my Console Programming class.  For several reasons, this did not work as intended, but the experience was still worthwhile.

My original objective was to create a simple scripting language, complete with syntax, parser, and runtime, to enable designers to more easily script behavior.  I was inspired by ZZT-OOP, a language included with the influential 90's ZZT game and world editor.

This goal got away from me as I delved further into language design.  I started out trying to define the syntax, but found that it was easier to write the bytecode instructions first.  Each instruction contains two parts - an opcode and an optional argument.  A program is just an ordered list of these instructions (with optional labels) combined with a program stack, a data stack, and a context stack, to maintain which variable table is being referenced.  Most opcodes operate on the data stack, pushing or popping values.  Others push data from the variable table onto the data stack or push the top value from the data stack into a spot in the variable table.  Still others branch or jump to various labels within the program, allowing for the creation of loops and conditionals.

This created a really cool demo, but led to the creation of something that would require more work to interpret compared to the single-instruction, command-line style of ZZT-OOP.  I began looking more closely into Lua, borrowing its "table" concept for variables.  Unfortunately, this led to an attempt at parsing Lua-style syntax, which, if you've ever compared ZZT-OOP to Lua, it's night and day.  Lua, in comparison, is significantly more flexible, which makes parsing it much more of a challenge.  These difficulties served to slow my progress, and with the constant need for progress in my Production course, my work ground to a halt.

Luckily, this attempt was not for naught.  I definitely understand more about how languages work behind the scenes and understand the bytecode pattern much more completely.  I also learned a lot about the limitations of C# in creating a scripting language.  Most other implementations are in C or C++, which allow for unions and treating strings as char pointers.  Comparatively, C# requires that you hack unions with FieldOffset, and strings are treated as managed copy-on-write objects, making it impossible to embed them within a C# struct "union".  I also received another lesson in scope management, and should probably not get distracted by shiny popular languages in the future if I return to this endeavor.

So, the most important takeaways from this project: bytecode is pretty easy, language specifications are more difficult, and translating between the two is tricky.  Also, designers don't really enjoy writing code, so a visual scripting tool is not only easier to use, but easier to interpret into bytecode.  If I return to this, I'll likely make some kind of WinForms tool instead of a full-blown written and parsed language.  It's a bit more effort from a tools perspective, but if my goal really is to empower designers, then this is a much better alternative.

April 3, 2015

Mass Aggregate Physis (Game Physics)



For this Game Physics project I confronted a mass aggregate-style physics simulation, attempting to get basic shapes and motion from rod and cable constraints.  For various reasons this didn't turn out as expected.

Debugging mass aggregate systems can be time-consuming and challenging, particularly when the issues only show up at scale.  One physics rod may correctly resolve two linked particles, but what if there are four inter-dependent rods connecting a pyramid?  I pored over my contact resolution algorithm many different times, spotting no differences between my code and the provided code, yet something was clearly wrong.  Shapes would collapse upon themselves or, worse, explode outward.  Eventually, I managed to resolve the issues, though more through brute force than anything else.  Given more time, I would like to figure out exactly where my original simulation went wrong.

The project also took longer than it should to complete.  I underestimated how long debugging the simulation could take.  After all, the algorithms are pretty simple and laid out for us in the course material - I only have to implement them, quickly test them, and get the gameplay working.  Easy, right?  This didn't hold true, and I spend too much time at the end attempting to fix basic physics issues.  The physics work, but performance could be improved.  Additionally, this cut time from being able to improve the presentation of the simulation by, say, rendering lines for each physics rod in the scene.

February 17, 2015

Planetary Simulation (Game Physics)


Over the past few weeks, I've created a planetary physics simulation for my Game Physics course.  It uses OpenGL, GLUT, and GLUI to render out the simulation.

I've built a classic implementation of an Entity-Component system, where Entities only serve to bind data Components together, though my Entity also contains a position, since that is shared most often among components.  The Systems operate on the Entities with certain Components.  Thus, I have a PhysicsSystem which operates on all Entities with a PhysicsComponent.  This allowed me to update the simulation all at once, instead of at a per-object basis, which could lead to some issues with state synchronization.

There were some challenges with the sheer scale of the numbers involved.  In kilometers or kilograms, the distances or masses might be too large to operate on properly.  I converted everything to astronomical units and solar masses, though this also caused some problems with very small numbers.  In the end, though, I was able to get the simulation working mostly correctly.  The Earth's moon is still a little weird, as I was not able to find the correct numbers to get it to work properly.

Getting the rendering to work also had a few challenges, most notably in rendering the planets with different textures.  While I took a Graphics II course back in Montreal, that was in DirectX, and we had been given a solid framework to build off of.  Here, I started from nothing to get an OpenGL renderer - not necessarily too challenging, but time-consuming.

May 2, 2014

Pierce the Dark

Pierce the Dark is the newest (and only) game from the Beautiful Elevator Kids, a team of six student game developers at Champlain College.  We're comprised of Ben Thomson (Lead Designer), Alex Beauchesne (Lead Programmer, me), Zach Collins (Lead Artist), Charles Stone (Designer), Vasily McCausland (Programmer), and Chas Elterman (Artist).

A fifteen-week project for our Game Production 2 course, we took great advantage of our time and created more than just the vertical slice we were required.  Our game is polished, challenging, fun, and promising.  The game's only in Beta, and there are a few tweaks here and there we want to make, especially regarding the game's conclusion, but this represents the most complete game I've worked on in my time at Champlain so far.

We plan on finishing up the last bits of the game over the summer, and a spiritual sequel is being considered in order to further explore the gameplay avenues we've opened up.

You can download the beta as it stands for PC and Mac (size: ~30MB).
Watch some gameplay footage here.

I'll make a blog post later on detailing the technical design of the game.  It was my first experience with Unity, and while learning Unity I found myself learning a lot about game engine architecture.

A few more screenshots for good measure:


April 24, 2014

Patisserie Montreal (Twine Story)

I wrote another interactive story, this time as a final project for my Food Writing course.  It deals with my experiences in Montreal this semester.



This one was a little easier to write, since I wrote about my own experiences rather than some fictional world.  The expandable details are a bit lengthier than those from my previous stories and cover a broader range of topics.  A few are a bit heavy in terms of the amount of text presented, so I'm going to focus on writing tighter in my next stories.

As always, any kind of feedback is appreciated.

February 1, 2014

The Frozen Mountain (Twine Story)

I wanted to do another short Twine jam today, so I asked a friend for a theme to help me write the story.  I took her suggestion of "Climbing Everest" and wrote The Frozen Mountain in about four hours.


This one was a little harder to write than Space Cruiser Panic.  That story had a futuristic setting with a lot of room to fill in details, while the landscape in this story is sparse, unforgiving, and realistic.  Much more of my writing had to be dedicated to imagery rather than the absurd.  Still, I think this story is worth reading.

As always, any feedback is appreciated.

January 25, 2014

Space Cruiser Panic (Twine Story)

Today, I challenged myself to create a game in two hours.  It ended up taking more along the lines of four hours, counting some polish at the end, but the effort, I believe, was worth it.  I'm really starting to like Twine.  It combines my love for games with my love for stories in a quick, accessible format.


The story is a narration of an absurd day aboard an interstellar star cruiser.  The ending's really why the story took so long.  I wanted something beautiful, something that ends on a hopeful note rather than what the ending initially appears to be.  Hopefully my efforts have paid off.  I may attempt another 2-4 hour game jam next Saturday.

As always, I appreciate any feedback I can get on my works.  Feel free to criticize, praise, etc.

December 5, 2013

Dijkstra Maps and Simulating Goal-Based AI

(Note: this post served as an explanation of a final project for a Game AI course.  It describes a pathfinding technique in detail.)

A Dijkstra map is a pathfinding tool that, in its most basic sense, marks a 2D grid of cells with distance values according to the number of cells a particular cell is away from a target cell, navigating around wall cells.  When used properly, however, it is a powerful data structure that, when combined with other Dijkstra maps, allows multiple A.I. agents to intelligently navigate towards targets, biasing one set of targets over another based on specified weights.

Dijkstra maps operate on very basic principles.  The implementation I chose (and the one described by Brian Walker) is relatively naive but simple to implement and does the job well enough.

October 31, 2013

Well, it's Halloween (Interactive Short Story)

I said I was going to finish a story for today, so I did.  I successfully completed a very short story in Twine.

I present to you all: Well, it's Halloween, a short interactive story about a man with some free time on Halloween.  I haven't found a good spot to host it yet, considering I finished it within the past hour, so you'll have to download and open the html file.  As soon as I can find a good spot to host it, though, I'll update this post with the new link. 

I'm pretty happy with how this turned out.  I managed to balance an introspective narrative with a decently lighthearted tone, which is a drastic change from my first attempt back in January.  I'll give it it's own page within a few days.

You can check out Twine here.  It really is a great tool for this sort of thing.

Edit: I updated the story a bit after messing around with Twine a bit more.  The visual presentation's improved, so there should be less confusion.

October 28, 2013

Introducing Little Battleship of the Deep (October 2013 Update)

Regretfully, I did not post here over the past several months, despite having worked on some excellent projects during that period.  My motivation has been flagging a bit due to personal issues.  I am working to correct that, however, and perhaps by informing my readers (that's right - it's plural now!) of my progress I'll finally get something finished.

This summer, I worked on a flash project with a good friend, intending to sell it on FlashGameLicense.  We discovered the Video Game Name Generator (wonderful website, by the way), and after wading our way through the multitude of off-color names offered, we happened upon one that didn't sound vaguely sleazy and was somewhat comprehensible.  Realizing that it was just a clever way of saying "submarine", we quickly drew together a plan for a underwater horizontal shooter.  Thus, Little Battleship of the Deep was born.


A battle with Liquid Man and his army of Vengeful Sewer Goldfish.

October 3, 2013

Space War Clone Jam: Postmortem

(Note: this post was made for a Networking for Online Games course.  It serves as a short postmortem for a SpaceWar clone game jam.)

On September 27, we were tasked with creating a clone of SpaceWar in a few hours.  I partnered up with Robert Bethune.  We started with the game I made for the previous assignment and made short work of the game jam, almost completely finishing within those few hours.

What we did right: Starting with base framework.  Thanks to the framework I established for my earlier assignments, we didn't have to fiddle with network code too often.  It was simple to add new packet types and send important information from the host to the clients.

Biggest difficulty: Bullets.  Bullets are currently handled by the host as a table of IDs to bullet objects.  This worked just fine with my previous assignment, but here, the jam required we delete old bullets if too many were present.  It's not necessarily the oldest bullet that gets destroyed, but the one with the lowest ID number.  This is not an ideal solution by any means.

What we could improve: Authoritative host controls.  The host currently updates host-specific code during the network code rather than the world code.  This seems logical, but it results in many issues absent from the other approach.  Important world code is not run before the host checks for collisions, for example.  This led to a bullet collision problem.  Bullets take two health off of players instead of one.  Despite all attempts to fix this, we were only able to implement a hack to display what the health should be (half the real health).



Professor Pile's Blog
Robert Bethune's Blog

September 6, 2013

UDP in X-Wing vs TIE Fighter (Networking for Games)

 (Note: this post was made for a Networking for Online Games course.  It is intended to describe one game's approach to networking, as well as the various advantages and disadvantages of using UDP or TCP.)

X-Wing vs TIE Fighter is a multiplayer space combat simulation game released in 1997.  The developers wanted to create an experience more complicated than a deathmatch that could be played over the internet.  This posed a series of significant technical challenges from the start:
  1. The engine had not been designed for the Internet.
  2. There was more data involved in simulating missions than in simulating deathmatches.
  3. They were not able to use a dedicated server, relying instead on a peer-to-peer system.
  4. There are latency and bandwidth issues to deal with over the Internet.
 The developers decided on a host-client system.  One player acts as host, processing input from the clients and dispatching game state data to the clients.  The clients send information about their inputs to the host, instead of changing the game state and sending information to other players.  The host-client model worries about synchronizing players with the host, instead of with every other player.

When dealing with synchronization problems, the developers found the system of recording and playing back user input on the host machine was not entirely reliable.  Inputs that could have different effects depending on the state of given variables could quickly result in diverging simulations depending upon when said variables were updated.  They attempted to fix up these types of bugs and implemented a system of detecting out-of-sync issues, resending the data that had diverged.  They also had the game store two copies of the world state.  One would represent the state based on the actions of each player, and the other would represent the currently available state.  The latter was based upon predictions of each player's actions and was the only state rendered to the screen.

Upon conducting some real testing over the Internet, the team discovered heavy latency issues, usually within the range of five to ten seconds but occasionally upwards of fifty seconds.  They quickly came to realize that TCP was not the correct protocol for their system.  It relies on a system of acknowledgements and will only accept data in the correct order.  This makes it a reliable, but ultimately slow, system to use for rapidly-exchanged game data.  They switched to using UDP but encountered dropped packets.  With every resent packet more bandwidth was consumed.  Their solution was to send a copy of the last packet with the current packet, making it more likely that the data would be delivered.

When dealing with lost connections, the team implemented a time-out feature.  Players whose connections worsened, sometimes to the level of only three or four packets in twenty seconds, would have their game stopped and resume only when the connection had been cleared.  The host would, if necessary, drop any player's input that took too far long to arrive and send out the game state information without it.  This was not usually the case, however, and the speed of the game would often depend upon the speed of the slowest connection.  This created an effect the team dubbed "star-field warping", wherein a player's position would suddenly jump from their predicted position to their actual position in the simulation due to lag.  To help smooth this effect over, the team implemented an algorithm to move players' ships from their current predicted position towards their last known position, resulting in a smoother, if less accurate, representation of the game state.

(Source: Gamasutra - The Internet Sucks: Or, What I Learned Coding X-Wing vs. TIE Fighter )

April 25, 2013

Extreme Fly Fishing 2013

I mentioned a few weeks ago I was working on Extreme Fly Fishing 2013.  Since the game is now complete, I feel it's time to elaborate on its workings.  (Play it here!)

Extreme Fly Fishing 2013 (or 2003, GOTY Gold Edition, or one of a variety of other subtitles we use) is a mobile arcade game about fishing, flying, and the fourth dimension.  As fisherman Al, you use your fishing pole and bobber to hook onto birds, kites, and other flying objects, pulling yourself up and flinging yourself off to climb as high as possible.  Along the way, you travel through space and eventually transcend it to explore other realms.


April 6, 2013

Some Old Games and Some Flash Games (April 2013 Update)

I haven't put much on this site in a while due to heavy schoolwork and some personal issues, so hopefully today marks the start of a more productive period.

There are now quite a few of my games you can access from this site, including Sights and Sounds, Ninja Cat: Quest for Bird, Apocalypse: Space, and Dash.  I've discovered Flash game development to be quite enjoyable, and I expect to be working with the platform for a while.  Out of the four listed above, Dash is the only made in a different tool.  It is also the longest of the bunch.  I expect I'll elaborate more on Dash's development at a later date, as there's just too much to talk about for the space I've given myself in this post.

I ended up creating two Flash frameworks during the course of my Game Production I class: BeauSWF and BeauSWFMobile.  With some cleaning up, I may end up releasing BeauSWFMobile as an open-source framework.  It works equally well on my desktop and my Android tablet, and I never have to worry about resolution changes, as it scales the game to fit the screen while maintaining the aspect ratio.

I attended PAX East on March 24 (conveniently also my birthday) and got to talk to a bunch of cool game developers, including Rami Ismail of Vlambeer and Robert Boyd of Zeboyd Games.  It was quite encouraging visiting all the booths and realizing how little distance exists between developers like me and those presenting at PAX.  It has strengthened my resolve to get something of note finished by the end of this year.

Oh, and I'm working on a mobile game for my Game Production I course.  It's called Extreme Fly Fishing 2013 (that's not quite the full title, but I'll save that for a later date), and it's an arcade game about fishing, flying, and the fourth dimension.  Here's a screenshot from the latest development build:



Expect more details in the coming weeks.

December 10, 2012

Welcome to my blog!

Welcome to my blog.  I'm BeauPrime, a game developer studying game programming at Champlain College in Vermont.

In order to get my work exposed to other people, I figured I'd start a website on which to host several of my games.  I'll also discuss various aspects of game development here, provide readers with updates on my current game projects, and share other tidbits you might find interesting.

Game development has been a fun adventure so far and I look forward to sharing the results of my experiences with you.

~ BeauPrime (B')

January 1, 1970

Duncan Brook Publication

Back in 2011, I finished up my Eagle Scout project on Duncan Brook, a local swimming hole.  It hasn't seen much use outside of camping excursions and meetings from the Boy Scout Troop I was involved in.  It used to be a very popular place, but due to several factors, it saw its popularity decrease significantly.  I was surprised to find no real official source of information on Duncan Brook, so I made it my goal to compile as much information about Duncan Brook from both historical records and personal accounts into an official source on the area.  The resulting publication is available for download below.

Download (121.0 KB)

Christmas Background 2012

Cute animals wait by an impressionist tree in the glow of the moon.

A peaceful Christmas background created on the 16 of December 2012.  I'm particularly proud of the tree.

Download 4:3 Version (77.4 KB)
Download 16:9 Version (98.1 KB)