Monday, March 29, 2010

Lately things have just been insane, practically busy up to my eye balls. There's always loads to get done, whether it's pushed on my stack, or it's something I would rather like to get done. The past week, I would say represents a new level of heavy multi-pronged focus on other matters, but that's a truckload in of itself.

I wish someday, it would actually be possible to get some rest :-/ For some reason the concept of time to rest, brings forth a vision of a pine box... lol

Sunday, March 28, 2010

A glance ...

One paramount factor, is my mind constantly processes and evaluates multiple "Atoms" of data, for lack of a better word. Near simultaneously crunching away at relevant atoms, both processing new ones and refactoring existing ones in light of continued thinking, and supplementary atoms.

I don't know how to explain it, without phrasing it much like a computer copes with multi-processing, or a significantly greater understanding of cognitive science then I possess, and I'm a programmer at heart, not a neurologist. If I knew someone with that kind of knowledge, I would probably ask whether the brains ability to handle things in parallel is built into our physiology, or just a learned 'trick' like multitasking on a uniprocessor system. (Ok, everyone's asleep while my geeky brain drifts off, hehe.)

I refer to titbits of data as an "Atom", because it is the most fitting word. While not to be confused with the meaning of atoms as understood in chemistry or physics, so much that cutting chunks of data into still smaller scalaresque elements would serve little purpose. The word stimuli might be more appropriate but hey, I'm not an English teacher.

Input sources for these so called atoms of data, can be virtually anything; ranging from what's under ones nose, to past experiences, or established references. In thinking, my mind processes enormous amounts of data, proportionate of course, to the amount of data I may gather! Every atom is constantly evaluated, weighted in the context of it's value and studied from a probabilistic perspective.

Over the course of my life, I've learned to be quite adapt at the gathering of information, in any topic or subject that I choose to pursue suitably. More then a few times, I've astounded people by quickly gathering an input set, and coming to a conclusion based on that data, in fairly short order compared to most of my peers. The ability to search for information should never be overrated, and controlling access to information can be crucial to manipulating an enemies reaction, but denying it and permitting its dissemination. That of course being said, I believe strongly in the freedom of information Growing up next to a set of mouldy encyclopaedias and a dusty double volume of Funk & Wagnails dictionary, it wasn't very long after I learned how to read (well), that I would start learning how to gather and process resources of information efficiently. Libraries, technical manuals, even consulting more learned individuals than myself. Perhaps I should also be eternally grateful to Mage, for introducing me to a search engine that doesn't suck! After gaining a measure of internet access around 1996-1997, I had found little use for the web beyond answering the quest for intel on any given topic of interest. That being said, I never came to make positive use of the Internet until closer to 2000.

Once I have information, I process it thoroughly, both in context and at many instances, off the wall as well. As I said previously, everything is weighted (it is also mentally tagged), helping me gauge the importance of any given atom towards arriving at a workable conclusion. Based on what I know, I also apply ample consideration for the likely hood of any meaning that may be possible. In terms of what may be possible, or the so called sample space, is something often run together in my head, and computed there as well, rather then done straight using numbers. Should we say, my mind operates on a level where the most relevant atoms are not necessarily easy to express as a number, yet may be readily thought of as if it were. Earlier this week, I told a friend that between 0 and 1, my grasp of the possibilities for most things I think at, often has the capacity to go beyond what the number of digits an average persons calculator can express to the right of a decimal point. The depth of my thoughts can often be compared to a typical person taking twenty years cracking at it... lol. Ok, so I think a freaking lot.

In building away at what I know, in order to put it to some applicable use, my reasoning is fairly varied, an art form if you will. I combine what may be inferred with what one may wager, and fairly carefully gauge the potential follow ons. Using both what I know and an an increasing understanding of what I don't know, to arrive at the end of the line. One of my favourite jokes, goes something like this:
An astronomer, a physicist and a mathematician are on a train in Scotland. The astronomer looks out of the window, sees a black sheep standing in a field, and remarks, "How odd. Scottish sheep are black." "No, no, no!" says the physicist. "Only some Scottish sheep are black." The mathematician rolls his eyes at his companions' muddled thinking and says, "In Scotland, there is at least one sheep, at least one side of which looks black."
 You must always check your facts ^_^.

Most things I think about in depth, do not require very precise processing (someone I know, might call it a lack of rigour), only a disciplined and orderly analysis of atoms. Experience as a programmer as well as much time spent labouring over questions of "How does sth work", has thought me much of that. Organised thinking is a very valuable asset, to any reasonable individual.

It can never be said enough however, that the sources of atoms most also be evaluated as much as the atoms themselves (fellow coders might call this a form of mental taint checking). Sources are important, check and discriminate them! One can learn much from a study of historiography, if the words primary source and secondary source mean nothing, you should probably repeat part of school... and try not to sleep through it this time :-P (that or have your old history teacher fired). Many people who berate resources such as Wikipedia, often need to learn the value of checking multiple sources, and strongly taint checking the atoms that go through your brain.

When dealing with matters of intelligence6, it is even more important to consider the validity of ones sources, and it's meaning. Perhaps the best examples of this, would involve a game of poker or a peek at a handful of agencies, but hey, go learn it yourself. I am very objective of the information I process, as well as in that which I promulgate. Some of the more shadowy figures who follow my journal every now and then, will no doubt have comprehended that, if they themselves possess any understanding of intelligence analysis.

In the course of my life, I've found digging into solid sources as well as concise overviews of any subject matter, also to be a worth while pair. I have never allowed anyone or anything to influence my opinion, so much as I search for and study the factual data, and what may be proven through it; and despite the marbles that sometimes rattle too and fro, my mind does not settle lightly without good reason.

Earlier I noted that all of this stuff, occurs fairly simultaneously. At any given time, my brain normally follows about 2 1/2 to 3 trains of thought, and regularly the impacts of mental operations upon one atom, will affect dozens of other atoms, not always related ones either for that matter. (I love phrasing things like that :-P.) Being able to follow trains of logic and reason while gathering more data, and to do so concurrently is inherently a valuable skill to learn. Perhaps I owe this one, to having to often (ab)use my computers capabilities at multi-tasking whenever I'm around, and thus my mind had to adapt to take advantage of it.

Practical experience in a matter, as well as taking into account evaluations from others also plays a roll in things. One interesting example, SAS has placed me so many times into planning and leading missions, I often have the perspicacity to tell when something appears sound coming from a younger Element Leader, but is really a load of marlarky. Such usually becomes obvious under scrutiny. Ones experiences however, can not override all other considerations, after all, just because you've never seen a winged horse in the sky, does not rule out the possibility that such a creature could [have] exist[ed] somewhere in the universe.

Poor it all in a mythical brew, and you have an interesting if verbose summery, expressing parallel application of deductive and inductive reasoning, contextual evaluation, systematic thinking, respect for probability, taint checking, experience, and more then a few techniques for analysis that I care not to mention publically. Growing tired, perhaps it might just be more succinct to explain my mental processes as a form of a deep magic that describes my minds fundamental functioning. Some other people still work on the spaghetti theory.

Oh wells :-/

Saturday, March 27, 2010

Angels & Demons

Just got through watching Angels & Demons, basically filmed as a sequel to the The Da Vinci Code, which was actually the second book written. On the positive side, that means if you missed (or skipped) watching the code, you won't have trouble following this film in the least.

It carries that rapid pace, oft' times so difficult to achieve in writing, while creating a very thrilling mystery you just can't help but watch. The ending is also one that (ofc) shakes the Vatican to its core, and as anyone whose ever watched some Star Trek is likely to recall, what happens when matter makes contact with antimatter is explosive stuff ^_^.

The only thing I can complain about, is that the film gives away the ending well in advance... if you are keen enough to be paying close attention in the first place. A bit of knowledge about psychology, as it impacts the kind of stuff we do over in SAS, also helps a sharp mind to combine inductive and deductive thinking, to narrow the possibilities down quite considerably. That being said, if you didn't pay close attention, you might be shocked silly at the finale!

Hey, I'm a geek, my attention span has moments of hyper-focus on minute details all day long. Gotta love programming :-P.

Friday, March 26, 2010

Ugh, it's been a long and unpleasant day! Never the less, I've almost got the MSVC builds sorted to where I want them. Basically why unix builds are shared libraries and windows builds are static libraries, has to do with the respective linkers.

At least on FreeBSD i386, the (GNU) linker doesn't complain about the common and sys modules referencing one another, you could say it has more of a view that the shared lib is a chunk of code and all is fine as long as it all resolves enough in the end. I generally prefer dynamic linking over static, although I have nothing against static libraries internal to a project; when it comes to Windows  however, I'm particularly found of Microsoft's SxS technology.

While the GNU stuff on my laptop is hapy enough to obey, the link tool provided by MSVC however, won't cooperate with that model of behaviour for shared libs (DLLs), only static libraries. Other then the increasingly becoming stuff that belongs together, the common and sys modules were merged into a single 'core' module, and tonight, prepped to better handle compiler specifics as well. Secondary is that, simply put link makes shared libraries a bit more typing then need be. Every other sane OS/Compiler pair I've encountered, has the lovely habit of assuming that you wrote a function in a library, and might want to share it with other programs. Visual C++ on the other hand,  presents several ways of doing it: that all basically amount to telling the linker which things an application may slurp up from it. Basically resorting to writing a ".def" file, or in wrapping up function definitions with a __declspec(export) attributes, and the correct __declspec(export) or __declspec(import) attributes at their declarations.

Microsoft's way of doing things is more flexible, but one might fairly argue that the inverse behavour (e.g. export anything not specially marked) would have been better.

Generally I like MSVC, I think it's better then GCC, if you are willing to put up with the major lack of C99 compliance and lack of stdint.h (I use one written by Paul Hsieh). The main downside is the tools tend to be a bit, eh, stupider then GNU brew, and the best parts of the system are like wise fairly specific to both MSVC and Windows NT. Personally I would enjoy a professional edition of the MS's offerings, because it would net access to their 64-bit C/C++ compiler and much stronger profiling tools, that are simply missing from the express editions.

The sad part, is that Visual Studio is the only software package I have seen Microsoft release in my entire life that, that's worth buying.... lol. Not even their operating systems can say that much, from where I sit.

Tuesday, March 23, 2010

My thoughts on "Debugger Tips: 8 ways breakpoints can save your next software project"

Debugger Tips: 8 ways breakpoints can save your next software project: "Here are eight fairly simple techniques for using breakpoints and other features of your C/C++ debugger that can give you enormous power and visibility into your program.

Email this Article
Add to digg
Add to


An interesting article that's worth the reading, for anyone who is ever going to get stuck running a debugger. Personally, I prefer log files and analyzing the code in my brain, but when it's a task you can't cram up there in grey matter, or you need to cuddle up to the run time—a good debugger is your best friend.

I've learned two things tonight

  • Windows Services are really easy to work with.
  • If you use a big enough shoe horn, you can fill in the missing parts built into most unixes.
  • There has yet to be any Unreal Engine based game made, that doesn't suck. At least, that wasn't developed by Epic.
I say learned two things, because I already knew the third :-P.

Those who don't understand the third point, are likely admitting their incompetence.

Monday, March 22, 2010

Overloaded and still bit shifting

Ugh, I'm freaking tired. Started the day off computing what changes would be needed for setting up nmake based builds of Stargella, and everything has been on a snow ball since then.

I spent a considerable amount of time cursing at the MSDN Library over some very shotty docs, and realising that despite the overall quality of MSVC, the actual build tools behind it, has to amount to the stupidest ones I've ever seen. Although to be fair, the very first C compiler probably was worse, but this isn't the '70s :-P.

The depreciation of Code::Blocks for building things, and switching to appropriate make systems should mate more smoothly to my work flow. It also pisses me off that after all these years, the best tools for the job haven't improved much. Unlike the typical morons^H^H^H^H^H^Hprogrammers I've had to suffer, I also know how to cook up a build set that shouldn't be an almighty pain in the neck, just to use on another computer then my own work station. Applying basics of computer science to software construction, many hours; having to use tools that quadruple your work load, priceless!

As soon as I battle test one last makefile for MS's nmake, all should be ready for committing to the repo. Then I can worry about the next goal, a proper merge of the common and system modules into a central core, shuffling the Windows builds to using DLLs (to match the unix builds), and integrate PCC into the unix build stack. (For ease of compiling dependencies, only MSVC is supported on Windows: MinGW users are on their own).

During the course of the day, I've also done plenty of the server admin loop, and have serviced more interupts today, then my processor sees in a week of abuse.

and all while carrying on several conversations, hahaa!

Saturday, March 20, 2010

Got to enjoy one of my favourite films, Planes, Trains, & Automobiles.  In it's own way, it's an extremely well done film. Critically, what can anyone say, but it's an awfully small world with a lot of ground to cross. Sense of humour required :-P.

Combine the tightest prick this side of Chicago with the worlds most annoying shower curtain salesman, and the inevitable twists of fate, and you've got the holiday trip home from hell. Much of the things that go wrong for Neal Page and Del Griffith, you could only choose to laugh at or cry about, if they ever happened to you, which they finally break down laughing on the "Highway", once things finally go up in flames. It's just something you've gotta sit through and watch to enjoy, while being thankful you're not these two poor schleppen.

For how little it's been on air over the past decade, I've been very happy to see it on often this past year. The movie also illustrate one of the few things, I actually like about English:
Car Rental Agent: [cheerfully] Welcome to Marathon, may I help you?
Neal: Yes. 
Car Rental Agent: How may I help you? 
Neal: You can start by wiping that fucking dumb-ass smile off your rosey, fucking, cheeks! Then you can give me a fucking automobile: a fucking Datsun, a fucking Toyota, a fucking Mustang, a fucking Buick! Four fucking wheels and a seat! 
Car Rental Agent: I really don't care for the way you're speaking to me. 
Neal: And I really don't care for the way your company left me in the middle of fucking nowhere with fucking keys to a fucking car that isn't fucking there. And I really didn't care to fucking walk down a fucking highway and across a fucking runway to get back here to have you smile in my fucking face. I want a fucking car RIGHT FUCKING NOW!
Car Rental Agent: May I see your rental agreement? 
Neal: I threw it away. 
Car Rental Agent: Oh boy. 
Neal: Oh boy, what? 
Car Rental Agent: You're fucked!

You can stream together arbitrary amounts of profanity, until you finally calm down lol.

Gimped from the start, but still an [SAS] man

From Game Scores Volume I

Annoyingly gimped in the first 15 seconds of the game, yet somehow managing to limp through one of the largest RvS missions, and doing it faster then I've seen some 4 man elements do it too, lol. Over the years, I've actually seen people take over 20 minutes to do that map, even when in a 'hustle'.

I was supposed to be training Bajorq a bit on RvS, but ubi interfered, so I guess I got all the practice time :-S.
Well here I sit, working out my plans for the weekend. After sorting a few things on the spot, and spending some time on what I'll just call a spurt of stuff to hammer out, so I doubt tonight will be highly productive. It's the little bit of rest I get before I have to get cracking away on stuff in the morning.

Besides digging into a few thousand pages worth of book, in the chopping block includes:
  • Compile and test X.Org 7.5 on Dixie.
  • Finish my review of PC-BSD 8.
  • Complete the new auxiliary "Snipers" path on my Private Airport (kai) map.
  • A few SAS related details I won't mention here
  • Get the plots sorted for the next 3 live ops (;)
Also, there's something I have been meaning to do for awhile, refactoring the common and system modules of Stargella. The idea I'm thinking of, is merging them into a singluar "core",  and numerous other related changes. Mostly in relation to compiler support and hooking in the render module. Two points of research, being to depreciate the FreeBSD/GCC builds with Code::Blocks in favour of a recursive GNU Make, and perhaps also NMake for Microsoft's compiler. I would also like to experiment with supporting the Portable C Compiler (pcc), which entails either system modifications to FreeBSDs header files, or some redesign work on the games code.

I have multiple compilers available to me, several versions of GNU, the legendary PCC and Watcom compilers, and the express edition of MS Visual C++ 9.0. The only supported compilers for my project, are GCC and MSVC, under unix and windows based systems respectively. When ever possible things should be usable with most (reasonably) standards compliant C compilers. Not that Microsoft's compiler is one. The main reason I don't do mingw or watcom builds under Windows, is it's just easier to go a strict MSVC route, when it comes to handling the dependencies. If it wasn't for that, I would actually go as far as supporting as many compilers as possible.

One thing that really pisses me off, is even after 40 years or so, stitching together makefiles by hand is still one of the best ways to build stuff \o/

Thoughts of 'home'

Now this old article from Joel Spolsky makes me think of what it's like to be here, *and* trying to get work done. Managing computer work flow is simple, at best, just tell everyone to go to hell or sign off the IM. After so many years of being on the Internet, I can usually juggle multiple tabs without any real loss to getting stuff done. Having to get up and respond to an interrupt, and usually being interrupted twice more on the way back to my console on the other hand, is something that occurs so frequently I've almost a spider sense about it...

If I had a penny for every time I've been shafted that way, for lack of being able to escape to a private bunker, I would have enough cash to pay off the national debt!

Experience shows me one fact: I am most productive when I'm camped in front of a laptop, all is quiet in the world, NO interrupts, no morons to wait on hand and foot, nada, not even a music stream. Oh, that and realising the clocks changed from PM to AM, and I'm still coding smoothly xD.

Friday, March 19, 2010

I've nether yet fallen off the earth, or finally laid down and died; I've just been busier then a Japanese beaver doing over time.
After catching the opening segment three or four times, I've finally gotten to watch a classic western. It has about as much to do with historical fact, as my big toe has with rocket propulsion, but never the less it's a good portrayal.

In a cavern, in a canyon,
Excavating for a mine
Dwelt a miner forty niner,
And his daughter Clementine.

Oh my darling, Oh my darling,
Oh my darling, Clementine,
You are lost and gone forever,
Dreadful sorry, Clementine.

Light she was and like a fairy,
And her shoes were number nine,
Herring boxes, without topses,
Sandals were for Clementine.

Drove she ducklings to the water
Ev'ry morning just at nine,
Stubbed her toe against a splinter,
Fell into the foaming brine.

Ruby lips above the water,
Blowing bubbles, soft and fine,
But, alas, I was no swimmer,
So I lost my Clementine.

In a corner of the churchyard,
Where the myrtle boughs entwine,
Grow the roses and the posies,
Fertilized by Clementine.

Then the miner, forty-niner,
Soon began to peak and pine,
Thought he oughter join his daughter,
Now he's with his Clementine.

In my dreams she still doth haunt me,
Robed in garments soaked in brine;
How in life I used to hug her,
Now she's dead, and I draw the line.

Like wise followed up with Gunfight at the O.K. Corral and Crimson Tide.

Saturday, March 13, 2010

A technical and pseudo psychological peek into Raven Shields AI

In putting the last touches on Private Airport (kai), I've been spending some more time to study how the games Artificial Intelligence works, special thanks to [SAS]_Maj_WIZ for pointing out a more thorough list of developer diagnostics ;). Since this is the closest look I've taken at Rainbows AI in about 5 years, and an even closer study of Terrorist and Hostage behaviour, I think it's only fair to make a journal entry about it.

Here is a summery of my findings, and annotations about theories I've maintained for years:

The laser eyebrow problem
From the standing position, the source of each pawns aim is directly behind the skull, roughly where the head would be if the pawns stood erectly (like a tango). The point of aim, passes directly though eye level. When crouched the point is roughly near to behind the collar bone, and passes through the lower nasal cavity. In prone, it is much the same.

In real life (and any decent shooting game), that aim point should be chained to the weapon in the players hands.

How Tangos Fire Out Their Ass
Experiments with ShowFOV and GunDirection, demonstrate that there is no real connection between pawn animations, where the AI is looking, and where the AI is actually aiming; or as I have been saying for years, What You See Is Not Always What You Get. The most humerus moment in my testing, occurred with the Rear Guard "Facing" the rear but covering the elements front. My research shows that even if Rainbow is aiming at the target, they fail to engage terrorists outside their point of view. I.e. in the case of that rear guard, if a tango had walked up behind the element: it would've taken a moment for his aim point to realign with his field of view, resulting in the death of 2/3 the Rainbow AI element!

In short, this means that the AI walks around much like a Tank with an independent turret, only the artificial intelligence is riding in the drivers seat, not the gunners. Coincidentally, this is why the game has no real concept of muzzle clearance (as I have also been saying for years).

This may explain some of the more rolling on the floor laughing moments that often occur, when a "How close can you go" opportunity crops up in game. To prove a point, I cornered a tango in a corner and had him empty his magazine into me. Side stepping away and deactivating GOD mode, he was able to fire several rounds point blank into my pawn, before his aim point rotated to my new position - I died once the aim point got to me, not when the animations showed him shooting me.

Also it seems that hostages always seem to aim directly at Rainbow, but luckily the terrorist AI doesn't notice that (or they would always see us comming).

So far, these tests satisfactory seem to prove that my ~6 years old hypothesis, about the "Tango firing out of his arse" problem being is indeed codified into Raven Shield by design. Between network latency, the (usual) use of unreliable UDP communication methods for multiplayer game play, and the systems divergent means of rendering and applying these actions (seeing, aiming, firing, hitting), suggest that there is no way to solve the aforementioned (annoying) problem without fundamental changes to the way Raven Shield works. Since that is not viable, one can only look at working around the problem; even with more processing power then a Cray XT5 super computer, you also need a very high throughput network link between clients and server, likely to an extend that is unobtainable over the modern internet.

In laymen's terms, this means no matter how good your computer hardware or internet connection is,  the computer will always be able to cheat you. Should that change, most likely it will be so far in the future, we will be dead by then.

On the upside, I do believe that why the game is like this, was probably done in order to give the player more 'time' to shoot first (yes, some tangos have very slow reaction times: this appears why). It also appears to explain many of the discrepancies between common online play, single player, and LAN parties. However it is also worth noting, that this may have instead occurred due to limitations of the Unreal Engine (2) or Raven Shields own design and implementation.

Interesting Note: Now that an illegal RvS 1.60 SDK is available on the internet, it may be possible for cheaters to develop a method to take advantage of these problems. Imagine walking up on some one in Adversarial because you think they are looking away, then they shoot you out their arse ;). Luckily the engine has some respectable counter messures to such becoming (more) common.

Looking at the AIs skills
One of the very few things, that I have ever been able to praise Rainbow Six 3: Raven Shield for, is that the Rainbow AI often "Appears" to be covering their sectors, even if they totally suck at room clearing. In fact, their room clearing behaviour suggests that either the AI engine is extremely limited, or the game was made by people who know as much about CQB as the average RvS player, that is: absolutely nothing.

Since there is no connection (see above) between where the character on screen is looking (seeing), and where they are aiming (pointing), this means What You See Is Really Not What You Get. Have you ever seen in Single Player, where Rainbow is looking straight at a tango and gets owned without a shot? This is why. It is also why we can do the same to tangos online.

Terrorist movement is closer to What You See Is What You Get, then Rainbows; IMHO the movement for Rainbow was done to 'look' more realistic then it actually is (or the AI programmer sucked even worse then everything thinks). They also seem to have a tendency to remain fixed on hostages with their aimpoint, even while walking around a fair distance away. Ever got first sight on a tango, shot him trice, only to curse at him "Magically" shooting the hostage with barely a twitch? Yeah baby... he had that gun pointed at the hostage, all the while he was looking into your eyes.

Every type of AI in the game, demonstrates very poor skills at getting around the maps. I remember when I first started learning about pathing in Unreal Engines, I couldn't help but think, "We're still living in a dark age"... and that's all I will say on that lol.

Hostage behaviour, well, what can I say... what you see is exactly what you get: a stupid slug. On the upside, the terrorists do not show any signs of being aware to hostages; this is why for example, if a Rainbow goes down while escorting, and the hostage becomes a prisoner again, the terrorist may continue walking past. All the fancy stuff about the tangos shooting the hostage, is a mixture of the games rudimentary AI, and things that map designer has programmed.

Since I don't believe in taking advantage of the map design, or exploiting things I shouldn't know in real life about the missions, I will not make a closer study of that kind of stuff, nor will I tell others much about it. If you want to figure out how to take even that (ugly) edge over the game, you can go learn how RvS works for yourself. Beat it punk.

I just study the mechanics and psychology of the games AI, you know, the whole know your enemy thing. In actual ops with SAS, I tend to employ more knowledge of human psychological behaviour then how the game was designed. That is both by intention

A Random Bullet Test
A tango surrendered and I fired a shot into his head, the round should have impacted his hand (placed on his head). There was a blood puff and a bullet hole in the wall directly behind his head, however the tango survived. Weapon used was an M16A2 at approximately 350-450 unreal units.

This suggests that terrorists have no brains, since the angle means the bullet must have penetrated his skull, and his hand (I pray) being all that slowed the high velocity FMJ round down enough to prevent a kill. Suggesting that any hit box modifiers applied, were for a 'hand' (arm) shot rather then a head shot.

N.B. other tests I have done over the years suggest this kind of problem and the ballistics model used, is why sniper rifles may incur a two-shot requirement on tango kills, and the exaggerated effects of JHP/FMJ selection on SWAT 4.

Anyone still awake and scratching their heads?

All this is based on roughly 6+ years of playing the game, much more then trivial knowledge of such matters, and being a very, highly observant individual.

Oh Brother, Where Art Thou Noggin?

With the questions my brother has been asking me about his computer, and his "Plans" for rebuilding her into a higher end machine, I'm starting to wonder how he even got one built in the first place... what was it, in one ear and out the other? lol.

And I am the moron, who was barred from building his own computer !?

Marc Espie on portability

Marc Espie on portability: "
A short while ago, Marc Espie (espie@) wrote to the ports mailinglist with a short rant about autoconf. His mail gives good insights into the problems porters face when dealing with GNU software, especially those using autoconf."

This actually describes one of the many reasons I despise working a lot of other 'programmers' in this world, many of whom exhibit even greater levels of brain injury then that post takes as examples.

In my not so humble opinion: GNU autotools is either a good idea gone horrible wrong (in practice), or a royal brain fuck that just got out of hand. Users who can use such tools properly, seem to be falling by attrition to younger developers, many of whom (in my experinces anyway) wouldn't know portability if it strung them on the keester like sitting on a scorpion. The GNU build system can an extremely good tool chain to work with, or it can be your worst freaking nightmare; a lot of people just don't seem to care any more. My policy has always been, to support what I use (BSD/Win), and trying to minimise the heartache of getting code built on another platform.

Although the GNU project is perhaps the largest distributor of infectious disease on the Internet, I blame the developer idiocy I see around me, on the youth and not on the software. Most "Old wizards" seem to actually know their tools.....

Mario: Treat your tools like a friend. Keep 'em by you. Never let 'em down, and they're always at your side.
Luigi: Hey, Mario, how is it that for every situation that could possibly come up, you always got a saying about tools? 
Mario: I got 'em from Papa. 
Both: He got 'em from Grandpapa!

Private Airport (kai) going RC

After much abuse and perhaps a weeks kicking, or two thirds of a week in man hours, the first map in my RvS map pack is almost complete. The first one, as one might infer from the title above, is a custom version of the Private Airport. In having to find something reasonable to prefix or suffix the maps with, I chose the simple suffix of '(kai)' for each map, why? Just blame it on an Endless Waltz.

The map has been optimized for Co-Op Mission and Team Adversarial play, but should function as expected in most game types; there is also a tweak for Bomb mode. You would still recognize it as the Private Airport, and I have tried not to destroy the maps excellent flow, merely augment it and revivify the game play. Several areas are in my humble opinion, more realistic, while still reflecting the intended feel of the map. Since there is virtually no one left alive, who is playing Raven Shield off a 32MB or 64MB AGP card, I have also taken the liberty of "Fixing" the portaling a bit, trading the frame rate on your toaster oven, in the hopes of reducing some of the floating guns a wee bit (in so far, as that is actually doable in this fucked up game). I also seem to have fixed one of the most annoying rooms in all of RvS, in that process ;). See, I do know what I have been cussin' at for all these years :-P. My changes shouldn't impact anyone who has a computer that could play RvS without extreme abuse in the first place (Yes, it is time to give up on your 4MB 3dfx card and buy a new computer), and shouldn't effect performance for 96-98% of players.

In architecting the changes for mission mode, the thought that kept running through my mind is "This map is gonna be pure evil", and if you enjoy doing things Ninja style as much as I do, on top of forceful dynamic fare, one will no doubt enjoy playing the coop mission on ROE: RED and saving the day like a sneaky son of a gun, hehehe. Things have been engineered to offer a more tactical experience to both coop and advers. mode, and I think my Private Airport (kai) will be much better suited for Force on Force Training, not to mention bounding drills.

The changes are numerous, tallying over 25 completed tasks on my RTM, and countless dozens of on-the-fly changes that occurred to my twisted mind during editing phase. Being a methodical type about getting my plans carried out, of course corrections and issue tracking was pushed into my RTM list as needed, instant triage.

I will likely make the map available to a select few for closed door testing, once I've finished a bit more private testing on the airport. After that, I would say the map is essentially good to go out the door. There is still an unfinished portion of the map, that is non essential, but to complete it properly, would entail triple the work and completing a subsequently desired feature set. There is also a few other features I would like to add, such as maximizing the sniping opportunities even further, but that can wait until later. The next iteration of the map, will likely contain such changes.

For now, I'm content to move onto the last leg of testing the map, and to get started on my 'next' one, mauhauhauahauhauha!!!!!

Friday, March 12, 2010

Building better memory management for high performance wired/wireless networks: Part 1

Building better memory management for high performance wired/wireless networks: Part 1: "The authors describe a variable pool memory management scheme that has been implemented for LTE and WiMAX protocol stacks and has exhibited excellent performance, especially when compared to traditional fixed-pool implementations.

Email this Article
Add to digg
Add to


Maybe I'm a freako, but I find these this article set to be intensely interesting.

In my travels, I've read plenty of miles of code, including more then a few programs that go as far as memory pools, and even writing a real memory allocator for all practical intents and purposes. This ranges from programs simpler then most (non UNIX) users would think trivial, all the way to more "Complex" systems. In fact, I've even spent time spelunking kernel virtual memory and file system code, which can be a truly interesting set of experiences in their own right.

In working on Stargella, I've wondered whether or not using such techniques would be a viable method of improving the games performance, but for this point in time, everything relies on the C library to work wonders where dynamic memory is needed. While I can see potential savings from adapting a more elaborate memory management schema, it's rare that I'm kicking something around, that really warrants the extra time for creating and debugging code for it, over just rolling with the local libc brew. Of course being the code monkey I am, I always keep an open mind for what the future may bring in the way of change.

Although I will use malloc() quite freely in coding, I also look at it like a reload in a CQB situation: if you're reloading, you're not able to engage more threats, and that (at least for me in SAS) is often the slowest element to an aggressive and dynamic advance. On the other hand though, I generally expect the operating system to provide a decent memory allocator for most tasks, rather then a brain damaged one \o/. Ways to minimize the cost of allocating memory however, is something that I always consider a plus.

Hmmm :-)

Wednesday, March 10, 2010

Redefining pot luck

Tonight Food Network displayed one cracker jack of a mission, in which Robert Irvine of Dinner: Impossible was sent off to the UNC. The objective? Turn whatever he could scavenge out of the dorm rooms into a quality meal for a ~hundred students, in less then six hours!

So here Irvine is with his sous-chef, and they're trying to figure out what the hell can you do with a barrel of cheese balls, dozens of cans of different soups, a megaton of ramen noodles, and so many other odds and ends lined up on tables. Not to mention a deep fryer that went out so many times, he had to threaten the to throw the rent-a-fryer guy in it, lol. In the end they had to raid the sonority houses just to gather enough proteins to make a decent meal. Impressively they shipped about 19 dishes, and no one died of a heart attack in the process. Battle planning went out in like the first 15-min, and they had to result to an on the fly menu plan. It was shocking that they actually came up with something edible, let along that much food lol. In response to someone saying they would make his last minute concoction for the fair, billed as "Robert's Corn Dogs", he quibbled something about how he would never cook like that in a sane situation.  Despite what's probably the most ludicrous episode I've ever seen, somehow they pulled it off with a hair trigger.

What makes Dinner: Impossible such an enjoyable show, is watching the host stew through it... and thanking GOD that you don't have his job, hahaha. If Guy Fieri has the best job on Food Network, Robert Irvine has the most stressful. Me, I would just like to tag along on Triple-D, and gain back my lost 40 lbs in the process xD.

It's just one of those nights....

... where I'm to restless about getting things done, yet to freaking tired to actually get anything of value done. I've already spent most of the day like a humming bird, even while on an RvS break; so it's starting to get ridiculous lol.

For the past few days, I've been pondering ideas and looking at where I would like to be in the next ten years. Of course, getting through this year is a prerequisite 8=). I tend to analyze things systematically, so it's a problem I engage no differently then any other, it is merely a bigger issue to study. At present Operation Redeemer is proceeding at a terribly slow pace, one that's being forced upon me \o/, and likewise data also suggests this will increase the odds of later being shafted before things conclude. Experience has shown me that families either represents the finest support system ever created, or the exact opposite: matter and anti-matter. Sadly with about the same impact on moving forward, only useful with a warp core and containment field. The principal agenda guiding my short term plans (Redeemer), is focused on brushing away the obstacles that make any larger aims, an utter impossibility. Ever being who I am inside, of course I've gotta lay foundation on later plans too. In the end though, only time can tell the future.

At the more immediate moment, I'm just whipped. There's no shelter from exhaustion at this point, and probably never will be in my life: that's one reason that I tend to take things one day at a time. I'm so fucking tired, yet hate to watch the hours go by without getting anything practical done. I also know, working on most of the stuff that needs doing, isn't wise when I feel like passin' out.

The crappy thing is, if I log off now, either I'll be wide awake in a couple of hours (and back in the same boat), or by the time dawn rolls around, I'll feel like slamming my sleep starved head into a wall, \o/.

Monday, March 8, 2010

After getting my CP back in January, I've finally gotten to put it to good use: in our old churches back parking yard. My mother also has, for lack of being able to spell the Italian word coming to mind, I'll just describe as having gained injured nerves >_>.

I've known the theorem and mechanics of driving since I was like eight or nine, so my focal point is on filling the experience gap. Ma has been driving the same '93 F.O.R.D. for almost as many years as its been off the assembly line, and knows its handling inside and out; I don't. Unlike my mother however, I can trivially calculate the distance between the car and what's around it, stuff like that is a skill I've developed over the years, I can both feel it and fill the missing picture in, based on what my mind has already seen. Thus getting to close to the curbing means either I miscalculated the difference between the steering wheel, and the actual wheels current vectors, or it took to long for my foot to shift between pedals: not that I can't see where I'm going 8=). Towards the beginning, I had to threaten my mother to shut up and stop grabbing at my arm, or I would retaliate either by (intentionally) taking the car over the curb, or make her stand outside and watch. I don't give a fuck if there's more racket going on then in a warzone, jabber all you like, but don't interfere! Geeze I'm not an idiot, I know better to go over the curb; and that stopped as soon as she stopped jacking the wheel towards the curbing, whenever the car got too close. See, don't bother me, and things get done properly -.-

My mother is insanely short, and to narrow minded to assume others have the same visual problems that induces. What can I say, when I first sat down in the drivers seat I nearly knocked my glasses off, and had my head angled funny, just to avoid cracking it on the ceiling... and I'm vertically challenged myself. Just getting the seat and steering wheel adjusted was a feat, involving suspending myself over the cleaning supplies in back, in order to clear to crap out of the way so the seat would have somewhere to slide back to, and then trying to extricate myself, without castration, broken legs, or a sliced open belly. It felt like hanging myself from the cars interior roof, and applying a spiders agility lol.

The area I had for practice, is just two sets of parking spaces several car lengths long, joined by very tight turns on either end. Small enough to require paying close attention, yet empty enough to only have to worry about one parked car, hehe. Did several dozen laps around the yard over an hours time, including a K-turn to go about the other way. Started out going at the engines idle speed, before studying how she handles under different patterns of acceleration and breaking; I doubt if a claustrophobic amount of practice space in is a good thing for a noob, but I never the less, take it scientifically. For me, it is very important to learn how the vehicle handles, because I'm not going to be responsible for taking it on the road, unless I know it well enough to keep the damn thing under control. I'm crazy, but I'm not suicidal :-P.

Three things that I noticed about the family Ford: the old accelerator has a hair thin trigger, it's got a fat arse when it comes to rate of angle change in reverse, and exactly like in dreams that I've had about driving, the car will move forward even with foot off the accelerator. After 16-17 years of reading the dashboard sticker that says, "To shift from park, depress break pedal" in English and French, I of course remembered to do that without hesitation. I could probably understand the thing in spoken French by now \o/.

Unlike my brother many moons ago, I opted to keep things under tight control while practising. Heh, I can still remember when Reese got his learners, and ended up zipping around a large Sports Authority parking lot like a bat out of hell. At least, I was seat belted into the rear drivers side seat, and spent most of his learning sessions being plastered against the rear passenger side window, lol.

Now the big question, is how many months will it take before I get more time to practice \o/.

Friday, March 5, 2010

This weekends multi-part plan

  1. shave off the moustache and company; done
  2. get a hair cut; hopefully sorted before Monday
  3. a long shower; done as soon as the mops and laundry gtfomw
  4. finish pc-bsd v8 review
  5. report Stargellas sysio code to windows; stupid rsync screw overs...

With luck by Monday, I'll both feel less like Chewbacca the Wookie and have a lot of work done, hehe.

Tuesday, March 2, 2010

Bug smashing on the stack, hehe

Ok, I've spent some time longer then expected working on my games net code, mostly because I both needed one nights sleep this week, and wanted proper IPv4/IPv6 support going on. Sunday I basically finished principal work on the net module, and completed a pair of test cases: a really simple client and server program. After that went smooth, I had planned to complete the finishing touches.

The problem: the server example segfaulted. Now those who know me, I consider it a plight upon my honour as a programmer, for any code that I've written to crash without due cause (i.e. not my fault). So I spent work on Monday taking a break: refining code quality and then porting it from unix to windows. During the nights final testing runs after that however, I had not solved the mysterious crash yet, and got the same results. I switched over to my laptop and recompiled with debugging symbols, only to find that my program worked as normal, only dying with a segmentation violation once main() had completed, and the programs shutdown now "Beyond" my control.

My first thought of course, was "Fuck, I've probably screwed my stack"[1], a quick Google suggested I was right. I also noted that turning on GCCs stack protection option prevented the crash, so did manually adding a pointer to about 5 bytes of extra character data to the stack. Everything to me, looked like the the return address from main was being clobbered, or imagine invoking a buggy function that tries to return to somewhere other then where you called it from. Before going to bed, I narrowed it down to the interface for accept(). Further testing showed that omitting the request for data and just claiming the new socket descriptor, caused the crash to end but still, some funky problems with an invalid socket. Inspection of the operation also showed that the changes were well within the buffers boundary, yet it as still causing the crash. So I finished the remaining stuff (i.e. free()ing memory) and went to bed.

Having failed to figure it out this afternoon, and starting to get quite drowsy, I played a trump card and installed Valgrind. It's one of those uber sexy tools you dream of like driving a Ferrari, but don't always find a way to get a hold of lol. For developers in general, I would say that Valgrind is the closet thing to a killer app for Linux developers, as you are ever going to get. In my problem case however, Valgrind wasn't able to reveal the source of the problem, only that the problem was indeed, writing to memory it I shouldn't be screwing with \o/.

So putting down Valgrind and GDB, and turning to my favourite debugging tool: the human mind. It was like someone threw on the lights, once I saw the problem. Man, it's wonderful what a good nights sleep can do!

Many data structures in Stargella are intentionally designed so that they can be allocated on the stack or heap as needed, in order to conserve on unnecessary dynamic memory allocation overhead, in so far as is possible. So the example server/client code, of course allocated its per socket data structures right inside main(). Because there is no real promise of source level compatibility between systems, the networking module is implemented as a header file, having function prototypes and a data structure representing a socket; which contains an opaque pointer to implementation specific details, itself defined in unix.c and windows.c, along with the actual implementations of the network functions. Because of that,the behaviour of accept() can't be emulated. Net_Accept() takes two pointers as parameters, first to a socket that has been through Net_Listen(), and secondly to another socket that will be initialised with the new connection, and Net_Accept() then returns an appropriate boolean value.

All the stuff interesting to the operating systems sockets API, is accessed through that aforementioned  pointer, e.g s->sock->whatever. What was the big all flugging problem? The mock up of Net_Accept(), was originally written to just return the file descriptor from accept(), allowing me to make sure that Net_Listen() actually worked correctly. Then I adjusted it to handle setting up the data of the new socket, in order to test the IPv4/IPv6 indifference and rewrite the client/server examples using Net_Send() and Net_Recv(), and that's when the crashes started.

I forgot to allocate memory for the sub structure before writing to the fields in it, resulting in some nasty results. When I say that I don't mind manual memory management, I forget to mention, that programming while deprived of sleep, is never a good idea, with or without garbage collection ^_^.

Now that the net code is virtually complete, I can hook it into my Raven Shield server admin tool, which will make sure to iron out any missing kinks, before it gets committed to my game. Hehehe.