Showing posts with label video games. Show all posts
Showing posts with label video games. Show all posts

2024-12-07

Sample Lufia 2 Fancy Character Movement Analysis

As I've noted previously, I've been working on decoding the scripting language Lufia 2 uses and trying to understand the less obvious details of what's going on behind the scenes in the various, well, scenes. (Lufia 1's scripting seems to be largely similar, incidentally, so feel free to use this as reference if looking into that.) Primarily, the point of this has been to extract the text cleanly and figure out what lines are used when, as well as what the progression of event flags looks like, but it's also been interesting to see how some of the more elaborate and expressive animations the game does so well work.

Let's take the scene in Tanbel when Maxim meets Guy and they decide to have a friendly duel as an example. It seems simple enough from the player's point of view. They face each other in an open plaza, Guy leaps at Maxim, and then they're interrupted before anything else happens. A surprising amount of effort goes into making the scene look good, though.

We'll start after everyone has moved into place and the initial banter has concluded.

Maxim and Guy face each other with an empty tile between them, while Tia watches from out of the way.

(Green text in blockquotes like the below is more or less what comes out of my script parsing program, minus the address offset data that isn't relevant here.)

{$34 1C 23: Change Actor $1C (Guy NPC)'s sprite to $23.}
{$37 0A: Brief delay, lasting 10 frames.}

Guy first switches to a different sprite to show him getting in a stance as preparation to make his leap.

Note that because he's not currently a party member, the Guy in this scene is a dedicated NPC.

{$4C 0C: Play sound effect #12}
{$34 1C 25: Change Actor $1C (Guy NPC)'s sprite to $25.}
{$34 00 1D: Change Actor $00 (Maxim)'s sprite to $1D.}
{$6C 1C FE FC: Draw Actor $1C (Guy NPC) at -2px X, -4px Y.}
{$30 5F 07: Put Actor $5F at map location #7.}
{$73 26 07: Play animation #38 at map location #7.}
{$37 01: Brief delay, lasting 1 frames.}

We hear Guy spring up, Maxim changes sprites to show that he's bracing himself, Guy changes into a leaping sprite and his displayed position is shifted two pixels to the left and four upward as his leap begins, and a dust cloud animation plays at Guy's starting location as Actor $5F is moved there. But what's Actor $5F?

Note that Guy has not logically moved at all; only the position where his sprite is drawn has changed. As far as the game is concerned, he's still actually on the ground where he started. If you could pause the scene and walk around, that's where you would find his collision and that's where you'd go to interact with him.

Of course, you can't pause the scene and walk around, so where he appears to be is all that really matters to the player at the moment.

{$6C 1C FC F8: Draw Actor $1C (Guy NPC) at -4px X, -8px Y.}
{$6C 5F FC 00: Draw Actor $5F at -4px X, 0px Y.}
{$37 02: Brief delay, lasting 2 frames.}

As Guy continues upward and leftward, Actor $5F follows him to the left, but stays at his initial height. It's his shadow!

Most sprites have shadows built in at the character's feet. Sprite $25 doesn't, so a separate shadow-only sprite is used in conjunction with it to give the impression that Guy is actually leaping upward and not merely circling around Maxim to the north side.

{$6C 1C FA F4: Draw Actor $1C (Guy NPC) at -6px X, -12px Y.}
{$6C 5F FA 00: Draw Actor $5F at -6px X, 0px Y.}
{$37 03: Brief delay, lasting 3 frames.}
{$6C 1C F7 F0: Draw Actor $1C (Guy NPC) at -9px X, -16px Y.}
{$6C 5F F7 00: Draw Actor $5F at -9px X, 0px Y.}
{$37 04: Brief delay, lasting 4 frames.}
{$6C 1C F4 EE: Draw Actor $1C (Guy NPC) at -12px X, -18px Y.}
{$6C 5F F4 00: Draw Actor $5F at -12px X, 0px Y.}
{$37 05: Brief delay, lasting 5 frames.}
{$6C 1C F0 EC: Draw Actor $1C (Guy NPC) at -16px X, -20px Y.}
{$6C 5F F0 00: Draw Actor $5F at -16px X, 0px Y.}
{$37 06: Brief delay, lasting 6 frames.}

The shadow continues leftward with Guy as he continues leftward and upward.

Notice that the delays are gradually increasing, while the vertical movements are gradually shortening, giving the impression of gravity affecting the jump.

Meanwhile, the horizonal increments increase at more or less the same rate as the delays, keeping the leftward speed more or less steady.

{$9E 14: Floating textbox; arg affects Y position:}
 Guy!!<$01=NEXT>

But now someone shouts, interrupting the action.

{$4C 14: Play sound effect #20.}
{$34 1C 23: Change Actor $1C (Guy NPC)'s sprite to $23.}
{$34 00 00: Change Actor $00 (Maxim)'s sprite to $00.}
{$6C 1C F0 EE: Draw Actor $1C (Guy NPC) at -16px X, -18px Y.}
{$37 04: Brief delay, lasting 4 frames.}

With the action interrupted, Maxim resets to his default sprite. Guy changes to a sprite with his arms in the air and starts falling with a corresponding sound effect.

Note that the detached shadow is still there on the ground below Guy, but the sprite he's switched to has its own built-in shadow, so he now has two shadows, one of which is hovering off the ground along with him. You should be able to spot this even at full speed if you're watching for it.

{$6C 1C F0 F0: Draw Actor $1C (Guy NPC) at -16px X, -16px Y.}
{$37 04: Brief delay, lasting 4 frames.}
{$6C 1C F0 F4: Draw Actor $1C (Guy NPC) at -16px X, -12px Y.}
{$37 04: Brief delay, lasting 4 frames.}
{$6C 1C F0 F8: Draw Actor $1C (Guy NPC) at -16px X, -8px Y.}
{$37 04: Brief delay, lasting 4 frames.}

Guy accelerates after beginning to fall, now topping out at 4 pixels per 4 frames, after starting with two steps of 2 pixels per 4 frames. His fall could be further smoothed out by using a series of 1-pixel shifts with 1-frame delays, but that seems like overkill. At full speed, it looks just fine as it is.

{$2E 5F: Deactivate Actor $5F.}
{$6C 1C F0 FC: Draw Actor $1C (Guy NPC) at -16px X, -4px Y.}
{$37 04: Brief delay, lasting 4 frames.}

Once Guy is a quarter of a tile from the ground, the detached shadow is removed by deactivating the associated actor.

{$6C 1C F0 00: Draw Actor $1C (Guy NPC) at -16px X, 0px Y.}
{$37 04: Brief delay, lasting 4 frames.}

And, at last, Guy has landed. The game is currently drawing him one full tile directly to the left of where it logically considers him to be.

{$34 1C 02: Change Actor $1C (Guy NPC)'s sprite to $02.}
{$30 1C 06: Put Actor $1C (Guy NPC) at map location #6.}
{$6C 1C 00 00: Draw Actor $1C (Guy NPC) 0 X and 0 Y pixels.}

Finally, Guy resets to his default sprite. The game also both moves his logical position onto the tile where he already appears to be and resets his rendering settings to draw him at his logical location, so although internally he's shifted one tile to the left, there's no visible movement.

All that just for Guy to leap at Maxim and fall to the ground! But the results are undeniable.

2023-12-18

Zombieconomy Sim Analysis

Introduction

Zombieconomy Sim, by Craze, appears in Befuddle Quest 4 Dead, the fourth in a series of collaborative puzzle games organized by kentona, which I recently (as of this writing) streamed a playthrough of on YouTube. It's largely similar to the Economy Sim minigame Craze contributed to Befuddle Quest 2: Charmed & Dangerous, but zombie themed.

And I found myself failing it repeatedly (refer to the end of Befuddle Quest 4 Dead (part 1 of 3)). So, as I tend to do, I went ahead and took a look at the design. After coming up with a plan, the next attempt went much more smoothly (refer to the beginning of Befuddle Quest 4 Dead (part 2 of 3)).

2020-03-29

Text Encoding and Compression (featuring Lufia 2)

One of the things I have a lot of on my website is attempted translations of video game text, mostly SNES-era RPGs since that's what I grew up on and have the most familiarity with. This started out as something I did out of my own personal curiosity and for practice, before it occurred to me that I might as well go ahead and share it. Here's a little more insight into part of the process.

2019-10-27

Most Common Kanji in FFVI Text

Some time ago, I was asked about kanji that frequently appear in Final Fantasy VI, so I scanned the text dumps to put together a list of the top 25, then added some basic information about them. Going through some of my working documents recently, I found the list and figured it would work as a blog entry with some revisions and extra detail, mainly added commentary.

2017-05-17

Pokémon GO types rant

I want to start by saying that I do enjoy the game overall. The data usage is basically negligible as long as you get game updates through wifi. It helps motivate me to do some of the exercising and exploring I ought to be doing anyway, and honestly enjoy doing anyway once I actually start moving instead of making excuses. There's just something about seeing these creatures from my childhood coming to life... more or less, anyway. And it's free to play!

That said, it definitely has its problems. There's no interaction between players except indirectly through king-of-the-hill-style fighting over gym locations. Status ailments don't exist. Monster spawns are often poorly distributed outside of urban areas. Eevees show up constantly instead of being rare enough that you can only get a single one in many of the games. A number of special monsters remain completely unavailable so far (though maybe that's better than if everyone were overusing them). The app chews through battery charge like no one's business. The interface's responsiveness always seems to stutter at the worst possible times. I've recently been having an annoying problem where all the nearby monsters sometimes vanish for a few seconds before coming back, sometimes several times in a row. Stability remains an issue months after the initial release, especially in the busier areas that would otherwise be the best places to play. The positioning sometimes gets so flaky that it thinks I'm driving too fast even when I'm on foot, or not moving at all. And let's not forget the cheaters.

None of those are my main gripe, though.

2016-01-18

Some Japanese Vocabulary Relevant to Video Games (originally posted on uCoz)

It feels like I'm past due to make some sort of update, and I've been putting this list together on and off for a while, so here it is.

Miscellaneous Vocabulary Related to Video Games

2015-03-17

Secret of Mana / Seiken Densetsu 2 / Legend of the Holy Sword 2 in the works (originally posted on uCoz)

So I've finally gotten around to putting together full text dumps from the game, with everything decoded except control codes (movement, sound effects, music changes, and so on are all lumped in with the text, instead of the text being in its own block and called by reference like it is in most of the other games I've dealt with). Aided by a reasonably functional editor, and a gamefaqs message thread with a remarkable amount of technical data as reference, and BizHawk's RAM Watch functionality to test some things, the section is shaping up rather nicely.

It's not ready to be posted yet, but for now, here's a list of some findings I thought were interesting and possibly surprising.

2009-09-04

My Bloopers in Chrono Trigger (originally posted on FortuneCity)

I recently (relative to when this entry was originally written) revised my translation of Chrono Trigger yet again (update planned for some time on 05 September 2009), and found a number of foul-ups along the way. Rather than simply correct them and be done with it, I've put together a list of the more significant ones to analyze here for your viewing pleasure, or whatever.

2009-04-23

How Translation Killed Another Puzzle: Part 2 (originally posted on FortuneCity)

The other day... well, okay, close to four months ago... I wrote about Luca's Love Flow puzzle, along with various ranting about translators handling things poorly. Today, I bring you the other half of the puzzle, with Cloche's Love Flow. You won't see both in the same playthrough, for reasons that become obvious when you get to that point of the game, but it's quite similar in concept.

2009-01-30

How Translation Killed Another Puzzle (originally posted on FortuneCity)

Ar tonelico II: Melody of Elemia. Great game, great music, thoroughly convoluted plot, and an engaging battle system. Unfortunately, it suffered even more in translation than most games do. Overall, the translation feels rushed, with some spelling inconsistencies, awkward phrasing, and more. Names suffered too, such as the "waath" (Hymmnos for "rebirth" or "renewal") in Luca's name, lost when someone decided to change the spelling to "Trulyworth" (while that interpretation is meaningful, it's not the only or even the primary one).