• Advertisement
Sign in to follow this  
  • entries
    3
  • comments
    0
  • views
    1424

About this blog

The trials and tribulations of building a game in a one-man effort.

Entries in this blog

Fixing major bugs.

Today was an excellent day.

You see, I've had this bug in my code which caused several errors while trying to build a database for the game. Basically, it was related to linked lists, and me not paying careful attention to what the heck I was doing. Well, today I finally squashed that bug. And, as a bonus, killing that bug also killed three related bugs.

The original bug was: when I loaded the database, the first entry would not load, but it would register in memory. Every other item in the list would successfully load.

Upon closer inspection I noticed some other bugs: when the database was saved, it would fill up with another few KB of garbage data (usually 2-3KB). I also noticed that once I loaded a database, when I edited it in-game, it would overwrite the entire database with that one entry. Finally, I noticed that in the database itself, some repeating garbage values were present in "unused" memory. How odd.

Well, after looking over my own code for a couple of hours to help better understand it, I eventually found a way to squash out the bug. It's now 10:35 pm EST. As of 35 minutes ago, the bug was successfully killed, and it put me in one hell of a great mood.

Fixing this bug is really a milestone because it now means I can actually add CONTENT to the game. Yes, there is a hell of a lot more to do (such as AI, battle sequence, and physics); however, it really feels like I've accomplished something I've never attained before, and it's a damn good feeling to know that most of the programing ahead of me isn't so much "problem solving" as it is "feature implimentation." Well, that, and it took me a shitload of time to fix this bug. I can now say that, save for any input errors (such as strings > 256), the actual saving/loading/editing of the databse is fully functional.

Hey, good things come in three, don't they? Let's see ...

1) My sister finally went away to college today, which means I can actually watch television again. As a side note, I also attend college (gunning for my BS in Computer Science), but do so locally. When sis is home, I hardly get much mindless entertainment in (or get to watch the Yankees).

2) I killed this major pain in the ass bug.

3) ?

Hopefully #3 will be "Jason gets a large wad of cash." ;)

Programming ...

I really have not done much programming today. What I did do, though, made me realize that the direction I had originally intended to take was an unecessarily difficult path.

You see, I've finished programing the item editor. It's really not much, just 85 lines of C code. Overall, it came out to about 200 lines of code that I needed to alter or fix. While I was programing the editor, I came upon the realization that integration with LUA was not going to be easy for the items, skills, NPCs and events. That's because everything I'm using is basically a number. Many of them were unsigned longs, which would become increasingly difficult to maintain.

So, I've narrowed down what is, and isn't a number; for example, things like "value" and "weight" are generic numbers; but, things like item type - which could easily be a regular integer in straight C code - needed to be changed to a string. While this may slow things down - on 486 processors - my real concern is being able to use LUA without having to code another library to translate those rediculous numbers into something a human would interstand.

Basically, they've gone from being described as 3265 to being described as a "weapon." A simple == operator in LUA, and not only does LUA understand what's going on, but the human behind the code knows, too. Which saves me a whole heck of a lot of time.

It also gives me another advantage: easy expansion. In the old system, the types of items/skills/etc ... were just #define's. That works all well and good in CircleMUD, because all of the code is contained in one executable. But, doing something like that with a scripting engine would be deadly, because if I wanted to add a new type, I would have to recompile. So, now, I just create a new type, and in the item script, I just do a simple check for that type.

It's actually kind of astonishing what very little code can expose to you.

So what I got accomplished today:

The item editor is fully functional.
I've expanded my engine to be much more robust.
And, a side note: I hacked together a quick array to unsigned long function (atoul). It works, and that's all I care about right now. ;)
I've (officially) been a member of GDNet since November 2000, and I'll bet not a single person here knows me. My original intent, when I joined GDNet, was to learn DirectX well enough to produce my own game. It has morphed over to to using game development to enchance my programming skills; however, that little desire - the desire to be a god-like entity - has remained with me over these few years. So, I've now shifted focus - yet again - to creating a real game.

That game - The Never World - is in the pre-alpha stages. Because I'm a college student, progress is painfully slow, but it has been chugging along for the past few months.

Right now, after a few months worth of work, I have:

A 2D tile engine
A map editor
A customized input/output buffer
LUA script integration
Basic player movements
So many linked lists that I want to hurl

What I've learned is that the programing aspect of this game is not the real challenge. No, the real challenge is getting around to actually coding something. After a good 12 hours coding my own input/output buffer system (with buffered keyboard text) I was ready to break my monitor. Sadly, the monitor died before I had a chance to take out my Louisville slugger.

I've also learned I get a really neat surge of, uhm, pride whatever I complete a task (such as the map editor, or getting LUA to work right). It's not as good as sex, but hey, I'm a single dork, so I'm not getting any action, anyhow ;)

If you're interested, you can grab a pre-alpha copy of what I'm doing at Here

I'm LordKaT, and yes, I'm a guy. I've always thought the "lord" made that part abundandtly clear.
Sign in to follow this  
  • Advertisement