You Have Been ID’d

I know why, long long ago, people created 4GL languages. Well, maybe not every reason. But this one MUST have been at the forefront.

To take care of File Structures. At least, that’s what I imagine the guys did with Clarion.

Tonight I implemented Unique ID fields across all my classes. It was an enlightening experience. I enjoyed it somewhat, but then … I only have a handful of classes, and this is my first time. I can imagine if you had a couple of hundred classes, many of the child classes, but needing their own Unique ID’s as well, it would quickly become a rather onorous task to write the functions to take care of the UID’s.

To achieve my goals, I wrote it out straight. That is, looped through the objects, assigned the local var xID, and then incremented said xID var. Easy. Simple. As said, there’s only a handful of classes .. well, really, it’s only a handful of objects to go through. There aren’t many objects within the game world.

That reminds me.

Last night I realised one important facet I’d forgotten about the basic design. The World class. A class that tracks every object that is within it. At the moment, my Game Object is that, but this, for any real project, is very impracticle.

But for the sake of my initial goals, I’m pressing on.

The First Game Project :: Journal #001

What follows is the journaling of my experiences developing the latest Dev Dawn Project.

Spent most of the last few days restructuring the classes. There was almost zero structure anyway, just hotch-potch code. Now there is a definate heirarchy within the classes, although still a long way to go.

However, what I take heart in is that I don’t have to design the greatest piece of software. There are specific goals for this project, and what I have to do is attain those, and then see what happens.

  • Initial Structure

    To begin with, on paper for me, I worked through the basis of the game.

    Firstly, I had to break out of imagining writing a game as if I were playing it. Very important. I have to break down to the foundation of the game mechanics, the design.

    What makes up a game? Well, there are menus, loading screens, introductions, credits, other modules … and the game itself.

    So the game, as a player thinks of it, cannot be the basis of the game code, so to speak.

    What then, was the structure. I’d already passed it.

    Like a house, you lay the foundation. So, my first class, from which everything else comes from, is the Foundation class.

    From here I control whether the user/player is in the menu, the game, watching credits … etc etc. The loading of games is here to, I think. Haven’t got there yet.

    • That’s another thing. My initial desire with this project was to show how Clarion can be used as a database for a game. Moreso, I wanted to amalgamate my experiences with Clarion with my love for gaming. Because as a project, there’s nothing more I have wanted to do than make a game.
    • And more every day, it becomes clear. Games are just more numbers being pushed around. You know what I’m saying. And their usually not hard numbers either (on the face). Look at Tetris, Pong, and the others from your early memories.

    So anyway. I have now a Foundation.

  • Moving On

    Each time I grasp some mechanic/truth about the code/c++/gameplay, I then tend to pull the wool over my eyes once more, stumbling around in the darkness. So in this project, I’m trying very hard to listen to that little voice that says, "Maybe that should be a child-class, an object of it’s own", or, "Maybe you should make that private, and then call a function to manipulate it".

    It’s hard not taking the lazy root. But that’s what this project is all about. Investigatory Journalism. Ha ha. I mean, it’s about learning and getting better.

    So I move on to what lies within the Foundation.

    This is what I’ve got so far.

    • The Game
    • Various Game Objects, the Player Character, the NPCs, …
    • The Menus
    • Functions to load the engine, start the game, end the game, …

    There are probably more, but I’m running low and need sleep.

There is a lot more I want to journal about this project. It’s pretty exciting. I added a right-click piece of functionality the other day, and it was awesome. I almost, almost, got sucked into pursuing that, and other little pieces of functionality, but my sensei’s words of wisdom beaten into my head (well, not beaten so much) ring true. Get the base right before the other fluff.

It’s a rule that stays true no matter how much you do. Because the little things, the fluff, is most of the time so much more attractive. Adding a right-click functionality doubles the user’s input (from the mouse). But for the purposes of getting the structure and intial goals realised, it was nothing. Especially because the functionality didn’t actually do anything important.

Anyway, babbling. Bedtime.

Mixing My Meta-Tools

My next project, which is going full-steam tonight, is mixing together c++ and clarion. In the last week I’ve returned to some game code I wrote over a year ago, before getting my current job. I searched for a simple library to begin, and then dabbled a tiny bit.

Now I’m back, and it’s a blast. My understanding of what software development is has increased maybe 13.5-fold … and it’s got me very excited.

Anyway, the game itself is basic … the important test for this project is what lies behind the game. The data. The C++ application is going to call procs/funcns from a clarion dll, where the database is declared, specifically designed for the game.

There will be a host of things that come out of this, and most of them I don’t know about yet.

But anyway, tally-ho, wotnot, I’m off to code.