Monday, October 29, 2012

Random Steam Demos

Periodically I remember to browse the demos section on Steam and see what's available.  Here's a post listing a few games I've tried, my thoughts on them, and perhaps the most important question answered: do I feel it's worth the purchase price?

Castle Crashers
The ultra-popular XBLA game made its debut on Steam recently, and since The Behemoth was kind enough to provide a demo, I gave it a try.

Just on the off-chance that you've been living under a rock and haven't heard of Castle Crashers, it's a medieval-themed 2D sidescrolling beat-em-up for up to four players where you beat the bad guys to rescue the princesses, and then in multiplayer you fight each other for their affection.  It sports a lot of available weapons and four stat tracks to spend those precious level-up points in.  The only down-side to the demo is that it ends halfway through the boss fight at the end of the second stage.  It doesn't even have the decency to let you finish it and then say "that's it for the demo!"...

This is a case of a game that I've already played a bunch of over at friends' places and thus already know it's good.  From what I've seen in the demo, the PC version seems to be a pretty solid port, with nothing notably different in the available content.  It also has the Pink Knight and Blacksmith DLCs available for $0.99 each.  Worth the $14.99 on Steam?  Ehhhh...  I'll wait for a sale.

Fairy Bloom Freesia
Essentially a 3D sidescrolling beat-em-up, it stars a fairy named Freesia who is trying to defend her forest from monsters and humans that want to obtain the spirit stones that provide life energy to the forest.  The demo is a quick five stages, really just enough to get your feet wet.  You learn the basics, have the opportunity to play with buying moves and stat upgrades, learn the mechanics, etc., and it ends with a boss battle.  After the boss battle, the demo ends.  It sports a mechanic that anyone who's played Contra will be used to, namely down+jump to drop down from a platform.  It also borrows a fair number of mechanics from 2D fighters, like double jumping, air dashing, recoveries, and just defense.

Overall, the music is decent, the graphics are great, and the gameplay is solid.  The demo crashed on me a bit as I was trying to set it up (configuring resolution options), but once everything was set I had no stability issues.  Worth the $7.99 on Steam?  Sure.

Hell Yeah! Wrath of the Dead Rabbit
This is a crazy 2D action platformer starring Ash, a devil rabbit who is also the prince of Hell.  Apparently someone posted "secret intimate photos" of him on the Hell-ternet, and now he's pissed.  All the premise anyone really needs for a platformer where you go around killing everything.  Along the way you build up an arsenal of weapons.  Unfortunately, the demo ends abruptly just before the boss fight in the first area.

The music works quite well, the graphics are great, and the controls are solid.  The game does crash if you try to force it to run a display resolution it doesn't present to you in the graphics settings, though.  I was trying to get it to run at 1440x900, which it doesn't provide an option for.  Set it via the config file, and it re-sets itself to 1280x800 on startup.  So I exited, changed it back, and then made the file read-only, only to have it crash.  Oh well.  The game has two DLCs on Steam, a skin pack for $2.99 and a pack of extra missions for $5.49.  The game itself is $14.99 on Steam.  Worth it?  Just like with Castle Crashers, I'll wait for a sale.

Bang Bang Racing
This is a 3D top-down racing game.  From the looks of things there's a decent variety of cars and tracks to choose from.  The demo limits you to Free Play mode, which is fine, but then it gives you the whole "buy the full version!" marketing spiel after every race.  I'd be fine if it just did it on exit, but after every race?  Anyway.

Aside from the sounds being a bit loud by default, and the all-too-apparent presence of rubberbanding, there isn't much to gripe about.  The game's description mentions "technical driving skills" as one of its focuses, but with the rubberbanding in place, it doesn't matter how bad you screw up, all the AI cars will be waiting for you a little bit down the road.

As far as gameplay goes, it's on the full arcade side of things.  Akin to F-Zero, you simply need to make a quick pass through the pit lane to repair your car and refill your nitro.  You can drift a bit by pressing the brakes while turning with the accelerator pressed, but I found that the tighter corners were a lot easier to handle if I did the regular "slow down, take the corner, acclerate out" thing.  Again, due to the rubberbanding, I was never able to open a commanding lead and have a buffer for the occasional messed up corner, the AI is always right there as soon as you screw up.

Aside from rubberbanding complaints, the game supports up to 4 human players and you can turn off the AI cars, so there's hope in that form.  However, you really shouldn't have to do that just to get around the rubberbanding.  There should be a toggle for the rubberbanding.  The game itself is pretty fun, there are hazards to avoid like oil barrels, water buckets, and more.  It could use an option to turn the hazards off, as a good number of them are placed directly on the racing line.

Overall, it's fun, and the graphics are good, but it's plagued with issues that make me not really want the full game.  Definitely not worth the $9.99 on Steam.

Seriously though, is it really that hard to make a good non-sim racing game?

Saturday, October 27, 2012

Real Myst

Real Myst, or realMYST, or realMyst depending on where on the internet you read the name, is a modern re-make of the classic exploration puzzle game, Myst.

The game is available for $5.99 on both and Steam.

Friday, October 19, 2012

Minecraft Server Stuff

A friend of mine expressed desire for me to start up my Minecraft server again, so I generated a fresh (seeded) world on 1.3.2 and it's up once more.

I like to make little PHP scripts to output information about the server, like whether it's up or down, who's whitelisted, and various server options.  I figured this time around I'd implement a "last seen" feature that would tell you if someone on the whitelist had ever been on the server, when they last logged off, or if they're currently on.

I sat down with PHP and victory was had, but not without some shell script shenanigans with PHP's shell_exec() function.

Basically, the core of "last seen" functionality involves reading the server log looking for the most recent connection and disconnection notices for a given player, and comparing the timestamps to see if they're currently online.  In bash shell script, this is balls easy to do:
#!/bin/bash MINECRAFT_SERVER_LOG="/path/to/minecraft/server.log" LOGOFF_TIME=`grep -Pi "^.{19} \[INFO\] $1 lost connection" "$MINECRAFT_SERVER_LOG" | tail -n1 | sed -r 's/^(.{19}).*$/\1/'` LOGON_TIME=`grep -Pi "^.{19} \[INFO\] $1\[/[^]]+\] logged in" "$MINECRAFT_SERVER_LOG" | tail -n1 | sed -r 's/^(.{19}).*$/\1/'` if [ "$LOGON_TIME" = "" ]; then echo "Never" else if [ "$LOGON_TIME" '>' "$LOGOFF_TIME" ]; then echo "Online now" else echo "$LOGOFF_TIME" fi fi
Usage, if you save it as, would be ./ PLAYER_NAME

However, I'm working with PHP, not bash shell script.  Originally, I tried to dynamically generate a shell command to pass to shell_exec(), but a) it never worked right, and b) it ended up being more complex than I originally thought.  I was originally just getting each user's last logoff time, neglecting the fact that they could be presently on the server.

The "solution" was to copy/paste my shell script I was trying to shell_exec() into an external file and chmod +x the fucker.  Then my shell_exec() call became simply running that shell script with the name of the player on the command line.  It works, but using shell_exec()... yeah...

However, the functionality for grep (preg_grep()) and what I'm using sed for (preg_replace()) basically already exists in PHP.  While I'm a fan of writing things in the languages that make them the easiest to write, the result looks rather cobbled together and tends to break when you think about portability.  All PHP really needs is a native implementation of tail -n and we're good.

Which it doesn't have.  My next step was to sift through Google search results and see if anything of use popped up.

Initially, all I could find were tail -f implementations.  That allows live monitoring of a log file, which admittedly can be useful, but wasn't what I needed.  I just need one stinkin' line out of the file.  After sifting through the results, I noticed that one of them was indeed an implementation of tail -n.  However, it didn't operate in the way I needed it to.  Instead of taking in data and returning the last few lines of it, it required the data to be in a file.  Being that I'm passing the file through grep first, it wouldn't work.

Then I derped and realized that it's way easier than I thought.  If you read in the complete file with the file() function, you get an array of strings where every string is a single line of the file.  preg_grep() operates on an array.  So, basically, all I needed to do was this:
function tail( $data, $lines = 10 ) {return array_slice( $data, count( $data ) - $lines, $lines ); }
*nix tail defaults to returning 10 lines, so that's why the $lines parameter has a default value.  Even though I only need it to return one line.  The solution could actually get simpler still, but I'm leaving it this way.  preg_grep() leaves the array indices the way they were, but array_slice() renumbers them and makes dealing with the result a lot easier.

So if you need a PHP tail -n implementation and you're reading a file in via file(), just use array_slice() to get the lines you need.

All in all, I ended up with this:
function tail( $data, $lines = 10 ) {return array_slice( $data, count( $data ) - $lines, $lines ); } // getting the timestamp of the most recent line in the server.log that matches a given regex // $BASE_DIRECTORY is the absolute path of directory containing minecraft-server.jar, slash-terminated // $SERVER_LOG is the Minecraft server log, read in via file() // Reading the server log only once per request makes a lot more sense than reading it once for every person on the whitelist. function get_timestamp( $regex ) {global $BASE_DIRECTORY, $SERVER_LOG; $ret = preg_replace( "/^(.{19}).*$/", "$1", tail( preg_grep( $regex, file( $BASE_DIRECTORY . 'server.log' ) ), 1 ) ); return @$ret[0]; } function get_last_seen( $username ) {$logoff_time = get_timestamp( "/^.{19} \[INFO\] " . $username . " lost connection/i" ); $logon_time = get_timestamp( "/^.{19} \[INFO\] " . $username . "\[\/[^]]+\] logged in/i" ); if ( $logon_time == '' ) // user has never logged on return 'Never'; else {$cmp = strcmp( $logoff_time, $logon_time ); if ( $cmp < 0 ) // logon time is greater than logoff time (user is on now) return 'Online now'; elseif( $cmp > 0 ) // logoff time is greater than logon time (user has logged off) return $logoff_time; else // mystery case return 'Mystery case!'; } }
Two things:  First, the reason that calling strcmp() on the two timestamps actually works to see which one is more recent is entirely due to the timestamp format that the Minecraft server uses.  It orders the fields from least-updated to most-updated, which means that to strcmp(), a more recent date is always going to be "bigger".  Second, that line in get_timestamp(), return @$ret[0];...  The @ is a PHP operator that suppresses error output.  PHP bitches about that line, saying "invalid index", yet, all of my debug output shows a one-element array with the sole element having an index of 0, and if the error output is suppressed, it works properly.  I'm not sure exactly what PHP has stuck up its ass, but it needs to remove it.

Also, yes, technically speaking, the mystery case can be triggered.  The user's logon time has to be equal to their logoff time.  That's fairly difficult to achieve with Minecraft, since the server considers you logged in before you're even able to bring up the menu and hit disconnect.  Hence why I'm not actually bothering to write code to handle it.

Friday, October 5, 2012

Black Mesa

This is the Source mod that everyone's been spooging about lately.  It's basically a fan-made recreation of Half-Life 1 in the Source engine.  When I heard of it, the first thing that came to my mind was "don't we already have Half-Life: Source?"

I'm still confused as to why Black Mesa needs to exist, but regardless, it does, and I've played a bit of it.  It's not a huge priority since I've beaten Half-Life 1, but... yeah.

There are two things that I welcome over Half-Life 1's engine: you can jump while running downhill now, and there's a "quick weapon swap" setting in the options.  'Bout fuckin' time.  No more having to click to select a weapon, just scroll to it or press the key just like any other FPS ever.

Using the Source engine carries a fairly hefty hard drive footprint, which means I probably won't keep it around forever.  I'll probably keep it until it's actually downloadable through Steam.  Also, you get the HEV suit zoom feature that Half-Life 2 has, which is cool.

Unfortunately, ammo and health are scarce, and it seems like you can't use the Source engine physics to your advantage.  I got to a part where in HL1 I had to push a few crates into the water to jump on them, but in Black Mesa all the crates in the area are destructible and don't hold up very well.  Barring that, I tried to use the barnacles on the ceiling to get out of the water and continue on, but that proved to be impossible.  So basically I'm stuck in the water, unable to get out on either side.  So there are definitely some level design issues.

And that's all I've played of it.  Via the Source engine it does fix some of my gripes from HL1, but... while it's good, I don't really see the need to get all hyped about it.

Half-Life, Blue Shift, and Opposing Force

I grabbed the Half-Life Complete Pack during the Steam summer sale and decided I'd play Half-Life and the two side stories, Blue Shift and Opposing Force.  This post is in effect three reviews in one.


I could have played Half-Life: Source, but the Source engine carries a hefty hard drive footprint, and the original has a much smaller install size.  So I played the original instead.

This is where it all begins.  This is the Black Mesa incident referenced by the sequel.  Basically, Gordon Freeman and his team of scientists accidentally open a portal to another dimension and all kinds of weird aliens are now able to enter our world.  It's up to Gordon to kill them all, as well as the military who have decided to eradicate both the aliens and everyone who works at Black Mesa.

Overarching gameplay consists of working your way from the surface to a point deep within the Black Mesa facility, experiencing an event or fighting a large battle, then working your way back to the surface and repeating.  Once you've done that enough, you get to go through the portal to Xen, where the aliens came from, and this is where the end of the game takes place.

The final boss is a bit counter-intuitive to what you've been taught as you progress through the game.  Any other time there's something big, you either avoid it or there's an environmental method of taking it out.  But here, you just fill it with bullets after taking out the crystals on the walls that give it firepower.

Blue Shift

This is a side story that follows a security officer through the events of the Black Mesa incident.  You mostly run around rescuing scientists and occasionally receiving assistance from other security officers.

Overarching gameplay is more of the same, go down, go up, repeat.

However, here you're suffering from two constant crises: ammo and health.  I never had quite enough of either to feel secure.

Opposing Force

In this side story, you're a soldier in the military, sent to Black Mesa to kill everything that moves.  Except you seem to be less of a heartless asshole than all the soldiers that Gordon and our security officer encountered, so you actually end up helping a fair number of them.

The "go deep within Black Mesa, go back to the surface, repeat" thing is in full force here as well.

Just like with Blue Shift, you're suffering from the same two constant crises.  At one point I started to actually feel good about ammo, but then I had to use a bunch of it.

High point: getting a barnacle to use as a weapon and grappling hook.

Common Points
  • Graphics are notably dated, but not bad.
  • Everything feels slippery because you don't stop when you release movement buttons like in a normal FPS.
  • Switching weapons is incredibly awkward because you have to click to select the weapon.  In a normal FPS, you scroll to it with your scroll wheel or press the number key and that's it, you're changed over.
  • Some jumps are irritating because they're ever so slightly taller than your regular jump, so you have to do a weird crouch-jump thing to jump up onto a crate and get where you need to go.
  • Can't jump while running downhill, either that or it's very difficult and incredibly timing-dependent.
Specific points relating to Blue Shift and Opposing Force
  • These side stories were developed by Gearbox, not Valve.  Which probably explains why they feel kind of weird, and don't seem to have the same production values.
  • At least with Valve games, if there's a big enemy there's going to be a reasonably large open area to fight it in.  None of this "close quarters combat with an enemy that can take you from full health to dead in two or three hits" crap.
  • You often see scenes, hear audio, or visit locations from the main game.  That's how they tried to tie it in and drive home the fact that Blue Shift and Opposing Force take place simultaneously with respect to each other and Half-Life.

Half-Life is worth playing.  Blue Shift and Opposing Force, not so much.