Showing posts with label games. Show all posts
Showing posts with label games. Show all posts

Sunday, June 2, 2013

Minecraft Exploding Sheep Java Bukkit Server Mod

Among other various and sundry things I've been working on, Java has been one.  If you haven't learned, it you should probably pick it up at some point.  Along with Python, C, Perl, C++, C#, PHP and other flavors of the day.

I picked this particular language as it's been very popular, has lots of community support and lots of plugins, and tools available to help you write code.  I use some of the Eclipse Java Development tools and it almost feels like my program gets written for me.  That's a post for another day.

This is just a short shameless promotion for my Minecraft Bukkit Server mod, Exploding Sheep.  Currently, it just makes sheep explode when you shear them.  I'll be adding explosion adjustment configuration and and sheep wool color configuration.  I've also had Feature request include exploding pigs, when shot with arrows.

The main point was to start an open source project in Java and using the Bukkit API seemed like a fun way to do a real Java project.  It's a dipping my toe in the water of open source so to speak.  Source is available on github, it's pretty simple so far, an event handler and some initialization.  I'll be accepting patches and updates and exploring some of the more esoteric features of github.

Be the envy of all the other servers, install the Exploding Sheep Mod today!

Monday, April 4, 2011

Using regex on a Drupal RSS Feed

A brief intro on regex

regex or "Regular Expressions" are used just about everywhere. When you do a search on google, you are using a form of regular expression. When you do a find in a document, you are also using a form of regular expression.
What is a regular expression, for the un-initiated? Simply put, a regular expression is a way to write a concise definition that matches characters, words, and pattern in strings of text and documents. I won't go into a tutorial about "regex" - pronounced "rej-ex", you can read up about it at Wikipedia if you want to know more.

Testing your expressions

I've used regex for many years and many forms, and I've always struggled with it. It's kind of obtuse, and I've seen regular expressions, for verifying a valid e-mail address, that are hundreds of charachters long. It can get really complicate really quickly. In experimenting with using Regex as a parser in the Drupal Feed Importer stack, I ran across a very awesome tool that allows you to test out your regular expressions. It's RegExr at gskinner.com, and it's one of the best regex testing tools I've found. It even shows you your grouping matches, does multiline, and lots of other neat stuff.

Install Drupal Modules

To use regex on a news feed import in drupal, you'll first need the Feeds Module. This module allows you to import news feed items and elements into drupal nodes. Next you'll need the Feeds Regex Parser. This little module is great if you have a news feed that doesn't have the field parsed out all nice for you. In my case, I had a long address in one string and I need to pull the street address, city and state out. With the Feeds Regex Parser, you can import pieces from pattern matches using groupings.
For example, say I have a news feed that looks something like this:
<feed>
<item>
<address>123 Anystreet, Yourtown, CA</address>
</item>
<item>
<address>234 Anotherstreed, Anothertown, MI</address>
</item>
</feed>
And I want to pull out the address part of this without the town and state, and make it the title of the node I create from the feed.

Add New News Feed Importer

First create a new feed in Administer->Site Building->Feed Importers.
Give the feed a name and a description, then set up the feed on this screen:

Click on the basic settings and make sure you have the content type set as "Use standalone form" and that the Minmum refresh period is "Never". You can change the refresh period to your liking once it's all tested and working.

The fetcher should default to "HTTP Fetcher", so you don't need to make any changes here.
Next click change next to parser, then click "Select" next to the Regex Parser entry:

Once you've chosen the regex parser you can move on to the node processor settings, since the regex parser doesn't have any settings. Pick the content type you want to create with each feed item. I have chosen page, but if you choose feed, or feed item, your post will get created as part of an individual feed that has multiple nodes. I just want one page with no attachments, per news feed item, so I have chosen content type of "Page".

You can of course flavor the above to taste. Next is creating your mapping, which is pretty simple. You just select the only choice from the pulldown on the left, then select the field you want to load it into. Create as many entries as you need. We only need to pull the street address, so we'll create one.
We also need a unique identifier for this item, so we don't keep creating a new document every time we see it in the news feed. I'm using GUID. Notice I've checked the box on the GUID line to make it my unique target after I added it.

Import Your Data

You're almost there. Next you click on the top level menu item "Import", then click on the name of the importer you created. You can now enter your regular expressions. I've over simplified mine, and these most definately could be better in terms of construction, but I'm not here to discuss elegant regex writing. What I want to demonstrate below, is that your context, is your "Record Context", i.e. in what context will all of your record chopping regex occur?
So in the example below, my context shows <item></item> and then I am free to parse out my fields below that.
Lastly, enter the URL for your feed, then hit the import button and you are good to go!!
Anything that is specified in your grouping (In between the parenthesis) will be loaded into the field you specified in your mapping.

Caveats and Patch

You can use preg_match_all switches below, but I was not able to get them to work as expected. Also you can only have one group so a regex like the following won't work:
/$(.*),(.*)/
It will take whatever is in the first group.
I did write a small patch that concantenates the groups into one string for loading
In the FeedsREGEXParser.inc file in the module. Modify the following:
if (isset($matches[1])) {
return $matches[1];
} else {
return $matches[0];
}
}
To Be:
if (isset($matches[1])) {
$retval = "";
for ( $i = 1; $i < count($matches); $i++ ) {
$retval .= $matches[$i];
}
return $retval;
/* return $matches[1]; */
} else {
return $matches[0];
}
}
I'll submit this patch to the creator of the module for possible future inclussion, but in the meantime, it can help you strip comma's out of numbers and the like. So for example, something like:
/\$(.*),(.*)/
When applied to a string of "$100,000"
Will result in the number:
100000
Which can then be happily loaded into any numeric field.
-MT

Friday, April 9, 2010

Star Trek Online, How to NOT get it working in Linux (Ubuntu)

Well, I wanted to make a short post as I thought I had it working using the method below. When the screen came up to the initial game after I installed, logged in, updated, etc. The Video was scrambled.

Since then I have been hopelessly lost down a road of re-installs and Wine Internet Explorer madness. I won't bore you with details, but just wanted to follow up to my last article and let anyone know that, the guy in the Video made it look, Sooooo.... Easy, nothing about the extra bits and bobs that you might need or that he was using, anyway, suffice to say, I'm still dual booting to get my Kling-On, but I did manage to get Team Fortress 2 working on Ubuntu, but that's another story, I'm going to hit the waves for a bit while I wait for the Excel, Visual Basic, ODBC Macro monstrosity I have written is finished before it's off to the world of Cut, Paste and Glue!

I also saw someone comment about how my later articles were better than my earlier ones, and you know, it's because I'm better too, but that's REALLY, another story, until then Geek on, and I'll see you in space you squishy Federation types :p

Thursday, April 8, 2010

Star Trek Online, How to get it working in Linux (Ubuntu)

OK I haven't posted in awhile, but this will be my geekiest post to date. Not only do I talk about Star Trek, I talk about a Star Trek game, not only is it a game, it's an online game, a massively multi-player, online game (MMO). Now if that weren't geeky enough, at the end of this post I'm going to provide links that will allow you to install Star Trek Online under Linux. So if you are not already having spasms of geek joy just thinking about playing your geeky game about your geeky TV show with other geeks on the Internet on the geekiest (and most user friendly, ahem!) operating system on the planet, then read on.

I've really been enjoying this game, it's very cool to get my Kling-On :p. So far PvP as a Klingon is the best part of the game. There's a mission called "A Good Day To Die" where the object is to be killed 50 times in PvP. The only drawback with PvP'ing is that PvP is the primary way for a Klingon to level, Federation types have all types of missions they can run to level up and get good loot. It also means Federation types are soft and squishy. They don't PvP much, whereas the Klingons pretty much have to PvP to level or get any good loot. The alternative for Klingons is to grind exploration missions. I think once more content is added for Klingons, they will become less the PvP elite that they are now and it will balance out a bit. Still though, Klingon vs. Federation at the moment is pretty much a game of burn down the noob, hehe.

So on with how to get this sucker installed on Linux (Ubuntu Hardy Heron w/ Upgrades was what I installed on). First I tried to install this under VMWare. Even with the latest release and much gnashing of Teeth, no go. Next I tried VirtualBox. I really liked VirtualBox and I think I will move to it for my personal use of things like GotoMeeting, etc. Things I have to run I have to have Windoze for. Anyway, VirtualBox had a problem, even though I had read people had gotten it to work. Of those who reported it to to work it worked very slow.

In comes Wine, yeah Wine. The difference between Wine and VMWare or VirtualBox, is that VMWare and VirtualBox, at their base are hardware emulators. They emulate a virtual piece of hardware, that any operating system can be installed on. Wine on the other hand is an API that interfaces Windows applications to the Linux OS. It's more of a bridge than an emulator. That being said. I found this nifty YouTube Video where this clever chap shows step by step how to install it.

The application he's using is PlayOnLinux, which helps you install your Windoze games on Linux. It can be downloaded from http://www.playonlinux.com

You'll also want to install the PlayOnLinux plugin POL Helper (Also in the video)

Instructions for that can be found in the following thread:

http://www.playonlinux.com/en/topic-2415-Plugin_POL_Helper.html

So my friends, sit back, relax, and geek out!

Tuesday, December 11, 2007

Mr. T, William Shatner, Verne Troyer (coming soon), It's World of Warcraft!!

First the South Park tie in, now popular celebs stumping for the game. They've got some sharp marketing people over there at Blizzard. I love the Mr. T Spot. Gonna get me some Night Elf Mohawk.... Fool!!




Not to be outdone, one of my heros, old Mr. overacting himself, you know what to do dog!



They've also got Jean-Claude Van Damme in a French commercial



And for the Spanish speaking set there's Willy Toledo



And because Mr. T is the man *smirk* Here's a word from Snickers

Sunday, December 2, 2007

ATI, Ubuntu Gutsy , Compiz, BigDesktop - Beautiful :)

Even in 2D mode without Compiz, Ubuntu Linux with Big Desktop is the shiznit. Turn on Compiz and it's a desktop experience that makes is a pleasure to sit at the computer.

So far I've gotten the following goodness working on Ubuntu:
World of Warcraft
Team Fortress 2 (w/ voice coms)
Eve Online (Although I'm still trying to figure out how to get the sound to share)

The key things to watch out for when configuring games is that wine and some of the older Linux audio applications will us oss and/or talk to the sound card directly and not be nice and share.

I couple of options exist to share the sound hardware.

aoss, esd and arts. For me arts has worked the best, I haven't tried esd and I got static with aoss.

To start arts, first start the server by doing the following:

$ artsd -d &

The -d tells it to go full duplex so you can use voice comm applications.

Then do:

$ artsdsp TeamSpeak

or

$ artsdsp wine WoW.exe

Other than that, but "ubuntu" before your searches and there are lots of awesome folks in the Ubuntu community that have been there and documented what they have done to get it to all work.

I have been having a few issues with the ATI card and BigDesktop w/ 3D Acceleration, but on the whole I've been very happy with my new install. You can get the nitty gritty of it on the Ubuntu forums at http://ubuntuforums.org/showthread.php?p=3882866#post3882866

Enjoy and have a nice big cup of Ubuntu!!

Saturday, December 1, 2007

World of Warcraft on Ubuntu Gutsy w/ Teamspeak (and Music)

So I've gone upgrade crazy. I've got the Latest Ubuntu Gutsy Gabon (7.10) installed. And I got all my doo-dads working as well.

First off, I found the most useful walk-throughs on answers by prefacing my searches with "Ubuntu"

For example "ubuntu warcraft install howto" on google did wonders. Lots of good advice, etc.

In a nutshell the procedure is

1. Install wine on Ubuntu
2. Get the WOW download or copy the contents of all 4 install CD's into a single directory.
3. enter "wine Installer.exe"

There are many other details depending on your video card, etc. but probably the most useful notes are as follows:

1. Wine will try to "own" the audio device. So only one program at a time when running under wine will have audio. The solution to this is to use either aoss or arts on Ubuntu.

With aoss you do something like:

aoss wine wow.exe
aoss TeamSpeak # the linux binary

I found aoss to be not so good and had static when using TeamSpeak.

I personally use arts. You start up artsd first (the daemon) as follows:

artsd -d

The -d puts it in full duplex mode so you can use your mic.

Then start your applications like aoss, i.e.

artsdsp wine wow.exe
artsdsp TeamSpeak
artsdsp rythmbox

Anything that uses audio in wine or any linux programs that use oss audio need to use either aoss or arts if you want to run more than one program with audio output at a time.

Enjoy...

Monday, November 12, 2007

Team Fortress 2, Good FPS Fun

In my off time, I enjoy playing a game or two. Single players are OK, but when it comes to pure gaming satisfaction, multi-player games are the stuff. When you play against a computer there is always some pattern, that when figured out, enables easy wins. When playing against a human opponent, you never know what they'll do. It makes for a richer gaming experience, In my opinion, and there is a small visceral satisfaction in knowing there's someone on the other end of that missile you just fired going, "Dammit, he just shot me!".

I've been a big fan of the EA Battlefield series for some time and have been liking Battlefield 2142, but just found a new FPS (First Person Shooter) that has great gameplay, an abundance of servers and terrific player vs. player action. It's one of the only video games that plays just like it's trailers. With alot of games you watch the trailers get excited about it, then the game itself comes nowhere close to the hype of the trailer. With Team Fortress 2, the games plays like the trailer. You don't just blow people up, you blow the hell out of them. When using a flamethrower you don't just set people on fire, you burn them down!

I'm including a couple screenshots from some recent gameplay and be sure to check out the site at The Orange Box Site

These are shots of a couple of guys that got their just rewards after filling me full of lead. The game gives you the opportunity to take a screen shot of the avatar of the person that just killed you. Here are a couple

Saturday, August 4, 2007

Fix Disconnect Problems on Battlefield 2142

For those of you that don't know, Battlefield 2142 is one of my Favorite FPS (First Person Shooter) games. It's a multi-player futuristic shoot-em-up that is the third generation of the original Battlefield 1942. If you like FPS games at all, this is one of the top of the line games.
Although the game has worked flawlessly for me, a couple of different people have reported problems with being randomly disconnected from games both with and without messages from Punkbuster.

These things have worked for some people and if you are having problems with disconnects when you play BF2142 try these links first.

For Punkbuster Kicks

For Disconnects

If that doesn't work you can try to uninstall Windows update KB917422 by going to Add/Remove Programs in Control Panel, checking the show updates box, and removing KB917422. Do so at your own risk.

See you on the Battlefield

Monday, July 30, 2007

Get rid of the annoying beeping when playing games on Windows XP


My machine recently started beeping when pressing multiple keys on the keyboard.

As I understand it, the Windows keyboard buffer is filling up and it's giving me a system beep sound. My games function properly, I just get this annoying beep when I try to hold a key or a key combination found.

I saw some solutions like trying to increase the buffer size in the registry, but the one I opted for was to go to Control Panel->System->Hardware->Device Manager

Then select View->Show Hidden Devices

Then in non-plug and play devices, right click on beep and then disable.

After you re-boot, the beep is gone!!