My games net module is almost complete under unix, and in theory should be able to handle both IPv4 and IPv6 communication fine; not that I have much to test the latter with. Windows support will need a bit more tweaking, and then it’ll be possible to plug it into my Raven Shield admin quiet easily.

Pardoning interruptions, I’ve spent about 6 hours of my day working in straight C, followed by about 15-20 minutes for a little rest. For some sickening reason, my weekends almost always fall into the category of working all day, eating dinner, then working until dawn lol.

Doing things in C, I find more time consuming then more dynamic languages, chiefly because of how much testing I (try to) do, coupled with how much lower-level stuff one has to keep in mind. Having to deal with memory management issues, is not a problem for me, although I do admit that garbage collected languages can be very enjoyable. To be honest, I find the portability problems of doing anything interesting, to be a greater drawback then managing memory; e.g. by design Python is not very portable in comparison to C, but it more then portable enough for anything you’re likely to bump into on a PC, and can do ‘more’ with less bother, for an acceptable level of portability. They are very different languages at heart, and their designs reflect it strongly. A lot of people (including myself) call Cs portability a myth, and it is in the sense of what most people want (especially me), I doubt is possible without a more modern rendition of the language (NOT Java or C++). Where C truly excels at portability, well I reckon you’ll just have to study more assembly language to understand the value of it.

Now if only I had something better to do, then spend all my time behind a computer screen, monkeying around with GCC on one side, and MSVC on the other 8=).

A REAL HOME

A REAL HOME is a playground. Beware of the house where no
rough-housing is allowed and no cries of glee are heard.

A REAL HOME is a workshop. Pity the child who is unfamiliar with
wrenches and hammers, knitting needles, thread, screwdrivers and saws.

A REAL HOME is a forum. Honest, open discussion of life’s great
problems belongs originally and primarily in the family circle.

A REAL HOME is a secret society. Loyalty to one’s family should mean
keeping silent on things that are the family’s business and no one else’s.

A REAL HOME is cooperative. Households flourish in peace when the
interest of each is the interest of all.

A REAL HOME is a school. Many of life’s most important and lasting
lessons are learned here, both early in life and later on.

A REAL HOME is a temple, where people are loved and respected
and where life is appreciated, in the recognition that life in all its parts is
a gift of God, with our family being our personal and most precious gift.

Is your home, A REAL HOME?

Author Unknown

I wish I could answer that question without hurting anyone, myself included.

Almost a Quaketorious Victory :'(

It was a nice double that quickly turned into a massive battle, going up from last to match leader in the first couple minutes… couldn’t be racking up frags any faster if I had a nuke: I actually had greater then 2:1 K2D ratio. It’s like no matter what the other players did, BAM I was right on’em, often being involved in  3 to 8 way melees.

Ended up neck in neck with another match leader at the end, and cinched it at like the last blink of an eye by scoring like 6 frags in near perfect succession, winning the game!

Loaded up the next map and was having like the best freaking roll of my life, bodies dropping left and right. There’s something uniquely satisfying about using my SAS skills to counter the other match leaders “Mad skillz”, with great effect no less. Again neck in neck for the lead and looking like the end of this match is gonna flop in the bag in a sec…. when I got called off to clean up someone elses disgusting mess. Worse then that, because of QLs scoring system, not only does that mean I was forced to forfeit everything earned during that pwntacular frag fest, it negatively impacts my reputation for the quit.

And so, family induced as only it could ever be, ends one of the best game nights of my miserable little life. There must be some bastard in the universe, who can take a perverse pleasure in that. Odds are we’re related.

In being dragged across the grocery store yet again! I spent some time contemplating what I was thinking about last night, as I was finishing up part of my games net code. Wouldn’t it be practical, to just implement a simple Virtual File System? It would make adapting the code base to different uses easier, since pathes and I/O could then be defined through a set of VFS_routines, but on the downside, making it pluggable would push greater overhead on all those I/O routines at every use.

The zpkg, system input/output, and network modules present very similar interfaces. Main differences being that zpkg doesn’t have write support (an unneeded non-trivial feature), and seeking between positions in a socket, just doesn’t make the same sense as with local files. If a virtual file system layer was built on top of it, it would be rather easy to define a “Plugin” data structure providing the necessary function pointers as needed, and simply use a hash table to handle the mappings between paths. Of course that leads to the bugger of a look up operation o/.

Really, most of the places where it matters wouldn’t impact game play, since most I/O can be divided between startup phase, loading stuff, client/server communication, and shutdown phase; the chatter between client and server obviously being implemented directly on top of the networking module, and therefore a moot point. It would make it possible for the resource loading code to become more flexible at run time; i.e. being able to load game assets both out of zpkg files and local system files without a recompile or a  restrictive version of the VFS.

I think it would be worth while, as an added plus, it would even allow splitting the path argument to Zpkg_Open, and pulling out the interesting bits into the VFS adapter function, which would be replacing that feature of the zpkg module.

For today however, my primary goal is to port the networking code (almost) completed last night, from the BSD Sockets API over to the Windows Sockets API. That way I can replace the less appropriate network code in my RvS admin program with it, and save having to complicate its design to make the most of Qts networking API. All while improving my games code base ^_^.

Although WinSock was based on the old Berkeley interface, Winsock has arguably grown more over the last decade, then the Unix interface has over the last 20 years. Not that there was much need beyond adding IPv6 capability, which the common Unix interface already grew ages ago. I personally dislike both the Berkeley and Windows interfaces immensely, why? Because in my humble opinion, the proper way would have been something like:

int s;

if (s = open("/net/tcp/host:port", O_CREAT | O_RDRW | O_EXLOCK)) == -1) {
perror("Unable to open a connection to host:port");
}

/* do usual stuff here, like read() or write() */



where /net would be an arbitrary mount point for a special file system, in which file system operations reflect their corresponding network operations. Flags for system calls like open() and fcntl() could have been suitably extended to cope, and others like accept() implemented as needed. In the light of things like FUSE, it would be even more interesting to do it that way today, then it would have been in the 1980s.

Instead of that simple form, whenever we want to create a socket: we have to setup suitable socket-specific data structures, which and how many depending on the operations to be conducted; common practice is to zero over the most important (sockaddr_in / sockaddr_in6) structures before using them, and leave it to the compilers optimizer whether it actually happens at run time; look up in the system manuals what pre processor definitions correspond to type of network connection we want (let’s say TCP over IP) for the socket() call; initialise the field structures, using the same pre pre processor flags, and even converting details like the port # into suitable formats, all by ourselves. After which we might finally get around to doing the socket I/O ourselves, pardoning any intervening system calls needed for your particular task.

/*
 * Assumes open flags in previous theoretical example corresponded to a connect
 * operation, rather then a bind() and listen() operation. Like wise for the
* sake of terseness, I'm "Skipping" support for real.host.names rather then IPs.
 */

int s;
struct sockaddr_in addr;

memset(&addr, 0, sizeof(struct sockaddr_in));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
if (inet_pton(AF_INET, "xxx.xxx.xxx.xxx", &addr.sin_addr) != 1) {
/* handle AF_INET, address parsing, or unknown errors here.
* error is indicated by return value.
*/
return;
}

if ((s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
perror("Unable to create socket");
goto CLEANUP;
}
/* use system calls and a data structures as needed to setup things as desired */

if (connect(s, (const struct sockaddr *)&addr,
   sizeof(struct sockaddr_in)) == -1)
{
perror("Unable to connect socket");
goto CLEANUP;
}

/* do I/O here: send/recev, or read/write */

CLEANUP:
shutdown(s, SHUT_RDWR);
close(s);

I reckon the Berkeley interface was the right choice, for portability between systems (including non-unix ones; making it easy to write stuff like WinSock), and probably easier to graft onto the 4.3BSD kernel, but it’s damn inconvenient for a UNIX programmer. That ain’t changed after about 25-30 years.

Oh wells, at least it works pretty darn near every where, give or take a few kinks.

Now playing: one of my favourite songs

I don’t want another heartbreak
I don’t need another turn to cry, no
I don’t want to learn the hard way
Baby, hello, oh no, goodbye
But you got me like a rocket
Shooting straight across the sky

It’ s the way you love me
It’s a feeling like this
It’s centripetal motion
It’s perpetual bliss
It’s that pivotal moment
It’s, ah, impossible
This kiss, this kiss, unstoppable
This kiss, this kiss

Cinderella said to Snow White
“How does love get so off course, oh
All I wanted was a white knight
With a good heart, soft touch, fast horse
Ride me off into the sunset
Baby I’m forever yours”

It’s the way you love me
It’s a feeling like this
It’s centripetal motion
It’s perpetual bliss
It’s that pivotal moment
It’s, ah unthinkable
This kiss, this kiss, unsinkable
This kiss, this kiss

You can kiss me in the moonlight
On the rooftop under the sky, oh
You can kiss me with the windows open
While the rain comes pouring inside, oh
Kiss me in sweet slow motion
Let’s let everything slide
You got me floating, you got me flying

It’s the way you love me
It’s a feeling like this
It’s centripetal motion
It’s perpetual bliss
It’s that pivotal moment
It’s, ah, subliminal
This kiss, this kiss, it’s criminal
This kiss, this kiss

It’s the way you love me, baby
It’s the way you love me, darlin’, yeah

It’s the way you love me
It’s a feeling like this
It’s centripetal motion
It’s perpetual bliss
It’s that pivotal moment
It’s, ah subliminal
This kiss, this kiss, it’s criminal
This kiss, this kiss

It’s the way you love me baby
It’s the way you love me darlin’, yeah

This Kiss—Faith Hill

Yes, in some ways I’m a bit hopeless at heart lol.

One of the things that has been resting on my mind, is working on my game projects and raven shield admin system. I do believe, that I’ve figured out a way that I can augment my engines capabilities without breaking down portability to much, and still retaining the “C” language factor ;). I’ve also decided that my RvS admin tool, will likely benefit if I complete my games net code, and integrate it in place of the existing networking code it uses.

I’ve three game projects, generic titles being StarFighterGame, TacFPSGame, and MechCombatGame; each chosen for their obvious descriptiveness in place of an iron clad title. StarFighterGame, has been awarded the title of “Stargellas Revenge ©”, and the others are still to be decided. Story wise, Stargellas Revenge is green light, it just needs the game code and assets to catch up with it. I have the general overview for TacFPSGames story and enough design details set, but still can’t figure out a proper title. The ‘mech game, I’m thinking of splitting into two different games: one aimed at a combat simulation, and the other as a Real Time Strategy game, charting the “Bigger picture”.Story wise, things need to develop further, as well as growing a title. On the one side, I’m thinking some what along the lines of an epic war meets small scale tactical warfare, and some hordes of enemies to mow down for the action cravers, hehe.

The code backing my game projects, is engineered to be highly portable, and suitable for producing most any kind of game. My primary focuses, more or less follow the styles of arcade and simulation games, but alas, I prefer flexibility over rewriting crap later on, hehe. I could do so much more if I had more to work with :'(.

I haven’t been getting much rest lately, although a fair bit of sleep. My dreams have been weird, ranging from caring for the best friend I’ve ever had, to struggling with more difficult adversaries. It’s kind of strange, because I generally don’t dream about the dead :-/. The only good thing I can say, is despite a few disturbing things, going to bed ’round 0200 local sure beats 0700, lol.

My minds focused on getting stuff done, and trying to rack up some R&R. Which leads to my new official Quake motto is “Fuck’em all, and let John sort’em out”. With the wifi being a bit more upity lately, I’ve mostly been hanging around Raven Shield the past couple weeks; unlike SWAT 4, in RvS if you lag out in the middle of a gun battle, it tends to increase your survival rate, rather then negate it.

Yet I still have a tendency to lag up and fall off into deep space when playing Quake :-(. Although I must admit, even with my wireless freeze frames every two minutes or so, I’m actually getting quite good at handling them, but there’s only so much you can do when it’s in mid air lol. Last night I got plugged off an arena platform, and died with rocket launcher in hand, because I lagged up and missed the chance to rocket myself onto a nearby jump pad for a last minute save.

This song is stuck in my head o/

On the day the wall came down
They threw the locks onto the ground
And with glasses high we raised a cry for freedom had arrived

On the day the wall came down
The Ship of Fools had finally run aground
Promises lit up the night like paper doves in flight

I dreamed you had left my side
No warmth, not even pride remained
And even though you needed me
It was clear that I could not do a thing for you

Now life devalues day by day
As friends and neighbours turn away
And there’s a change that, even with regret, cannot be undone

Now frontiers shift like desert sands
While nations wash their bloodied hands
Of loyalty, of history, in shades of gray

I woke to the sound of drums
The music played, the morning sun streamed in
I turned and I looked at you
And all but the bitter residue slipped away…slipped away

A Great Day for Freedom—Pink Floyd.

Well, I finally reached the point where I couldn’t focus on the code any longer, and just went to sleep hours early lol. Ironically by the time I would’ve likely gone to bed, there was such a huge freaking storm blowing, that I woke up o/. It was so ferocious sounding, that it took me a while to be sure whether or not I was dreaming or waking up, but it woke me up lol. The thunder was so earth shattering loud, I think to get any louder, it would take flying in it.

The downside of going to bed early, is missing a few hours coding, and that I’m awake already :'(

Between projects, duties, and my own odds and ends, I’ve basically have used five or six programming languages this week in order to get stuff done, and have probably read code in a dozen more languages. Sometimes I really wish sticking towards one or two languages across every task would be more practical, but I’m unlikely to see that happen in my life time. I just use whatever gets the job done best.

Ya know, if I could speak human languages as well as I know computer languages, I could order dinner in any civilised country in the world.

Today’s main goals, are to work on finishing my ‘new’ client side admin for Raven Shield, hash out Stargellas networking sub system, and find some time to play a couple rounds. Although of course, if I actually had a worth while choice in the matter, I wouldn’t be spending my day camped in front of a computer, but knowing my family well, it’s unlikely to day is to stick to last weeks schedule. *sigh* at this rate I’m never getting out of this place without a sledge hammer.