Thursday, December 31, 2009

Much of the last few days has been spent in toying with data structures, and testing a few dozen hash functions for use with a simple hash table module. It's actually the first time I've ever had to implement a hash table myself, lol. It's a fairly simple creation built on top of chaining.

The perfect hungry mans analogy for those that know squat about data structures: let's say you want to find a recipe for peanut butter cookies in a cook book. You could thumb through every couple pages of the book, looking for cookie recipes, or even flip over to the index in back, and depending on the quality of the index, hunt down by looking down the index and systematically checking all cookie references; linked lists and arrays more or less work similar. A hash table is more like a table of contents: you flip open the book, go to the ToC, and find the section with the cookie recipes, then flip to that page and start flipin' every few pages until you find the one you want.

Hash tables work essentially the same way, you feed in the key (peanut butter cookies, yum), hash it down to an index to where you can find the target. Although hash functions that don't collide (often enough to care) are possible, when you have to bind the generated index within a given size, the odds of several different keys sharing the same index skyrockets. So instead of a direct 1 to 1 mapping, you have a needle to which haystack mapping.

My implementation uses a dynamic array of bucket lists that are allocated with HashTableCreate(), each element is a list: every key is hashed then squashed down to the size. When a new key:value is inserted, it gets added to the bucket list. On look up, the key is hashed back to the same value in order to find the correct list, in which to hunt down the correct entry.


One reason I chose separate chaining, other then it fits with how my brain works; many schemes for open addressing (the alternative), feels more like something I would think up, in order to skip writing a hash table >_>. Although, I must admit the possibilities of  open addressing combined with quadratic probing are interesting; I'm more in favour of the chains. While I doubt my implementation is memory efficient—since the only two design goals were to be faster then a (pure) linear search and quick to hash out the code, it undoubtedly has it's flaws. For the sake of testing how it effects the intended usage, I may try augment/replace the current behavior of prepending new entries to the lists with moving last requested keys to the head, or switch to using red-black trees in place of a linked list.


I spent several hours testing different hash functions, using a small input set of words and a larger system dictionary file for testing. HashTableCreate() allows one to specify which hash function should be used, and it's possible to override with a user supplied one. In testing, I've found using hash functions created by people with a background in mathematics, works significantly better then my own, as duly expected lol. Other then dealing with hash function issues, the rest was a cake walk.

Monday, December 28, 2009

Building SpiderMonkey 1.8.0 rc1 on Windows XP with Visual C++ 2008 / 9.0

Finding this note in SpiderMonkies documentation was a huge NO NO for me, because a dependency on Autoconf 2.13 is *worse* then a dependency on Autotools in general.

As I said I would, I investigated Windows/MSVC builds with SpiderMonkey before completing and utterly refusing to ever use the thing ^_^. This is a summery of my findings.

A lot of people are still using Visual C++ 7.1/2003.NET or 8.0/2005 versions, while I however use the Express Edition of Visual C++ 9.0/2008 for Windows builds, which generally means no pre-compiled libs binaries are available. That's ok, since I prefer to evaluate the buildability of a dependency before I commit to using it.... hehe. One perk of doing most of my coding under FreeBSD, no need to buy a Professional Edition of Visual Studio :-D. I think this post should apply to most versions of Microsoft's compiler, +/- differences in compiler flags.


The proper build requires MinGW, MSys, GNU Make, and a suitable copy of Visual C++.


MSys is required because of UNIX tools, such as uname, sed, and countless others are used by the build system; which also seems to depend on GNU Make.

Open the Visual Studio command prompt, or call  %VS90COMNTOOLS%\vsvars32.bat from your current cmd session (VS90 = 2008 fyi; adapt as needed for older/newer versions). Then execute a MSys RXVT terminal from that. You do that by running the msys.bat script in the MSys root with the -rxvt argument, example:


+> C:\DevFiles\MSYS\1.0\msys.bat -rxvt



which will close the cmd session and open RXVT.

Change over to the js/src directory of where you extracted SpideryMonkey to, and run make on the projects makefile:


bash $ pushd /C/DevFiles/Libraries/SpiderMonkey/1.8.0rc1/js/src/
bash $ make BUILD_OPT=1 -f Makefile.ref



The BUILD_OPT causes an optimised release build to be made, default seems to be debug builds; read the Makefiles and Wiki for details on that.


Now for an example app to test, to see if more then js.exe works!


bash $ cat > test.c

#include "jsapi.h"

/* The class of the global object. */
static JSClass global_class = {
    "global", JSCLASS_GLOBAL_FLAGS,
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
    JSCLASS_NO_OPTIONAL_MEMBERS
};

/* The error reporter callback. */
void reportError(JSContext *cx, const char *message, JSErrorReport *report)
{
    fprintf(stderr, "%s:%u:%s\n",
            report->filename ? report->filename : "",
            (unsigned int) report->lineno,
            message);
}

int main(int argc, const char *argv[])
{
    /* JS variables. */
    JSRuntime *rt;
    JSContext *cx;
    JSObject  *global;

    /* Create a JS runtime. */
    rt = JS_NewRuntime(8L * 1024L * 1024L);
    if (rt == NULL)
        return 1;

    /* Create a context. */
    cx = JS_NewContext(rt, 8192);
    if (cx == NULL)
        return 1;
    JS_SetOptions(cx, JSOPTION_VAROBJFIX);
    JS_SetVersion(cx, JSVERSION_LATEST);
    JS_SetErrorReporter(cx, reportError);

    /* Create the global object. */
    global = JS_NewObject(cx, &global_class, NULL, NULL);
    if (global == NULL)
        return 1;

    /* Populate the global object with the standard globals,
       like Object and Array. */
    if (!JS_InitStandardClasses(cx, global))
        return 1;


    /* Your application code here. This may include JSAPI calls
       to create your own custom JS objects and run scripts. */

    /* Cleanup. */
    JS_DestroyContext(cx);
    JS_DestroyRuntime(rt);
    JS_ShutDown();
    return 0;
}
bash $ $ cl -nologo -DXP_WIN  -I.. -MD -Fetest test.c js32.lib bash $ ./test.exe



footnote: that test.c is just the minimal app example from the user guide, here. Also note that using /dos style switches with cl under bash/rxvt, doesn't seem to work (it's converted to file names).



I'll need to do some further testing but everything appears to be working fine.

Sunday, December 27, 2009

Of geeks and logs

Took it 'easy' yesterday, played some games and the only work that got done, was fairly light debugging / library installing / feature adding. Originally I planned to setup expat, libxml2, and libxslt under MinGW/MSVC, but called it a night after expat. Found an interesting thread on Daemon Forums, which shows either I really need to get a life, or a good nights sleep.

Grabbed a trio of cookies, put on the simpsons, and went to bed early, around 0100R; the easier solution :-o.

Had a fair bit of trouble getting to sleep as always, but being winded helps. By a quarter to 0700R, I had already woken up three times :-/. It was a half past noon when I finally got out of bed, not being disturbed makes for an interesting opportunity to sleep like a log and enjoy crazy dreams lol.


For my p resent activities, I've merely worke don importing my Live Journal entries from February 2009, into Blogger. I don't think I'll make my goal of having it all done before 2010 arrives, but alas, it will get done eventually!

Friday, December 25, 2009

Local time is reading 01:40R, so it seems that I've survived another Christmas on this rock. Much of the day, has really been spent trying to avoid the holiday altogether, for all practical intents and purposes. At least I got plenty of C code written for my games :-/.

The only real good thing out of the day, was a the ecard a friend sent—my one smile of the day.

Thursday, December 24, 2009

Yipee-Kai-Yay Terminus font now avail. on Windows !

As some no, after spending a night of debugging only to learn that I had typed structobj,member instead of structojb.member, after a 6-8 hour coding run, I went in search of a new font. The font I found, was Terminus, and ever since I have _absolutely fucking loved it_ in fact, I can't even look at my terminal in another font without missing it.


When filing a bug report to the libmng folks, I left a comment in the bug entry about using a font where O != 0; then went in search of my dear terminus, and then found this and just had to install them :-D.


Terminus is my favourite font, but my only compliant has been needing X to actually enjoy it.... now that's solved!

Here's my notes from installing JPEG-7 on Windows

Take note: I install libraries into C:\DevFiles\Libraries\What\; with compiler specific files dumped under sub folders, e.g. C:\DevFiles\Libraries\zlib\msvc\zdll.lib and C:\DevFiles\Libraries\zlib\mingw\libzdll.a. Like wise, I leave a README.TXT file in the root, noting anything I will need to remember when it comes to using the library.


# build for Visual C++ 2008 / 9.0
> unzip "path\to\jpegsr7.zip"
# I want it in jpeg\src for safe keeping
> mkdir jpeg
> move jpeg-7 jpeg\src
# use the corresponding .vcX files for version
> copy makeasln.vc9 apps.sln
> copy makejsln.vc9 jpeg.sln
> copy makewvcp.vc9 wrjpgcom.vcproj
> copy maketvcp.vc9 jpegtran.vcproj
> copy makervcp.vc9 rdjpgcom.vcproj
> copy makedvcp.vc9 djpeg.vcproj
> copy makecvcp.vc9 cjpeg.vcproj
> copy makejvcp.vc9 jpeg.vcproj
> copy jconfig.vc jconfig.h
# I'm using vcbuild, since I read .vcproj files in vim; you may want the IDE
> vcbuild /nologo jpeg.sln "Release|Win32"
 ...
> vcbuild /nologo apps.sln "Release|Win32"
# I put compiler specific files in a suitable folder
> mkdir ..\msvc
> copy Release\jpeg.lib ..\msvc
# jconfig.h is compiler specific, so we dump it in our compiler directory
> copy jconfig.h ..\msvc\
> del jconfig.h


# build for MinGW/MSys
$ pushd /C/DevFiles/Libraries/jpeg/ 
$ pushd src
# works for most packages
$ ./configure  --prefix=/C/DevFiles/Libraries/jpeg/ --exec-prefix=/C/DevFiles/L
ibraries/jpeg/mingw/
$ make
$ make install
# move jconfig out of independent include and into compiler specific dir
$ mv ../include/jconfig.h 


Now copy jerror.h, jinclude.h, jmorecfg.h, jpegint.h, and jpeglib.h into ../include/. Those are the portable headers, that won't very based on compiler (MinGW/MSVC).


and here's my notes file:

MinGW -> static link as normal
MinGW -> Use import library libjpeg.dll.a for dynamic linking with libjpeg-7.dll
MinGW -> Last build JPEG-7 on 2009-12-24

MSVC -> Can only static link agaisnt jpeg.lib; must use /MD
MSVC -> also add msvc/ to include path, for jconfig.h
MSVC -> Last build JPEG-7 on 2009-12-23

In all cases, add include + compiler folders to your include path.
Although my original plan for the day, was to spend it working on Stargella, I've not found time for it, and I've to much of a headache now to worry about it.

I got in some good SWAT action then set to work on dependency compiling and evaluation, getting the freetype and jpeg libraries built. It was excellent to see that the freetype folks know how to use autotools, something a lot of projects fail at; and that jpeg has an gone through insane hoops to make their package easily built, on virtually anything lol. Tomorrow is moving on to other libs that may be useful. Since the handling of model and map information, will likely be done through XML files, I also need to start evaluating XML parsers again; something I have absolutely no love for. Also, because of that, there's no point in taking a few moments to write a simple config file parser, when the application requires an XML parser :-S.


Code wise, the main focus for the day was to be working on implementing a simple drop down console, but I haven't had time to focus on it, due to the time and effort it takes to compile software in a Windows environment. Which is approximately 200% more trouble then a unix environment, or 90% higher if it's a Linux application written by assholes who knew less about what they're doing then the puts who wrote the tools 8=).

I'm interested in seeing what SDL_ttf can do for rendering the textual part of the console, but that requires freetype, lol. Freetype however is a very painless thing to setup under Windows, at least using MinGW and MSVC. Whether or not SDL_ttf will be so hunky dory, remains to be seen.


Also spent some time in evaluating the concept of using JavaScript as an embedded scripting language. Mozillas Spidermonkey seems to be the only engine that fits the bill: written in C. It's also fairly portable and has one hell of a nice (JS)API , with out a doubt it's gotta be a lovely way of embedding a language into your program. The only problem, the build system issues. I will explore it's compilation under Windows but expect it to be a wash out. The comments about autotools alone, virtually make Spidermonkey something you can rule out of any sane programmers toolkit.  I've already learned about Python extension modules, but have never had time to look closely into embedding the interp into an application, but will do that also in time. Another thing to consider, is embedding Lua, a language I've never had an excuse to study, lol.

On the embedding a language thing, my thoughts are focused around in game scripting, more so then implementing the game in it. Although with the JSAPI, it wouldn't be to tricky to do the entire game in JavaScript, as absurd as that might sound to the uninformed. For Stargella, the scripting needs can actually be integrated into the map data, in a fairly simple manor as firing positional events off to the game code. However the underlying code is meant to be (largely) shared across several games, and some (the tactical fps for example) will need much more useful scripting capabilities. Using shared objects written in C would be possible, but then maps would become non-platform independent, and I don't want that. Quakes solution, was inventing their own C based language, and to a lesser extent the Q3VM, but ahem, I'm not quite going to do that :-P.


Some how, the idea of scripting the game system using JavaScript is still an attractive idea.... but do I really want to live with compiling Spidermonkey in order to do it?

Wednesday, December 23, 2009

The principal concept of any build tool, is building stuff. In my opinion, make has the perfect idea for it: just tell it what you want, then tell you want done about it.Then exploit that what you want done, can usually be guessed or written once, hehe.

At it's heart, tmk is still a `make`, and perhaps barrows the most from classic make and from Qts project file sytax. Personally, I feel tmk makes things more simple, I'll not repeat here what I'm loading into the Wiki on Source Forge however.

Tuesday, December 22, 2009

Well, at long last: my own build tool

In dealing yet again with compiling dependencies under Win32, and yet again having to deal with a yucky mixture of GNU Autotools, CMake, and IDE-x project files.... I've come back to thinking about an idea from several months ago, for a project called `yet another build system`; which led me to learning CMake.


The original (yabs) idea, was centred around the concept of XML descriptions of build tools, most namely the Visual C++ and GNU compilers. Which would have been mated with a simple `make` like list of rules, basically on par with the inference rules everyone knows, and loves (or hates).

For tmk however, the horizon has expanded and the XML is dropped lol. tmk is meant to be very much, a more portable make with interesting tuning options. Conceptually, it's the same, but, eh fixed you could say. If you don't understand that, just think back to using Makefiles and having to support 20 different build environments! Yeah, that kind of fixing.


The main point, is abstracting away the shoe honing measures. Make is perfect for the environment it was created for, building software on UNIX. However unix has diversified and fragmented sufficiently, that the average programmer is a useless stick in the mud for writing portable sh, supporting other environments like Windows, generally requires a separate set of Makefiles or carting along the (superior) unix environment with you, which is a terrible way of doing things. Fixing that problem is simple, it's been done.

A novel feature, tmk will aim to complete builds as quickly as possible: by inferring from the rules how to build modules in parallel, which also provides me an excuse to write some code I've been meaning to write for EPI ;). This part is also easy.


The interesting part, will be handling dependencies properly. The real royal fuck-baked irk of most 'later day make' solutions, such as CMake or VCBuild, are that can't handle dependencies worth a shit: and it makes building software off the original work station (windows) or operating system group (unix) a bitch and a half.


That's the personal itch tmk has to fix ;-)

Sunday, December 20, 2009

Having a bit of time free, I've elected to work on my games resource sub system. Overall, the whole game is a lot like Id Tech 3 in architecture, because it's exactly the kind of architecture I want, even if I don't want to put up with the engine that powered Quake III: Arena so excellently.


For the resource loading, what I want is for a configuration file to define what packages should be loaded, kind of like a PATH for zip files. When something needs to be loaded, it'll be be found at a path, like foo.zip:/what/file.ext— telling the sub system to locate foo.zip in the game or user data directory, then return a handle to the /what/file.ext stored inside of it. As opposed to the more Id approach, where file naming, e.g. pak0.pk3, pak1.pk3, ... controls the loading order, I want my game to use a config file to handle that. Because personally, I think having to remember which machine friendly name a resource resides at, is a pain in the arse for making maps and mods >_>.


Because I'm running things very light on dependencies, mostly because compiling stuff on Windows is a bitch (stupid programmers) and many useful items are not easily available on FreeBSD. So things will probably be built on top of zlib, using contrib/minizip as an example of using zlib with the ZIP format.
It has been a some what hectic day, logged off around 0400R last night and couldn't sleep, by the time I finally started to doze off, ma started shouting and jarred me awake again :-(.


Fast forward to like 0815 this morning and she does the same damn thing, I've had about 3 hours sleep, tops. Getting back to sleep is unbearable, improbable, and time passes slowly. Fast forward again, to about 1045R, and I'm thusly awoke again. In fact, by this point, I've had sooo little sleep, that I didn't even realise that I was having a dream, until I was woken up! Went back to bed and finally got up sometime after 1200R, to be used yet again as a cheap slave.... I'm tired of being nothing more then an asset.


The only positive things so far, is I've had time (~1 hour) to play with my file server with only a half dozen interruptions or so. For me, that's a blessing.



No idea what I'm going to do for the rest of the day, I'm not really in a good mood.... and there's nothing much that I can get done right now, that is not going to result in headaches later. I fucking hate my life here.

Thoughts drift to backup technology

As has been on my todo list for a while, is setting up cron jobs for running dump on my file server, as an "Extra" safe guard to the fact, that my data is mirrored across three different computers already, hehe. (I also do periodic backups to a separate cold storage partition, and priority files to CD-R every year or two.)

My main concern there of course being, how to do it without compromising disk space to much, after all we're talking about a lot of crap lol. In writing my test script, I've also experimented with piping dump into lzma for compression, but at least with Vectra's scarce resources, is a bit toooo much for the box to handle the data sets involved. Then I started to think, gee, wouldn't it be cool to just keep a SQLite database that stores logs of changes (cron'd from a script), and then periodically run ZIP on the target, excluding unchanged files since the last backup. Effectively creating a smart form of dump, that functions at a different file system layer (e.g. like tar or cpio).

Then I started to think, well, the best existing solution that I've ever bumped into my travels, is a program called Bacula, but I've never had to to explore it. With a little poking around, it seems that Bacula is very much the kind of system that I would like to have.

Which poses three questions:
  1. How well does it work with OpenBSD?
  2. How well does it handle disk space/compression tasks?
  3. When will I have time to read all the excellent documentation?


So, sadly it will probably be some time after the new year has come and gone, that I'll have time to return to this loop; my RTM updated accordingly. On the upside, if three hard disks in separate locations of the building, and with very controlled data replication patterns, some how fails before then.... the entire building will likely have collapsed, so it would be the least of my worries lol.

Saturday, December 19, 2009

I just had some fun :-D

Was walking to the mail box, and on the way back an older man asked if I was cold—like normal, I'm out in sandals, shorts, and T-shirt and it's freezing cold out.

"Nope"
"Wow, you must be part escamo or something"
"I was born in Flordia, so I love it: beats 90 degrees!"


:-D
Been in/out all morning, but finally woke up around 11:15R, from a dream best described as interesting but alarming :-S. Less then ten minutes passed before the aggravatory pouncing began, and it was less then 15 minutes before I was officially enlisted for slave duty again :-(.

It's like everyones a big bird with radar...



On the upside, I've managed to transfer all the Live Journal entries from January 2009 into Blogger. Really, I hope to have everything transferred before 2010, lol, but we'll just have to wait and see. I've made about 36 posts on Blogger since the beginning, not counting the moved posting. Live Journal says I've made 1537 entries (counting that one), and blogger gives my grand total here as 1,076 posts. So, there is about 498 posts to transfer over, Feb-Oct 2009 and part of Nov. 2009.

After that, the new roost will be ready for a party, muahuhauaha!

Friday, December 18, 2009

Pour me a stiff drink

Managed to get through work, a further reminder that freezing wind and plenty of rain don't mix very nicely, my hands were almost numb by the time I got inside :-/.


Spent most of my day thinking over the changes for Stargellas input system, but for the most part was thinking about the client/server aspects of the engine, resource loading, and the issue of dealing with cheaters. After taking a very detailed line of thinking about methods to prevent cheating: I've decided that it is impossible to crate a PC game that forbids cheating, or it must take the next Albert Einstein to figure out.

Obviously the moment any thing leaves the trusted server, it becomes untrusted information: no data from the client can be trusted what so ever. Most of the more "Industrial" advice about cheat prevention is a totally load of bullshit; more often then not, worse then bullshit. The only way you can stop a cheater, is to close the system down: run your own hosting servers and the clients, in LAN fashion. Then put up the `eyes in the sky` like a casino to make sure no one jacks your hardware. Anything less then that, is basically a lost cause lol. You can raise the ante but you can't mark all the cards. As soon as tools to disassemble the code or view/change the programs memory enter the picture, the battle is lost: so absolutely nothing on the clients computer can be trusted, even the operating system. Of course, one could easily state in the ELUA that any unauthorized software assisted means of interacting with the software is illegal, which rules out everything save butterflies, but there's no enforceable method to deal with that. Even attempting to  abort program if cracker program X is running or installed, is a wasted endevour: you'd be on the wrong side of the arms race. Whether the game itself is open source or closed source makes no real difference, because obfuscation doesn't work outside of movies.

Because it's impossible to prevent cheating outside of your own private arcade (at best), the only viable solution to preventing cheating in an online game, is to give the community the tools to deal with them.

Requiring an authenticated account and having the servers verify this with your own systems before allowing the player to join—and implementing the means for admins to properly ban that account from their servers. Like wise, a global blacklist for any account banned from more then X servers is a good idea, hehe. That being said, of course there is no reliable way to keep the person from coming back: even if they needed another account name, e-mail address, IP address, and computer hardware. It does however, "Level the playing field" by giving the community the means to regulate itself.

The downside of course being, unless your companies game supports a generic peer to peer (unauthenticated) multiplayer mode, the game becomes a paper weight as soon as you shut down the servers. If those login servers and such are not going to remain in steady operation for at least 10-15 years or so, you're cheating the customers. (Especially those that coughed up $50 on day one and a pre order.) Even worse are games like Battlefield 2, where you can't do squat unless you login, because once the server is shutdown, it's unplayable without hacks. At best, you could hope the company puts all the important server addresses in config files instead of the game exe/dll files, as it makes switching to a community provided replacement a bit less complicated for granny.



In the case of my games, well there's none of that. The only anti cheat measures to be taken, are those that raise the `barrier to cheating` to knowing how to cheat. Unless I become the next Mark Shuttleworth or something. But then again, my games are being developed for my own enjoyment: allowing others to play them, will just be a side effect of (some day) finishing the projects.

Thursday, December 17, 2009

It's been an easier day then expected: ma wasn't feeling up to working, so instead I ended up in the super market >_>. On the upside, financial woes aside, I got to spend more time focused on programming :-D.


Lately I've been working on the computer games I want to build, and finally came to a working title for `StarfighterGame` --> Stargella. With a sub title of vengeance or revenge, which is a perfect title for allowing sequals and expansion packs to be made ^_^. The concept is much like the classic arcade games: simple mindless action. I remember Galaxian and Galaga most fondly, as games that I played in front of Pizza hut as a child. The best free "Clone" that I've seen is xgalaga, but it leaves a lot to be desired. What I want, is the kind of game you sit there and play for hours, and suddenly realise you've been sitting in front of a computer for the last 6 weeks with a long beard and a torn house coat lol.


The story is simple, also like the great classics: you've returned home to the beautiful world of Freyja to discover it is being ravaged by the evil Viekasiekian Empire. Realising that you are the last able bodied star fighter pilot on Freyja, you dive into battle: pushing the Viekasiekian forces back off into space for the final showdown against Emperor Zurick.Game play obviously being in the overhead shooter style of Galaxian and Centipede, but unlike the classics, I want the ship to have full range of movement with the mouse cursor, instead of being constrained to say, left and right, ala space invaders.


Calling the planet Freyja, is meant to encourage the concept that the planet is a beautiful paradise. Like wise, the name of the lead baddy is named in hnour of the graveyard scene from Shakepeare's Hamlet—Alas poor Yorick, I knew him well! The intention here, being to thoughts of death and such. After all the Viekasikians are meant to be evil ;). Geeze, try to say that three times fast without twisting your tongue in a loop!



Portability concerns have caused me to have to largely 'drop' python from the mixture, along with all high level solutions for general rendering and game development tasks. FreeBSD is a horrible platform for developing a video game on, IMHO, unless you like the low level stuff. So, I'm using a common denominator of fairly ANSI C / ISO C89 compliant code, with SDL as the principal backends for graphics and input handling.


It's also kind of hilarious, trying to maintain a code base that supports both the GNU C++ and Microsoft Visual C++ compilers, using a *subset* of common C++, is actually painful. However using a fairly common dialect of standard'ish C in GCC/Visual C++ is quite less painful. This is principally because MSVCs concept of C programming is more or less 20 years behind the rest of the world 8=).




and if anyone else dares to fucking interrupt me while writing this post, you're going to be flung out a damn fucking window!

****sigh****

Haven't been updating my journal here lately, been to busy with work.... still 2 or 3 days of labour to deal with to boot.

Router has been giving me grief for at least two days, and previously was a power outage; I'm starting to think that the outage my have damaged the router somehow. If that's the case, I am really fucked—because I can't afford to replace the S.O.B.


Even worse, on top of that, I got up to cycle the router again and my finger hit my laptops power button while a port was upgrading, what a fsckin' night!

Monday, December 14, 2009

One cheerful moment in a dreary day

The world abounds in aphorisms that convey wisdom to the young, although that advice is usually ignored. Many aphorisms are by unknown authors: "A stitch in time saves nine" (although anyone who has repaired a sail knows that one stitch can actually save 9,000). "People who live in glass houses shouldn't throw stones." And many witty people have contributed their own, like this gem from Mae West: "Lead me not into temptation; I can find the way myself."

source


Saturday, December 12, 2009

If only I could ...

My original plans for the night, was to be working on my games and setting up a test suite for the SAS project I've got on the side burner. However, since  being informed  Thursday that my Saturday was being taken *away*, I've been tasked with not staying up all night tonight: fat freaking chance of that. So instead of being up until 7 am working on code, I played a few hours of Quake Live, lol.


I expect that tomorrow is going to be a living hell anyway it's sliced.... have to be used as a navcom so we can get to work, it's likely to be to be on par with the worst job I ever had, and is in effect, a continuation of the second or third most utterly-exhausting-fml job I've ever had.... the kind you feel like you were dead when you get off work, instead of feeling like you're dying. On the upside, I ought to get to see a few dogs that I haven't seen in a while; which reminds me of a pair of sad memories[1][2].


One way or another, tomorrow is likely to be a wash out, of torture and getting nothing done. I'm already wishing it was Sunday...... !


Don't feel like going to sleep, but if I don't start snoring in the next 15 minutes, I'm not likely to be up tomorrow; would rather be having a snack. I know my body, and in all probability, I'm probably going to be awake for 2 or 3 more hours :-( :-( :-(.

Quake + Sleep != good mix

Been playing QL again, won two matches and placed in a third before taking one extra for the effort.It was kind of hilarious in it's own sick sadistic way... I won because of applied tactics. The matches were free for alls, and on maps where shotgun, plasma, lighting, and rocket weapons are the most common upgrades to your starter kit: machinegun and gauntlet (buzz saw).

After so many years in [SAS], it's a triviality for me to be able to calculate the most 'ideal' target to engage first with whatever weapons stock I've got available.... heard of baddies, shove explosives or paint'em blue with plasma. Even use of the virtually useless machine gun can be useful in a pinch: to pepper the loosing half of a brawl or as a hair cutting follow up to a couple crippling rockets or a plasma flourish, which can sometimes be more expedient then scoring another good splash with the rocket launcher before the enemy manages to kill you lol.


Having always prided myself on piloting skills Mech Warrior, coupled with a heavy knowledge of tactical movement from life in [SAS], it's also possible to calculate more ideal movement patterns for giving myself a small edge. Once you get used to the games controls, you either master movement quickly or die a noobs eternal death.


Combine all that with effective area / equipment denial techniques (king of the kill!) at the choke points, makes for scoring huge numbers of frags quickly unless the swarms of enemies manage to frag you fast... the key is not dying.


Good clean manoeuvring - always being aware of enemy positions, power ups, and obstacles, while taking care to evade enemy fire as you set up a lethal volly. On the first match I won, it was surprising no one accused me of using an aim bot or some kind of crystal ball for the efficiency with which I nailed enemies while snatch power ups, like a maniac on steroids >_>.


Simple bits of psychology, instinctive/near mathematically determined engagement patterns,  mental timers, and ever increasing ease of manoeuvring through the game environments multi tasking nature.... and volia, you rack up frags until someone out does you.



In a way, Quake is probably the most addictive action game since the original DooM was released! I've never really cared much for Q3A or UT style gladiatorial games, but a few games of Quake are much better at cleansing stress then playing Raven Shield. Experience as shown me, never play RvS when pissed, or you will have a vein popping out of your head lol.

Friday, December 11, 2009

I've just posted a call for title/story ideas on [SAS], in the hopes of moving foreward with the TacFPSGame project and my toolkit for working on the Starfighter game.


Today I was reading an arcticle off /. and started to think.... gee, wouldn't it be an interesting game idea: it started me to thinkin' and combined with all the Quake Live I've been playing lately, get's me back in the mood to work on game development lol. I really want the FPS to reflect my style of things: it should be fairly realistic in nature, but still a fun action game. Perhaps the original Rainbow Six or SWAT 3 are my strongest inspirations for the tactical elements, while Quake III and Urban Terror remind me of how much fun "Crazy off the wall" can get ;).

When it comes to the general game design and architecture, I know what I want both inside and out. It's just the issue of having time to work on it. My primary loops at the moment, are working on EPI and some stuff for [SAS], but once that's done, I'll have plenty of time, in so far as my available coding time goes that is lol.


I've also elected, to start testing a conversion from C++ to Python. I originally elected C++ because it was the lowest common denominator for getting the best tools, and well, I can care less about having to deal with manual memory management. My reasons for contemplating the switch over, is because Python has largely become my standard utility language for cross platform stuff—and I would like to be able to play my games on my FreeBSD laptop!!! 90% of all heartaches have been due to differences between GNU Compiler Collection and Microsoft Visual C++. The most pissy problems being how they implement templates >_>. Ah, sweet, sweet C++, all your best features are also your biggest liabilities.

Most of what I'm interested in, is doing the game logic and stuff, I'm not willing to spend 6 months to 2 years writing a fourth rate rendering system when there is plenty of good open source code to draw upon. Yet, I'm not interested in being limited by most existing engines, like updated Id Tech 3 (Quake III: Arena), Blender-stuff, or the snazzy Unreal Engine 3 that was recently released. You could say, I don't want an engine, I want a frame work :-/.

I was originally planning to integrate python for AI and level scripting tasks anyway, so big deal... it would become less problem to do it if everythings in Python anyway hehe.

Wednesday, December 9, 2009

Why I ****ing hate my life here

I don't know what it is about coming home from work, that gives me a feeling of doing nothing: probably an intimate knowledge of how many interruptions I'll have if I do work on anything :-S.


A lot of thoughts have been on my mind lately. Hasn't been a very nice couple of days. Much of my time has been spent contemplating large portions of my life, and the future outlook. Really, it is probably a good thing that I can't update my journal from work, other wise I might actually survive to get things off my chest. When I'm at work, I've always managed to have the most focused thoughts: it's just that time of day, but alas, by the time I get home, there's too much to worry about to retain most of them for long, until they're lost to the interrupt storms.

I've been thinking about the dynamics of life here and how to describe it, I managed to think of, what would be equal to several type set pages :-/. Too blasted tired to pour over that again but it would vindicate what I feel. The only concise description that I can think of, is emotional torture; I'm not sure if there is actually a definition of that, but it's what things feel like here, a subtle form of torture. There's no better way I seem to be able to describe it then emotional torture and people who don't care, nor are capable of understanding the things done. Any other way of explaining it, I think would require treading incredibly more painful grounds then that, and I'm already well aware of the differences between my and my families definitions of most concepts 8=). I operate on my own, more "English language and logic driven" definitions of things.

From thinking back through the ages,  I can recall a time where I was actually happy in life: the only worry in the world being that my brother would pop the final cork and our mother would leave us holding the bag. Spanning ~90% of the range of memory I have been searching through, hell, I can even remember a time when my family was borderline on becoming homeless, and being far better off on the inside. Since, I guess the mid '90s, things have been increasingly bad. The price of progressing from being a pawn in their games, to being an appetizing target to punt around the line of fire.


No one has dared lay a finger on me in years, at least a lustrum or more. The only place I fall under assault is where nothing can ever show through but my eyes in the dark. Last time anyone tried getting violent with me, my mother ended up with sore wrists for a few days: because I had locked her hands together until she finally "Chilled out". All I had down was bump into something in the hallway and it sparked firsts flying. I have no problems with disciplinary action when I do wrong, but ahem, just being pissed enough to try pounding at me doesn't cut it ;). Under normal circumstances my reactionary back then (cica 2003-2004), as it would be today if someone started up like that, would be my old triple combo followed up by a point-decommissioner to put them flat out on the deck before they could counter, but I only restrained her from doing harm. I spent enough years of my childhood, hearing my mother going on and on about how her first husband beat her, that I am incapable of ever striking a woman: my mother included. So obviously no intent of harm was in my heart, only a forceful deescalation. Looking back at the past, it is ironic, because the impetus for developing my combative-knowledge was to protect my family in the event of emergency, not to protect myself from them lol. It's been almost that long, if not longer since I've been involved in any brawls, but the muscle memory is always sharper then the muscle.


After that incident in the early-mid 2000s, I think is when my family figured out that I had learned much to much about fighting, to be vulnerable to any blow they could dream of landing without my permission. Since then, at least in my mothers case, she knows how to dig in by other means. It's like being ripped apart without taking a blow.


Perhaps it's probability that my families crazy sign-of-weakness thing, would likely making me a target the likes of a bleeding fish in a shark tank, or that *hammering* just what this shit does to me through anyones head, would be much more painful then dying inside... but all the same: I rarely make an issue of it. I've learned through experience at trying, that it does no good, save to give more ammunition to hit me with again. Life here has allowed me to develop one hell of a poker face, because any sign of cracking would likely be like putting blood in the water, and that means being dug into deeper. Whatever I feel on the inside, you won't see it cross my face unless I put it there, or I'm ready to keel, and it takes a lot of hurting to get me there.


I believe that you can try to build people up or ripe them down, through your words and actions. For the most part, I believe in building people up instead. Because I know all to well how it feels to be ripped down and torn apart by the wolves. The only time I do widdle away at people around me, it's in jest to cause a chuckle, and my friends know it's a joke: other wise I wouldn't say any of the negative remarks I do make. That's how I am, I don't believe in inflicting the same pain upon others arbitrarily. My mother on the other hand, is a master of making me feel miserable.... an absolute master compared to anyone else. Never underestimate how your treatment of another person, can impact them, that's the one thing I've learned from my family.


Over the past couple days, I've looked at a very large portion of my life. The only thing I can say, is that they don't care as long as their agenda is archived... because I don't know if I can emotionally tolerate another explanation. It's impossible to hit me but it's easy to strike me in the heart, that's what they do. Nailing until it hurts inside, and any attempt at making that known, is just going to see things get worse.

The other day a friend asked me if I was ok, I told her I would probably be fine in a couple days; I was at a bit of a loss for words. In the past decade'ish, my family has pushed me hard enough. Three times in my life, I've come close to a nervous break down and bounced back from it. Once contemplated suicide and never will again, period. I've also had several depressive episodes (IMHO anyway) and enough periods of "bleeding out" from this place. These fucks will never kill me.  It even shows in my call sign... like a spider, if you want to crush me, you really have your work cut out for you.


Today I was remembering a song I used to sing to myself silently as a child, whenever my family managed to hurt me where the sun doesn't shine. In thinking about it, it feels more like an slaves song, something no one else in my generation is likely to comprehend (the history majors aside). How much has really changed since then? They still do it, only more often and with greater skill.


All I can say, is my D-Day is coming....

Tuesday, December 8, 2009

Old regexese mastery revisted

For keeping my mind off things, and passing time while more up to date ports compile, I've spent some time working on neo (a replacement for my private updater.sh; itself a replacement for portmaster/portupgrade). When I had last left off, I was trying to integrate code lifted fro NPMs pkg_info wrapper, used for splitting canonical package names into the packages name and version numbers; when I noticed comically that the old kludge didn't quite hold water. Kind of ironic, considering it was one of the most throughly tested snippets of code I have ever written lol. The principal problem was making it deal with names like libsigc++, pcre++, and libxml++—which contain regex meta characters (the +'s) and dealing with (\)escapes breaking the algorithm.

So I just sat down and rewrote it, *properly* this time around, and it works like a blasted charm, in half the amount of code and a fraction of the execution time to boot. The only downside is between development and testing, I've spent several hours on it, and I've got to get up for work early tomorrow :-(. But hey, it's not like I could have gotten a decent nights sleep anyway.... and I would rather have something like this catch my focus, then leave my train of thought to it's usual ends.

neo is basically meant to replace updater.sh, but at the moment, I'm focused on replacing portversion—to make it worth using. Basically, I gave up on portupgrade and portmaster, and wrote a shell script that is more to my taste (updater.sh) some months ago. Using it is a simple thing:


# portversion -o | grep '<' | awk '{ print $1 }' > /tmp/pu && vi /tmp/pu
# /home/Terry/updater.sh /tmp/pu



leaving me to manually select and sort the list before starting the upgrade. Now I could easily insert filters to handle that kind of stuff in a highly flexible way, but if we're gonna do that.... may as well ditch the portversion dependency, and that means ditching /bin/sh :'(. Making the current dilemma, converting the wacko zacko formats of version numbers, into something comparable in order to tell if it's up to date or not. Technically, a straight compare could be done, since it obviously isn't up to date unless it matches the version saved in the INDEX, but that precludes handling common edge cases.

Monday, December 7, 2009

That was a freaky moment... was sitting here writing a post to a mailing list over ggrps when the light/tv started to fade in and out. Did a quick ^A^C in the hopes that I might get the text copied to qlipboards file store, and flushed to disk before the system could fail.... no such look, an hours of typing gone: and I'm not rewriting it.

The strange thing, is it wasn't a normal power outage, but more of a fluctuation. Part of the building went dead but part remained, on extremely low power, and I'm talking like a lamp making like it's been given a 10 watt bulb lol. The best way I can describe it, is that it is as if the available power was tuned down waaaayyy low, and anything not able to compete for enough power started to shut off.


What is this, Republic of Turkey or something?

EPI rolls on

It's been a bit of a busy hectic, if slowly progressing day :-S. Most of my time has been a juggle between being driven crackers, and trying to actually get stuff done. I've made about 9 commits to EPI and created more wiki content, so at least it's been a viable use of time.

Since I'm more familiar with git then any of my colleagues, I've been focusing on the git side of wiki content for now. Source code management / version control technology is pretty simple to use, and although I can't speak for the early days, modern git (1.5+) is down right easy lol. Well, it sure makes me happier then Subversion ever did >_>. Most of my experience with git, has been as sole developer, and should we say, without having to worry about patches, so I'm more intent on having this kind of stuff documented in our wiki then I normally would be about such a matter.


Also did experiments in writing the program documentation in DocBook XML. So far so good, the manual page outputs from docbook-xsl is pretty damn good, and the HTML will do perfectly enough I think, when mated to a little CSS, hehe. I'm not sure what we will be using for writing our documentation  beyond the Wikiverse, but the best options are DocBook, Plain Old Documentation, and GNU TexInfo. Personally I prefer POD but DocBook and TexInfo are more appropriate. I shared the DocBook manual I did this afternoon, along with links to the documentation for the GNU Compiler Collection, to serve as examples of what the two systems look like. If we need any custom XSL files, I can probably whip them up; already have rudimentary stylesheets to convert a book to forum and blog posts ;).


For the most part, I've been rather melancholy mood of late, so being able to focus on EPI has helped me a lot today. I'm usually happier when I'm able to 'geek out' then when I'm assaulted and bored...

Saturday, December 5, 2009

A little $HOME, NPM, and EPI fun

Been cleaning up my home directory a bit, particularly ~/Projects and the dumping ground in ~/2besorted lol. I've managed to find a lot of old notes, even have imported a couple saved items into del.icio.us. While I've mostly dropped all my bookmarks, there are still a few files with old bookmarks in them. I merged them, using the old `cat files | sort | uniq > newfile` method ;). Sometime I've gotta shift through them and see what's worth keeping. Since ma.gnolia's great lossage, I've still have been maintaining the habbit of using Google and my brains limited RAM as a substitute for bookmarking >_>.



I've also taken some time to sort out the change over from Subversion to Git on NPMs source forge page. Last night, I started work in converting my updater.sh to Python... figured to dub it 'neo' and incorporate it as part of NPM. Hey, I've always wanted to remove portupgrade from the picture... lol. The neo script is basically meant to be comparable to portmaster or portupgrade, and whatever century time brings me back to Neo Ports Manager, will likely serve as the backend. However, I must admit, unlike NPM, this part is somewhat of a selfish agenda at heart: it will be able to do more then my updater.sh can without help.


Finally found the time to add a few pages to the wiki being setup with the Encapsulated Package Installer project. The stuff there is still mostly bare, because I've been focused else where's the past couple of days. Mostly the content added was centred around development tasks, going to have to settle down and plan out what changes need to be made. All in all, things have been moving foreward. When it comes to my personal projects, EPI has the lead seat, and the rest are enqueued, in terms of programming.


That being said, of course I have my strokes of working on other things when shorter periods of time are free: the odds and ends, hehe.

Friday, December 4, 2009

This Journal Moved To Blogger

Well, I've still got a years worth of posts to transfer (groan!) but since I've been updating my journal at blogger consistently since the last post here on LJ, and half the people that follow my journal periodically, have probably updated themselves... lol.



This is the official transferring post!



I have moved to http://spidey01.blogspot.com/ and will be updated my journal there, leaving this Live Journal setup to be as a matter of posterity. LJ has a policy of leaving inactive accounts lay, so I expect this page will survive longer then most references to it. All future updates are going to my page on Blogger. If anyone actually tracks me through bookmarks or Atom/RSS feeds, time to update.


Few people if anyone read my blog, so it's not much trouble, beyond updating my forum signatures lol.

Ahh, a good day...

Spent most of the work time, thinking about todays tasks. I really did not expect the new continuation training sessions to go over very well, just an inkling. Almost had a full server, but lost a few due to connectivity issues and ~20 minutes delay in trying to get as many bodies as possible. But hey, if we had started on time, there would only have been two participants to scare off  >_>.

Things went pretty well, tried to keep the live fire exercises fairly easy since it was the first session. Ezbassr and company proved to be more then up to it, much to my relief lol. The purpose of continuation training, is to give you a rough and tumble environment to practice your skills. It's not a piece of cake, you've gotta be sharp, or you'll fall flat on your face. Ah, the joys of [SAS] training :-D. We train harder so we can fight Eazy ;).

Thursday, December 3, 2009

Highway 20 ride

I ride east every other Friday
But if I had it my way
A day would not be wasted on this drive
And I want so bad to hold you
Son, there’s things I haven't told you
Your mom and me couldn't get along

So I drive and I think about my life
And wonder why that I slowly die inside
Every time I turn that truck around
Right at the Georgia line
And I count the days
And the miles back home to you
On that Highway 20 ride

A day might come you'll realize
That if you see through my eyes
There was no other way to work it out
And a part of you might hate me
But son, please don’t mistake me
For a man that didn’t care at all

And I drive and I think about my life
And wonder why that I slowly die inside
Every time I turn that truck around
Right at the Georgia line
And I count the days
And the miles back home to you
On that Highway 20 ride

So when you drive
And the years go flying by
I hope you smile
If I ever cross your mind
It was the pleasure of my life
And I cherished every time
And my whole world
It begins and ends with you
On that Highway 20 ride....
-- Highway 20 Ride, Zac Brown Band

Tuesday, December 1, 2009

Oh how I love git, let me count the ways!

Initially I kept separate repositories for each portion, most notably the EPI core and build system. Since Trac was selected for part of our web stack for getting stuff done, and it can be a tad pissy about multiple repositories, I've opted to create a "Merged" repository from the others. Essentially the Trac will require multiple Trac environments or a singular repository; while my we take the time to decide which to use, I just whip up a solution out of my hat like a good little geek &(^_^)&.


The trees were located in dixie:~/Projects/EPI/repo/ and still are. After backing up the repositories, I created a new 'work' tree to become the home of this merger, threw them together, and did some clean up. First I tried using git filter-branch and git format-patch together with a few other mungies to get the history retained how I wanted it, then I decided to screw it and just make branches reflect the history—even better then what I wanted.


I then used git format-patch to create patch sets, placing them in temporary directories. Rather then change the patch sets to reflect the merge (good task for perl scripting), I decided to rely on git mv for something more full proof then hacking patch files by hashed out automata.

Creating a new 'work' repository, I made an initial commit with a stub file, then created suitable branches for each in my original repos, which is a task easily automated in sh or Perl, for people with lots of branches. A little bit of git checkout and git am, then slurped up the patch sets bringing each repository (and it's associated branches) under one roof.

Creating the new merged 'master' was a simple octopus merge.

$ git checkout master
$ git merge repo1 repo2 ...
$ git mv ...
$ git commit -a


Job done, good night!


Note also, I wanted the trees merged, so conflicts were not even present, hehe.