Skip to content

Using Wireshark to Determine Bandwidth Use

For a game I am improving, I needed to improve the efficiency of communications between the client and server.  To benchmark my results, I used Wireshark to compute the total bandwidth used over a period of time, then looked at the statistics.

First, I started a capture with the filter “host <IP_OF_INTEREST>”, and then started playing the game.  After I had enough data, I stopped the capture and added a port filter, because there was some background traffic going on between the source computer and the server it was connected to which was not relevant to the protocol I was looking at, so I filtered the display with “tcp.port eq <PORT_A> or tcp.port eq <PORT_B>”.  This showed only the packets on the two ports I was interested in.

Finally, I wanted to view an overview of the statistics.  So I clicked on Statistics->Summary, and it showed me a summary of the data which was captured, as well as a summary of just the data being displayed.

References:
http://wiki.wireshark.org/DisplayFilters
http://sysadminhell.blogspot.com/2008/04/using-wireshark-to-determine-bandwidth.html

GIMP: Create Animation from Spritesheet

At work, we often keep game artwork in spritesheets. Our games can read these and split them up into frames to use and display, but sometimes I like to goof around and make animated GIFs from these spritesheets.

I searched around and couldn’t find a simple GIMP plug-in to split apart spritesheet frames into separate layers, so I attempted to use the poorly-documented (perhaps I am not searching for the proper terms when looking for exhaustive documentation?) library of functions that GIMP has and write my own Scheme script to accomplish this task.  You can download it here:

Animation From Spritesheet

To install, place it in

<GIMP_INSTALLATION>/share/gimp/2.0/scripts/

and reload GIMP.

Please note that I do not believe I wrote this plug-in very well. It was thrown together in about an hour, and it only supports sprite sheets where the frames are placed horizontally. Let me know if you found it useful or make any improvements!

Batch Shell Execution

Back when I was too lazy to use a search engine to learn how to write shell scripts, I would write PHP scripts to do trivial things like execute the same program with each file in a directory as a parameter.  Here is how I did it today, after looking up shell scripting.

for i in `ls`; do convert $i -crop '90x1440-0+0' $i; done;

Additionally, I had a bunch of similarly named files in svn that I wanted to rename.  So I used the following command:

for i in {1..8}; do svn rename "image$1.png" "The_Image_$1.png"; done;

References:
A Bourne shell script that loops through all files
Bash For Loop Examples

SSH Connection Closes after MOTD

I had been having a strange issue when connecting to a remote server over SSH using public key authentication.  I could log in — I know I was logged in because it displayed the MOTD — but immediately afterward the connection would be closed.

It turns out that when my user account was created, the person doing it forgot to specify a shell for me.  This problem turned out to have an easy solution, just specify a shell for my account.  I told the administrator to run this command:

usermod -s /bin/bash my_username

Presto! I had access.

Thanks to linuxquestions.org for providing the solution.

VerifyError: Error #1079: Native methods are not allowed in loaded code.

I remember seeing this error when I first started working with Actionscript and FlashDevelop:

VerifyError: Error #1079: Native methods are not allowed in loaded code.

I just experienced it again, and am writing this blog post to explain how I resolved it, as the results I found on the Internet had not been helpful last time around.

The solution?  One of two things.  Probably is the first:

  1. You are building code with two different versions of Flex.  Use the same one throughout your workflow!
  2. You have an outdated playerglobal being linked in.  Remove it!

Monster RPG 2

Monster 2

The title screen to Monster RPG 2.

This is a review I wrote for the iPhone/iPod Touch/iPad game Monster RPG 2, developed by Nooskewl. I played through both v1.1 and v1.2, with this review being based on the content in v1.2.  The computer version is available at nooskewl.com.

You start out seeing two kids, Eny and Tiggy, picking mushrooms in the woods. On their way back home, Tiggy finds a wizard’s staff and is possessed by its evil powers, which drive him to team up with goblins and wage war against the local towns and villages. It is up to you to control Eny and the companions she meets to rescue Tiggy and save the world!

Monster RPG 2 is a role playing game mimicking the style of classic Super Nintendo games such as the Final Fantasy and Lufia series. Just like these games, it features turn-based combat, a large array of characters to meet and play as (only three playable characters in this demo), and an original and only slightly cliché storyline with numerous plot twists. There is beautiful pixel art and a melodious mood-setting synthesized soundtrack. If the soundtrack is not to your taste, you can utilize the fact that you are playing the game on a music player, and listen to your own tunes instead.

Monster 2 Battle

The battle screen. In the lower-left corner there will be buttons for actions to perform, but because the dialog box is at the top, they are not displayed.

When I first started this game, I saw the loading screen. It’s a little bit tacky. Then there’s the company logo screen with a terribly annoying “beep beeeep” sound. Companies like Capcom have an appealing and recognizable chime to brand their products with, but Nooskewl has chosen to forgo that approach. I like the logo and the way it fades in and out, but the sound effect really needs to go! This is probably the worst part of this game right here, so don’t let it deter you.

You can control the game by either tapping to perform actions or by using a virtual D-pad and buttons. I thought that I would prefer the virtual D-pad at first, but found the tapping interface to be more usable because there were no controls obstructing my view.

Monster RPG 2 Dialog

A dialog in Monster RPG 2.

When I first played this game, I complained that it was ridiculously hard. This is where it differs from other games in its genre. When I would play games on my Super Nintendo, running from a battle was out of the question except in dire emergencies. You start out this game in an emergency situation, so don’t be afraid to run from a few battles.

Every so often you will encounter mini-games, which you would expect to find in most modern games.  These help break the monotony which sometimes comes from playing RPGs like this, and they are welcomed challenges.

Overall, this game is top notch, and I would definitely recommend it to any fans of old school console RPGs.

Brothersoft (Irks Me, Kind Of)

Brothersoft Search Cloud (Click to enlarge)

Brothersoft Search Cloud (Click to enlarge)

You may or may not be familiar with the website scraper Brothersoft dot com.  I’m not going to help give them traffic because I dislike them.

The DOS version of my Kids game was scraped by them last July, and many confused people have downloaded it from their site — significantly more than have downloaded it from here!  I was looking up the statistics (1120 currently) and noticed that they have this “Web 2.0″ list of popular searches.  It says a lot about the users of their website.

You can also note that they have done a verbatim copy of the text on my web site, and applied their logo to my screen shots. That is why my screen shots now have a watermark with the web address on them.

Also, the DOS version is ancient. If you are interested in a flashcards game, you might want to give the Javascript version of Kids a try.

Regex matching strings that DON’T contain a particular string

My debugging logger (SOS) allows filtering log messages by certain strings.  However, there are certain components that log lots of information that is completely useless to me.  This is how I only show the messages that are not from those components:

^((?!(Music|ChairHelper)).)*$

Bibles

The other day I went to a store with the intention of buying a Bible for the purposes of reading. I was interested in a Bible that would be laid out in a manner like most other hardcover books are: legible words on the pages, margins large enough to write notes in, only the original author’s text, not extra thoughts the translator or someone else added in.

As it turns out, they don’t seem to make Bibles like that.  Instead, they all seem to fit into the following four categories:

  1. Those with a theologian’s notes
  2. Those with articles for some special interest group
  3. Coffee table books (“Doesn’t it look nice sitting there open to Psalm 23?  Of course I’ve never read it!”)
  4. Fashion accessories (genuine leather, bonded leather, leather-look, etc)

I only found one — ONE — that fit into this description, and it was ESV Journaling Bible. The pages were (intentionally) shaded yellow, and there were lines in the margins to put notes in.  The text was too small and the lines were spaced too far apart.  It was not acceptable.

Here is a list of all the other types of Bibles I observed while looking for one which was intended to be read:

  • Numerous Gift & Award Bibles
  • Numerous Family Keepsake Bibles
  • Fire Bible
  • Case for Christ Study Bible
  • Celebrate Recovery Bible
  • The Passion(tm) New Testament
  • Revolution Bible Updated
  • American Patriot’s Bible
  • Firefighter’s Bible
  • Sailor’s Bible
  • Police Officer’s Bible
  • (there are more like this, but I’m conserving space)
  • Old Scofield Bible
  • Dake Annotated Reference Bible
  • Max Lucado Bible
  • Joyce Meyer Bible
  • Legacy Study Bible
  • MacArthur Study Bible
  • Maximized Living Bible
  • True Images: The Bible for Teen Girls, Updated Edition
  • True Identity: The Bible for Women
  • Wedding Bible
  • Bride’s Bible
  • Original African Heritage Study Bible
  • Every Man’s Bible
  • Serendipity Bible
  • Personal Worker’s New Testament
  • The Official NCV Duct Tape Bible
  • Charles F. Stanley Life Principles Bible
  • The Net Bible
  • The Message
  • The Message Remix Parallel Study Bible
  • New Interpreter’s Study Bible with the Apocrypha
  • Oswald Chambers Devotional Bible
  • Classic Thinline Bible
  • Premium Thinline Bible
  • Daily Bible in Chronological Order

Newegg’s Windows 7 Page

Newegg.com's Windows 7 64-bit Home Premium for System Builders product page.

Newegg.com's Windows 7 64-bit Home Premium for System Builders product page.

Since my copy of Windows 7 will expire in 14 days, I started looking around for how much a legit license will cost. The price isn’t as bad as I thought it would be (I was expecting $200), but their pricing structure is certainly odd.

This is from Newegg.com‘s Windows 7 Home Premium 64-bit page.