Sunday, July 6, 2008

Audio, some refinements, and this week's to-do list

I've spent the past week messing around with the sort and sweep algorithm some more. The main problem, in my case, is that I need to do a good bit of reading on the IComparer class, because I really don't understand it. As it is, if there are multiple objects with the same X coordinates, it isn't necessarily including them all in the appropriate lists of interfering objects. Take, for example, the picture at the top. If we're checking interference with the rabbey (the little brown rabbit monkey thing standing on the question mark block), we look at everything in between his leftmost and rightmost points. In this case, two grass blocks, a mountain, and a question mark box. That'll work, and that's all fine.

If, however, the rabbey is on a stack of ten boxes, all of which have the same position along the X axis, and the rabbey happens to be at exactly the left- or right-most point of said stack of boxes, some funky things start to happen. This is because when we're sorting the list, we SHOULD be putting the rabbey's left coordinates at the beginning of any string of identical coordinates, and the right ones should go at the end of any string of coordinates identical to those. In other words, the rabbey (in this case) should be the very beginning and the very end of any items who might interfere with it.

In my implementation, however, this isn't the case. the list is sorted, but no particular creedence is given to the order of multiple cases of identical coordinates. My short term fix is to test three or four extra objects to the left and right of the object in question, but this is a stop-gap solution and is probably the worst way to handle it. I'll be researching IComparers in order to find a better way. I shouldn't have to sort the list multiple times per update (as that would be prohibitively expensive, CPU-wise), and I think I can just search for certain values in the list. That should hopefully be kind of easy.

The main additions I've made in the past couple of days have been audio (all music and effects copyright My Awesome Talentedness, 2008). A friend of mine is going to do some music for me, and I'm really looking forward to that. I'll mess around with the sounds a bit as well, but it's not a high priority for me at the moment. At this point the voice acting is no worse than Symphony of the Night, and that was one of the best games ever made.

I've also done some minor tweaks here and there, mainly standardizing the blocks' sizes (so they'll all match up, duh), and tweaking a few things in the update cycle (the most noticeable of which being that the enemies don't move unless they're pretty close to being onscreen).

In addition to the aforementioned sort and sweep fixes, I'd like to add some enemies, some block types, and blocks that pop out powerups in the coming week. I also need to add a way to finish a level, load into the next one, stuff like that. Finally, I think it's really time that I implement a game state management system, even if it's hard as hell to do it. I need to be able to pause, have some menus, get a game over, and stuff like that. It won't be fun. But it has to be done. We'll see how it goes.

Videos:
Youtube
High-res download (720p) (recommended)

1 comment:

Unknown said...

Hi, I'm looking to create something just like this...a Mario/Sonic style game. I'm a C# programmer, and I went through the XNA tutorials on Microsoft's site to create a shooter style 2D game, and I went through others on making sprites jump and move.

I have no idea what the best ways are to do a Mario style game like you've done. Could you provide the code, or point me in the right direction? I'm lost on how to begin creating the plaforms to jump on, etc. Thanks so much!!! My e-mail is andy@andyd.org