Portal 2 for Linux?

My it has been a while since I've last posted. My time is now dominated by work, and I have had little free time to work on all the little projects that I used to... However, I just had to make sure to allocate some time for Portal 2. And I'm glad I did; it's an AWESOME game! My favorite bit, though, was inside the steam directory, where there is a "portal2.sh" file. I understand that this file is primarily for Mac computers (they have Bash too), but I did find this interesting bit in this file:

#determine platform
UNAME=`uname`
if [ "$UNAME" == "Darwin" ]; then
# prepend our lib path to LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH="${GAMEROOT}"/bin:$DYLD_LIBRARY_PATH
elif [ "$UNAME" == "Linux" ]; then
# prepend our lib path to LD_LIBRARY_PATH
export LD_LIBRARY_PATH="${GAMEROOT}"/bin:$LD_LIBRARY_PATH
fi

if [ -z $GAMEEXE ]; then
if [ "$UNAME" == "Darwin" ]; then
GAMEEXE=portal2_osx
fi
fi

So their script will set up the library environment if run under Linux, but will not assign an executable, meaning that they had a mind to support Linux, but didn't compile the final binary. Hearing this after the whole "evidence of linux-based steam client found in Mac OSX client" thing from a year or so back just gets me excited. I know I'm probably just getting my hopes up, but it would be awesome to see Linux supported by arguably one of the best game studios out there.

BTW: Portal 2 was FANTASTIC. Play it if you haven't already. :)

Wallpaper Cycles in GNOME

GNOME has supported wallpaper cycles for a while now. I know that Ubuntu includes several of them in the default install. (Check them out; there's a Space image cycle, and a cycle for winners of a wallpaper contest.) However, if you want to make your own cycle, then you're SOL, cause there is no official GNOME editor for these wallpaper rotations. So I wrote a simple utility to make them:

#!/usr/bin/env python

import os, sys, datetime, random

# Configuration:
extensions = [ "jpg", "jpeg", "bmp", "gif", "png" ]
period = 5 * 60 # 5 minutes
transition = 5 # 5 seconds
starttime = datetime.datetime.today()
randomize = True


# Verify that we were given a filename:
if len(sys.argv) != 2:
print >>sys.stderr, "Please provide a destination filename."
exit(1)

# Select all images in the current directory:
imgs = filter(lambda x: x.split(".")[-1].lower() in extensions, os.listdir("."))

# Now, get all of their absolute paths:
imgs = map(os.path.abspath, imgs)

# Shuffle if needed:
if randomize: random.shuffle(imgs)

# Functions for writing the XML document:
def write_static(f, path):
global period
f.writelines([
"\t<static>\n",
"\t\t<duration>%d</duration>\n" % period,
"\t\t<file>%s</file>\n" % path,
"\t</static>\n"])

def write_transition(f, start, end):
global transition
f.writelines([
"\t<transition>\n",
"\t\t<duration>%d</duration>\n" % transition,
"\t\t<from>%s</from>\n" % start,
"\t\t<to>%s</to>\n" % end,
"\t</transition>\n"])

def write_header(f):
global starttime
f.writelines([
"<background>\n",
"\t<starttime>\n",
"\t\t<year>%d</year>\n" % starttime.year,
"\t\t<month>%d</month>\n" % starttime.month,
"\t\t<day>%d</day>\n" % starttime.day,
"\t\t<hour>%d</hour>\n" % starttime.hour,
"\t\t<minute>%d</minute>\n" % starttime.minute,
"\t\t<second>%d</second>\n" % starttime.second,
"\t</starttime>\n"])

def write_footer(f):
f.writelines(["</background>\n"])

# Open the file for writing:
f = open(sys.argv[1], "wb")

# Write the XML files:
write_header(f)
for i in xrange(len(imgs)):
write_static(f, imgs[i])
write_transition(f, imgs[i], imgs[i+1 if (i+1)!=len(imgs) else 0])
write_footer(f)

# Done!
f.close()

Usage:

./gen_wallpaper.py output.xml

The script will detect all images in the current directory, shuffle them, and write them into the output xml. You can then open that xml file in the background selection dialog (get the file dialog to show 'All Files') and your background will cycle through all of those pictures.

Have fun! I know this script has been pretty dang useful for me. :)

Humble Bundle 2

Just a quick advertisement: Humble Bundle #2 is out! This time around, they will be selling Braid, Cortex Command, Machinarium, Osmos, and Revenge of the Titans. Sadly, none of the devolopers have commited to releasing source (yet), but this bundle is still a great deal, and I do love supporting indie developers. Plus, I was already planning to get Osmos and Machinarium, so this bundle is still pretty awesome.

Oh, and once again, (as of time of posting) Linux users are the most generous contributers at an average of $14.10, Mac users are second with an average of $7.66, and Windows users are at the back of the pack with an average of $5.67. WOOO, GO LINUX! Developers, are you listening?

Oh, and I'm glad to hear that Jonathan Blow (the Braid developer) got around his problems with linux. :)

Ok, that's it, spammers.

Ok, so a new spammer has learned about this blog, and they're sending 5-10 spam comments per hour. Defensio is handling this crap like a champ (98.5% accuracy), but it's still incredibly annoying, since I go through all those comments to check for false positives...

Anyway, I've added Re-Captcha to the comments form. Comments that make it through that are still passed through defensio and moderation. Let's see you get through THAT spammers!

(This is in no way a challenge. Please don't try to get through that, spammers...)

TunnelTanks 0.4

Well, I've been pretty consistently working on TunnelTanks over the last two weeks, and I've actually gotten quite a bit done. Here's a summary of the changes, adapted from the CHANGELOG file:

  • Switched from a custom python script for configuration to a CMake/CPack-based build/packaging system, which can build binary tar.bz2's, deb's, and rpm's.
  • Improved Twitch's self-preservation instincts. He is now smart enough to try to return home when he is low on energy/health. ('Try' being the operative word. He can get stuck on level details...)
  • All code is now managed by the Bazaar VCS.
  • Made it possible for there to be multiple level generators, and added 2 new ones: 'simple' and 'maze'. The original one is named 'toast'. Better name coming soon. :)
  • Added fullscreen capabilities. Just run tunneltanks with "--fullscreen" to start that way, or hit 'F10' at any point to toggle into fullscreen.
  • Added a means for an AI to query the surrounding level. Twitch makes very basic use of this functionality, but it'll be far more useful for more complex AIs.
  • With the '--large' CLA, you can have the level generators make even BIGGER maps. (1500x750 vs 1000x500, which is 2.25x more pixels!)
  • Improved command-line parsing. Just run with "--help" to see all the new options.
  • Many other bugfixes.

There's a lot of new stuff there, but my favorite is the ability to add new level generators. Here are some sample levels from the current set of built-in level generators:

This is a sample 'simple' maze:

Sample simple maze

This maze started out as a way to accurately mimic the level style of the original game, since the original game will generate a rock wall sort-of like this, and then sprinkle the outer border with random rock outcroppings. Sadly, all attempts to reasonably capture this style fell short, so I instead worked mostly on generating the rock border, so that the original game's "fight in the middle" mechanic could at least be preserved. Sadly, it'd be difficult to perfectly replicate the original game's level generator without the original game's source code, since it has lots of quirks that are unique to it...

The second maze generator is the 'maze' generator. This was probably the most fun level generator to work on. :)

Sample maze map

The maze generator uses a Randomized DFS maze-generator, or as it's called on http://www.astrolog.org/labyrnth/algrithm.htm, the "Recursive Backtracker." It's fast, it's effective, and I really like the mazes that it generates. And also, check that page out. That guy is a huge maze fan, and he really knows his maze generating techniques. Interesting read... :)

And of course, we still have the 'toast' generator.

Sample toast map

I only called that generator 'toast' since I couldn't think of a better name. If you have a better name, do feel free to tell me. :)

That's about it. I am now keeping info on the project, including instructions on how to clone the Bazaar repository at: http://www.poweredbytoast.com/tunneltanks

Since I changed to CMake, the build instructions have also changed to:

cmake . && make && ./tunneltanks

If you wish to install this project, you COULD do a 'make install', but it'd be far cooler to use the new packaging targets. For example, do a 'make package-deb' to make a deb file, that can be installed through your package manager. (You can also do 'make package-tbz2' for binary tarballs, or 'make package-rpm' for an rpm file.)

Source: http://www.poweredbytoast.com/files/tunneltanks-0.4.tar.bz2 (GPLv3)

Enjoy! ;)

 1 2 3 … 13 Next →

About

User