Archive for September, 2011


Batch Files… and a Puzzle

I’ve been studying the ergonomics of modding, and I’ve realized that whenever I need to do some modding, I need to open a bunch of folders as well as some programs (CaveEditor, Noxid’s TSC Editor, OllyDbg, Doukutsu Assembler… just to name a few). None of these things are pinned onto my taskbar, and I feel that even if I were to pin them there, the taskbar would become too cluttered.

Even worse, sometimes I feel like modding, and then I remember how many programs/folders I have to open. Then I somehow get so lazy that I don’t bother to start modding! A bad turn of events… wouldn’t you agree?

There is a simple solution to avoiding this tedious but necessary task: have the operating system open everything for you. The idea is not terribly difficult: create a Windows batch file to open all the stuff necessary for modding. Here’s a nice little screenshot of a batch file basking in the glory of my desktop background:

@echo off
title It's Modding Time!
echo :D
echo.
explorer "<PUT STUFF HERE>"
explorer "<PUT STUFF HERE>"
explorer "<PUT STUFF HERE>"
explorer "<PUT STUFF HERE>"
explorer "<PUT STUFF HERE>"
pause

Those are the contents of the batch file. For each <PUT STUFF HERE> thingy, just replace it with the full path to the folder or the full path to the .exe file you want to open. Now you can start modding with a single click instead of several clicks.

As for the Witching Hour itself, I’m making a pretty typical TSC-based puzzle and a map to go with it.
Here’s a picture (promotional banner?) that illustrates the puzzle:

Yeah… I’m making this puzzle and its new map without first creating the tileset for the new area. So everything in the new room looks like Mimiga Village right now. I’ll replace the tiles with custom ones later, so that’ll add more interest to the area.

Thanks for reading this week. I suppose I’ll give some more time if anyone still wants to take a stab at the riddle (from the previous blog post). Good luck.

Sprites Galore

As promised, I have some sprites ready for you guys.

Satellite dishes. It’s not much, but it’s something. The dishes will probably be used for telecommunication towers… or maybe not. I don’t know yet. In fact, I’m not even sure whether they’re going to be tiles or NPCs, but they’ll definitely be used for something. The dishes are supposed to glow blue while transmitting something, just so they don’t look too static.

Behold – a new character! An NPC to be precise. Her name is Em Dash, and she’ll play an integral role in some new area of the game that, uh, hasn’t been designed yet.

This week’s post wasn’t terribly long, so I’ll give you guys a riddle to figure out. Before that though, I’ll tell you that I’ve thought of a unique idea for a new weapon. It seems straightforward to design and should work in principle, but it may require some work. By work, I mean a lot of recursion (nah, just kidding… there probably won’t be recursion involved).

So this idea for a weapon… it’s related in some way to this pair of words:

sorrow stub

See if you can figure out what I’m thinking about. This riddle might be a little hard, because it assumes that you visit non-Wikipedia wiki sites a lot and have experience with Japanese homebrew games. All of you should know about Cave Story, which is basically a Japanese homebrew game, so that’s a plus there. It still might be difficult to guess the right answer, but don’t let that stop you from trying.

See you guys next week on Saturday.

Boss & TSC Engine Modifications

That boss from the last post… yes his name was Minoss. Maybe I chose it because Minoss sounds similar to Minotaur, and this guy attacks rather aggressively. His behavior is here:

  • Step 1 = Randomly choose a step from step 2 to step 6. Go to that step.
  • Step 2 = Walk around. At a random time, go to step 4 or step 1.
  • Step 3 = Run faster and jump in the air. Will slow down to regular speed quite quickly. After a while, go back to step 1.
  • Step 4 = Fire weapon. This will only fire a single bullet in the direction Minoss is facing. Go back to step 1.
  • Step 5 = Rapid fire. This will fire a stream of bullets for a short time. Go back to step 1.
  • Step 6 = Super barrage. Jump in the air, and fire a big cloud of bullets (Most powerful attack). Go back to step 1.

As you can see, the boss starts off at step 1 when the fight begins. Step 1 will lead to all the other steps (2 through 6) by randomly choosing one of them. All the other steps will go back to step 1 to repeat the cycle. So you might see Minoss walk around, maybe jump, maybe fire some bullets, and then possibly go for some big attack. Or perhaps he will go for the big attack first. It all depends on the random number generator.

Now, Minoss’s code is rather huge, and he’s the guy who caused the birth of the Doukutsu Assembler because I got so annoyed at rewriting his calls and jumps whenever I needed to fix a bug.

I’ll give you a small piece of his code right here. This is “Step 4”, where Minoss fires a single bullet and then goes back to step 1.

:state4
PUSH 0
PUSH 0
PUSH 0
PUSH 0
CMP [EDX+4C],0   ;If direction is 0, fire left.
JE :fire_left
PUSH 750
JMP :next1
:fire_left
PUSH -750
:next1
MOV EAX,[EDX+C]  ;Boss's y-position.
ADD EAX,400
PUSH EAX
PUSH [EDX+8]     ;Fire the bullet at my coordinates.
PUSH 7B
CALL 46EFD0
ADD ESP,20
PUSH 1
PUSH 36
CALL 420640      ;Play firing sound.
ADD ESP,8
MOV EDX,DWORD [EBP+8]
:goto_beginning
MOV [EDX+74],1
JMP :set_velocities

Now, what other weird things did I also accomplish during this week? To give you an idea, think about how Cave Story cutscenes and events work in general. If you are a modder, you should be able to comprehend the following TSC script:

I’ve finished up a proof-of-concept assembly hack that lets you run two events at (essentially) the same time. It does this by modifying the TSC engine in slight ways and introducing a couple of new commands for the functionality.

If you would like more info, look at this thread on the CS Tribute Forums.

Ack, maybe that was too much assembly for a single day. I’ll probably have some art ready by next Saturday. See you later.

New Game Icon

All right – this time I’ve replaced the old custom game icon with a new one. This new icon has better anti-aliasing and should look nicer overall. Here’s a comparison:

Now, I’ve had trouble doing this in the past since sometimes the icon doesn’t “seem” to change when you actually try to change it. The problem occurs because Microsoft Windows keeps a cache (a collection, that is) of old program icons that it doesn’t appear to update very frequently. Pressing F5 probably won’t solve the problem.

If you are a modder and you’ve been having problems with replacing the game icon more than once, the solution is to do this:

  1. Change your settings so that hidden files and folders are shown.
  2. Go to the folder C:\Users\YOUR_USERNAME_HERE\AppData\Local\
  3. Delete the file IconCache.db that you see. Though I’m not an expert, it should be safe to delete this file.
  4. Restart your computer.
  5. If it still doesn’t work, repeat these steps. Believe it or not, I had to do this twice before the icons refreshed for me.

And this is the useful website where I got this info: TechPaven: How to Refresh Windows Icons

In other news, I’ve also made sprites for the boss Minoss, who will be the guardian-type-person for the technology area. He’s based off of Curly:

Minoss

I’ll explain his attack pattern along with his assembly code in the next post or so. As a short preview, he acts much like the Curly boss in the Sand Zone except he can fire more randomly and jump around. When he jumps, he may shoot a large barrage of bullets that is difficult to avoid unless you remember to stay close to the floor.