Category Archives: Computer Games

I love computer games. Sometimes I chat about what’s currently floating my boat.

Linux Mint 17 and the Nvidia GeForce GTX 970

Last week, the magic smoke escaped from the 3D graphics card of my trusty desktop machine. Last night, the magic came back with a new card. Notes, I thought to myself. I need notes, so it’s dead easy to do again.

Because… let’s face it Linds…. you LIKE messing around with the software too much to let something as trivial as the threat of Operating System permadeath stop you.  And you like getting it up again fast, because OS reinstalls ain’t where the action is.

So the following is for you future Linds, and possibly you, reader with the google-fu fingers, and a good working knowledge of Linux systems…

Continue reading

Advertisements

Who I am and why I’m here (with Pocket Ninjas)!

Existential, no? Don’t worry. I’m participating in a blogging challenge to see what new things I can learn about this hobby. Regular subscribers be warned, this probably means I’m going to be more post-happy-chatty over the period of the challenge.

Today’s challenge encourages me to (re-)introduce myself and give you a feel for why this blog exists.
Continue reading

If you love a Minecraft construct, set it free

I spent a bit of the weekend consolidating most of my Minecraft constructs into a single world with WorldEdit, given some tentative musings around setting up a home server. You see, my eldest has been going full-tilt into creating fantastic worlds of imagination and recently wondered aloud if we could build in the same world.

In doing the move, it occurred to me yesterday that surely there’s a web-location where peeps share their minecraft schematics. Lo and behold! Minecraft-schematics.com.

Doesn’t seem that popular at the moment, but never-the-less there are some stunning consturcts already up. So, you’re now free to take copies of the things people build and post to this site. As The Culture so elegantly put it, “Superiority through Redundancy!”.

There are a few more to go yet, but so far I’ve uploaded those that didn’t need much love:

And here’s a gallery of the schematics embedded in a test world:

This slideshow requires JavaScript.

So, if you have some Minecraft schematics you’re looking to house remotely, and are happy to share what you’ve built, consider joining me in populating Minecraft-schematics.

Torchlight 2 Toon Archiving: The Sequel

The kids left me alone last night, so I decided I’d goof around with my Torchlight  2 character archiving.  Recent reading around Git has convinced me that Git stores deltas of its binary file commits, so my last objection to using Git over Subversion for binary files has just been laid to rest.

Also, the original Perl script was a bit brain-dead in that it was good at automatically committing save files that had changed, but additions and deletions were still things I’d have to manually tell the repository about.

As these things tend to go, the lion’s share of the script was written in maybe the first 15 minutes.  The rest of the night was spent tweaking and testing the command template constants, destroying and re-creating Git archives until I had myself convinced that the script was automatically committing exact replicas of the save-game directory, regardless of additions, deletions and modifications.

The script turned out to be pretty short, and is included at the end of this blog post in all its perlesque glory.  Now that I have the trick of it though, the pattern is pretty much applicable to any save-game directory I might want to subject to version control.  The human-readable formula is basically:

  1. Delete all contents of the directory within your version control repository that contains the copied image of your save-game directory.
  2. Fully (recursively) copy the contents of that save-game directory into  the recently emptied archive directory.
  3. Ask the repository to identify all files that have been deleted from the  copied file set that it is currently archiving.  If there are any deleted files, stage these files to also be deleted in the repository on the next commit.
  4. Ask the repository to identify all new files that it is currently not archiving. If there are any new files, stage these  files to be added into the repository on the next commit.
  5. Have the repository apply in a single commit, all deletions, additions and modifications identified.  
#!/usr/bin/perl

# An archive utility for Torchlight 2 characters. Works by commiting the current
# save-game contents to a GIT repository housed in the parent directory to the script.
#
# (c) 2013, Lindsay Bradford, released under the Creative Commons Attribution licence.
# http://creativecommons.org/licenses/by/3.0/
#
# The parent directory has two subdirectories, being "bin", and "toons".
#  The "bin" directory contains this script.
#  The "toons" directory contains the save-game content of the game.
#
# Usage:
#    archiveTLToons.pl <"optional commit message string"">
#
# Modify the constants below to suit your own environment

package ArchiveTL2Toons;

use strict;

###### constants for directory locations and command templates below #####

use constant GAME_SAVE_DIR =>
	"/home/linds/.wine/drive_c/users/linds/My Documents/My Games/Runic Games/Torchlight 2/save/76561198044661040/.";

use constant ARCHIVE_TOON_DIR =>
	"../toons/";

use constant CLEAR_ARCHIVE_COMMAND =>
	sprintf "rm -rf '%s'", ARCHIVE_TOON_DIR;

use constant COPY_COMMAND =>
	sprintf "cp -r '%s' '%s'", GAME_SAVE_DIR, ARCHIVE_TOON_DIR;

use constant REMOVE_MISSING_ARCHIVE_COMMAND =>
	sprintf "git ls-files --deleted \"%s\" | xargs -r git rm --quiet", ARCHIVE_TOON_DIR;

use constant ADD_UNTRACKED_ARCHIVE_COMMAND =>
	sprintf "git add --all \"%s\"", ARCHIVE_TOON_DIR;

use constant COMMIT_ARCHIVE_COMMAND => "git commit --quiet --m \"%s\"";

##### Methods below #####

# Bootstrap method.

&archiveTL2toons($ARGV[0]);

# Archives the current set of Torchlight 2 toons by
# deleting the archive contents, taking a recursive
# copy of the save directory back into the directory
# and commiting a snapshot of the copied content.

sub archiveTL2toons() {
  my $commandLineComment = $_[0];

  if ($commandLineComment eq "") {
  	$commandLineComment = "Commit of current save state.";
  }

  &runCommand(
    "Clearing archive content...",
    CLEAR_ARCHIVE_COMMAND
  );

  &runCommand(
    "Copying Torchlight 2 save game content to archive...",
    COPY_COMMAND
  );

  &snapshotArchive($commandLineComment);
}

# Commits a snapshot of the current content
# of the archive, assuming that the current content
# is exactly what the commit should contain.  Specifically:
#   * Any files missing  from the archive are deleted in the commit
#   * Any new files found are automatically added with the commit
#   * All modified files are commited as-is.

sub snapshotArchive() {
 my $commandLineComment = $_[0];

  &runCommand(
    "Staging removal of missing files from archive...",
    REMOVE_MISSING_ARCHIVE_COMMAND
  );

  &runCommand(
   "Staging addition of untracked new files to archive...",
    ADD_UNTRACKED_ARCHIVE_COMMAND
  );

  my $message = &getNowTimestamp . " | " . $commandLineComment;

  my $commitCommand = sprintf COMMIT_ARCHIVE_COMMAND, $message;

  &runCommand(
    "Commiting staged snapshot of save-directory to archive...",
    $commitCommand
  );
}

# Generates a timestamp of the current time.

sub getNowTimestamp() {
 my ($sec, $min, $hr, $day, $mon, $year) = localtime;
 return sprintf("%04d-%02d-%02d %02d:%02d",
       1900 + $year, $mon + 1, $day, $hr, $min);
}

# Simple method that prints the $message supplied,
# runs the $command specified, and prints any results
# the command generates.

sub runCommand() {
  my ($message, $command) = @_;

  print "$message\n";

  my $result = `$command`;
  print $result;
}

On a final note, I installed EPIC for Eclipse to modify the script, so despite my intense dislike for the lack of automated refactoring, I’m begrudgingly having to admit that it’s working better for me than doing it in a text editor.

Repurposing PvP Skills for Torchlight 2

A long time ago, I played a lot of WoWCrack, and spent a fair amount of time in their PvP battlegrounds. One of the lessons learned was to re-map the keyboard shortcuts to cluster all the battle-necessary action keys to be directly underneath the fingers of the non-mouse hand. Preference for the more frequently used actions went to keys easily reachable by the index and middle fingers, with less critical actions going to keys under the “less co-ordinated” fingers.

Now that I’m pretty much done with character development with Dawnshammer (yes, I retired Von, and gifted her “ph@t l007z” to Dawnshammer), I figured I’d jot down what I’ve done to Torchlight2 based on that PvP experience here. Below is an image of Dawnshammer in mid-dance, with all-but-one of the customized keybindings visible on the action bar below:

Dawnshammer's Hotkeys

Dawnshammer’s Hotkeys

Here’s a brief run-down of the key-bindings and some reasoning behind each allocation:

  • The ‘W’ key (not shown in the screenshot) has been remapped to the movement key.  This is a tip of the hat to the WoWCrack days of ‘W’ being the move forward key.  Experiments with other actions have failed.  My mind is hardwired to expect the W key to involve forward movement.
  • Keys ‘1’ and ‘2’ are devoted to consuming the best health and mana potions in my inventory. It’s easier to reach up in a hurry than to reach down, so I’ve moved potion hotkeys up and on the outer edge of what’s comfortable for the middle and ring fingers, as I don’t tend to use them often.
  • The tilde key `~` gets portal scrolls, so I can drop one without having to open my inventory. The key itself is difficult to get to in combat, which is perfect for when I drop a portal.
  • The `Q’ key gets the ‘Dervish’ spell, which given its 30 second cooldown, gets used infrequently. Often I save it for bosses to build charge fast so I can spam ‘Flame Hammer’. It’s easily accessible from the ring finger, and allocated based on the infrequency of use.
  • The ‘E’ key gets Onslaught, which is often used as an opener for new mobs to slow them down, followed by a Seismic Slam for the stun. Given that it debuffs boss mobs and helps speed up map traversal, I keep it very handy under the index finger.
  • The ‘D’ key gets ‘Seismic Slam’.  It’s directly under the ‘E’ key, see. so a typical opener is the index finger punching a very easy to reach key, then another directly below it. The stun lasts only 2 seconds, which is all the time I need for a circle of trash mobs, but as they come in waves, I like being able to successively spam this skill as new waves replace their fallen fiends.
  • The ‘A’ key gets ‘Ember Hammer’ which only really shines with a full charge, so I tend to let charge build on trash mobs before unleashing  it. As it takes some effort to gain enough charge to make this shine, but continues to deliver while I can keep that charge, it gets the resting-position of the ring-finger.
  • The right-mouse button gets Flame Hammer, which with a single charge point does some special damage.  Because it burns charge, I tend to save it for bosses and chunky trash mobs, but it’s so damn useful that if I have charge to waste, I’m happy to slap that puppy about with wild abandon.
  • The ‘S’ key gets ‘Ember Reach’. This is a single-point skill that I use purely to pick a caster out of a bunch of mobs, and mess it up before wading into the melee trash.
  • The ‘X’ key gets ‘Dynamo Field’, which is allocated only a single skill point. It’s deliberately weak so I pick up charge but minimise mob damage. The X key is not so easy to get to with the middle finger, and I only really ever use this skill when I’m out of charge, and there is a large number of trash mobs surrounding me. It’s too painful to use without lots of mobs, so it gets a key based on it’s infrequent use.
  • The ‘C’ key gets the ‘Healbot’. Given that it doesn’t need re-summoning often, it gets a harder-to-access key, but one that’s not too hard.  No healbot means no mana for this build, which means nothing but autoattacks.
  • The ‘R’ key gets ‘Force Field’, and is an easy key to reach from the index finger.  With the build chosen, Dawnshammer is only capable of the 2-hander melee mash when the force field is up.  If it drops in the later Veteran or Elite games, Dawnshammer very rapidly becomes pavement pizza.  I need it very easily assessable so I can re-apply it the moment the previous bubble fails.

The final key-bindings above were settled on with trial and error.  Skills I found myself spamming a lot gravitated closer to index and middle fingers with less frequent, not so important skills moving to harder to reach keys. And just so you know, the reasoning for why I settled on those skills with those keys came after I’d let instinct have its way with keyboard layout.

I don’t really have a spell rotation as such.  Generally speaking though, ‘Ember Hammer’ deals with trash when I have charge, otherwise its auto-attacks, or if I have a crowd of trash mobs, ‘Dynamo Field’ for fast recharge.

‘Flame Hammer’ deals with bigger threats, and really punches it when ‘Dervish’ is also active. I burn a charge point on a Flame Hammer, and let auto-attacks rapidly replace that charge point so I can spam it again.

Given that ‘Force Field’ is absolutely necessary for survival, all charge gets dumped into that the moment it goes down, so the build is heavy on building charge fast.

Engineering Archivable Torchlight 2 Characters

[Update: It’s been less than 24 hours since this post, and Runic have release patch 1.16. The patch allows me to play VonMalefic again (joy). Looks like it was more the game choking on a legitimate game file, rather than the file corruption I was afraid of.]

I’m in a painful place since the weekend, where patch 1.14 of Torchlight 2 caused a night of game crashes with my main character. Patch 1.15 came down the wire the next morning and bam, I can no longer even load the character without the game crashing.

Seem that this is a known issue on the forums (and here too). The toon has a full set of Mondon armour and Twitch (a legendary greatsword) that I spent quite a bit of time trading bits for to eventually complete.

Here is the toon VonMalefic, in a Steam screenshot I took jJust after the last piece of Mondon kit was added:

VonMalefic in better days

VonMalefic in better days

Now, I’m not pleased about game save-file corruption at any time, but at the peak of my obsession with a new computer game, it’s doubly painful.  It’s a software issue, and what does any self-respecting programmer do when he runs into a software issue?  They get all Bob-the-Builder on the issue!

Now, Steam is a great environment for ensuring off-site backups, but if a file gets corrupted, now I have an off-site backup of a corrupt file.  What I need is an archive of toon history that I can roll back to a “known-good point” with.  What’s the difference between a backup and an archive?  Well you see…. ahh screw it, here’s something that does a better job of nailing the difference between backups and archives better than I care to in this post.

My threadbare archiving solution?  I set up a Subversion repository on the machine, and write a very basic Perl script to automatically copy save-file games into the repository and take a snapshot.  My heart belongs to Git nowadays for file repository management, but last I checked it was still crap at binary files, so it’s Subversion all the way.

And finally, that threadbare script (I’m emulating the game using Wine under Ubuntu, which is why the directories look a little odd to Windows users):

#!/usr/bin/local/perl

package ArchiveTL2Toons;

use strict;

$ArchiveTLToons::SaveFileDir = "/home/linds/.wine/drive_c/users/linds/My Documents/My Games/Runic Games/Torchlight 2/save";
$ArchiveTLToons::ArchiveDir = "/home/linds/TL2ToonArchive/WorkingCopy";

sub copySaveFilesToArchive() {
  `cp -r \"$ArchiveTLToons::SaveFileDir\" $ArchiveTLToons::ArchiveDir`;
}

sub getNowTimestamp() {
 my ($sec, $min, $hr, $day, $mon, $year) = localtime;
 return sprintf("%04d-%02d-%02d %02d:%02d\n", 
       1900 + $year, $mon + 1, $day, $hr, $min);
}

sub snapshotArchive() {
 my $timestamp = &getNowTimestamp();
 my $cmd = "svn ci $ArchiveTLToons::ArchiveDir -m \"Commit of changes @ $timestamp\""; 
  #print $cmd;
  `$cmd`;
}

sub archiveTL2toons() {
  &copySaveFilesToArchive();
  &snapshotArchive();
}

&archiveTL2toons();

The script currently only handles character file changes easily. Any time I add or delete characters, I currently need to manually tell Subversion about the additions and deletions. Still, right now it gets me a very basic archiving solution, allowing me to recover from save-file corruption in the future.

On a final note, I’m conflicted on what to do now. I’ve lodged a support ticket with Runic in the (remote) hope that the save-file is somehow salvageable. I’ve resigned myself to that path being unlikely, so I’ve re-rolled Von. The replacement toon (Dawnshammer) will be more thoroughly Min-Maxed than Von, who bares the scars of my n00bishness with the game.

Still, Von wasn’t too bad all things considered, and entirely fit for the end-game grind. I’d rather have Von back over re-investing all that development/trading time with Dawnshammer. Fingers crossed Runic deliver some magic on this one.

Minecraft Sticky Pistons For Effective Boat Docking

I’m on holidays! Hooray.  To celebrate I’m going through a bunch of to-do things. Most not fun, but some (like this) quite enjoyable.

Recently, I’ve been taking my favourite Minecraft home and propelling it through new biome generation maps as the releases of Minecraft come thick and fast.  I’ve been meaning to get around to building a boat dock for the home, but haven’t been that fussed until a couple of ideas were posted on my youtube channel.  I was keen to try the ideas out, and the following tutorial/walkthrough video of how to make a simplified boat dock with sticky pistons resulted:

For some deeper thinking on why it looks the way it does, here’s the original post that this design is drawn from.

The texture pack used was SphaxPureBDCraft.