News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Castlevania II (Simon's Quest) - Multilingual enhancement  (Read 515349 times)

Bisqwit

  • Sr. Member
  • ****
  • Posts: 421
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1060 on: July 15, 2020, 09:29:40 am »
Tip-toe to the very edge, where on the very next frame Simon falls down. Perform the whip on that frame.

There's a variable at ram $336. 18-FF = okay. 00-17 = fall-through.

$336 = ObjectScreenYCoordFrac.

Yes…? I mean, not exactly secret knowledge you posted there (although I hadn’t tested the specifics). What is the point of this post?

Code: [Select]
+ $A4B5  A9 10:       lda #$10
++ $A4B7  A0 14:       ldy #$14
$A4B9  20 A2 E2:    jsr Object_GenericCollisionHelper_ParamAY_ReturnCarry_IfFrameOddThenDefaultSEC
$A4BC  B0 06:       bcs + ; $A4C4
$A4BE  20 27 E0:    jsr Object_SetXVelocity16bit_InvertCurrent
$A4C1  4C D9 A4:    jmp +++ ; $A4D9 -> Object_GeneringXYmovementEngine

About the ferryman stopping at the opposite shore. Would it be doable to set ObjectXSpeed to zero instead of inverting? Then the boat just stops a tad short of land but no longer moves anywhere.

It would be rather trivial to change (although it might be more complex than what you said, because when you are standing on the boat that has begun moving, you can’t talk to the ferryman), but I have not focused efforts on that, because I am not convinced that the game should be changed in this regard. I just listed it because I felt like listing it — because I was listing bugs of the game.
« Last Edit: July 15, 2020, 10:02:46 am by Bisqwit »

binarck

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1061 on: July 15, 2020, 11:12:53 am »
@knderia
Have you tested your suggested ferryman change?
- Once the boat stops, you can talk to him repeatedly with the same response.

- If you made a mistake and don't want to disembark, tough. You can't travel back to the other side without getting off and walking some ways to reset the boat.

- You can use the boat as a safety ledge against enemies, attack with near-impunity. That you're originally forced into hostile territory is what takes away the protection of getting off.

- I never saw the ferryman as that friendly anyways.


I don't think many of the remaining glitches are that harmful or not beneficial to players. Even falling through floors, although I'd prefer it be an optional fix. Are any of the present bugs worth fixing??


With the palette-fader, I think it'd be neat to have a 2-3 frame animation of the townsfolk shutting their doors at dusk to block Simon from entering. The zombies showing up early was actually cool I thought when it happened to me; caught me off guard.

helaku

  • Jr. Member
  • **
  • Posts: 44
  • What is a night without a curse?
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1062 on: July 15, 2020, 02:24:38 pm »
I don't know Bisqwit if you know but an official "glitch" that worked on the USA/Europe version didn't worked on the Japanese one or it's much harder to do it.

It's about this:


I can reproduce it using your patches and on the USA/Europe version releases but not on the Japanese one.

You must have to be very precise to execute this "glitch"; you have to press at the same time jump and attack at the very edge; that's how I've finished the game back in my childhood, didn't know about the red crystal power :laugh:

Do you think you can fix it in your version?

UPDATE: I've reproduced it on the Japanese one but it's much harder to do it than on USA/Europe version.
« Last Edit: July 15, 2020, 02:46:09 pm by helaku »
Have at you!

Bisqwit

  • Sr. Member
  • ****
  • Posts: 421
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1063 on: July 15, 2020, 02:47:50 pm »
I don't know Bisqwit if you know but an official "glitch" that worked on the USA/Europe version didn't worked on the Japanese one or it's much harder to do it.

I can reproduce it using your patches and on the USA/Europe version releases but not on the Japanese one.

You must have to be very precise to execute this "glitch"; you have to press at the same time jump and attack at the very edge; that's how I've finished the game back in my childhood, didn't know about the red crystal power :laugh:

Do you think you can fix it in your version?

UPDATE: I've reproduced it on the Japanese one but it's more harder to do it than on USA/Europe version.
Yeah, I can reproduce that glitch effortlessly on the NES game (at least in NTSC version). The same jump can also be performed at a couple of other places to save time in a speedrun. I wasn’t aware that it would be more difficult on the FDS version, though if I try hard, I can think of theories why it would be the case.

In any case, this falls into the category of things that are not worth “fixing” in my opinion. One could even argue that it’s a feature. It makes sense that you could gain some extra momentum from the whip the same way you can shift your center of gravity by positioning your hands and legs. Although the likely truth is it wasn’t designed that way.

The two-tile ledge fall-through floors glitch is another one that is probably not worth “fixing”. Casual players are very unlikely to run into it by accident (although it can happen), and people who know about it can use it (sometimes) to save time, especially in a speedrun. It is clearly a glitch though.

By the way, when posting screenshots, please try to do so without adding COLOSSAL black borders to them.

helaku

  • Jr. Member
  • **
  • Posts: 44
  • What is a night without a curse?
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1064 on: July 15, 2020, 03:00:53 pm »
Yes, sorry about the pictures...

In my case, this glitch somehow stopped me from discovering the use of the red crystal; only after some month's and after I've finished the game I understood the meaning of the riddle and discover how to use the red crystal.

So, from my point of view this glitch could ruin the natural feeling of using the items like they were supposed to.

If a casual gamer doesn't discover this glitch (aka repair) he is somehow forced to solve the red crystal riddle making the game a little harder and enjoyable from my point of view.

I for example, didn't play it with walkthrough or anything that helped to solve the puzzles; I simply tested every wall/rock with the holly water :banghead:
At that age I think I've tested every corner of this game using all combinations; that's why it's one of my favorite game of all time.

Don't know if others know but some invisible stairways must be discovered; I've discovered all of them :D
What is the use of them I have no idea :o
« Last Edit: July 15, 2020, 03:56:20 pm by helaku »
Have at you!

binarck

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1065 on: July 15, 2020, 06:40:13 pm »
What's interesting is how much height Simon gains due to the jump glitch. 6-7 pixel gain.



Code: [Select]
$863E  A0 10:       ldy #$10
$8640  20 ED 86:    jsr Simon_CheckMapCollision_LeftAndRight
$8643  C9 01:       cmp #$01
$8645  F0 0E:       beq + ; $8655
$8647  C9 02:       cmp #$02
$8649  F0 0A:       beq + ; $8655

+ -- $8655  20 F3 84:    jsr _func_C4F3

All I can think so far is to add a check to see if Simon is above the landing platform before shoving him onto ground. C4F3 clips sprite to ground level, so compare that result to old oam sprite ypos (ram $240).

If originally below, reload old value and block the gain. $04 would be a nice temp variable from Simon_CheckMapCollision_LeftAndRight.



Maybe the FDS version has a smaller y-subpixel velocity boost, making it harder to get up that high?
« Last Edit: July 16, 2020, 10:37:10 am by binarck »

Bisqwit

  • Sr. Member
  • ****
  • Posts: 421
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1066 on: July 16, 2020, 04:42:44 pm »
I can imagine that if we reduce the range that Simon’s Y-coordinate is automatically aligned to the nearest surface, it will increase chances of the fall-through-floors glitch manifesting. As for any additional checks, I am not feeling too positive about the idea of adding more code that has potential to lag the game. This game already has way too much lag.
« Last Edit: July 16, 2020, 04:56:04 pm by Bisqwit »

binarck

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1067 on: July 16, 2020, 05:58:45 pm »
$8655 is only triggered when Simon is falling and hits a (semi-)solid object, so it won't run on most frames.

That's when I'd do the y-pos test which from small testing, I don't think it would affect the fall through floors bug, but I am curious why that happens also.


I might try writing a proof-test to see how well it works later. You pulled off some incredible technical feats with this game; I never realized still how slow the engine is running. That's a bummer. :|

________________________________________________________


Explanation of floor bug:
- Walk off floor and use item. ObjectXSpeed = 1. ObjectCurrentActionType = 5.
  Note that ObjectXSpeed = 5 when normally falling straight down and using item.

- If the subpixel height gain from using item is large enough, we get a pixel shift.
  Which causes us to miss the floor detection on next frame.


- When item is done playing, $DC86 is called to reset pose.
  Because ObjectXSpeed = 1, game thinks we are walking sideways (not falling).
  Turns off Temp93.

- Simon is allowed to free-fall for at least 1 frame because _loc_C632 is not doing collision detection.

- Sometimes game turns back on Temp93 and Simon keeps falling to next platform below.
  Other times Temp93 is off and dies below.


Not sure if there's another way than to insert kludge at $DC86 to check for ObjectCurrentActionType(05) and turn back on Temp93. :|

But $DC86 runs only 1 frame of lag since it's putting the item away.


Or it can be done here?
Code: [Select]
_loc_C6E0
$86E0  A9 01:       lda #$01
$86E2  20 C0 D3:    jsr CheckIfBoneHeld_SetSimonAutomaticSprite_To_Table_Atimes2plusBone
$86E5  20 7A 87:    jsr Clear_Unknown6Cand6D
$86E8  A9 05:       lda #$05
                            sta ObjectXSpeed
$86EA  4C BD DE:    jmp Object_SetCurrentActionType_For_Simon

It's a 1-time tiny hit for walking off ledges and works to solve the glitch. Although dealing with free space looks annoying.

________________________________________________


I have a naive question about this snippet.

Code: [Select]
Simon_CheckMapCollision_LeftAndRight
$86ED  84 94:       sty Temp94
$86EF  A9 FA:       lda #$FA
$86F1  A4 94:       ldy Temp94
$86F3  20 AC D3:    jsr Simon_CheckMapCollision
$86F6  85 04:       sta $04
$86F8  A9 06:       lda #$06
$86FA  A4 94:       ldy Temp94
$86FC  4C AC D3:    jmp Simon_CheckMapCollision

Based on the xspeed, couldn't you just check 1 side or the other? Seems like a waste to check both sides of the map if you're heading in one exclusive direction.

____________________________________________________


Small gain.

Code: [Select]
Update_39_and_3B
lda CurrentXScrollingPositionPixels
lsr
lsr
lsr
lsr
sta TempPtr08_lo
lda CurrentXScrollingPositionScreens
asl
asl
asl
asl
ora TempPtr08_lo
sta Unknown39_From_XscrollingPositionDividedBy16
lda CurrentYScrollingPositionPixels_Mod256
lsr
lsr
lsr
lsr
sta TempPtr08_lo
lda CurrentYScrollingPositionScreens_maybe
asl
asl
asl
asl
ora TempPtr08_lo
sta Unknown3B_From_8C8D_dividedBy16
rts
nop
nop
nop
nop

_________________________________________________

Quote
I can imagine that if we reduce the range that Simon’s Y-coordinate is automatically aligned to the nearest surface

My safety net was to see the previous oam or physically drawn y-coord on-screen.

Normally when falling down, Simon's last visible frame should always above the platform. In the 3-pillar exploit, he's clearly seen below ground and on a descending velocity; last oam value useful to detect this.
« Last Edit: July 17, 2020, 08:23:00 am by binarck »

Bisqwit

  • Sr. Member
  • ****
  • Posts: 421
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1068 on: July 17, 2020, 09:44:45 am »
Small gain.
Code: [Select]
lsr
lsr
lsr
lsr

Yeah, the code is full of things like that. I have fixed some of them as I go, through I try to keep the impact as small as possible so as to minimally hamper compatibility with possible other patches people want to apply. The general guideline is that I only optimize code that I already need to replace for other reasons. One exception was NMI_ProcessPPUsendQueue handler, which I rewrote and optimized with unrolling & duff’s device because I needed it to be faster in order to support wider dialog boxes. The length changed from 192 bytes to 182 bytes.
In this particular case that you quoted, each replacement of and+jsr with 4×shift saves one byte and 14 cycles.

As for your question, what you are proposing regarding checking only the relevant side makes sense, although I imagine that’s exactly how SMB1 gets its walk-through-walls glitches. You can enter a wall as long as you do it backwards (and your Y coordinate modulo 16 is within certain range and you keep jumping).
« Last Edit: July 17, 2020, 09:51:09 am by Bisqwit »

binarck

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1069 on: July 17, 2020, 12:17:04 pm »
I realized that you can jump right and catch the edge of a platform with the far left side of the sprite. So that idea is toast. But a new thought.

Code: [Select]
;------------------------------------------
Simon_CheckMapCollision_LeftAndRight
$86ED  84 94:       sty Temp94

$86EF  A9 FA:       lda #$FA
$86F1  A4 94:       ldy Temp94
$86F3  20 AC D3:    jsr Simon_CheckMapCollision
$86F6  85 04:       sta $04

$86F8  A9 06:       lda #$06
$86FA  A4 94:       ldy Temp94
$86FC  4C AC D3:    jmp Simon_CheckMapCollision

We do the obstacle math for the left side. Because we know the right side is literally just 1.5 8x8 blocks away (12 pixels), we can shortcut all the math. Update ObstaclePointerLo, NameTableAddressLo manually. Then jmp straight to $E9FB and get the other side very quickly. Would save a ton of cycles.

Bisqwit

  • Sr. Member
  • ****
  • Posts: 421
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1070 on: July 17, 2020, 07:39:29 pm »
Version 2.10.0-test3 is now available at: https://bisqwit.iki.fi/cv2fin/ips/cv2_ntsc_eng_map10_vram0-2.10.0-test-3.ips
EDIT: NOW it is there. I accidentally copied it into wrong directory.

Still not in the vending machine, because I need enough feedback on whether this dialog size thing is a good idea to have or not.

Changes:
— Fix 2.10.0 regression: Visiting the SRAM-save screen can soft-lock the game in some situations by preventing screen scrolling
— Fix potential source of bugs: Blob merger in the linker did not verify if two sets of externs have a bytewise partial overlap.
— Some text changes mainly in Jova.
— Made more code relocatable, although the mechanism is very clunky. Ideally my linker would deal with CA65’s .o files directly, but the object file format is too complex and not really designed for interoperability. I already have code that deals with o65 files (Andre Fachat’s tools as well as my own nescom/neslink), but CA65 cannot produce those. So instead, I have to produce (almost) position-independent code, compile each of them into raw binaries using ld65, and then use sub-string replaces on the binary data to insert actual fixups/externs/relocations before linking. Only for some pieces that I really need to make sure that no page-wrapping occurs, I link them into fixed addresses, so that I can use CA65’s .assert to verify&catch violations of the rule.
— Fix 2.10.0-test1 regression: Toast ending no longer skips first line.


QUESTION time. Margins!

First image: No margins.
Second image: Left margin.
Third image: Top margin.
Fourth image: Both margins (current version).






Which one looks best?
« Last Edit: July 17, 2020, 09:26:56 pm by Bisqwit »

binarck

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1071 on: July 17, 2020, 09:23:51 pm »
I shortly compared all 3 versions: vanilla, 2.9.9.1, widebox.
-- Liked vanilla the least. It may be nostalgic but meh. The font and short text clips turn me off now.

-- 2.9.9.1. Font is nice but the fixed-size box feels restricted. I'd wonder if you had to cut parts of the script to make things fit. And it takes me time to digest everything. It just feels strange to me but it works.

-- Widebox. I'll label this "natural", meaning I don't think about the formatting or anything as much. The text pauses and line breaks are more pleasing to me visually and mentally. Maybe some things can be rearranged like

"Would you like
 to buy a
 [white crystal?]"

And perhaps some boxes can be shrunk down some on the side?

"Find one of the
 13 hidden clues,
 and a riddle
 can be solved"

Or expanded some more?

"Go and buy a white
 crystal.

 That's the first thing
 you must do, the
 beginning of all things."


Perhaps I'm thinking more of the Romancing Saga type resizable dialog boxes.


Quote
Still not in the vending machine, because I need enough feedback on whether this dialog size thing is a good idea to have or not.

I suppose after a longer playthrough, my opinion may shift more. But I still think widebox is a better direction so far. Has more breathing room.

I'd think don't hurry putting into the vending machine. Give it some more tweaks and reflection.

_________________________________________________________


edit:
Just saw the edit. For Aldra pic, I'd say margin #2. Greatly prefer the blank line added in the middle.

Cemetary = #2 also.

Don't know why but find #1 to be disgusting. Guess it's too close to the side.

Laurel = #4. Clear winner for me.



Short summary: I like padding in general. And not too much excessive blank space. I can be very picky without good reason.

That might change a lot when playing in real-time and turning off the analysis; just enjoyment mode.

#4 on average is good though. I'd go for a mix depending on text to get best results.
« Last Edit: July 17, 2020, 09:35:24 pm by binarck »

Bisqwit

  • Sr. Member
  • ****
  • Posts: 421
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1072 on: July 17, 2020, 09:34:01 pm »
Both the dialog box size and the margin thing are global. Although for box sizes, I have a total of eight different sizes that I can can use. One for dialog (excluding latter categories), one for shops, one for clues, one for gift-givers, one for possessions, one for the priest, and one for the ferryman. All sizes also must be multiples of 16 pixels (two tiles) in both directions.

I suppose in theory the boxes for everything except status/shop/possess could be adaptive, but right now I am not too optimistic about that idea. It looks like pretty major work.

binarck

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1073 on: July 17, 2020, 10:05:50 pm »
I don't think adaptive boxes would look that great. Having 'perfect' looking boxes everytime can came off as too sterile and robotic also (which is kinda why I unlike the non-widebox look).


At most just an extra string header flag for [medium, large, extra] or something would cut down the right-side padding. And adding [line break] flag to laurel picture #2 would easily simulate #4 and satisfy me.


As for a vwf, I honestly don't know. You should do a mockup with(out) composite bleeding. Not sure the gain is worth all the fancy trouble.


edit: Possible to add a tiny pause x2 after the Priest's "Amen."? It flashed by so quickly and closed suddenly, felt abrupt.

Bisqwit

  • Sr. Member
  • ****
  • Posts: 421
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1074 on: July 17, 2020, 10:17:57 pm »
edit: Possible to add a tiny pause x2 after the Priest's "Amen."? It flashed by so quickly and closed suddenly, felt abrupt.
Just go kiss a skeleton or two and the problem is solved.

binarck

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1075 on: July 17, 2020, 10:27:46 pm »
I get your point about the healing time being the pause. :)

Bisqwit

  • Sr. Member
  • ****
  • Posts: 421
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1076 on: July 18, 2020, 12:09:08 am »
How about this?

For comparison (the misplaced arrow has already been fixed):
« Last Edit: July 18, 2020, 12:14:54 am by Bisqwit »

Vanya

  • Hero Member
  • *****
  • Posts: 1759
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1077 on: July 18, 2020, 05:14:55 am »
New one looks much better.

binarck

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1078 on: July 18, 2020, 08:13:32 am »
+1 for new style. A clever rearrangement and looks more informative than bottom two. Also takes advantage of the wide-look. That inside menu border divider line helps a lot.

First impression sticks better.
« Last Edit: July 18, 2020, 08:19:32 am by binarck »

ifightdragons

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: Castlevania II (Simon's Quest) - Multilingual enhancement
« Reply #1079 on: July 18, 2020, 09:16:53 am »
I'll be the contrarian;

I don't think the wide text box adds a lot of value. It might be slightly more aesthetically pleasing, but to me the difference is truly nigh on negligible.
However, if adding them doesn't require a lot of work on your part, I'd say go for it.

But if adding them takes a lot of extra work, and/or might open up possibilities of new bugs and potential conflicts with existing code, I'd say it's not worth it as the value returned is, subjectively, not a lot.