The Joy of Programming: if(false);

There comes a point in every mans life when he is up at 3am trying to debug some god awful mess, and it turns out that it was just a semicolon in the wrong place. I had this happen to me recently with the following piece of code.

This if statement looks honest enough. Sets the characters animation to RUNNING if his velocity is > 2. Right? Wrong! Unfortunately for us, a rogue semicolon was placed at the end of the if statement. This causes the code above to ALWAYS set the running animation, regardless of the outcome of the if statement. This is a difficult to spot bug because it isn’t a compile time error, and doesn’t even cause Netbeans to throw a warning. So the next time you have an if statement acting weird, check for rogue semicolons! 

Justin wrote…


We’ve been working intently on getting a ton of new gameplay systems prototyped so we can start playtesting and get our fun factor as high as we possibly can.  We’ll be showcasing some of the creative and awesome gameplay systems that we have designed soon enough, but in the mean time, some eye candy from an artist who we have been in serious talks with.  First is the Bounty Hunter, this is just an early version of his sprite, but we love the utility belt and the very cyber looking Omnicore, which will be the Bounty Hunter class’ weapon of choice. 

In the post above are some enemies that have made me scared to go for a walk in the woods :( But these look amazing, we can’t wait to design the sprites and the AI for creatures that will undoubtedly be intimidating and exciting to do battle with.  The “Space Pirate” is a working title for a mercenary-esque faction that will end up being quite important to our story… but you didn’t hear that from me!

Stay tuned for some more updates.

The Joy of Programming: Return False;

Mike wrote…

This is the first post in a series I’m calling “The Joy of Programming”. Today’s post will be about the joy of working with other peoples libraries. 

Let me set the scene for you. I’m working on a particularly stubborn bug having to do with our physics. After several attempts to fix the problem I decide to bite the bullet and go into the code of the physics library we use. After a bit of looking around I find the culprit. One of the engines functions wasn’t working exactly as it should. Here is a screenshot of the function as I found it.

It seems that the author of our physics engine forgot to implement one of the functions! And instead of throwing an exception just decided to always return the result of false.

So I guess the lesson here is to remember that all code is susceptible to human error, and to keep that in mind when trying to fix problems you are having with your libraries.

We would like to thank ej-technologies for allowing us to have access to their install4j Java installer. Their help is greatly appreciated. Check out their website here.

We would like to thank ej-technologies for allowing us to have access to their install4j Java installer. Their help is greatly appreciated. Check out their website here.

Justin Wrote…

Short gameplay demo containing a lot of new features since our last video!

- NETCODE (Multiplayer support over the net)

- Skills

- Inventory and Item enhancements

- A HUD

- Experience and stat scaling

- Character save files

- The map editor

- And more…

Some of these features are going to warrant their own video and post, others won’t.  However we’re going to be able to make video updates a lot more frequently now that the engine is more or less done, and game design is ramping up =)

Random fun stuff.

Justin wrote…


Sometimes I enjoy taking a break from the really intense stuff and just coding something fun, like a level up script that puts a fancy particle emitter on the player, applies a golden glow, and plays the level up “DING” noise from WoW that is just so… damned… satisfying… :D

Scripting and conditions are working very nicely :) We are right now just putting the finishing touches on the map editor and deciding how we are going to store persistent game data and variables so that we can start to make quests and whatnot.  Hopefully the next few weeks will look something like this:

Update 7: Map Editor

Update 8: Silver Goblet Scripting System

Update 9: …. ?

The editor and scripting system are designed to be intuitive, require no knowledge of java, and require only a top end understanding of our system, so that anyone can easily come in and write nifty NPCs, signs, chests, etc!  Map editing is smooth and intuitive, and we can’t wait to see what some of our level builders come up with once we have some actual graphics.

Stay tuned!

Zomg random updates!

Scripting system is well underway and the level editor/script UI is very near completion :)  Some sick stuff coming up.

Link to update 6 for the lazy.

Justin and Mike wrote…
BLIZZCON!  We’re going this weekend and ridiculously excited.  We’ll try to blog about it while we’re there, and the level editor update will have to wait until we return :) Hopefully we have some neat pictures to show.

Justin and Mike wrote…

BLIZZCON!  We’re going this weekend and ridiculously excited.  We’ll try to blog about it while we’re there, and the level editor update will have to wait until we return :) Hopefully we have some neat pictures to show.

Next update (now up @ youtube.com/silvergobletgames!)

Justin wrote…

Going to be doing a short video for update 6 to pave the way for our big map editor update (the one that will ship with the game!).  This one is going to cover our text rendering system and particle engine, which are going to be oddly related in some ways!  For people who are unaware about what I mean by particles:

Particle engines are mostly seen by 3D engines, but in 2D can be quite effective as well!  A “particle” in this case is an extremely tiny shape, image, or blob of color that can be given properties like position, velocity, acceleration, angle, angular velocity, etc. etc.  A “particle emitter” is an abstract construct whose job it is to emit particles into the world with initial color, velocity, etc., at which point they will act on their own.  When properly used, particle emitters are helpful for creating “fuzzy effects” that are very difficult to do with conventional rendering, such as: fire, explosions, smoke, moving water, sparks, falling leaves, clouds, fog, snow, dust, meteor tails, hair, fur, grass, or abstract visual effects like glowing trails, magic spells, etc.  Obviously not all of these will be used (hair, fur, grass come to mind), but you can bet on there being a fair bit of them :]

An example of some particle effects

An example of some particle effects you can achieve in 2D.

We use a similar paradigm with our text rendering by creating a class that is a wrapper for text that we can add to the scene and extend just the same as any other object, which we’ll be previewing with combat text at first - it’s neat to give Text a velocity and rotation over time and see what kind of neat effects we can come up with. 

When the video comes out, you can count on it being posted here.  It’ll likely get made and posted on Sunday.

(EDIT 1: Tonight, I promise =] )

(EDIT 2: It’s up! http://www.youtube.com/watch?v=JPuQE-L_9is)