19 November, 2013

A recent debacle

I was happily playing a game, and I was also talking on IRC. My wife was also on a computer game. June the 29th, about 3:30pm. The day when a DSLAM cabinet down on a nearby main road stopped working. I wondered what had happened, put it down to a normal outage. I got in contact with the local ISP a couple of hours later, only to be told the sad tale of a little brave green cabinet that decided to jump in front of a car, with catastrophic results to the internals. The left hand side ended up totally dead, the right hand side barely had voice capability. Trying to get it repaired didn't get us very far.

In the area where we are, we had a little bit of a disaster. As a result, several houses have already been removed in our local area, and lots more houses are expected to come down. Needless to say, that means that Chorus (our phone line maintenance company) won't be replacing the cabinet that got damaged. However, their solution was to move customers over to the next nearest street cabinet. This should have happened to us, but our connection wasn't made to Chorus's specifications originally, so we got completely missed. I had a chat to our ISP over the course of a few days, and we ended up with our DSL coming from the exchange instead, nearly seven kilometres line distance. And the stupid thing? Our ISP couldn't do a single thing better for us. I don't know if any other ISP could have done any better either.

Anyhow, I stumbled onto a website for New Zealand geeks, where a lot of telecommunication industry representatives also gather—there are often people from the major ISPs too, and one of those representatives also includes Chorus. That's right, the guys who maintain our phonelines. Once I got in contact with him, I put my story to him and asked what could be done. A few days later, I was informed about the status of our connection, and was told that they would have to put a custom solution into place for us. A week later (about seven weeks after the initial problem) we were finally back onto the Internet at a decent speed.

I don't know whose the original problem was, nor how many other people would have faced the same issue as we did. What I do know is that this issue would not have got cured for Joe Average who'd been connected up the same way we had. I shouldn't have had to go to a website like geekzone, even though they're perfectly great. I should have been able to hammer on my ISP, and my ISP should have been able to talk to Chorus and punt us to the next nearest DSLAM box as part of our contract. I'm more surprised at Slingshot's inability to kick a dog and get things moving, frankly—I've had no issues with Slingshot until then, nor have I had any further issues.

17 November, 2013

How long a blog post takes

What, you write blog posts more often than once a year?

Sometimes, yeah. I spent about five minutes thinking about this blog post by Sacha Chua that prompted this reply post from me, as I thought a post would be better than a comment. After all, her original post was made three years ago.

Thinking about what to write

This takes the longest length of time, funnily enough. It’s one of the reasons there’s such a long time between posts on my blogs. Of course, once I’ve actually got a subject to talk about, then it’s just a case of clawing together some details, which takes time. Most of it is definitely spent just plain thinking about how to write my subject matter.

An aside—selecting tools

Using a standalone editor—emacs, (g)vim, kate, TextMate or gedit—vs a web-based editor? It doesn’t matter, both of them work with getting words into a framework. However, with the standalone editors, I have to write in html source mode. Render mode won’t happen until I get it into the “render” mode of the blog, so it’s better to put some of the framework into place while I’m writing the blog entry. If I was really insane, I’d write in TeX and use a LaTeX renderer to output into HTML, PS, PDF or other supported output formats. Unfortunately, I’m not familiar enough with it to be comfortable writing in markup alongside of paragraphs.

I had a tinker with posting back ends—I wrote the bare text and headers, while the posting back end handled turning it all into HTML goo ready to be viewed by a browser. Most of these editors didn’t do what vim does—nor emacs, for that matter. Often, they were a bit simpler, providing clipboard operations and a preview-ish window.

Anyhow, I seem to have settled on using vim, writing my text out to a file to preview in a browser as I go. It’s just the tool I’m most familiar with. It doesn’t slow me down particularly, or at least no more than other editors would.

Working out what the text will be.

Adding material

Once I’ve got the germ of an idea, content writing takes a while in its own right as I’m not exactly a quick thinker. Waiting for thoughts to shuffle around and arrange themselves on the stage of my mind is simply a case of waiting for other thoughts to come out of hibernation and percolate around the original thought.

Cutting material

Sometimes, stuff just plain doesn’t need to be there. it either repeats what I already said, or it doesn’t fit and should be shifted somewhere else or removed altogether.

Correcting goofs, rewriting and adding new material

Thankfully, this doesn’t take long. Often the previous section happens in parallel with generating text just to make sure I don’t miss too much. I inevitably miss something, of course.


Shortest bit. About 3 to 5 seconds. Done. Now to check the post… oh heck, I missed that???

Posting again!!! after correcting goofs I missed the first nine times!

Even with “proofing” manually in a browser, there’s inevitably something I’ll end up missing by the time I post, so by the time I get my final content posted—and edits applied, it could be a little while longer. Especially if weblinks change, that can take a little while to percolate through. I hate dead links.

Minecraft got more loving

New Music by c418

I finally don’t have to feel guilty about playing c418 music any more. This guy here is responsible for the music in Minecraft, among other things. He released a new album last week, and some of that music worked its way into the Minecraft game recently. I was thinking it was about time, as I like his music. One nice thing that c418 did for his latest album was to provide stereo versions of some of the minecraft records, which had previously been available in mono. It seems strange hearing them, it’s like they’ve got this … extra dimension to them now. They occupy a distinct space which hadn’t been true before.

For all you non-audiophiles out there who don’t know what I’m on about when I talk about with mono/stereo, don’t worry, I’m not talking about your soundsystem getting a incurable virus. Stereo is two distinct channels of sound, mono is one channel. The modern take on surround sound contains 4, 5, or in some cases even 9 distinct channels of sound. With headphones, it’s a little harder to feel the music love, but don’t worry. You can still hear music just fine, as most of it is written for plain old stereo. After all, we have two ears.

Anyhow, ’nuff from me.

03 October, 2013

The Death of Respect

... or The Rant Against Fish.

Something's Fishy here.

Having seen the amount of vitriol splashed about the Internet gaming community for game developer Phil Fish and his outspoken opinions, I'm frankly surprised the guy hasn't been driven into suicide. I don't need to link the article about him quitting, hundreds of websites have done that already. I feel sorry for the guy, frankly. Yes, he's considered a strongly opinionated person with a massive following of haters, but he doesn't deserve the complete hate campaign against him. Nobody deserves that.

Thankfully, people support him, although their support is completely overwhelmed by all the negative comments that Phil has engendered. Looking through the comments on Phil's latest blog post about dropping game development, I'm not entirely surprised at his reaction. I am surprised at the complete flood of hate directed at Phil, purely because some people absolutely totally and utterly hate the guy. I mean, some people think he's worse than Mussolini, Hitler, Caucesceu and Mao all combined, in part because of what he said about some modern Japanese games. And that's not including the general opinion on his previous statements in the press. Let's face it, in a lot of cases, this guy is honestly loathed. And frankly I'm totally sick of it.

The Game's Up, and it's all good.

I'm not qualified to judge Phil's comment about Japanese games. I haven't tried modern Japanese games, and I don't own a modern console. Most of the games I have are from the Indie community or from Valve, so I'm not approaching this question from a hard-core game player's perspective. Instead, I'm stating what I feel as a casual gamer approaching a game I hadn't seen before but had certainly heard of.

Now that I've tried Fez, I quite like it. Phil does the necessary work needed to introduce the game mechanics, and then gets into what makes the game so good, at least for me. Yes, I'm frustrated by not being able to get further through the game, but I can lay that entirely to my lack of skill, rather than any flaws in the design of the game. I like the degree of having to figure stuff out, without it getting entirely frustrating.

Phil Fish, if you ever read this, I hope you are able to continue to partake in the Internet community. You probably already have a skin like a turtle's shell. I would love it if you reconsidered your position about game development, but I won't blame you if your decision is final.

As for those that wish to completely vilify and revile a character, think about what happens if that flood is aimed against yourselves one day. How would you hold up?

09 September, 2013

Learning to code from drowning

First, you drown (and get saved)

Simply put, I'm not a coder. I found this out the hard way with my first C program, called list. It tried to display a file to the screen, a la less(1) or more(1) but with a wrinkle. Of course, I decided I wouldn't look at any previous source code from either of those programs.

First off—although I didn't know it at the time—I did two things wrong. I learned a long time later that coders don't reinvent the wheel if an established codebase already exists. They simply credit, use, and move on. The second thing I did wrong? I didn't expose myself to how things were done properly. I came in as an almost completely new coder, barely knowing what a function was. One of the things that experienced coders have done is to examine as much good code as they can manage to without invading corporate secrets. I get the impression that they practically drown themselves in good code, hoping—or perhaps knowing—that some of the code will stick in their memories to use later on.

A function is always embedded in code. To be successful at this, each function has to do one job, and only one job. For code reuse to work, a typical function has to be used more than three times within a codebase. You have to know what job your program does. You also have to know how you divide up that job into functions. It might be stretching it to say that your “job” should only be decomposed into functions you already know how to write. If that were the case, then I would have never persisted with programming. However, you do have to know how to write good code. There's no sense in creating a C program that doesn't free any memory you allocate. There's no sense in trying to write your .NET without classes—it's practically impossible. And there's no point in trying to fight the programming language to do what you want to do. If you can't write the function you need to—either because you don't understand the programming language or the programming language won't allow you to—then you have two options. Learn the language inside out, or change languages. This isn't practical within the context of a single program, as you have to stick to one language for one program.

Now, you learn to swim

Of course, reading lots of good code isn't any use to you until you understand it—especially how it interacts with other code. Often, bugs aren't caused by poorly written code, but instead by poorly understood code. You wouldn't use a mini to transport your 5-bedroom house, but I swear that some programmers would try it.

Try another beach

Specialising purely in one language or another will make you really good—eventually—in that one language, but won't be very portable to other languages until you understand the programming concepts behind the code. It's usually a pretty good idea to at least become familiar with multiple languages, and even families of languages, as this can often make the difference between barely reaching the target or being the best tool for the job at hand. You may not see Haskell in your workplace if it's a Java shop, but knowing the concepts that led to Haskell may give you an edge in understanding. And if you spent your life learning assembler, then Smalltalk can seem like another planet.

17 February, 2013

A tale about incorrect challenges

First, the soup

Several years ago, I got onto the broadband bandwagon after putting up with the increasingly inadequate ability to cope from my dialup account of the time. At the time of the upgrade, I gained a D-Link DSL modem from other sources, plugged it in, and prepared to see what the world was about on broadband. Until I hit a snag. Things weren't staying online consistently. After stuffing around with various things, moaning at my ISP, getting one of their modems (a Dynalink DSL-302) and still getting no real joy, we finally got our local telecommunications company around here. They replaced enough of the phone lines in the place to get things working and I haven't had a hiccup since, until I had to replace the ISP's modem because it started showing erratic behaviour over several weeks, then finally died.

It had lasted a while, but I did rather think it would have lasted longer. Never mind, modern throwaway hardware being what it is, I guess we just had to take it on the nose. We bought a more up-to-date modem (the TD-8840 from TP-Link), plugged it in, set it all up, and tried getting back to the surfing habits we'd got used to. Ha. Except that wasn't exactly the case.

We found that download speed would seriously fluctuate when we were using the modem at full capacity, even though we had been sold the modem on the premise that it would certainly more than cope with the load I stated. I took the modem back to the store, stated what was happening, and asked for another model or our money back. The shop was unable to comply, pointing out that their specific terms of return excluded the option of refunding the money, with the only other option provided being the same model modem as we already had.

In the end, we took the modem away with us, knowing that it probably wasn't up to the demand, but we purchased a Netgear N150 DSL modem. Again, this is busybox-enabled, but very slightly differently from the Dynalink I was using previously. I'm not going to bother plugging in the TP-link again, even though the expected load has now dropped (one less member in the household). The Netgear's done perfectly well as a performer, and even has the advantage of having wireless in addition to the four ethernet ports. I thought it was pretty good, and didn't need any further firmware patches.

Until the other week.

Now the meat

The issue first got noticed that not all might be right when I was gifted a DOTA2 key as part of Valve's somewhat-closed-but-getting-heavily-tested beta of DOTA2. I'd had issues with two other Steam games, but those were eventually sorted out with ping-pong calls to Steam's support service. Side note: they're quite good, although I find them very very slow, often taking days to reply. This issue on the other hand, wasn't something I could get Steam's help with, as the application started up fine, but would outright refuse to join any servers, with no indication of why. I even poked extra holes in the Windows firewall, even taking it down for one test. Of course, that didn't cure the problem. So that left the DOTA2 binary itself, something wrong with Windows itself, the DSL modem, the ISP, the Steam service or the remote servers as the likely suspect.

Someone else offered to help, and we got going on a TeamViewer session to see what was going on. For him, DOTA2 worked perfectly, so that counted out the servers he was connecting to. They were up, they were responding fine, no issues there. The next step we tried was to log into Steam from his computer, using my login credentials. I duly fed SteamGuard the right code to continue, and fired up DOTA2. Imagine my surprise when I found that DOTA2 worked perfectly as it was supposed to. With that, we counted out Steam themselves from having any involvement with the issue. Leaving only my machine, the ISP, and that DSL modem that had performed sterlingly up until now.

I found out that this program supported the -console switch too, so I fed that to the command parameters being used to launch the DOTA2 process. I started it up, and watched while various messages scrolled up the console window. All things appeared to be correct, so I tried to start up a multiplayer session with bots. And there I struck my next issue, and the real cause of the problem. In the console window whenever I tried connecting to a server, I was getting messages like this: Server connection did not have the correct challenge, ignoring. I hadn't seen this until I'd brought up the console, but it explained (partly) the problems I was having.

Don't forget the vegetables

I checked out whether I'd accidentally missed out any ports the ISP might not be forwarding, but struck no issues. In short, the ISP wasn't at fault (as if they ever were). Leaving ... you guessed it. That modem. The modem had been fingered by others as being suspect in a number of not-working DOTA2 installs from all over the world, mainly from the U.K. where the modem is commonly handed out by the ISPs to their customers. I was just the first to have struck the issue from New Zealand, where I live. It seemed that the DSL modem was mucking up the UDP packets and not giving them back correctly. So, now I had to find solutions. One solution (not optimal) was to switch the method that the modem used to talk to the ISP with, from VC-MUX over to LLC-based, however this meant that each packet leaving the modem and returning would have larger packets, increasing the amount of information transferred for no real gain in amount actually downloaded. Surprisingly, this actually worked for me, with my machine finally able to talk DOTA2 to the rest of the world. I didn't want to keep the modem in LLC-mode though, as it had been delivered in VC-MUX mode to begin with, and that's what the ISP supported directly.

The pudding (dessert for all you others)

The other option was to flash the firmware to see if it fixed any of the behaviours I was seeing. The last time I'd looked up firmware for this modem was very shortly after I'd installed it, at that stage, I already had the latest firmware, but now this was several months down the track. Anything useful was worth a try. I logged onto the Netgear website to look for updated firmware, found that yes, there were further updates, and downloaded them. I flashed the modem, hoping like anything I wasn't going to brick it, rebooted it, and hey presto. It came back up with all my settings intact, surprising me who was expecting to have to enter everything in by hand again.

Anyhow, the proof of the pudding was to reset the connection back to VC-MUX, and try starting up DOTA2 again. Thankfully, it all worked, and I was finally able to connect to servers, without me even having to reach for a Steam Support ticket. And the moral of the story? Sometimes it IS good to flash your modem, even when it's not obviously going to fix the error you currently have. And now I'm only stuck with the normal challenges of learning a game I've never played before, in a genre I hadn't played much if at all. But that's another tale, and one I won't tell for the moment.

06 February, 2013

Waitangi - our national day of shame

Yes I hate to say it, but it's true. It seems that we can't get our heads around the fact that we're supposed to remember a contract between the settlers of the time and the indigenous people, the Maori. And remember it without arguing about it. Instead, it's become a day when the Maori air their ongoing grievances, often with each other within the Maori community. This often means that our esteemed leaders get caught up as collateral damage, with previous instances of our Prime Ministers being reduced to tears (Helen Clarke), showered with manure (Don Brash), or other unfortunate incidents.

It is difficult to nail down any one specific reason why this should be so, as there are multiple reasons for dissatisfaction. Maori feel hard done by, and that the Crown never fully paid reparation for their excesses against the Maori people. European descendants often see that the Maori are just whining for the sake of it, or more seriously, trying to bankrupt us so that they can see their issues with suitable redress. I'm just an average New Zealander of European descent, so I can't speak with any authority on these matters. Looking at the Treaty made my eyes glaze over, but looking at the conflicts between Maori and Pakeha (the Maori name for European immigrants) made me angry.

Injustices on both sides have led to generational grievances that don't ever seem to get entirely settled to the satisfaction of either party. As a result, I perceive that Maori, even if they have been through a settlement process, often realise later on: "Oh wait, we never knew THIS..." and kick off another settlement process, bogging the whole procedure down in what amounts to red tape.

Is there a way to fix it? Perhaps. Is there a way to fix it that will entirely satisfy all parties? Not a hope. Can we possibly come to an agreement that everyone can put up with? Perhaps, but it's taking far too long. Members of the current Government want this dealt with, over and done with, and finished up so we as New Zealanders can get on with making this country better. Not we as Pakeha and Maori. New Zealanders. They don't wish any distinction between us. But the Maori want distinction, so they don't lose their culture. And frankly, what race doesn't?

In addition, it also seems that even the Maori can't agree amongst themselves what they want, and neither can the Pakeha. Factions exist both within Maori and within Pakeha that regularly strain attempts at reconciliation, resulting in outbursts that regularly stain our reputation as a multi-racial nation that tolerates diversity, encourages distinctions, and supports culture in a way that few other countries attain to. Put simply, we are not tolerant. We are not supportive of cultural diversity. We don't like distinctions between us, and we don't support other cultures when they conflict with our own solidly held beliefs about how we think the world should be.

We don't like difference. And yet we must have it, or we'll become just another Western country like all the other Western nations. We need all the things I have mentioned. So why can't we stop arguing?

20 January, 2013

Of games and scripting, and scripting games

Life's not always a game, but it can seem like it

It's been a pretty long time since I've contributed to either of my blogs recently. Not that I've been doing a lot, though I have been contributing to the coffers of Steam and Indie game creators, mainly through the Humble Bundles.

A little humility goes a long way

Humble bundles are collections of (usually) games typically from Indie developers, and the ones I look at are at a knock-down price. In essence, you specify the price, and specify how you want the price divided up amongst various categories. Independent game developers get much-needed profile as well as a little extra cash in their pockets, any charities get a little bonus and the group organising this also gains a slice. And it's all decided by you and me, the prospective purchaser.

You certainly won't find Call of Duty, Halo 4 or any other big AAA titles in these collections, as those are normally funded by organisations the size of Valve, EA and the likes. No, these are little games, often coded by one person, or perhaps more, but usually no more than ten people.

These humble bundles work best when we're not cheap retards that pay one cent and expect seven good quality games. One current way to combat this is to provide basic games for any amount less than the average. Additional games are provided if the prospective purchaser pays more than the average. If we're prepared to put a halfway decent amount of money towards the games, then developers are more inclined to look at this as a viable way of increasing visibility.

The Humble Bundles provide binaries for Windows, Mac OS X and Linux. I think that's fantastic, but I noticed something about contributed amounts for various platforms. Windows users provide more than 60% of the purchases, yet they're the cheapest of contributors. On the other hand, Linux buyers provide the greatest amount for contributions even considering their lowest profile. I wonder why that is?

As a result of my various contributions to their respective coffers, I have stellar little gems such as Gish, Toki Tori, Cave Story +, and many others.

I do run the risk though, of running into an awful lot of games that I'll probably buy, play once or twice, and then hardly ever play again. Minecraft seems to be a very rare exception to this.

One small niggle I seem to have, Steam's copy of Doom3.exe doesn't want to work properly on my computer, and nobody actually knows why. I've downloaded the Doom3.exe from ID, and that seems to work fine. In addition, so does the Linux binary. So it seems that the data files are fine, at least. It's just the binaries.

However, in more testing, it seems it might actually be the Steam interface that isn't running something the steamed-Doom executable expects. Once I was running the beta Steam client, it now seems to work properly.

Except for Defense Of The Ancients 2, which has issues of its own that I have yet to understand.

Houston, we have lift-off

On the topic of Minecraft, I cobbled together a script (called minecrafty) to start off a selection of Minecraft launchers. The launcher handles loading modifications to Minecraft, and my script handles other items such as screen brightness, choosing the right launcher and defining the amount of memory devoted to java.

Since then, I've added other functions. I added in the ability to run a specific server, or download versions of Minecraft, and most recently, to download various launchers. Currently it only works under bash, as that has a far better ability to chain commands together. Heck, bash even has functions, and has done from day one. I don't know if CMD.EXE even has functions, though it has callable subroutines, but I do know it was a pig to write for when I last wrote for it. So I write minecrafty in the bash scripting language.

I can't think of much more to add to minecrafty, as it has everything I need it to have. And frankly, that's often what home coding is all about—scratching an itch. I needed to brighten up the screen before launching Minecraft, and reduce the brightness back to normal afterwards, which is how this all started. In doing this, I found out a little more than I really wanted about how to change brightness on individual monitors (and refresh rates) of my two-monitor system. I was also surprised about just how much detail I needed to know about. For example, someone was having total problems starting my script on their system, purely because they hadn't put things in the same place that I had done on my system. That provided me with the impetus to add in a function to download (and install) a launcher. At this stage, the script supports five separate launchers, with no real plans to support any others—as it is, I only use the one launcher anyhow.