July 2011

July 12th, 2011
Currently in port in Bahrain, and sweating my ass off. Even with the AC blowing right on me, it reads about 99 in here. I think it will cool off a bit once we get back underway, and we’ve concocted a plan to “modify” the bulkhead using a massive drill and some pretty beefy drill bits so that we can spit the hot air out into a different space and seal ours up with a watertight hatch. As hot as it is up here, it’s getting kind of difficult to focus on programming. I’ve been working for a few days now, and just can’t seem to make a script interpreter that will do the sorts of things I need. I think the best way to do it is to add some code in the event that triggers every 100ms, something like:
if level=japan then
if horsedude.x less than some arbitrary value
horsedude.x+=10
if dude.x greater than a little less than that same arbitrary value && emily_captured=false then
emily_captured=true
horsedude.sprite=horsedudewithemily
dialoguebox(number_corresponding_to_a_conversation_in_a_text_file)
if horsedude.x less than a different arbitrary value && emily_captured=true
horsedude.x+=15
elseif horsedude.x greather than or equal to that arbitrary value just now && emily_captured=true
horsedude.sprite=nothing
Also, the more and more that I think about it, the closer I come to scrapping most of the Wild West level. The horserace thing is kind of neat, but will require so much more coding; it’s completely unique in the program, there’s nothing reusable in there. I feel like it might be something I could think about if I get everything finished and still have plenty of free time (and I’m not tired of staring at a computer screen after 5 months). Until then, I need to spend some time coming up with a different idea. Way back when the game was still in its basic concept stages, I wanted another dream level with a noir-detective-mobster sort of atmosphere. Maybe if I can flesh it out well enough, I can use that instead. It would certainly be easier to come up with music for that level than the western one. I could even keep the bar at the beginning; Emily is a lounge singer, and some mobsters bust in… Yeah, I think I can make this work.

July 7th, 2011
Normal melee (katana), special melee (pitchfork), normal ranged (bottle), special ranged (whip) are all implemented and working properly. Instead off adding another item to the animation_list, I just added a few lines of code in the dude portion of the animation module to display an additional surface, centered over the dude’s position. This way, the katana bobs up and down and lines up with the dude’s hand as he runs around. The katana is currently the only one I’ve animated like this; it feels kind of pointless to be spending this much time in photoshop when I know that these graphics are nothing but placeholders anyways. I suppose after I have all the guts of the program finished I’ll go back and animate the rest of the weapons and enemies. The whip looks pretty retarded, but it’s the only way I can think to animate something like that. Maybe I can go back and change the graphic used so it doesn’t look as stupid when it’s rotated. We’ll have to see.
I also realized last night that I completely forgot about scripting. I need to create a basic script-language and interpreter to handle things like dialogues and cut-scenes. I’m really dreading it because I haven’t done any sort of planning for it; I’m not really sure where to start. I really wish I still had that source file I made back in high school for the artificial reasoning program I wrote to play turn-based strategy games. It had almost exactly the sort of script interpreter I need. I think I’ll put it off for a little bit and work on frill animations instead. I can work on planning out the scripting while I’m on watch later this evening.

July 4th, 2011
I finished implementing the pitchfork (before the final boss, since it’s required to move him from phase 1 to 2), which ended up a little less complicated than I originally planned. Instead of clicking and holding, then aiming and letting go to toss the enemy somewhere, now a click just throws them back a little bit, which doesn’t lose much of the original intention, and is way easier to program. Now that I have a decent framework for weapons, I now have a new problem to think about: animating attacks and weapon sprites. Should the dude’s sprite carry a weapon around all the time, or should it only appear when attacking? The first would look way better, but require some redesigns and a lot more sprites. Also, the attack animation I’m using right now makes the guy’s sprite about twice as long due to the sword, which throws off all the physics calculations that use the sprite’s width. I need to go back and replace every dudepos.width with a generic pixel size that I set as a global constant at the beginning of the program. Although, another way around that (and something that would fix the earlier problem) would be animating a separate weapons sprite that moves with an attack, and travels along with the dude’s coordinates. It wouldn’t look as natural, though I suppose I could program generic dude-attacks for melee weapons and for ranged weapons, and then just separately add in the weapon after the fact. That might not look bad at all, now that I think about it. It’s a pretty large deviation from the original plan, though, so it will take some working on.
Today is the 4th of July, though I don’t think it’ll mean anything different for us. I’ve heard that there’s going to be a “picnic” on the mess decks for most of the day, which I suppose means that it will be that much more difficult trying to get something to eat around meal hours. I also heard that our division will be letting us sleep through reveille and cleaning stations this morning due to the ridiculous drill/maintenance schedule that everyone’s been working around, so long as we make it to training on time at 10. If that’s true, that’s pretty good news seeing as it’s currently 2:30 in the morning, and I was only planning on getting about 4 hours of sleep. I think I’m going to set my alarm for 9:30 and just sleep until either it goes off, or someone wakes me up telling me that I’m late for something.
Edit:
I can see the weapons module turning into a huge mess the deeper I get; I need to start working on making it more organized before I get too much further. I’ve decided on having a separate sprite for the weapon, and cycling an attack animation for the dude depending on what kind of weapon he’s carrying:
Thrust attack: STUN ROD, PITCHFORK, MIND BLAST, RIFLE, SWORD ALT-FIRE
Overhand throw: WHIP, BOTTLE, MIND WHIP
Downhand motion: KATANA, SWORD, MIND FIELD, 6-SHOOTER (reversed order of sprites)
I can add an item to the animation_list, make sure it updates last so it always displays on top (the frills need to display afterwards, though. Might take some looking in to to make that work). I’ll get that, a melee weapon, a ranged weapon, and a whip-style weapon, and I’ll call it ready.

July 2nd, 2011
Finally, jesus. Whenever I read about any sort of TIGJam or anything where someone just “threw together” a game in a day or so, I always wonder how they did collision detection. Historically, that has always been my biggest problem. Every time I’ve had to give up, or something has taken me days to fix, it’s had something to do with physics and collision detection. Am I really making it so much harder than it needs to be? Or is it just the ridiculous combination of tile-based and pixel animation that I’m trying to use? Will I ever get a method working that’s simple enough to remember and reproduce in the future, should I ever need to do this again? Or will every time require two or three days of pulling my hair out and shouting at my code and making sacrifice unto the gods of programming before it will all work as it should?
Anyways, the player’s collisions are back to normal. It does seem a lot easier than what I had going on before, and I haven’t seen any odd bugs or other problems. I think I can go back to coding the behavior of the Japan mini-boss now. After I’m done with him and the final boss, I need to start working on weapons, which is the last big addition to the side-scrolling sequences. After that, everything will be just tweaks and coding the individual enemies, though I need to force myself to make a top-down engine first. Since there’s no gravity, acceleration, friction, etc. I should be able to make a ridiculously simple collision detection engine for that part. As long as the mini-boss is taking me, due to his unique behaviors, I’m starting to think that I’ll need the rest of the next 5 months to get everything down pat.
Also, Amanda Palmer = awesome. If I ever get around to ordering that amazon.com care package for myself, I’m going to look and see if she has any other CDs out.