Viridian Games

The professional blog of Anthony Salter, game programmer.

Archive for the 'Self-Improvement' Category

I AM THE MASTER OF UNLOCKING!

Okay, settle in for a long, non-game-development-related story.

So I’ve got this car, see. It’s a 1996 Toyota Camry. And the Toyota Camry has a common flaw - the door handles break off. The handles themselves are made of plastic (yes, even the outside handles) and if the car sits out in the sun for a few years the handles get very brittle.

So about four years ago (when I was working for Gizmondo, in fact) I came outside ready to head home after a hard day’s Battlefield and lo and behold, the handle came right off in my hand. I could still open the door because there was a small tab of plastic connected to the latch, but eventually that broke off too. I was reduced to prying up the latch with my key every time I got into the car.

Then, not long after that, I pulled a little too hard on the inside door handle and…it broke off too.

(Yes, I am secretly The Hulk. Don’t make me angry, you wouldn’t like me yadda yadda.)

So now to get out of the car on the driver’s side, I had to roll down the window and pry up the outside door latch from the inside.

And then…the inside latch on the passenger’s side broke off too (it made me angry). So now I couldn’t really have any passengers because I’d have to get out to let them out.

And this was the status quo of my car for a long time. The door latches were annoying, but not so annoying that I was willing to pay $400 a door to get them fixed.

So I just put up with it.

Until my car got broken into.

The thief was attracted by the wire running from my in-dash cassette player to the small storage space between the driver’s and passenger’s seats. He smashed out the small triangular rear window and opened the back passenger door, then opened the front passenger door, got inside and closed the door.

He opened the storage compartment to find a cheap $25 CD Walkman instead of the expensive iPod Touch I’m sure he was expecting. So he ransacked through my glove compartment looking for anything of value and came up empty.

That’s when he realized that he couldn’t get out of the car.

Now, if I could have just seen the look of panic on his face when he realized that he was effectively trapped in the car it would all have been worth it. I know he panicked because he tore the entire passenger’s side door handle out of its housing trying to get out.

(It would also have been worth it because I would have been close enough to administer a sorely-needed asskicking.)

He finally wormed his way into the back seat and exited through the back passenger door. Then, just to add injury to injury, he didn’t fully close the door which caused my interior light to drain my battery.

Needless to say, I was pissed the next morning. The door handles had been destroyed to the point where I couldn’t easily get out of the car either.

So again I was looking at $400 a door. Which I didn’t have.

So I did some research. This was the point at which I discovered that this is a very common problem with Camrys from the 1990’s. One website even had detailed instructions on how to replace the exterior door handle yourself.

So I ordered the parts and decided to try to fix the door myself. Hey, it’s not like I could make it any worse.

So today I went out to give it a shot. After four hours and five trips to the hardware store (”Oh, I’m going to need a torque wrench set, better pick one up. Oh, this set doesn’t have the right size hex, I need a 10 mm. Oh, this 10 mm hex driver I bought isn’t long enough to reach the hex bolts inside the door. Oh, this extender for my torque wrench is perfect, but somehow I managed to buy the 11 mm hex for it instead of the 10. Oh, there we go - finally got it right.”) I managed to replace both the exterior and the interior door handles.

And they work. They aren’t pretty (especially the interior, since I couldn’t pop the frame of it through the door panel) but they work. Pull latch, door opens! Pull latch, door opens! No more reaching through the damn window!

I’m so happy!

Now to do the other door. And get the window fixed. And buy a new CD player. Grumble, grumble…

8 comments

Time to Level Up

I’ve been thinking that it’s about time to start challenging myself again. Yes, yes, Planitia…but there’s something else I’ve been wanting to do.

I’ve mentioned the self-confidence problems that I’ve had in the past and while I’m a lot better (look, Ma! I’m writing in public!) there is one thing I still don’t like to do and that is compete. I shy away from testing my skills against other people, because I’m afraid I’ll discover that I suck. Well, it’s time to meet this thing head-on.

Therefore, I am hereby announcing that I will compete in Ludum Dare Eleven, which will be held from April 18-20.

Now, see, in order for this to really work I’m going to need to make a pretty good showing of it. So for the next month I’m going to be making lots and lots of small games. I’m hoping to do at least four and I don’t want any of them to take longer than a week to do. This will get me better at starting out quickly and sand over any edges in my 2D development skills.

So the bad news is that there won’t be any Planitia news for a while. The good news is that there should be lots more news on all the other games I’m doing leading up to the competition.

I’m also going to have to come up with a few good recipes, since one of the categories you’re graded on is food

4 comments

Book Progress, Part Deux

I have now finished 110 of the 357 pages in my current book. That’s about thirty percent. I would very much like to get this book done by the end of next week…that will take a serious commitment from me. To the tune of about twenty-five pages a day.

I also have a little something else that I’ll talk about later, when it’s actually congealed.

2 comments

Book Progress

I am currently on page 78 of Frank Luna’s book. There are 376 pages in it. I am averaging about ten pages a day, which means I’ll be done in about a month unless I really pick up the pace. Of course, I don’t want to rush too much or I might miss things, which would be counterproductive.

In other news, last night I dreamt that I’d already lost all my weight and everyone was commenting on how good I looked. Then I woke up. :(

7 comments

Weight Control

I’ve had a weight problem for about ten years now.

Being overweight didn’t used to be a problem. It meant you had eaten more than you needed to survive - thus, you were a successful person. And most people become overweight simply by eating when and what their body tells them to, because our biology has not caught up with our sociology - it is no longer necessary to put weight on as a safeguard against starvation later. In fact, in this day and age, being overweight is like hanging a permanent sign around your neck that reads, “I have no self-discipline”.

Except that I do have self-discipline. I have done things that required serious self-discipline in the past and will do more of such things in the future. Why am I still having trouble with this?

I am six feet, four inches tall. I weigh about three hundred and forty pounds. Because of my height, I am not really rotund, but I still weigh about a hundred pounds more than I should.

About two years ago, I seriously started on a plan to lose weight. I did some research, reading books like The Hacker’s Diet. I then got off caffeine, drank only water, took vitamins every day, and ate a very small number of calories (around 1800). I also worked out at home at least three times a week. My workout consisted of playing Dance Dance Revolution for about fifteen minutes to get my heart rate up, then doing a series of calisthenics. I burned about 250 calories per workout. The very low number of calories was quite difficult to maintain, but I told myself that every time my stomach growled it meant I was losing weight.

Initially, this worked great. The pounds seemed to melt right off, and it appeared that I would reach my goal of 240 far faster than I thought I would. I don’t know exactly how much weight I lost because my scale was not reading right (something I didn’t find out until later) but I probably lost about 35-40 pounds. My legs looked great, and I started having to tighten my belt lest my pants fall off. A female co-worker of mine told me I was looking “splendid”, which was quite encouraging.

But I was overdoing it. For a 340-pound male, 1800 calories is practically nothing. After about three months of this, my body went into starvation mode and I stopped losing weight. This was also when I discovered that my spring scale was not accurate, since it was telling me that I weighed 295 but the new digital scale I bought, which went up to 300, refused to weigh me. So I didn’t even know how much I’d lost.

After about a month of continuing to practically starve myself with no results, I got frustrated. I stopped exercising and started eating “normally” again. And all that weight came right back on.

My story is a very common one. Despite all the research I had done and all the good intentions I had, I had gone about this project exactly wrong. The worst thing you can do to lose weight is temporarily alter how you exercise and eat, because even if they work, once you reach your target weight you will go back to normal…and the weight will come back on.

My weight is a consequence of my eating habits and exercise habits. Thus, if I want to change my weight permanently, I must also change those habits permanently. There is no way I can maintain a healthy weight drinking as much soda as I do, so I must stop drinking soda - permanently. There is no way I can maintain a healthy weight exercising as little as I do, so I must start exercising - permanently. And there is no way I can maintain a healthy weight eating as much mayonnaise as I do, so I must stop eating mayonnaise - permanently. I must break myself of my bad habits and replace them with good ones, and I must continually reinforce the good habits lest my decades of bad habitting reassert themselves.

So I’m going to start again, within the next week or two. I’m going to do a little preparation and then I’m going to start back down the road to good health…more gently, this time. It will take longer and be more difficult, but the result will be permanent success.

4 comments

Confidence

I recently listened to Steve Pavlina’s podcast on building confidence. It crystallized a couple of things for me.

(Warning: PSRD breach ahead.)

I’ve stated in the past that I’m not very big on God, because I have an engineering mindset and that makes it difficult to believe in things that I have no evidence for. I’ve been asked, “But such belief tends to make the lives of the believers better! Isn’t that sufficient to justify religion, even if it’s not true?” Now, a purely agnostic, atheistic response to that would be, “No! Believing a lie is never justified! Live as we do, undeceived!”

Except that believing in something that you have no evidence for is the essence of self-confidence. Self-confidence is actually self-faith. You believe despite having no evidence, and your belief gives you a much greater chance of actualizing what you believe in.

Thus, the atheistic/agnostic mantra of “It’s always better to live undeceived” is revealed as a lie - there is direct evidence to the contrary.

Does this mean that I believe in God again? No, not really. But even after I fell away from religion, I never developed an antipathy for religion like some atheists do. And now I know I never will. Religion is actually a useful tool for self-improvement…I just don’t feel it works for me personally.

6 comments

Inaria Postmortem

Around the end of October 2005, I decided to try to write a complete computer role-playing game in forty hours. I was inspired by this article by Jay Barnson on GameDev.net, Jeff Vogel’s excellent work, and by my own love of RPGs. I am a professional game developer, but I’d never written an RPG engine and considered that a “hole” in my experience.

I picked a time limit because I’ve also been fascinated by people being forced to do the best they can with their skills under such limits; this was one reason why I wrote my Iron Gamedev article (the other reason was that I was feeling really goofy that day). And of course competions like the Ludum Dare also inspired me.

The project is now complete. You can download the game here, and the source files for both the game and the editor here. Here’s a screenshot:

Mmmm...pixels.

Now, the point of this project was to learn, not necessarily to make a complete and fun game. That said, I did want to make the game as good as it could be in the time I had. Here’s an excerpt from my original design doc with my goals:

We need four things to be able to call the project a success.

We need to create the map structure and populate it with an initial terrain layout.
We need to allow the player to walk around the map and be blocked by passability data.
We need to create monsters and have them move toward the player and attack him when they get in range.
We need to allow the player to attack back, and to have the player somehow gain in abilities when he succeeds in killing monsters.

That’s it. If we get that, we can publish it without fear of too much ridicule.

But that’s not enough. What I want is:

A map structure where every map cell is a list of critters placed on that cell. When the cell is drawn, all objects in that cell are drawn, from bottom to top. Since the terrain object will be pushed on the map on load, it will always be drawn first, on the bottom.

A map structure that contains data for map links.

An inventory and a current equipment screen.

If we get all this implemented, I will consider the experiment a resounding success.

Finally, what I’d really like is:

An overworld, three towns, two castles, and eight dungeon maps.

An overall plot, no matter how thin.

Quests and quest objects.

If we get all this implemented, I’ll be damn suprised.

Well, I didn’t get quite everything on my list done, but I’m still very surprised at how much I accomplished. I got the map structure I wanted, an inventory, buying and selling, NPCs with different AI behaviors, levelling up, one town, two castles and eight dungeons. And a very, very thin plot, but not quests or quest items.

I kept rigorous track of my time, but since I have a full-time job and a family, I wasn’t able to spend my hours over the course of a weekend or even a week or two. It took me about three months to finish the project, and I actually feel I did well completing it in that time. I am actually alloting myself four months to complete my next forty-hour project.

I would break down my time spent as follows: about five hours was spent fiddling with graphics, about thirty hours was spent writing code, and about five hours was spent creating the NPC data files and game levels.

What Went Right

Kicking it Old-School

Emulating an old Ultima-style RPG was the right tack to take. If I’d tried to write a 3D RPG, I simply would have gotten overwhelmed and probably quit. The feature set I wanted fell into the “tough but doable” range and made for a perfect forty-hour challenge.

Using the SDL

I wouldn’t have completed what I did if I had not used the SDL and instead just used DirectDraw. End of story. I cannot imagine why someone would not want to use it for a project like this, it was so easy to use and saved me so much time.

Grabbing Graphics off the Web

All the items, monsters and NPCs in the game came from this page of free RPG tiles. This was a lifesaver - if I’d had to create the graphics myself, not only would they have looked like crap, I would have burned so much time on them that I would not have had any chance of completing my goal. As it was, I could not find any decent terrain tiles that I liked, so I ended up grabbing a lot of the ones I used out of Ultima VI. This cost me at least two hours, unfortunately.

Making an Editor

I spent about five hours making an editor for the engine - you can see a screenshot of it here and it’s included with the source package linked above. I think this may have been my smartest move. I ended up spending far too much time on the code and far too little on the maps (see What Went Wrong, below), but if I hadn’t had the editor I probably wouldn’t have gotten more than one or two maps into the game.

Using my PDA to Sync Projects

I have an Asus A620 PocketPC-based PDA. I love it, and one of the things I use it for is to keep projects synched between work and home. This way I was able to work on my project at work, sync my PDA, take it home, sync it at home, and pick right up where I left off. Now that I’ve got some webspace, though, I’ll probably set up a Subversion server to make it even easier, and give me real source control features like versioning.

Blogging the Process

This was vital. The fact that I knew people were watching kept me going when I got really tired of the project :) I’d like to thank my friends Ryan Clark and Tom Mauer from work who tracked the progress of the project with interest, as well as Andrew Wooldridge and Gianfranco Berardi who linked to me, and to Sol who piped up with helpful suggestions when I mentioned I was using his tutorials.

What Went Wrong

Hoo boy, where to start?

Well, first, here’s a screenshot of the most visually interesting bug I encountered during development:

I'm walking on mouths.

Multiple Mistakes with the Editor

I made two huge mistakes with the editor. First off, I made it too early in the project. I made the editor when I felt I needed map data to work on, but once I had the map I then added lots of features to the map structure…which the editor then didn’t support. I had to add the map level number, map name and map links all by hand. The editor still saved me time, but it could have been even better if I’d just made a temp map by hand to work on, finalized my map data structure, and then made the editor.

My second mistake was a doozy. I split the editor off into its own project, instead of simply creating a new editor source file in the base project. By splitting the editor off, I ensured that all maps would have to be moved from the editor folder to the actual game folder before they could be tested - and then moved back if additional work was needed. Maps quickly got out of date and filenames got confused. I finally fixed this by putting a hardcoded path into the editor source so that it saved and loaded from the game folder, a terribly hacky solution.

Secondly, I ensured that all the changes to the source files I made while writing the editor had to be merged back over to the game project, and then changes made there had to be merged back into the editor…it was just bad. Still much better than no editor at all, but these mistakes caused me to eat up time that could have been spent making the maps better. Which leads me to…

Too Much Time on Infrastructure, Not Enough on Content

Now…this is a thing that went wrong, but in the end, this was a learning exercise, not an attempt to make a publishable game. I wanted the game to be as good as it could be, but in the end the quality of the game is not that important.

That said, the game could have been twice as good with just one or two more hours spent on the content - and I’d have had those hours if I’d both planned better and not made those boneheaded mistakes with the editor. There are features in the engine that the player will never see…because I didn’t have time to write content that uses them. Yay!

Schizophrenic Source Code

I almost didn’t want to post the source…in just about every case, I started doing things the “right” OOP-ish way, and then reverted to procedural programming when time got tight.

For instance, there is an NPC class. Great! Do I subclass from that for all my NPC types so that I can program in individual unique NPC actions? Nope, I simply use that one class and have the Update() function determine the NPC’s type and perform actions based on a classically bad switch/case statement. The input code is atrocious; I’m doing tons of stuff there that have nothing to do with input. I felt like crying when I put the code to draw the hit marker and projectile marker inside the input function with their own frame pumps…but it was either do that or cut them completely. I guess I can console myself with at least knowing that it was bad.

Conclusion

Despite all of that, I do consider the project a success. I learned a lot and created a fair amount of code that can and will be reused for other projects. And I’m planning on doing three more of these forty-hour learning exercises over the course of the next year.

5 comments

Success

Around the beginning of 2004, I started thinking about how to seriously improve myself. I wasn’t down-and-out or anything. Our financial situation was…adequate, and the job I was at was stable. But there were several aspects of my life that I didn’t feel were measuring up, and I wasn’t happy about them. I was fortunate at around that time to run across several articles on the internet that pointed me in a helpful direction.

Since then, I’ve read several self-help and success books and listened to many recordings. I’ve read The Power of Positive Thinking by Norman Vincent Peale, Success for Dummies by Zig Ziglar, and I’ve listened to The Strangest Secret by Earl Nightingale.

They basically all say the same thing.

First, in order to succeed, you must define success for yourself. This smacks of secular humanism, but it’s true: we all define success differently, and our definitions of success are direct reflections of who we are as people. Success is your goal - and your goal must be concrete and measurable. It must be a specific event. Unmeasurable goals are not goals at all and cannot be attained. Most people never specifically set goals for themselves, and then wonder why they feel directionless.

Once you have defined success for yourself, you then create a plan for achieving that success. The plan must consist of several steps or milestones, each of which is a smaller, measurable goal that, when completed, add up to the completion of your overall goal.

Then, having picked a goal and defined a plan, you must make progress along your plan every day.

That’s it.

Well, goshwow, you might be thinking, if it’s that simple, why doesn’t everyone do it?

Two reasons.

One, we’re not taught to do it. While I had very good parents, at no point did they ever sit me down and say, “Anthony, here’s how to ensure you get the most out of your life.” Most parents feel that if they simply ensure their children recieve a good education, they’ve done their job. It’s hard to blame them; they probably weren’t explicitly taught about how to succeed themselves.

Two, because, if you’ll forgive the hokey Matrix reference, it’s far harder to walk the path than it is to know the path. Succeeding takes self-discipline, which most of us don’t have (and again, aren’t taught). I recently watched an episode of Penn & Teller’s excellent show Bullsh*t!, which talked about Alcoholics Anonymous. One thing mentioned during the episode is that just about all professional self-help systems report about a 5% success rate (success being measured by a person staying on the system for a year straight). This matches up with Earl Nightingale’s findings; he found that only 5% of people are financially self-sufficient or better at retirement age. Thus, if you are capable of self-discipline, you have automatically put yourself into the top 5% of people, and it’s difficult for someone with self-discipline to fail.

But what about motivation? How do you keep going when it gets difficult?

This is where things get kind of fuzzy, because just about every major self-help author is a Christian, and he simply says, “Have faith in God! He’ll help you!”

(Yes, I’m violating PSRD a bit here today. You’ll live.)

I’m not big on God. Most people with an engineering mindset find it difficult to believe in something that there’s no physical evidence for. So what do I do? When things are tough, who do I lean on?

Well, the answer has to be me, doesn’t it? And it’s not as silly an answer as you might think; there are many people who aren’t religious and yet have the depths of self-discipline necessary to succeed despite adversity and difficulty.

Now, despite not being particularly religious, I have to express an admiration for Christianity at this point. Christianity is based around two powerful ideas: have faith and treat others as you would like to be treated. (Both of these are commandments from Jesus himself, see Mark 9:23 and Matthew 22:39). This is why Christianity was able to shuck the majority of its tribal, barbaric roots (see the book of Leviticus in the Old Testament for many instructive examples). It moved forward and became something very positive in the lives of its followers.

But if there is a practical difference between a person who succeeded because they believed, “God is helping me” and the person who succeeded because they believed, “I believe in myself”, I don’t know what it is. Hardcore atheists will doubtless say, “Well, the first person believed a lie, and the second believed the truth” but recall that I was asking for a practical difference. In both cases, the person succeeded.

It will be necessary for you to train yourself to stop negative, “I can’t”-style thoughts in their tracks and replace them with positive thoughts. If you’ve thought your plan out and it’s a good one, and you are making daily progress along it, then there really isn’t any reason for you to feel bad about yourself. You have proven that you are in the top 5%, and about the only way for you to fail to eventually reach your goal is for you to abandon your plan. And why would you do that?

Believe and succeed.

No comments

[Keanu]Whoa.[/Keanu]

Okay, back in March I wrote an entry here called The Power of the Force, which detailed how my life changed when I finally started moving resolutely towards my goals.

Well, a few days ago Steve Pavlina (who I mentioned in said entry) asked for people to submit stories about how what he had written had helped people. He was going to judge the stories and award the winner with a CD of Earl Nightingale’s The Strangest Secret. So I posted a link to my story.

And I won. And now there’s an entry on Steve’s blog mentioning me and my story.

Whoa.

1 comment

My Latest Project

Okay, purely for my own edification, I intend to write an RPG in 40 hours.

I was, of course, inspired by this blog post, and also by the fact that I really, really wanted to participate in the most recent Ludum Dare challenge, but couldn’t. So I’m sort of doing it on my own. Now you know why I was researching Roguelikes; 40 hours is too short to do just about anything graphical. Text mode will allow me to get the most out of my time.

Here’s the rules:

1. This will be a project created in Visual Studio .NET, using C++. It will be a console application, and it should run on both Win2K and Win9x.

2. The timer starts when I first create the project (which I haven’t yet).

3. Since I am a father of three and employed full-time, I can’t do something stupid like work on this for 40 hours straight. Instead, I will work on it whenever I have time, rigorously keeping track of my time. When the 40 hours is up, I will post whatever I’ve got, even if it’s not playable (though I will do my best to make sure that it is).

4. Time designing, coding and creating content counts against my 40 hours; time thinking about the project and writing blog entries about its progress do not. Thus, I can do some “mental preproduction” work on it as long as I don’t code anything or write any design down.

5. Failsafe. I have 40 hours to do this project, and I can spread them as thin as I want, but if the project is not done within 30 days (that is, it is not done by midnight, June 18th, 2005) the rest of my time is forfeited and I must post what I have.

Currently my thinking is that I will break the project up into two 20-hour chunks - one for coding the engine and one for creating content that runs on the engine. This should (note the word “should”) ensure that I ship something a bit more robust than just a hack & slash engine. My fears are that I will either overestimate the difficulty of the project and set my sights too low, resulting in a completed game so simplictic that no one wants to play it, or that I will conversely bite off far more than I can chew, resulting in no functioning game at all.

Oooh, this is going to be fun. I think.

No comments

Next Page »