Ossa Sepia

June 18, 2019

Euloran Blu's and Boos

Filed under: Coding, Open Sores — Diana Coman @ 9:24 a.m.

The legacy code base on client side can best be described as a pile of tangled pointerisms and assorted CPP mess under the name of Planeshift (PS) on top of a smaller ball of ifdefism1 and XMLade called CrystalSpace (CS), on top of a comparatively saner and at any rate smaller ball of CPP called Cal3d, the whole construction bursting with a lot of good intentions and precious little useful structuring or maintenance consideration. While sanity seems to quickly decrease from bottom (cal3d) up (to CS and then various parts of PS), what strikes one even more is that the whole thing if afflicted with a grave case of XML addiction that starts from CS and then simply comes to its ugly fruition in PS. It has been obviously written at the very top of the XML hype - everything and I do mean *everything* and everywhere is best described in XML! It could be argued that the authors simply wanted to have a lot of XML of their own but since they couldn't do just that2, they had to also do a graphics engine and a sort of game on the side, almost as a second consideration really. Come to think of it, why not call it then at least XMLSpace and XMLShift?

While CS itself has at least some clear initial design and therefore some structure (if a very clunky one at best of times mainly because the author really had too many good intentions), its main underlying assumptions are precisely the opposites of mine: besides the total focus on xml, there is also this obsession with event-driven (which makes it very hard to actually follow anything from one end to the other), the generic plugins (which again means that doing the simplest thing involves a huge scaffolding upfront) and the fact that the whole thing tries rather desperately to make itself "easy to use" by those who don't understand (nor even look into) the code at the expense of course of those who do since there is no possible way to have one without the other. Leaving aside for a bit how one can never really do the work of others for themselves, the sad result is that tracking down anything in full becomes extremely difficult. The documentation helps here but only up to a point since it is not exactly up to date and more importantly, it doesn't really focus on helping the reader understand the code - it focuses instead with all its good intentions on helping the reader use the library without really understanding it, as a sort of black or at best graying box. And moreover, pervasive everywhere, there is the wrong sort of "simplification": while the weight of it all becomes obvious to the author too (it's quite usual for various constructors to have at least 10 parameters and they are already several layers deep so they anyway call parent constructors with yet another set of parameters), he doesn't see or choose a better abstraction that would help rather than hinder the effort. Instead, he arbitrarily fixes some bits and pieces: for instance, the terrain2 plugin simply expects the heightmap to be in a file called sectorName_heightmap in exactly the current path of the VFS3. In other, fewer words, weaning the legacy code base off its unsavoury assumptions and xml-addiction so that it simply loads art as it becomes available is extremely frustrating and time-consuming, making the overall situation quite foggy blue with cornered cases and hardly anything useful in sight:
cube_eulora

The art4 that you just admired above might not look like much but it's a big achievement on Euloran soil: for the first time in Euloran history, a Testy character (still sadly xml-based himself) made it outside the pre-defined sphere of the XML-Island and into the great unknown of non-predefined, non-xml, fully code-loaded and discovered as you go world! It's true that the world is for now only a cube with rather sharp and unyielding corners and no landscape at all, it's true that the very three suns that gave reasonable light on the Island look foggishly blue in here and it's sadly true that the character itself is still trapped in the XML bubble. But it's a working start and moreover it's a seed that has just caught roots within the hostile soil of the legacy code so that it can grow out of it, hopefully discarding as it grows more and more of the unhelpful mess!


  1. This is a term of art, the logs will help you. 

  2. Why? Why can't you do *just that*, whatever it is you actually want, did you ever ask yourself? 

  3. Virtual File System inside CS.... 

  4. In computer graphics EVERYTHING is art, ok? There is no such thing as mere fitted drawings and clumsy, clunky approximations, no, no. All the games have nothing but art in them! Hell, they *are* nothing but art. Well, of snorts, yes. 

August 4, 2018

A Collection of Pearls as Well as Ever Sadder Epitaphs

Filed under: Open Sores — Diana Coman @ 11:39 p.m.

Motto: Gura pacatosului, adevar graieste.

Deep inside the muck that passes for code among the open source tribes, there are pearls left not before the swine but rather plainly after them1. Like any pearls, they are the fruit of pain avoided and postponed, the signs of the beginning of defeat, the ever sadder epitaphs:

//@@@ Dirty, hack, this might be in a diffrent thread
//@@@ need to syncronize this in some way. But at least
//@@@ by moving this here the client code dosn't call
//@@@ SendOut anymore.

Oh, how truthful it starts, for it is indeed dirty and a hack and it "might be" something else "in some way" - that way being of course if only someone else wrote it! "But at least" it's written there and then never read or acted upon again of course, for how else would code be muck and shit accumulate at such tremendous speeds to make all those half a million lines of code?

 // REVERTED 3/8/03 Until I can figure out why this is causing client conencts to fail - Andrew Mann (Rhad)
// If we don't know who this connection is, don't handle ACKs
//if (!connection)
// return false;

It's 2018 and I'm sure he has figured it all out by now, right? The best way to figure things out is by avoiding them. Only for now, only a bit, only in "some way", only temporarily, of course. OF COURSE. And the best way to clean your house is by sweeping the dust under the carpet, don't you know?

// XXX: This is hacky, but we need to send the message to the client
// here and now! Because in the next moment he'll be deleted

"Where there is a need there is a right" or how did it go? The fact that you *need* to send a message in an ill-suited place at the wrong time to an idiot client and so on are ALL signs of problems to be sorted out not reasons for piling the shit higher and higher!

 // TODO: Hack, for now just get the y value and sector from the first point.

There, the great discovery of this year's lazy bums just as lazy as last year's lazy asses: don't do today what you can postpone indefinitely! And if it's on a todo list, then it doesn't need to actually be done! If I write that I'll do it then it's just as good as if I did it and way less work so it's win-win-me, isn't it? Especially since nobody will dare laugh at me for it since that's discrimination and a big no-no and I'll get all upset and they'll hurt my feelings.

// HACK TO GET AROUND BAD INCLUSION OF PSCHARACTER.H IN DRMESSAGE.H KWF

This one truly reminds me of a children's story: a granny was once asked how many people were there at the party she had just attended. And she truthfully replied: only 1 person; for there was an old dirty barrel blocking the entrance and everyone got around it except for this last man who actually moved the barrel out of the way and only then got in.

What can I tell you, they used to teach this stuff in kindergarten!

 // Hack to work around the weird sector stuff we do.

This is the very way hacks reproduce until there is nothing left but a big pile of hacks precariously stacked on one another all the way to the moon. The hack because of the hack because of the hack because of the... Just stop hacking already and clean the darned shit from your house, you know? Why do you keep shitting where you eat?

// Special case for string, because we have to specify the namespace
// std::string, which doesn't play nicely with our FLAG__namespace hackery.

Hack and... counter-hack! If hacking breeding more hacking and shit growing up to your eyeballs wasn't already clearly and plainly the only result of this insanity. What does it take for you to stop this stupid approach with the special case for the extraordinary situation of the most unique item on the singularity of shit?

/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
* this will of course break if we're included before OpenSSL headers...
*/

You know it's broken but you ... do it anyway? The once inconceivable, the un-human, is that the modern human? Why, just why would anyone do such a thing knowingly?

/** @@@ Hack: please someone tell me how to do this better? */

Perhaps one of the saddest of them all: he is asking, you know? Perhaps in the wrong place, perhaps poorly stated, perhaps at the wrong moment, perhaps even only half-hearted but nevertheless... he asks for some guidance away from the swamps! But who answers, who is there to even read his comments at least if not his code? Of all the thousands pairs of eyes, none even blinks in recognition, not even once and the question remains there unanswered, the hack stays in place, the cry for help goes unheard and unnoticed for there is nobody to hear it. The thousands pairs of eyes stare without seeing anything for they are all little more than painted eyes on painted masks on painted cardboard in the painted world. Pure insanity this brave new world, the very stuff nightmares are made out of.

There truly is no worse loneliness than the loneliness of those trying to be people while lost among the crowds. For crowds are never, ever, people. And more importantly perhaps, out of necessity, crowds will always and invariably choose to mend and make do, just as reflected in all those comments above, never to clear away the rot that is left therefore to accumulate and fester and stink and drown everything. So next time *you* make your choice between the expensive exposure and fix of the rot on one hand and the mend and make do on the other, think perhaps also of that loneliness of the person in the crowd and of what it truly means to be - to become! - only one of the many, many identical pairs of unseeing eyes in the crowd.


 


  1. Hey, swine have rights too! What are you getting offended about? 

October 30, 2014

The cost of shitogramming

Filed under: Open Sores — Diana Coman @ 11:09 p.m.

I am the one who got to volunteer because everyone else took a step backwards. This time, the lack of backward steps got me to experience cross-compiling, funky code and other beasts that await the insane traveller in the world of Windows shitogramming1. And it also made me recollect the main reason why I do not want to make a living out of programming, although I could do it: there is so much shit out there masquerading as code, that programming anything of any consequence invariably requires first2 the cleaning of Augean stables. And yes, the beasts are divinely healthy too, so no chance for that to stop really, or for doing the cleaning once and for all, once and for good.3

The task seems easy at first: take a bunch of C++ code and libraries (cs-winlibs, crystalspace and eulora or more precisely its planeshift-based client), previously compiled without a hitch on Linux and just compile them the same on Windows. The only caveat is that... no one succeeded before. Plenty compiled it on Linux and plenty... tried to do it on Windows (including me in a previous driver-problem-induced madness). So, after having actually played the game to its very bones so far, earned the prizes and everything, I got back to compiling it. And here's how it went, in all its glory4:

  1. In an attempt to avoid at least going too deep into the famous stables, I installed at first MinGW and MSYS, figured out how to deprecate the compiler so that it is just old enough for cs-winlibs5 and... success with CrystalSpace. And a lot of good that did to me, because Eulora still failed with the compiler screaming and shouting murder, rape and abuse by means of funky forward declarations6. The reason? Well, that's why there are c++ standards clearly defined, so that on one hand Visual Studio wipes its bum with them and on the other hand the beasts in the Augean stables shit unportable code undisturbed with the help of this wonderful bum-wiping device. The solution? Indirectly7 from the mouth of those writing the Planeshift client, it goes along the lines of "I suggest you use Visual Studio." In other words, stomp stomp, we can't be bothered to write portable code and we like our stables very much, thank you.
  2. Since I was already brown and stinky with Windows in any case, it's not as if a bit of Visual Studio would truly make a difference in terms of colour, odour and general well-being. So I got all the way to the deep and smelly parts of the stables and I installed Visual Studio 10. And the Service Pack for it, of course, because well, that's how the pile in the stable grows, one pack and one patch at a time. Then load the whole thing in, trim it to compile at least only the projects which are actually needed for eulora's client, rummage around and set all kinds of bells and whistles8. Compile and fail. Strip away useless junk that the Visual Studio solution insisted it needed anyway and don't you dare tell it that's not true, you stupid user, you, the machine surely knows best. Then compile again and still fail, but happily only on projects that eulora can run without9.
  3. Already quite surprised that things worked in the end to some degree10, I've set all the environment variables, checked the setup and... ran eulora's client. Which loaded nicely almost all the way and then... crashed. Just so that it's clear how things are with those stinky degrees and all the rest.
  4. When it successfully ran, the server was down. And when it was up again the next day, I first ran the client from where it had compiled rather than from the location it expected (although it wouldn't say), which meant that I was just about to throw the computer out the window when it wouldn't run but complain instead that the variables (which hadn't been touched from the previous successful run) were not set.

After all that (and some cool-down period much needed for me), it finally ran fine, the server was up, I could login and so I saw the land of Eulora again, even from the remote (and rather stinky) Windows place. It took me though longer to get there from Windows than it took me to explore all Eulora, to craft its items and to learn its skills. That's the cost of shitogramming for you.


  1. I can't call every line of code the result of programming, just as I can't call literature every bunch of words thrown at a blank page. 

  2. usually second and third and fourth, but let's remain positive and call it only first 

  3. I wholeheartedly admire those rare actual programmers who go through all this trouble and I am grateful to them for doing it. But I don't want to do that for a living myself, thank you. 

  4. for the version without glory but with clearer instructions, check out Eulora's wiki 

  5. basically by doing an upgrade which is a downgrade and here we go la-la-la: mingw-get upgrade --recursive "gcc<4.7.1" "gcc-g++<4.7.1" 

  6. and some blindness to a very existing and actually linked zlib, but that was relatively easy to solve by modifying the jam file to add the -lzlib flag at the end of the command line. 

  7. aka via Chetty who was kind enough to ask them for me 

  8. include directories in project properties, preprocessor definitions etc. 

  9. loader, celgraph and the sound manager, hence it can run, but it can't speak. Plus an error that was relatively easy to repair by getting a few more files from the project although the very same files were not needed on Linux, but hey, we are in the stables, more is good, especially when there is lots of it anyway and lots and lots and lots. 

  10. the devil is in those degrees, what kind of thing that's not from hell works "to some degree"? It either works or it doesn't and that's the end of it. 

Theme and content by Diana Coman