Detailed network metrics with Munin (Linux)

Munin already does a great job on graphing – but I noticed that there weren’t any plugins dealing with the metrics in /proc/net/snmp and /proc/net/netstat. I didn’t know what all the metrics could mean, so I made some generic code that gathers all the data – and asked a couple of bright coworkers to pitch in with what they know. It doesn’t have any thresholds set, as we haven’t considered using it for alerting yet. Patches and feedback are welcome.

The plugin creates 22 (!) new graphs. A detail level of this magnitude is for most people too verbose, but if you have a large rig that pushes a lot of traffic – frontend nodes perhaps – you may want to learn more about what goes on.

This is a Multigraph plugin, it requires Munin 1.4, and it’s easy to extend. It does not suggest to be enabled by default, because it’s so verbose.

I just committed it to the project – and it’s available here; Trunk

I expect that it’s included in Munin 2.0, but I don’t know for sure.

The samples below shows one frontend node pushing a lot of traffic – the huge spike is a soccer-match (Norway and Denmark).

Posted in Munin, Planet Redpill-Linpro | Leave a comment

Links house, analyzed: Part 1 – The tilemap

This is a picture of the interior of Links house, in “The Legend of Zelda: A Link to the Past”. It’s the first room in the game. It looks very good. I will attempt to analyze what they have done to achieve this – what techniques have been applied, and why. Some techniques has been used because they are great artists – and some techniques have been used, because the SNES has very little memory.

First, a little bit about the SNES. The old game consoles got hardware-support for tiles. This means two things; Re-using small pieces of graphics was easily achieved – as the console can flip the tiles horizontally, and vertically, without consuming more memory. The only console in sale today, that still makes use of this – is the Nintendo DS.

A screen consists of a grid of tiles. When you look at a grid with 8×8 spacing, you can easily tell that the tiles are being reused. In some places, you’ll see variations that are achieved by just flipping every other tile.

The floor is the simplest pattern in this scene. It is made out of two tiles, simply alternating each other. One can also create this pattern as one 16×16 tile.

The bed is fairly simple. It consists of 6 tiles. The bed is symmetrical, so the right side is just repeating the same tiles as the left side, but flipped horizontally. Rows 2-4 are identical.

This cares to demonstrate some of the limitations the graphic artists were working under. Even though the game looks very good, it’s needless to say that the artist would be able to create more detail if he wasn’t confined to the limitation of maximum X tiles in the tileset. We now know that the bed is symmetrical, because of technical limitations – and not because the artist thought it was the best way to draw a bed. You will find this literally everywhere in 16-bit era games.

It still looks good, but it was also a sacrifice to make room for more art. Unless you are making graphics for a platform with strict limitations on how detailed your graphics can be – you should remember that this is not a compromise you need to deal with. You may chose to do so, for your own reasons – e.g. you want to mimic the 16-bit era graphics more accurately. But you don’t have to. You’re free to ignore it.

Posted in Game development, Graphics | Leave a comment

Drawing tiles: Some lessons from an amateur

So, I’m quite happy with the tiles I ended up with in SUBJECT:7 – so I’ve decided to make a guide on how to draw them. It’s fairly easy to learn – one just have to apply the knowledge.

I mainly use Gimp for drawing – but I suspect that any drawing application that’s capable of dealing with layers, opacity settings on the layers, and radial gradients will do (yes, I’m aware that gradients is a nono when doing pixelart – I don’t care).

First a couple of words about what you see here:

Two tricks are used to give you the illusion of depth. The first technique is to make the bricks on the top appear larger than the bricks on the bottom. The second technique is to make the bottom somewhat darker than the top. This is a very common way to do things – one very good example would be “The Legend of Zelda: A Link to the Past”.

You should also note that on the corner-tiles, the brick-spacing is moving slightly towards the corner – this adds the illusion of perspective.

Things appear larger on top, smaller on the bottom. Brighter on top, darker on the bottom. Thus adding to the illusion of perspective. These tiles are from The Legend of Zelda: A Link to the Past

When you create a new image, you start with a background layer. I usually never want to do anything with this layer – except for maybe give it one opaque color covering the entire thing. I always apply details on different layers, because I never know if I want to reorder anything later on. I also like to configure a grid to match my tile size immediately – always showing the grid, and zooming in as far as 1600%.

Step 0:

We will create tiles that are 16×16 large. The wall tiles will for practical reasons be made in groups of 8, so create a new image that is at least 48×48 pixels large. Set grid size to 16×16, and turn on the grid. You should now have a blank image, with grids showing the 16×16 borders clearly to you.

Step 1:

Create a new layer, name it ‘step 1′. Make the changes on the new layer.

Give the corner tiles one straight line from the center and to the edge – create four squares within eachother. Note that the squares have different spacing – this is to add to the illusion of depth. Leave the square of 16×16 in the center empty.

Step 2:

Create a new layer, name it ‘step 2′. Make the changes on the new layer.

It’s time to add the space between the bricks. On the corner-tiles, it should move slightly towards the corner itself – on the top/bottom/left/right tiles, they should always be straight.

Step 3:

Create a new layer, name it ‘step 3′. Set its opacity to something low, like 25%. Even though the picture make it look like we’re drawing with grey – we’re still using solid black as the color. Make the changes on the new layer.

It is time to draw some cracks in the bricks. The purpose are to give the players some illusion about how great you are. The cracks are just semi-random shapes on each brick. If the shape can start from an adjent brick-space, it may add some appeal.

Step 4:

Create a new layer, name it ‘step 4′. Make sure that it’s ordered to be between the background and ‘step 1′. Fill everything, except for the middle 16×16 with a color of your choice. I’ve used red.

Step 5:

Adjust the opacity of ‘step 1′ and ‘step 2′ according to taste. I’ve set my ‘step 1′ to 70%, and ‘step 2′ to 65%.

Step 6:

Create a new layer, name it ‘step 6′. Make the changes on the new layer.

Create a solid black square, partially covering the brick wall. I’m covering 7 pixels in on my tiles here.

Step 7:

Adjust the opacity of ‘step 6′ to 30%. Look! We have shadow!

Step 8:

Repeat step 6/7 with a slightly smaller square.

If you’ve followed my instructions, you have a set of tiles that points inward in a room. You still lack the tiles pointing outward – but these steps can be repeated. All you have to do different, is to reverse the two techniques that achieve the illusion of perspective, which I explained early in this tutorial.

The layer composition should be something along these lines;

Posted in Game development, Graphics | Leave a comment

SUBJECT:7 (LD48#21)

This was my entry for Ludum Dare #21 – the theme was “Escape”. I had been pondering about what I could do with the themes we were voting about for a couple of days, and decided to make a top-down “don’t get caught”-game.

Our character is trapped in a cell, and wants to escape. The cell is unlocked by someone/something unknown, and you’re grabbing the opportunity. I’ve been playing with some light-effects for a little while, and figured that it would look good with this concept. The idea was to create a few puzzles that you would have to solve to get free.

I only know of two bugs; One is that I should have made all textures a power of two – people with less prominent graphics cards will have problems with the title/help-screen – and perhaps the end screen. The second bug is that the donut is placed on top if you.

All in all; I’m happy with the result – and I’ll do even better next time.

Some screenshots:

Timelapse video

Posted in Compo Entries, Games | Leave a comment

Terrorists win.

The other day, I read the an article (Norwegian) in VG stating that stores are removing ‘TERRORGAMES’ from their shelves.  The said stores are Platekompaniet and Coop.  They state that this is a token of respect to the victims of the recent terror attacks in Norway.  It is known that the suspect did play Modern Warfare 2, and World of Warcraft – as his (now deleted) Facebook profile showed this, and he clearly states so in his manifesto (p. 1408).

I find this to be a sad and misled reaction to the horrible acts he performed.  First of all, I chose to believe that the victims would enjoy these games just about as much as anyone else (on average).  Secondly, the attacker did, according to his 1500 page manifesto, also enjoy other things.  Even though his acts was monstrous and inhumane – this person did enjoy a lot of everyday activities, like you and me.  If I happen to enjoy the same video games, TV-shows, physical activities or hobbies as this man – that does not make me insensitive to the victims.  It makes me like anyone else.  I want to list some of the activities he enjoyed, that was not removed from any shelves out of respect of anyone (referring to the pages in his manifesto that confirms this – I will not store a copy of the manifesto on my blog for reasons that should be obvious);

One should also note that the list of games removed is as far as I can tell limited to Modern Warfare and World of Warcraft.  A lot of similar games were remaining in the shelves (as I observed at the store earlier today, there were plenty of FPS games to be found – with the exception of Modern Warfare).

The article in VG also state that Spaceworld did not remove the games, as they didn’t see what that had to do with the attacks.

I’m rooting for Spaceworld.  Otherwise; Terrorists win.

This graph also comes to mind (I did not make this graph, and I do not know who did);

Posted in Rants | 13 Comments

Super Mario Bros 3 Blanket Progress

So, I’ve tricked my lovely girlfriend into knitting me a huge Super Mario Bros 3 blanket. I wrote a small php-program, that converts sprites into shopping lists for yarn. It matches the colors used in the sprite with the best matching yarn color – makes certain assumptions about how much a pixel weighs, and calculates how many balls of yarn we need to buy. It’s on my todo-list to wrap this program up as a online service that people can use.

So, 504 pixels – each being 7.5cm x 7.5cm large, weighing 4 grams – resulting in 135cm x 210cm large blanket, weighing 2kg. This requires 47 balls of yarn (assuming each ball contains 50 grams of yarn, the extra yarn we’re left with is due to some colors only being used for a few pixels). Estimated worktime is 201.6 hours, + another 10 hours of assembling all the pixels in the end.

It will look like something along these lines:
It's 16 bit Mario from Super Mario All Stars - Super Mario Bros 3

Posted in Make | Leave a comment

Cheese Hunter (LD48#20)

This was my entry for Ludum Dare #20 – the theme was “It’s dangerous to go alone, take this!”. Since the theme is a quote from Zelda 1, I figured, like some other participants, that the right thing to do was to attempt a Zelda clone.

Our character is on a quest for cheese, on behalf of his princess wife thingie. One gameplay element I figured out was interesting – was the shapeshifting item. A paperclip is an item you can modify – and you toggle its shape with a. The only usable shape in this game, however – is the fireball-throwing wand (you shoot with f).

This game has quite a few bugs – but it’s perfectly possible to finish – it could however use some more content in the dungeon. But this is what I feel I had the time and capacity to do – my main excuse is that I’ve been fighting with my own basecode.

Some screenshots:

Outside house. Inside house. Bossfight. Title Screen

Time lapse video:

Posted in Compo Entries, Games | Leave a comment

Why I regret getting a Boxee Box.

Last autumn I started planning my HTPC.  I’ve always wanted a nice piece of hardware to use for watching movies / TV-shows / Internet content.  I already had a Popcorn A-110, which did the job – but not to the extent I wanted it too.  A natural choice of software to achieve this is XBMC.  It looks good, and it has all the features I want.  One specific feature I consider to be of killer class – is library mode, with its ability to automatically discover new files, and that you’re able to toggle display of stuff you’ve already watched. You can also manually override which movies/episodes that are tagged as watched.

With the exception of toggling listing of which shows/movies have been seen – these features exist in the PC version of Boxee (at least 0.9.21.11487, which I just tested this on).  XBMC has had these features for many years.  Boxee is a fork based on XBMC.

I saw some videos on Youtube, showing off the new Boxee-appliance – the Boxee Box.  It has a pretty neat remote control, and the developers told us they wanted it to be hackable.  Based on this, I figured out – Boxee Box sounds like a good deal.  This is exactly what I want.  (It’s pretty, too)

So for Christmas, I got a Boxee Box instead of what I had originally planned to get.  I was really excited when I got the box in the mail.  Booted it up – everything looks fine.  Added my server as a source of files – Boxee Box indexes stuff just like one would expect.  I go to my library of shows and find it’s full of internet content I don’t care about.  Since then, they’ve made it possible to filter away internet content – which I appreciate.  Then I watched some shows – which worked fine.  I noticed that I couldn’t filter away the episodes that I had already seen, so I decided to get active and post about this on their forums / bugtracker.  A month later, it’s closed as fixed – yet, all they did was add the ability to toggle if a movie was watched or not.  This did not apply to TV-show-episodes, nor could you toggle if it’s displayed in the list or not.  Great job on that bug, Boxee.

I recently updated my Boxee Box to firmware 1.0.4.  I watched an episode of a show, and noticed how the sound was very low – I had to turn my TV to 50 (normally, I hear what I need to hear when my TV is turned to 10).  I figured that it may was a defect with that episode – and didn’t give it too much thought.  Youtube worked fine, the menu sounds were also quite laud (which becomes a problem when your TV is set to 50).  I watched several other episodes since this – and the symptom is still the same; Whatever I play that is located on my file server are played with exceptionally low sound.  Today I decided to ask for help on the forums, and figured out that a bug is posted on their bugtracker – with status “Resolved: Won’t fix”.

Great customer service, guys.

To top it all off, the box isn’t exactly hacker-friendly.  Being an Intel Atom computer, I expected to be able to (in worst case) install my own operating system, and fix XBMC myself.  This is clearly not the case with this piece of hardware.  It has great potential, but no community / poor customer service puts it in a corner.

Posted in Rants | Leave a comment

Bugtesting: There’s work to do

I’ve yearned to start giving back to the free software community for years, but never really figured out what I can do. I’ve aimed high, and tried to find bugs to start working on, but most projects don’t really have much ‘low hanging fruit’ that give you an easy start. I’ve done some translation work, but don’t get the satisfaction I yearn for.

But lately, I’ve been looking at the WINE-project. What make this project special? Well – since it’s an application which create an environment for other applications to run within – it means that there are a lot of things that probably don’t behave as it should versus how they do in Windows. This in turn means that there are A LOT of bugs which report of applications crashing, and how to reproduce the error. A significant amount of these bugs haven’t had activity for many months (and that’s not due to the WINE project being idle, because there’s a new release every two weeks), and there’s a significant chance for the bug to be outdated.

So, the latest weekend, I started doing bugtesting. I just made a report from the WINE Bugzilla, looking at simple things to test. These are my results from a few hours of laundering:

  • 17 bugs tested
  • 2 new bugs posted (#25734 and #25761)
  • 8 bugs resolved (#5349, #12006, #13165, #13457, #15423, #16330, #17494 and #18597)
  • 8 bugs being supplied more information to (updated with stack traces and terminal-output from recent versions of WINE)
  • 1 of the bugs were unsuccessfully tested (#18616), due to a regression being introduced which make me unable to test the bug (#25734).

This may not look like much, when WINE totals with 6465 bugs. But it’s not a hopeless endeavor if one spend a little time creating a filter which makes sense to attack. Every time there’s a new WINE-release – a list of bugs that has been closed as RESOLVED FIXED since the last release is posted. I wonder how long list we’re able to make, if we all make a little effort –

Posted in Planet Redpill-Linpro | 1 Comment

Steam on Linux, or are Phoronix just being morons again?

It’s Official: Valve Releasing Steam, Source Engine For Linux!” … It popped up in my feed one day a couple of weeks ago, and I was very curious if it really could be so. Could we really get a good commercial content delivery system for a platform which have suffered for poor support from the game industry for so many years? Nope … Some moron in this so called “news-site” just got overexcited and figured out it was best to give thousands of readers false hope.

Phoronix, it’s not OK to bring people false news like this. Steam for Linux is pretty high up on the list of things I wish would happen – and I do acknowledge the leaked client from Valve – but stating that it’s official, without having any form of source, is very poor journalism (no, the Telegraph does not count as a source, as they don’t have a source themselves). I wish other news-sites will stop referring to you as a source of news until you stop with those tabloid headlines that plainly isn’t true. But people are actually buying this, and quoting you as a source for these great news that gaming for Linux is finally real.

I hope, and believe, that this will happen eventually – but until it does, I won’t run around and claim that it’s official. Because it isn’t.

Posted in Rants | Tagged , , , | Leave a comment