Okay, the blog is finally here. I have no idea why this took forever, but of course you don’t want me to blab about the boring aspects of setting up a site like this, do you?

What’s this blog about? The Witching Hour of course. I’ll let you do the clicking around to figure out what this mod entails, but here I’m gonna jump right in.

Dome Computer

There we go. Some progress right? It’s a simple resprite of Cave Story’s blue-ish computer that you see in Arthur’s house and other places. I went for a dome shaped screen because interesting appearances come out of impractical design features.

Computers would be rather useless if they didn’t activate something. That’s why I designed the “autoplatform”.

Autoplatforms

It’s a custom NPC that can move in a simple oscillating pattern. By positioning each of these autoplatforms and controlling how fast they move, I can create jump puzzles and other challenges.

Now I’ll give you a big chunk of assembly code I used for this NPC:

...

MOV EDX,DWORD [EBP+8]
INC DWORD [EDX+64]       ;FrameTimer
INC DWORD [EDX+78]       ;ScriptTimer
MOV EAX, DWORD [EDX+74]  ;get scriptState
TEST EAX,EAX             ;check if EAX is 0.
JE (do nothing)          ;if scriptState is 0, then don't move!
BT EAX,0                 ;get the last bit of EAX -> Carry flag
JC (leftright)           ;if last bit is 1, goto leftright

;up/down
SHL EAX,1                ;just in case vel is too small.
BT DWORD [EDX+4C],0      ;get last bit of Direction
JC (negvel)
ADD DWORD [EDX+14],36
CMP DWORD [EDX+14],EAX   ;remember EAX still holds Scriptstate
JGE (limitvel)           ;if vel is too great, limit it.
JMP (framecycler)
;negvel
NEG EAX                  ;negate EAX -- we need to move up instead of down.
SUB DWORD [EDX+14],36
CMP DWORD [EDX+14],EAX   ;remember EAX still holds Scriptstate
JG (framecycler)         ;if max neg vel isn't reached, goto framecycler.
;limitvel
MOV DWORD [EDX+14],EAX   ;store ScriptState to Y-vel
XOR DWORD [EDX+4C],1     ;flip direction
JMP (framecycler)

;leftright
SHL EAX,1
BT DWORD [EDX+4C],0      ;get last bit of Direction
JC (negvel2)
ADD DWORD [EDX+10],36
CMP DWORD [EDX+10],EAX   ;remember EAX still holds Scriptstate
JGE (limitvel2)          ;if vel is too great, limit it.
JMP (framecycler)
;negvel2
NEG EAX                  ;negate EAX -- we need to move left instead of right.
SUB DWORD [EDX+10],36
CMP DWORD [EDX+10],EAX   ;remember EAX still holds Scriptstate
JG (framecycler)         ;if max neg vel isn't reached, goto framecycler.
;limitvel2
MOV DWORD [EDX+10],EAX   ;store ScriptState to X-vel
XOR DWORD [EDX+4C],1     ;flip direction

...

For you ASM hackers, notice that this isn’t fully written in Doukutsu Assembler format because that didn’t actually exist when I made this NPC.

For you non-ASM hackers, you are probably very confused right now. That’s perfectly okay.

Just know that BT means “bit test”, and it lets me test whether a number is even or odd. Actually, it can do lots of other things, but that’s mainly what I used it for.

Bit test lets me maximize <ANP’s great power, which is the script command used to animate NPCs. Here’s how that TSC command works with the autoplatforms:

<ANPXXXX:YYYY:ZZZZ

Animate autoplatform X with magnitude Y and motion Z.

If Y is even, autoplatform will move up/down. If Z = 0, goes down at first. If Z = 1, goes up at first.
If Y is odd, autoplatform will move left/right. If Z = 0, goes right at first. If Z = 1, goes left at first.
If Y is zero, autoplatform stops.

So that’s all for today. Yeah – I know, I went into too much technical detail… yet there’s not much I can talk about if I just say, “the platforms form puzzles that you have to solve”, even if that’s basically all there is to it.

Now, this blog will not necessarily show all updates in the order they were originally… err… updated in. That means, sometimes I’ll show you an old feature that I forgot earlier because you didn’t see it yet. Sometimes the blog will keep up with the actual progress. Sometimes the blog will go beyond the real progress and speculate upon future ideas – a sort of time travel but with modding.

This controlled chaos should create fewer “empty” blog posts that don’t have any actual content. At least I think it should.

As some sort of parting note, this blog will also be updated on Saturdays (that’s the plan, anyway). Have a good day. Hope you enjoyed the first post.