Syntaxus Dogmata

An Insane Developer's Journal

Hiatus: Complete

All right, ALL RIGHT… no posts since April 20th, and not a word of explanation.  This is inexcusable!  Worse than that, it’s reprehensible and vile and just downright evil!

The truth is, I got caught up in a couple things during this dry spell.

1) My family and I moved out of our home and into an apartment where we’re markedly happier, thank you very much.  I also lost my job at that dumbass mortgage company and found a new one a few weeks later with an awesome research company where I’m markedly happier.  That’s a lot of upheaval, and something just had to give during that time.

2) I took leave of my senses and decided to pursue the vagaries of… *shudder* web development.  I know, I know.  Such a thing is completely irrational, given my reasons for wanting to make games in my spare time.  Fact is, I saw an opportunity to bring together a family business venture, part of which involved me making games, but it ended up being more hassle than it was worth.  In the end, I found myself several projects deep JUST to get my mind wrapped around JSP development.  The more time went on, the more decoupled I felt from game programming, which is the opposite of what my efforts were supposed to do.

So here I am exactly seven months later.  I’ve all but abandoned web development (nothing’s set in stone yet), and I’m gearing up to revisit my work with VertX and XNA.  Thank heavens for this dev journal.  Without it, I’d be about as lost as a penguin in Alaska.  As it is, I’m barely able to follow my notes in the decision-making process I went through.

I’ll get there again, I’m sure.

Nov 21, 2010 Posted by | Uncategorized | Leave a comment

Geeks and GIMPs

A while back, I mentioned that I was searching for a cheap & simple paint program not bent on being God’s gift to the photo editing universe as a free alternative to Photoshop.  I settled on Paint.NET the same way an old woman settles on a hemorrhoid donut — gingerly, and with a sigh of relief.

But not without trying a couple other candidates first.  GIMP was one such candidate, and I’m finding that it’s aptly named.  Like many other poorly implemented Windows applications, GIMP’s uninstaller doesn’t quite remove its massive, blubbery footprint from the operating system, as evidenced by the fact that every time I right-clicked an image file in Windows Explorer, the context menu still contained an item that proudly said “Open with GIMP.”

So, figuring the odds of me being the only hapless prospect out there to encounter this issue, I go searching for a solution online, and once again I’m reminded why most “helpful” geeks irritate the bat snot out of me.

I had to sift through several online forums where the original poster had the same problem, and asked for advice on how to get rid of the annoying menu item.  Inevitably, the majority of respondents felt the burning need to reveal their intelligence quotient by calling the issue into question…

“It’s just a harmless menu.  Why do you want to get rid of it?”

“Just change the file associations and double-click the image instead.”

“There are other ways of launching an application, you know.”

Why do people do this?  What is it about the human psyche that causes vacuous geeks to pull their head from its usual storage area to type an endless stream of worthless, issue-dodging drivel in response to a simple question?  It’s not just this particular issue, either.  It happens all the time!

Hey Einstein, do I look interested in justifying my question to you?  Did I ask for your personal bachelor’s dissertation on file associations or the finer points of launching a Windows application?  The issue isn’t about working around the problem — it’s about GIMP taking a big old [expletive deleted] on my operating system and not cleaning up its [expletive deleted] mess when it’s [expletive deleted] told to!  If you can’t offer an actual solution, then how about you pour yourself a big, steaming cup of [expletive deleted], and give way to others with brains larger than an average walnut who can actually help?

There, I feel much better now.

Apr 20, 2010 Posted by | Uncategorized | | Leave a comment

Spritely Sprites in Spriteland

The last quandary I’m slated to tackle is the whole cascading effects feature I’ve wanted for VertX.  See this post I made several days ago for details.  Originally, I was ruing the task of getting all of that working in VertX, but now I’m not so sure it’s going to be the chore I was expecting.

What I’m discovering now is that I don’t have much cascading left to do in the hierarchy, really.  My initial thought was to have sprite objects able to contain other sprite objects, but after thinking about it, I’m coming to realize that such a thing would be overkill for what I want to do with sprites.  Instead, I’m leaning toward having sprites contain multiple graphics (Texture2D objects), and manipulating them during the sprites’ Update() and Render() cycles.  That way their locations and transformations can be relative/cascaded or not as the game developer chooses.

So, in the time it’s taken me to get to this cascading effects issue, I’ve removed the Widget class from the hierarchy, added the Frame class, and decided that sprites don’t need to contain other sprites.  These three things together has made cascading effects something of a non-issue.  All I have left to do, really, is create a sprite with multiple textures, and voila!  I’m in business.

Once that’s done, I have a decision to make.  I could proceed to work on the Animation class, which is pretty exciting and a big leap toward making VertX’s a viable game development framework.  I’m tempted, however, by the prospect of working on Tetris again.  I’m in this to make games, after all, not merely to make an XNA-based framework for game development.  Tetris wouldn’t require any animations (that I can foresee right now), so this is an opportunity to actually put my framework work to work and make it work.

Yeah, that sounds more appealing.  I’ll extend VertX as needed with future games that are more sophisticated.

Apr 17, 2010 Posted by | VertX™, Video Games | , | Leave a comment

Frames Are On!

I finished the introduction of Frames into VertX.  They work great, and the Screen class has been refactored the way I described in my last post.  Screens became so simple, in fact, that I wondered if I hadn’t made a huge mistake and turned it into something of a vacuous class.  But looking at it now that everything’s working, there’s enough functionality there to justify its existence, I think.

As I worked, the thought occurred to me about how adding frames affected things like collision detection and mouse clicks in the future.  VertX doesn’t feature such things right now, but it will fairly soon, and I couldn’t help but wonder if adding frames into the hierarchy wasn’t unwittingly sabotaging such matters.

I figured collision detection wouldn’t be a problem, as long as I made it a rule that sprite collisions would only be detected between sprites in the same frame.  Implementing this rule would make frames quite useful, in fact, as they would separate out the sprites whose collisions I don’t care to detect from those sprites whose mutual interaction I do care about.

Mouse clicks, on the other hand, nearly made me reconsider what I was doing with frames.  Every time the player clicks somewhere on the screen, I have to figure out what it is the player is clicking at.  It’s a form of screen-wide collision detection that transcends all sprite layers — including any frames that happen to overlap at those screen coordinates.

Obviously, this already violates the rule I established two paragraphs up, and I don’t envy the poor bastard (me) who is responsible for writing the algorithm that works through all the frames and sprite layers in order to serve up the sprite that was clicked… if any!  Not only that, but it must do so in a manner that doesn’t severely impact performance for that game cycle.  How would it look if every time the player clicked the mouse, the game froze for an eighth of a second just to figure out what it was they were clicking at?

If you’re waiting for ol’ Syndog to pull a proverbial rabbit out of his hat with some slick mathematical solution coupled with a brilliant coding twist, expect to be waiting a while.  I get the feeling the solution to this problem will require a lot of experimentation and trial & error engineering to pull it off.

But just because my hat is bereft of all lagomorphs in this matter, that doesn’t mean I don’t have a few tricks up my sleeve.

The first is a flag I’ve already implemented the Frame class, labeling it as mouse-sensitive.  If there are no “clickable” sprites in a particular frame, then there’s no reason why the mouse click algorithm should consider that frame at all.  That alone can cut out a huge number of sprites from the process of elimination.

Another idea I had was to make only one frame mouse-sensitive at any given time, which would narrow the field even further, but I think that’s too impractical a limitation to place on the game developer.  When it comes to the organization of their sprites among the screen’s frames, I want them to have as much liberty as possible.  Mouse sensitivity will certainly affect the way they organize their sprites among the frames, but I don’t consider it overly restrictive, as having only one mouse-sensitive frame would be.

One way or another, I’ll work it out.  Who knows?  Maybe I’ll get lucky, and the process won’t be all that intense to begin with, and I’ll find I was concerned over nothing.  Were I a gambling man, that’s not the way I would bet, but stranger things have happened.

Apr 17, 2010 Posted by | VertX™, Video Games | , , | Leave a comment

On To Frames!

All right, so it took more effort than I thought, but after much weeping, wailing and gnashing of teeth (and I don’t mean in a good way), I achieved what I set out to do in my last post.  No longer is the SetUp() method having to check for valid objects among the parent and children along the class hierarchy.  It required a few default objects to be made, which I hadn’t anticipated, but there you have it.  This also bought me the liberty to review the code already in place, and make a few minor adjustments.  Mostly it was eliminating code that I’d written under pretenses that ended up not working out in the end, and I neglected to go back and remove it.

So now, on to frames!

You’re gonna want to slap me around after I spent all that time fussing over sealing the Screen class a couple posts back, but I’m reconsidering the conclusion I reached.

If you’ll recall, I decided against it in order to keep screen creation simple.  If the Screen class isn’t extensible, that means all the custom, game-specific objects that compose a screen (sprites mainly) would have to be instantiated and added to the screen by the outside world, making that code more complex than it needs to be just to set up a screen.  I delight in simplicity, and the mechanism of choice by which I achieve it is through encapsulation.  That means the Screen class will need to be extensible, and I still stand by that.

So no, I’m not contemplating a sealed Screen class in the future (not that I’ll confess to, anyway), but I am thinking of abstracting the Update() and Render() methods from its descendant classes.

This wouldn’t make sense if the Screen dealt with all manner of sprites, all bouncing around the screen higglety-pigglety.  How else would the screen manage the various drawing effects and parameters of all those sprites?  The way XNA employs the SpriteBatch ensures any standard algorithm set in stone would be implausible.

But now the screen isn’t dealing with all those sprites.  With the introduction of the Frame class, sprites are now effectively abstracted from the Screen class.  Instead, screens deal exclusively with frames — a far simpler notion — leaving the frames themselves to deal with all those pesky sprites.  All it would take is for the Screen class to store its frames in a standard collection, and then call their execution methods successive to the order they were added.

In short, I’m making a compromise here between the two extremes of letting the game programmer go nuts overriding the fundamental operation of screens, and shutting them out of all customization completely with a single keyword.  Screens will execute the same across the board, but will remain extensible for the purposes of composition setup.

In the words of Gurney Halleck, “Behold, as a wild ass in the desert, go I forth to my work.”

Apr 14, 2010 Posted by | VertX™, Video Games | , , | Leave a comment