Well, here you have it. The epic tale of mirth and woe, sanity and madness, blasphemy and sparta! this is:
My First Pyweek Entry: a sordid tale
When I started out, I really had no idea what to make of the theme. In fact,
I hated the theme. Feathers.
The LD people had caverns, and both competitions were going at around the same time. Caverns is a much cooler topic than feathers.
"Screw this," I thought. "I'm going to make something which subverts the feather theme as much as is humanly possible"
So, armed with newfound resolve, I decided to make a game about a pimp. Or rather, an idiot trying to become a pimp. You would run through a randomly generated maze, trying to find mystical 'hatbirds' with awesome feathers. The design was as follows:
- Search for eggs in a random dungeon
- Pick up a stack of hookers over your head, bible adventures style
- Pile hookers on top of the eggs to make them hatch
- The police want to stop you (and are basically goombas)
sounds awesome, right? what I ended up making was nothing like it.
How to fail at levels
I've made a few character and graphics systems from the ground up, so I decided the logical place to start would be level generation, since I'd never really made anything except little prototypes in a box, except in game maker.
Turns out this was actually a logical place to start, since it ended up being the longest part, as I was learning while writing. The real problem was that I thought I could save time by making the levels procedurally generated.
While it may be true that someone with a lot of experience making random level generators would find it easier to make a generator than a map editor, for me it was the opposite. While it did allow me to release the game with arbitrarily large levels in less than 20kb, it also adds about a minute to the game's launch time, and took a whopping 5 days to complete. that just left me two days for the game itself! arghehh!
On the very first day, I had the following demo complete:
I tweaked theProperUndead's random level alg to add connectivity. It exposed a couple big problems with my tileset splitting class, when the pipes showed up with seemingly random connectivity. That burned the whole first day, but by the end I was so happy that the damn thing worked that I spent most of the second day just dicking with the result.
Once I had that all together, I made a room class that would hold the tiledata for each room. I decided to store the tile data using the same 4 bit int strategy I'd used for the map connectivity, just to be consistent, and also so that the tiles would have proper borders:
Now, at this point, I decided I could simplify the collision resolution if I sampled the neighbor data from the rooms, and moved game objects back from borders accordingly. I'd never seen collision done this way, but working it out on grid paper, it looked great! I decided to go ahead with it.
The problem with that is that I would absolutely need to make the neighbor data seamless across all the room objects, since otherwise entities would collide with invisible walls when traveling between rooms. and it WASN'T COOPERATING. mostly due to my lack of experience with tile based junks
I ended up also making the platforms placed manually, using a bitwise or operation based on which walls were connections to other rooms.
Finally, I did get it right:
I'm still on track fortunately. I've never made a random level generator on this scale, so I was expecting to spend most of the week on it. Not quite this much, but my game concept is so simple (EX the random levels) I should still have time to do stuff to things.
LOL NUB
Overworld: two days
Level data: one day
Seamless levels: two days
Total: 5 of 7 remaining
Who is That Dashing Reginald?
The answer: Reginald is an ASSHOLE
He's also the character occupying the first 16 tiles of this sheet.
Fun fact: of this entire sheet, to my knowledge, only the first four frames are used in the game.
I started out with the part that was easiest to me, the physics. I've made a lot of little physics demos in java and C++, and even made a game maker version of Metanet's N physics engine at one point. My record was making a physics engine in java in half an hour. 'cause physics is fiken k00l.
Physics is easy to me, but the collision was another matter:
Main character in game. Looks great, but he falls through the platform and hangs by his hat. GAR. pencil and paper time.
Remember that collision scheme I mentioned earlier? the one using the neighbor data? the completely untested and unproven one that I've never seen in use anywhere?
IT FAILED ME
I wonder why.
Basically, I didn't realize it at the time, but my connectivity data was working the wrong way around. An empty square would have a value of 15, a square with a neighbor to the left would have a value of 14, etc.
What was happening was that the guy was falling all the way through the platform and standing on the inside of the blocks. After I resolved that problem, I found another problem where you would sometimes go flying really high up into the sky when you hit a platform from the corner. I looked long and hard at this problem, and found that it was actually a problem with how collisions were being detected: since the connectivity map had data on the four neighbors, it had no idea when it was colliding diagonally. Then, once it drifted past a certain threshold, it would detect the collision, and the verlet physics would fling the little bastard to the moon.
Once I had that sorted, there were other difficulties, like reginald getting glued to the ceiling and hanging there flailing.
I ended up fixing the glue bug by padding the top of the collision box a little, and fixing the massive glitch jump bug by adding a little bit of damping and increasing the gravity and normal jump strength to make it less noticeable.
Entities added to game: 1/2 day
Collision response: 2 hours
final score: DAY 7 OF 7 EVERYONE PANIC
Ginger Moonshine
I learned how to make homemade ginger ale this summer. I'm on my ninth batch, and have never had any significant problems. Why is this significant you ask? because I had a friend over on saturday to show him this, and we drank a batch that had been in the fridge since the beginning of the week.
This batch had been sitting long enough to develop a little bit of an alcohol content.
I don't drink at all, so I'm a huge lightweight. There was barely any alcohol in it, but it was definately enough that I felt it, and it was making it hard to concentrate.
Oh god there are like three hours left. and I'm still totally not finished. BARGH
let's recap:
Level generation is good (if boring)
you can walk around as the player
all the areas on the map are reachable
there are no enemies
there are no birds
there is no way to win
I think I allocated my time slightly wrong this time :L
After writing the above, I bashed together a simple bird collectible, basically a token that you would pick up, and made them show up as yellow dots on the minimap.
No hookers, no police, no picking things up over your head.
I'll probably make a postmortem at some point, but for now:
AWESOM THENG:
the game is under 20 kilobites!
the character physics worked correctly on the first try!
the levels are more fun to explore than I thought they'd be!
cool open world game!
FAEL THENG:
no enemies!
no saving!
had to cut out the egg opening part!
really obvious collision detection edge case!
a rare case where it generates over 9000 birds in the map!
all in all, the AWESOM:FAEL ratio is about 4:5, so I'm happy enough for a first time entrant.
Here's my contest page:
http://pyweek.org/e/GremHammer/I've released it public domain, so if any of the generation stuff is interesting to you, feel free to have a look, and/or copy it for your project, but be warned that it is a dense rat's nest of hacks.
Got questions about the techniques or whatever? ask away!
Now if you'll excuse me, I'm off to drink the rest of that ginger moonshine