|
Title: mallocator Post by: Average Software on August 14, 2011, 03:21:18 PM I've been toying with idea of using things that are normally considered signs of bad programming as gameplay mechanics. Specifically, I was looking at memory leaks and segfaults.
I was having trouble coming up with a game that used these things, until it occurred to me to actually make a game about memory leaks and segfaults. I came up with this simple little thing, which I call mallocator: (http://www.averagesoftware.org/images/mallocator1.png) (http://www.averagesoftware.org/images/mallocator2.png) In mallocator, you play as a C memory management system. The green blocks falling from the top of the screen are memory requests that you must service. You have to grab them with your cursor, and fit them into the three memory banks available. If you cannot service a request, and it falls off the bottom of the screen, you will cause the program to segfault, for real. This is a "hard loss" and results in the complete loss of your game, including your potential high score! After sitting in a memory track for a little while, the memory blocks will turn yellow. At this point they must be freed. To free a block you move your cursor over it and hit the action key. When you free a yellow block, all consecutive yellow blocks bordering it are freed as well. You get more points for freeing large chunks of memory at once. If you fail to free a block in time, it turns red, which means it has leaked. The memory leaks are real! The amount of memory leaked is trivial, just one byte per block, but every time you screw up you're still actually leaking your memory away. Leaked regions cannot be used for the rest of the stage, so they can seriously get in your way. In each stage, your goal is to release 200 blocks of memory. You receive a bonus for each block released beyond 200, so if your final free releases 10 blocks, when you only needed 1 to finish the stage, you get a bonus for the 9 blocks over. You also get a fragmentation bonus, based on how defragmented you managed to keep the memory. This bonus is where the bulk of your points come from, so it pays to keep things neat. If you leak 25 blocks in a single stage, you lose the game. This is a "soft loss" are your score is then eligible for the top ten. This was a very simple project, it has no sound or fancy effects or anything. It's written in C, which seemed like the only logical choice. The download includes the complete source code, GPL3 licensed. The only dependency is Gtk. Here's the download for anyone that wants to play around with it: mallocator for Linux (http://www.averagesoftware.org/files/mallocator.tar.gz) Title: Re: mallocator Post by: Player Ʒ on August 14, 2011, 03:48:34 PM As soon as I saw "segfault," I immediately thought of Linux. Definitely seems like an excellent form of malicious gaming. Severe and intended consequences, here they come.
Title: Re: mallocator Post by: LiquidAsh on August 14, 2011, 05:19:00 PM I don't have a linux environment to try running this from at the moment, but it's a fun idea. While reading the description, I scratched my head about getting points for freeing memory... it seem like allocating it is the valuable thing that should be rewarded (but then, again I haven't tried playing it). The other thing I wondered about from the screen shots is the choice of three columns of memory to use. I suspect this helps keep things challenging, but also believe this could help reinforce your premise. Each column could be a different level in the memory hierarchy: so there would be a small and fast column, a tall and slow column, and a medium column. Maybe you could even give more points for memory allocated to faster memory.
Fun idea. I'm not sure how I feel about the program purposely leaking memory... but I suppose that could add to the charm/appeal for some(?). Title: Re: mallocator Post by: Core Xii on August 15, 2011, 04:56:26 AM A game that purposefully crashes and leaks memory is a bad one indeed. Remove these ridiculous elements and you also might want to give score for something else, since freeing memory isn't the goal of memory management. Maybe some system where successfully allocating larger blocks gives more score.
Title: Re: mallocator Post by: eclectocrat on August 15, 2011, 06:23:09 AM I love the concept. Really sounds hilarious. I'm gonna boot up ubuntu and give it a try. Kudos.
And let it leak and crash. It's all memory protected anyways. Title: Re: mallocator Post by: Average Software on August 15, 2011, 09:35:27 AM Quote from: Player 3 Definitely seems like an excellent form of malicious gaming. Ha, "malicious gaming'... I like the sound of that. Quote from: LiquidAsh While reading the description, I scratched my head about getting points for freeing memory... it seem like allocating it is the valuable thing that should be rewarded (but then, again I haven't tried playing it). The allocations set up the freeing. You can't get big frees without good allocation strategies. The fragmentation bonus at the end is also where most of your points come from, and this is where good allocation pays off. Quote from: Core Xii A game that purposefully crashes and leaks memory is a bad one indeed. Remove these ridiculous elements These 'ridiculous elements' are the entire point of the project. They're the whole gimmick. Quote from: Core Xii and you also might want to give score for something else, since freeing memory isn't the goal of memory management. You do get score for something else, or maybe you didn't read that part. Points are awarded for keeping memory defragmented, which is entirely based on how you allocate. You also do get points for allocating, just not as many as when you free it. And freeing memory very much is the goal of memory management, in addition to allocation. Hell, most memory allocators are far more concerned with freeing memory than allocating it (think garbage collection). I think what drove me to this project was the fact that most games these days have little to no consequence for failure. In this age of save points you typically lose a couple minutes of progress at best. I decided to do something where your missteps have an impact beyond the game itself. Far more malicious ideas occurred to me, like holding random files on your system as hostages, and deleting them if you failed to rescue them, but that crossed the line into permanent damage, which I didn't want to do. Still, I have to think that there might be something to the idea of "malicious gaming," as was coined earlier. People do dangerous things for thrills all the time, bungie jumping, skydiving, all kinds of crap. I think there might be a similar thrill in playing a game that you know will mess up your system bad if you fail at it. It's an interesting change from most modern games, which barely mess up your schedule if you fail. Title: Re: mallocator Post by: Noyb on August 15, 2011, 09:42:33 AM Far more malicious ideas occurred to me, like holding random files on your system as hostages, and deleting them if you failed to rescue them, but that crossed the line into permanent damage, which I didn't want to do. There's already a game which deletes random files on your hard drive in response to user actions: http://stfj.net/art/2009/loselose/Title: Re: mallocator Post by: Evan Balster on August 15, 2011, 10:14:21 AM Try causing interrupt-level feedback loops. Those cause a terrifying sort of system crash. D: Of course I kid.
I'm reminded of the "fake" crash dialog in "I wanna be the guy" -- the one which resembles the frequently-seen Multimedia Fusion 2 crash report box but kills the player when clicked. |