LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
294 stars 591 forks source link

🐛 Traveling Merchants (Regional NPC's) not appearring in 1st place nation if 2nd/3rd place nations are allied? #3137

Closed RAIST5150 closed 1 year ago

RAIST5150 commented 1 year ago

I affirm:

OS / platform the server is running (if known)

Linux

Branch affected by issue

base, noticed on xiweb, rebuilt late on 11/3/2022

Steps to reproduce

One nation wins conquest, the two losing nations are allied. Seek out the Traveling Merchants (Nokkhi Jinjahl, Ominous Cloud, and Valeriano) in the appropriate zone of the 1st place nation, and they are not there. (more details and screen shots to follow in additional comment)

Expected behavior

These merchants appear when there is a clear winning 1st place ranked nation in conquest... no alliance or tie with that 1st place nation.

RAIST5150 commented 1 year ago

Much discussion went on about this state recently in xiweb's discord. Will post some info that was submitted in discord from Kain's logs and SQL query, as well as in game screen shots from my client confirming the regional map status and absence of the NPC's.

A question was raised as to whether checks in conquest.lua are getting a false positive to keep the NPC's hidden because there is an alliance present, although it is between the 2nd and 3rd place nations?

Info from logs and a SQL query presented by Kain in our Discord this afternoon concerning the issue:

[11/04/22 15:01:34:918][map][info] do_init: loading zones (do_init:260)
[11/04/22 15:01:41:443][map][lua] Making regional conquest NPCs available in: Port_Bastok (lua_print:153)

2022 11 04_ConquestState

Some wiki references concerning these NPC's: https://www.bg-wiki.com/ffxi/Category:Traveling_Merchant https://classicffxi.fandom.com/wiki/Traveling_Merchants

Screen shots from my client this evening:

2022 11 04_RegionMap

2022 11 04_NoMerchants

RAIST5150 commented 1 year ago

Should add that the following week, there was a tie for second place, with an alliance between those two nations.

No tie, nor an alliance with the clearly winning 1st place nation.. and again, the NPC's were a no show.

Which begs the question of whether that IsConquestAlliance check is indeed at fault here, and also... whether it is even relevant for this decision?

Does an alliance ever form with the clear first place winner?

Should it not simply be a question of whether there is a clearly defined first place nation (a tie occurring only between 2nd/3rd slots, and provided any alliance formed would be between those same 2nd/3rd slot nations and never including the clearly defined 1st place nation)?

TeoTwawki commented 1 year ago

It looks like xi.conquest.toggleRegionalNPCs() is simply set to not spawn them if any alliance is happening, and this was less notable/reported prior because a bug allowed to them to spawn at the 3rd place nation in these cases and that has now been fixed. if 2 nations tie for 1st, they go missing. if 2 nations tie for 2nd/3rd, they still show at the 1st place nation. doesn't look like the current code checks beyond "does an alliance exist".

Which is likely from ties not supposed to be possible for ranks other than 1st : it is possible for a 3 way tie for 1st image but there is zero mention if a clear 1st place and then the other 2 tying for 2nd on bg. old wiki the other hand, strongly implies the possibility and I want to say I have seen it. So very plausible older authors went by what one wiki said without checking both or seeing anything in game to base the code off.

RAIST5150 commented 1 year ago

Adding just for completeness sake. This week, xiweb got the traveling merchants in Windy with Ranks 1/2/3 clearly defined and no alliance present. When initially posting this issue, Bastok was first of the three but an alliance was present between Sandy/Windy when they did not show up.

Raist_2022 11 15_ConquestMap Raist_2022 11 15_gypsies