Skip to content

Conversation

yungcomputerchair
Copy link
Member

Task 875 in the XDT (both 104 and 1013) grants the wrong quest item on start. It should grant Fusion Override Module (231) but instead grants an unnamed quest item that isn't used anywhere else in the questline. Dev probably put in the task number by mistake but this will fuck up serverside quest item logic. Don't think the client is impacted at all.

Of Fathers and Fusions (Part 3 of 3) [M#279]
Type: Normal
------------------------------------
Find the Fusion Portal. [T#875]
Task type: 2 (GotoLocation)
Req NPC: Professor Utonium (702)
Req level: 8
Req completed missions:
	Of Fathers and Fusions (Part 2 of 3) [M#278]
Obtain items:
	UNKNOWN (875) x 1 (given)    <--- should be Fusion Override Module (231)
Target NPC: Location A206 (1337)
SUCCESS task ID: 879
Delete items:
	Fusion Override Module (231)

Enter the Fusion Lair. [T#876]
Task type: 2 (GotoLocation)
Req level: 8
Req completed missions:
	Of Fathers and Fusions (Part 2 of 3) [M#278]
Req instance ID: 36
Target NPC: Location A207 (1343)
FAIL task ID: 875
FAIL items:
	Fusion Override Module (231) x -1
SUCCESS task ID: 877
Delete items:
	Fusion Override Module (231)

Approach the force field. [T#877]
Task type: 2 (GotoLocation)
Req level: 8
Req completed missions:
	Of Fathers and Fusions (Part 2 of 3) [M#278]
Req instance ID: 36
Target NPC: Location A208 (1344)
FAIL task ID: 875
FAIL items:
	Fusion Override Module (231) x -1
SUCCESS task ID: 880
Delete items:
	Fusion Override Module (231)

Go to the exit. [T#878]
Task type: 2 (GotoLocation)
Req level: 8
Req completed missions:
	Of Fathers and Fusions (Part 2 of 3) [M#278]
Req instance ID: 36
Target NPC: Location A210 (1346)
FAIL task ID: 875
FAIL items:
	Fusion Override Module (231) x -1
SUCCESS task ID: 880
Delete items:
	Fusion Override Module (231)

Enter the Fusion Lair. [T#879]
Task type: 2 (GotoLocation)
Req level: 8
Req completed missions:
	Of Fathers and Fusions (Part 2 of 3) [M#278]
Target NPC: Location A210 (1346)
SUCCESS task ID: 880
Delete items:
	Fusion Override Module (231)

Defeat Fusion Bubbles. [T#880]
Task type: 5 (Defeat)
Req level: 8
Req completed missions:
	Of Fathers and Fusions (Part 2 of 3) [M#278]
Req instance ID: 36
Defeat NPCs:
	Fusion Bubbles (3) x 1
FAIL task ID: 875
FAIL items:
	Fusion Override Module (231) x -1
SUCCESS task ID: 2455
SUCCESS items:
	Fusion Override Module (231) x -1
Delete items:
	Fusion Override Module (231)

Exit and talk to the Prof. [T#2455]
Task type: 1 (Talk)
Req level: 8
Req completed missions:
	Of Fathers and Fusions (Part 2 of 3) [M#278]
Target NPC: Professor Utonium (702)
**Final task in mission** (success task: 0)

@dongresource
Copy link
Member

Did an in-game repro of all three missions in the questline to see how it behaves. Thought the mission would get stuck, but it completed just fine.

Upon a closer look at the mission tasks you've listed, I can see that the current behavior of the OpenFusion server implementation is that the wrong qitem (875) is given out, then the right one (231) taken away, but because 231's presence is never checked for on the client nor the server implementation the mission continues, and the server treats the removal of the non-existent 875 as a no-op. The outcome is that the invalid 875 remains as cruft in each player's quest item inventory after completing the questline.

This is consistent with a quick check of the number of 875 qitems on our public servers, which both total ~2700 for all players and only ~40 for players which actually have the two tasks in this mission in which you're supposed to have it.

Query for total 875 qitem count:

select
--	*
	count(*)
from QuestItems
--join RunningQuests ON QuestItems.PlayerID = RunningQuests.PlayerID
where QuestItems.id = 875 --and RunningQuests.TaskID IN (875, 876)

Query for would-be-valid 875 qitem count:

select
--	*
	count(*)
from QuestItems
join RunningQuests ON QuestItems.PlayerID = RunningQuests.PlayerID
where QuestItems.id = 875 and RunningQuests.TaskID IN (875, 876)

I'd say the qitem leak qualifies this as a tangible bug worth modifying the XDT dumps for, despite us having kept those clean so far. So I'm in favor of merging. But we should wait to actually apply a fixup to the DB to delete the post-mission instances of the qitem and transmute the ongoing mission qitem into the proper one, so as not to break the mission for players that currently have it. It's a simple fix, so I'll go ahead and do this this weekend or earlier.

This also highlights the possibility of checking public server DB quest item counts for signs of similar bugs. We should look into that.

@dongresource dongresource self-requested a review April 4, 2024 00:05
@dongresource
Copy link
Member

Here's a list of similarly likely leaked qitem IDs for your convenience, though note that some of these might be specific to defects in the current state of the OF server's mission implementation.

SELECT id, count(Players.PlayerID)
FROM QuestItems
LEFT JOIN Players ON Players.PlayerId = QuestItems.PlayerID
GROUP BY id
ORDER BY count(Players.PlayerID) DESC
LIMIT 10;
ID count(Players.PlayerID)
239 2814
238 2753
875 2749
263 2392
524 1865
254 1462
330 1208
136 815
85 646
176 591

Frequency for the first 7 is consistent between Original and Academy servers.

@yungcomputerchair
Copy link
Member Author

yungcomputerchair commented Apr 4, 2024

I did some analysis on the 104 XDT and looks like these leaks are present (in the success-only paths, at least):

Transmitter (537): 1 leaked by missions {1}
Burger Piece (31): -1 leaked by missions {9}
Gooby Trap (239): 1 leaked by missions {13}
Treasure map #3 (85): 1 leaked by missions {71}
Sticks and twine (95): 1 leaked by missions {78}
Treasure map #4 (102): -1 leaked by missions {82}
Shield Fragmentation Device (420): 1 leaked by missions {121}
Dark Tree seed (433): 1 leaked by missions {165}
Unk#875 (875): 1 leaked by missions {279}
Fusion Override Module (231): -1 leaked by missions {279}
Him's Magic Mirror (238): 1 leaked by missions {284}
Hall Pass (254): 1 leaked by missions {303}
Ace's Guitar (330): 1 leaked by missions {314}
Backstage pass (331): -1 leaked by missions {316}
Rebreather (492): 8 leaked by missions {353}
mini-Terrafuser (515): 2 leaked by missions {389}
Frequency Booster (263): 1 leaked by missions {418}
Sooper Secret Message (524): 1 leaked by missions {458}
Baseball Bat (556): 1 leaked by missions {733}

The QItem from this PR is in there and it looks like there is a lot of overlap with your findings from the DB.
I think these will need to be looked at and manually patched as well. (Maybe not the transmitter since it's tutorial only).

Edit: I got these numbers with roughly this reduction for each task:

qitem_count += max(m_iSTItemNumNeeded, m_iCSUItemNumNeeded)
qitem_count += m_iSUInstancename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants