Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCI32: Fix QFG4 tarot readings #1434

Merged
merged 1 commit into from Dec 24, 2018

Conversation

Projects
None yet
2 participants
@Vhati
Copy link
Contributor

Vhati commented Dec 4, 2018

Fixes incorrect cards and placement in the third and fifth readings.

#10822

// The fortune teller's third reading places the "Two of Cups" across another
// card, off-center. That View (1023) is cropped (130x64). All other horizontal
// cards (130x86, 130x87) are padded at the bottom with transparent pixels.
//
// A utility script (sShowCard) is scheduled to create each card with a given
// View (passed as local[0]) and move it onto a given pile (passed as local[2]:
// center, west, south, east, north). It has a switch block deciding x,y coords
// depending on the pile.
//
// We optimize a couple cases by consolidating their common code in a
// subroutine to make room. The rewritten case for the east pile checks if the
// requested card was "Two of Cups". If so, a special Y value is used.

#10823

// The fortune teller's third reading displays a right-turned "The Devil" card,
// but Magda says it is "Death".
//
// We change the card to a right-turned "Death".

#10824

// The fortune teller's third reading has the wrong card at the center. The 3rd
// and 4th reading are about different people, yet both have "Queen of Cups".
//
// The 1st reading establishes "Queen of Cups" as: a woman of wisdom and love,
// kind, generous, and virtuous. This fits the 4th reading: she uses her power
// joyfully, giving gracefully and lovingly to others.
//
// The 1st reading establishes "Queen of Swords" as: a deceiver or deceived,
// having suffered through terrible hardship, she faces her sorrows bravely,
// but with deep loneliness. This fits the 3rd reading better: some cruel event
// shaped her life... ambition, self-deception, and she is falling in love.
//
// We change the 3rd reading's center card to "Queen of Swords".

#10845

// The fortune teller's third reading places horizontal cards on top of
// vertical ones. Some then fall *through* the vertical card to the bottom.
//
// A utility script (sShowCard) creates each card and moves it onto a pile
// (center, west, south, east, north). Then the card is assigned a priority
// with setPri(). Generally these piles are two cards deep. Center has one.
//
// Every pile ought to start with priority 0 and increment thereafter. Somebody
// mixed up the setPri() sequence. We change 0;1,0;1,0 to 0;0,1;0,1.

#10846

// The fortune teller's fifth reading is unusual. It places all cards at the
// center pile, periodically fading out to clear the table. When Magda
// talks about the Sense Ritual, the "Six of Swords" (view 1048) sinks below
// the previous card.
//
// A shared utility script that creates and places cards (sSetTheSignificator)
// uses priority 12 as it deals, after which each card is given a lower value
// with setPri(). "The Falling Tower" (view 1031) did *not* get a new priority.
// Thus "Six of Swords", when given priority 1, sinks below 12.
//
// "Six of Swords" is the last card before a fade. We simply leave its priority
// at 12 as well. Being the most recent card, it will be on top. No worry
// about covering a subsequent card because the table will be cleared.

To test any reading...

  • Create a new character. Any kind.
  • Set plot flags for having seen previous readings.
    • Reading 1.
      • Just teleport.
    • Reading 2 (297).
      • vv g 518 64
    • Reading 3 (297, 298).
      • vv g 518 96
    • Reading 4 (297, 298, 299).
      • vv g 518 112
    • Reading 5 (297, 298, 299, 300).
      • vv g 518 120
  • Teleport into the tarot room.
    • room 475

For anyone interested in seeing higher-res cards...

Video: YouTube - Spoiler of the "Russian Tarot of St. Petersburg" deck (illus. Yury Shakov)

  • 0:31 Death
  • 0:34 The Devil
  • 0:46 Queen of Swords
  • 1:14 Queen of Cups
  • 1:25 Two of Cups

@digitall digitall requested review from bluegr and m-kiewitz Dec 4, 2018

@Vhati Vhati force-pushed the Vhati:qfg4_reading_three branch 2 times, most recently from 1995bb8 to 75fbdc2 Dec 11, 2018

@Vhati Vhati force-pushed the Vhati:qfg4_reading_three branch from 75fbdc2 to 6d0cbac Dec 16, 2018

@Vhati

This comment has been minimized.

Copy link
Contributor Author

Vhati commented Dec 17, 2018

This is what sThirdReading looks like. It's basically a cutscene, where the player clicks to deal the next card and hear Magda's interpretation.

script 745 - sThirdReading::changeState()

[...]
(18
	(= local0 1022)  # Ten of Clubs
	(= local2 4)  # East pile
	(g0_hero setScript: sShowCard self)
)
(19
	(local1 setPri: 1)
	(g91_gloryMessager say: 1 6 36 0 self)  # Magda describes the card.
)
(20 (localproc_1cfb))
(21
	(= local0 1023)  # Two of Cups
	(= local2 4)  # East pile
	(global0 setScript: sShowCard self)
)
(22
	(local1 setPri: 2)
	(g91_gloryMessager say: 1 6 37 0 self)  # Magda describes the card.
)
(23 (localproc_1cfb))
(24
	(= local0 1024)  # The World
	(= local2 5)  # North pile
	(g0_hero setScript: sShowCard self)
)
[...]

local[0] is the desired view for the card.
local[2] is the numbered destination pile.
sShowCard calls Glory::handsOff(), then creates and places the card.
local[1] is the last created card.

localproc_1cfb() selects HAND on g69_mainIconBar and calls g80_User::canInput(1), allowing the player to click the deck for another card.

@Vhati

This comment has been minimized.

Copy link
Contributor Author

Vhati commented Dec 17, 2018

script 475 - sShowCard::changeState()

(switch (= state param1)
	(0
		(global1 handsOff:)
		((= local1 (aTurnCard new:))
			view: local0
			init:
			moveSpeed: 0
			setPri: 250
			setStep: 30 10
			setMotion: MoveTo 148 150 self
		)
	)
	(1 (= seconds 5))
	(2
		(switch local2
			(1  # Center pile
				(local1
					moveSpeed: 0
					setStep: 30 10
					setScaler: Scaler 100 35 150 110
					setMotion: MoveTo 145 110 self
				)
			)
			(2  # West pile
				(local1
					moveSpeed: 0
					setStep: 30 10
					setScaler: Scaler 100 35 150 110
					setMotion: MoveTo 80 110 self
				)
			)
			(3  # South pile
				(local1
					moveSpeed: 0
					setStep: 30 10
					setScaler: Scaler 35 100 170 150
					setMotion: MoveTo 144 170 self
				)
			)
			(4  # East pile
				(local1
					moveSpeed: 0
					setStep: 30 10
					setScaler: Scaler 100 35 150 110
					setMotion: MoveTo 210 110 self

# This is where Y is fudged, if the card is "Two of Cups": 102 instead of 110.
				)
			)
			(5  # North pile
				(local1
					moveSpeed: 0
					setStep: 30 10
					setScaler: Scaler 100 35 150 50
					setMotion: MoveTo 144 50 self
				)
			)
	(3 (sndPlace play: self))
	(4
		(= local2 0)
		(self dispose:)
	)
)

@Vhati Vhati force-pushed the Vhati:qfg4_reading_three branch 2 times, most recently from 130ea01 to ee61c68 Dec 17, 2018

@Vhati

This comment has been minimized.

Copy link
Contributor Author

Vhati commented Dec 17, 2018

Description has been revised.

@Vhati Vhati force-pushed the Vhati:qfg4_reading_three branch 5 times, most recently from 603cedc to 7595b45 Dec 17, 2018

@Vhati Vhati changed the title SCI32: Fix QFG4 third tarot reading SCI32: Fix QFG4 tarot readings Dec 20, 2018

@Vhati

This comment has been minimized.

Copy link
Contributor Author

Vhati commented Dec 20, 2018

Added two more patches, for priority bugs in the third and fifth readings.

@Vhati Vhati force-pushed the Vhati:qfg4_reading_three branch 4 times, most recently from 6f5754b to 0acb267 Dec 20, 2018

SCI32: Fix QFG4 tarot readings
Fixes incorrect cards and placement, bugs #10822, #10823, #10824, #10845,
and #10846

@Vhati Vhati force-pushed the Vhati:qfg4_reading_three branch from 0acb267 to 567c778 Dec 23, 2018

@Vhati

This comment has been minimized.

Copy link
Contributor Author

Vhati commented Dec 23, 2018

While I caught up with master, I'd trimmed some bytes switching call offsets from UINT16 to single-byte. Waste bytes' disassembly happened to align without the need for an erasure line.

Forgot to adjust jumps and branches afterward. Should be working again now.

@bluegr

This comment has been minimized.

Copy link
Member

bluegr commented Dec 24, 2018

Nice work! This is quite a long list of bugs for the card readings, and your time spent on these is much appreciated! :)

Bugs #10822, #10845 and #10846 are all minor graphical glitches.

Bug #10823 is obviously wrong, the voice describes a different card.

Bug #10824 is quite obscure. After reading through all the transcripts as you wrote them in the bug, it's quite apparent that the central card is wrong in the third reading.

Patching these (especially #10822) was hard. Kudos for your work!

Merging

@bluegr bluegr merged commit 6383200 into scummvm:master Dec 24, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Vhati Vhati deleted the Vhati:qfg4_reading_three branch Dec 25, 2018

@Vhati

This comment has been minimized.

Copy link
Contributor Author

Vhati commented Dec 27, 2018

@bluegr:

your time spent on these is much appreciated! :)

I appreciate your closing remarks on tickets and PRs.
Even the boilerplate ones are good for morale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.