The price of pissing me off.

A word of warning, this post contains quite a bit of profanity after the jump break

After being up until well past 0400 last night, setting up a decent SCons build set on FreeBSD, for testing— its usefulness to this project. I started setting up the required config tweaks today on the Windows machine.

When suddenly, I found a odd difference between how the same SCons versions behave on FreeBSD/unix and Windows, in fact, this kind of thing is why I’ve given up on the more popular CMake.

lib = os.path.join('#', outdir)
#
# For some really mother fucking stupid reason, Glob('*.$OBJSUFFIX') works
# on FreeBSD scons 1.2.0_20091224 but not on the Win32 scons 1.2.0_d20091224
# from the installer. So we have to use this fucking method, which will require
# us to wrap it in exceptions in case OBJSUFFIX is None or missing totally on 
# platform X.Y.Z. from fucking hell -- I fucking hate software build tools.
#
src = None
try:
    src = os.path.join('#', outdir, '*'+str(env['OBJSUFFIX']))
except:
    print("Fatal error: I can't make libs from object files without a file "
          + "extension. TERMINATING THIS SCONSCRIPT")
    import sys
    sys.exit(127)

env.StaticLibrary(lib, Glob(src))



# edit: an explanation of why subst() isn’t used in place of the [] look up: once you violate the consistency part, I’m not going to trust that there will be an $OBJSUFFIX to subst() on.

I was going to make most of this code a simple library function for the sake of code reuse, instead of having a virtual copy/paste of the same few SConscript files between all my games source modules—after this, I’ll stick to having one of those comment blocks in each source modules SConscript file as appropriate.

Generally I like SCons, it’s rather similar to what I’ve invisioned as the “Perfect build tool”, even though SCons still requires about 3 x the amount of work for Stargellas build system then tmk should. However, SCons is here today, tmk won’t be for a long time. What annoys me, is that SCons is still just as bad as all the other build tools out there.

For crying out loud people, it is the year twenty first fscking century…. and asking some consistency of our modern build tools, still demands limiting ourselves to the 1970s era make tool from PWB/UNIX.


So busy, food even fell by the way side :-S

I spent yesterday experimenting with DevIL, I rather think that it will be more “To my taste” then using SDL_image for getting easy access to various image files. I only expect to use certain image formats in my games kit, but ahem, if that ever changes, who wants to write per-image-type handling code anew? Hehe. In playing with that, I’ve uncovered a bug in my zipped package handling, and have coded myself into a corner, where in the system would best serve me, by growing a more abstract file handling API—exactly the direction I wanted to go in, hahahaha! TBH, I’ve only ever coded myself into two corners in my life, but this ones a happy case.

Most of the night was used in experimenting with a pair of Integrated Development Environments, CodeLite and Code::Blocks, as possible replacements for existing build.{sh,bat} scripts. There is also a Visual C++ solution and project tree that I whipped up Thursday to replace build.bat, and am still cursing at over its dislike for by build tree o/.  In terms of IDEs, Microsoft has the best, but like visually everything at MS, it’s also as vendor specific as writing machine code in octal 8=).

Really, I can care less about having compiler, editor, debuger, … all integrated—other wise I’d use GNU emacs, screen, toolchain, and their dialect of C, and spit on everyone else’s graves >_>. The thing that interests me is having a suitable build system, one that can handle multiple compilers/configurations and multiple OSes readly, because `tmk` is a project on my back burner, and won’t be completed anything in the short term. Code::Blocks like modern MSVC/VC++, the file format is XML driven and quite easy to modify in a standard text editor.

Installing various libraries on Windows has shown me – most developers don’t know how to create a build system. At least, most open source developers can’t seem to combine computer science 1.0.1 with Visual Studio projects.

Installing various programs on Unix systems, has shown me – many developers don’t understand autotools or it’s just to complex a build system (I vote for both).

Me, I say fuck y’all. Do it right or don’t let it leave your workplace.

And so passes another black day

I’m rather glad to be heading back to work, and happy to see the 12th go. January is generally regarded as an off month in my family… January 12th, 1989 is the day my father died, as well as my parents wedding anniversary—what a peachy combination!

While I try to respect my families history, it’s also a matter I try not to dwell on for very long. *sighs*.

Being stuck with walking around the supermarket (baah, humbug!), I tried to devote my trains of thought to Stargella. For me, it is kind of a difficult project; much more complex then most of the things I’ve worked on.

In thinking about how to structure the rendering code, I started to think more on the issue of dealing with the data sets to be rendered, which basically means sprites (2d), models (3d), and rendering the level (2d/3d), and I want as much of the code to be shared between several game projects, which makes baking the lasagna a bit involved. Since my current focus is on the 2D oriented, Stargella, I find it wiser to concentrate on sprites then three dimensional models. At first I was thinking, it would be ideal to represent animations for sprites, as a simple image stack; but I don’t want to go through all that for unanimated sprites, which would still require a singular stack frame. The fix to that is simple, only use stacks for holding the animation details! Then I was thinking, gee, wouldn’t it be cool, if we could attach some type of script or shader program to be run, so a level of progmmability could be used in implementing special effects. For example, using program to stake out the centre of a starship, split it into segments and have them drift away from one another, while interleaving it with an explosion-like image or particle effect. Simple enough to do from C I’m sure, but I would much rather have it be apart of the game data, then the game code. I’m not sure if that would be doable from mating with GLSL files, or if it would mean binding a script with the sprite. Either way, as far as general game scripting goes, it should have some level of access to the graphic stuff as a matter of completeness.

For now, I think I’ll concentrate on resource handling. It should be easy enough, just create dynamic arrays as needed (e.g. of loaded textures), and each time a new texture is loaded, assign it an unique identifier that indexes into the array; …

Honestly, I don’t have a problem with programming in C, other then it can be time consuming at times o/. But, because I have to learn OpenGL along the way, it is, shall we say a freaking lot of docs to parse.

While I’m more familiar with Direct3D then OpenGL, even if you can still get a good bang for you buck out of a DirectX SDK without having to stoop to C++, I’m not willing to write a DirectX backend for my game. Obviously, I want to avoid using glThis and glThat all over the game code, but ahem, the issue of shaders enter the picture. Short of making a definitive choice at compile time, that would have to live for the projects entitiy, the only way to support runtime choice, would also require writing both HLSL (DirectX) and GLSL (OpenGL) code, and that’s a headache I won’t put up with!  As much as I favour the idea of nVidia’s Cg, it is not available on enough platforms, and implementing it where needed, to much trouble.

If people other then me want to play the game, they can buy a graphics card made in the 21st century and install its drivers >_>.

—- this post has been interrupted so many damn rat fucking times by family, that it is unfinished and will likely always remain so. This is one of many reasons why I fucking hate my life.

Bye bye work week!

Finally finished with a nutty schedule, this week is a bit more free, although I’m still working on the weekends. Things have been erratic lately, I’m not sure if that’s a good thing or a bad thing. Honestly, I like it when things are shaken up a bit, although routine does help with planning events around working hours!

My dreams have been a rather nasty torrent lately, mixing interesting possibilities with programming, and more moribund territory. On the first, I’ll skip journaling, to the second, it’s mostly revolving around C and OpenGL, I’m even dreaming of coding these days o/, and as to the third, somethings are too grisly to be worth recollection.

I’ve managed to get everything done today, and still find about an hour or so to take a much needed ‘break’, haven’t had one of those in a coon’s age. For now, I’ll probably take in a quick game of Quake or some Raven Shield. Later tonight, I need to mull over some more of the OpenGL issues and such. Oy, scratch that, dinners on the roll. It seems, one thing that never does end, is my ability to think 8=).

All in all, I’m looking foreward to Monday—I’m off work :-D.

*sigh*

There’s nothing todo, other then pass time and work across open projects :-/. Normally I would be working today, but the snow and ice has pushed into into Saturday, which is probably good fortunate since I’m scheduled for working most of the weekend anyway o/.

I’ve all but been going stir crazy for the last couple of days, although on the productive side, I’ve had some time to study OpenGL in greater depth. Ahh, joy. Can’t even blog in peace…  hours go by through interruptions.

QOTD and a personal favorite

After stress-testing my last post on a fellow [SAS] member, he asked me if I always thought like a program, or did I used to think like a human. To which I immediately thought of a remark for first Corinthians, and adapted it to suit.

“When I was a human I spoke as a human, I understood as a human, I thought as a human; but when I became a program I put away humanish thing.”

I really don’t like to quote myself, even if it’s a rip off of something St. Paul is credited with, but I really liked that target of opportunity, lol. It was just tooo good to miss!

How he does it – Trees!

Yesterday, I was explaining to a less experienced player how I so easily knew where the hostages he missed where located, after the young Element Leader exclaimed that he was always missing hostages rather then suspects 8=). For those that don’t play with me a lot, I am that annoying-guy in the element, who can usually tell the Element Leader what rooms were cleared, which were missed, and so on. In fact, during one live op, I ended up guiding a younger EL around the huge map.

The way I accomplish this feat of meticulous memory, is to keep track of it in my brains equivalent of a data tree. By remembering where I am in the mental tree (I have an excellent sense of direction), I know what the neighbouring nodes are in the tree—and if I forget what is after those, by the time I reach the spot-after, I can compare what I see with a ‘snap shot’ stored in my head, to trigger my brain into remembering where we’ve been before. If we’ve never been there, then obviously, I append it, or if it is an unexplored door, mark it as such mentally.

 I’ve been thinking of putting up a diagram of it for some time now, so here goes, lol.

This is a diagram of a fairly simple building, it contains a starting room (1), a large room (2) with a hostage and two terrorists: three doors connecting to two other rooms (3 and 4), containing terrorists and a hostage. Those rooms (3 and 4) connect to a final room (7) by way of hallways (5 and 6, respectively), and contains a hostage.

It is a very simple diagram, so I doubt anyone will have problems understanding that, because if you do, there is a problem with your map reading skills ^_^.

The way I navigate in side a building like that depicted in the above diagram, is storing each element as a “Leaf” or node in a tree, itself being a tree in my minds eye. Each node is a reference in my brain, telling me what door( node)s connect it to other rooms, and what was found in it (in this case, hostages and terrorists). Those in turn, point to other nodes or leaves of the tree, creating an organised pattern, shown below:

Here you can see the nodes are again labelled, matching to their “Room number” from above. I don’t mentally record room numbers, rather room names, but for sake of examples, I find numbers simpler to explain.

The first node (1) references a single child node (2), which as you can see, contains two terrorists and hostage, and references three door( node)s leading to the adjoining rooms—exactly as in the floor plan I drew earlier. To make it more obvious, I wrote X->Y on the nodes representing the doors, denoting where they lead to. The door( node) 2->4 takes you into room 4, from room 2. Just like in the floor plan, room four contains a terrorist and a door to a hallway (6), The two door nodes, 2->3, lead into room 3 from 2, where room 3 contains two terrorists and a hostage, again exactly in the floor plan diagrammed previously. The hallway( node)s (5 and 6) connect rooms 3 and 4 to room 7 (respectively), and room 7 contains a hostage.

This is actually a simplification of how my mind works, a since my mind notes doors, hostages, terrorists, downed team mates, objectives, important events, etc, as the children of a tree leaf, and the doors reference the next leaves. That however, is only of importance to another programmer :-o.

Since my head keeps a running track of where I am, and I know easily if I started in room 1, walked into the next room (2), and took the single door into another room, that I must be in room 4, and the door ahead leads to the hallway (6) connecting with room 7. The data tree (i.e. second diagram), is mental abstraction, showing (very roughly) how my mind views the relationships between elements of a map (e.g. the first diagram). So in essence, navigating inside a building, is a simple matter of scanning the tree in memory, and vola, I know exactly how to get to X from Y, lol.

This is how I navigate in doors, and it works damn well, certainly works better then asking a terrorist for directions! Because my working conditions place me inside buildings quite a lot, it has been necessary for my senses of navigation and deductive reasoning to adapt accordingly. I almost never get lost, just don’t ask where you left the swiffer duster. Even navigating outside, my roads-view isn’t street sign or land mark based, but closer to watching a overhead view on a HUD map from some video game…. I blame it on so many years behind a controller.

Lacking the knowledge of how the human mind operates, I’ve always found it easier to explain things in relation to a how a computer does its stuff…. because honestly, my mind functions eerily similar to a computer as it is… but hey, I am a computer geek!

The last couple of days have only been marginally productive :-(. The infrastructure for Stargellas console is virtually complete, except for the prerequisite renderer code. Soon it’s time to move on with the usual loop, progressing to [SAS] related projects, then cycling to EPI, and back again to my usual loops.

My dreams have been someone erratic lately, but so far, have remained quite consistently the opposite of whatever I’m thinking about when I drift off to sleep. I’m not sure if that’s a good thing or not. It seems no matter what, it’s virtually impossible to sleep without thinking, short of working myself to exhaustion. While maintaining a deep holmesian focus seems to be great for pushing everything out of mind, keeping that up for more then a few weeks is staggering :-/.

One good thing to come of today in particular, was scoring a 95% on the driver’s practice exams on the relevant state website. I can’t help but wonder, if some of the multiple-choice answers were intended for evaluating brain damage, but hey, maybe I’ll pass it. I’ve also found out that out here at least, being in my current age group, I could forgo the learners permit and skip straight to an exam for a full driver’s license, but rather would prefer the proper chance for learners-time. Although, I still expect family to fsck me in the end o/.

A fairly full work week is starting off tomorrow (the one luxury of being off Mondays, is work begins Tuesday). If it wasn’t passing 02:22 local time, I think I would grab a snack and read the a few standards cos, but alas, time to hit the hay, eh, pillow.