Changes

Jump to navigation Jump to search
1,766 bytes added ,  07:47, 15 September 2021
Line 18: Line 18:  
:::The location of Gem Birds should be random. Here are parts of relating codes:
 
:::The location of Gem Birds should be random. Here are parts of relating codes:
 
:::<syntaxhighlight lang="C#">
 
:::<syntaxhighlight lang="C#">
if (IsMasterGame && (bool)netWorldState.Value.GetWeatherForLocation(GameLocation.LocationContext.Island).isRaining)
+
private static IEnumerator<int> _newDayAfterFade()
 
{
 
{
Vector2 tile_location = new Vector2(0f, 0f);
+
......
IslandLocation island_location = null;
+
if (IsMasterGame && (bool)netWorldState.Value.GetWeatherForLocation(GameLocation.LocationContext.Island).isRaining)
List<int> order = new List<int>();
  −
for (int i = 0; i < 4; i++)
   
{
 
{
order.Add(i);
+
Vector2 tile_location = new Vector2(0f, 0f);
}
+
IslandLocation island_location = null;
Utility.Shuffle(new Random((int)uniqueIDForThisGame), order);
+
List<int> order = new List<int>();
switch (order[currentGemBirdIndex])
+
for (int i = 0; i < 4; i++)
{
+
{
case 0:
+
order.Add(i);
island_location = getLocationFromName("IslandSouth") as IslandLocation;
+
}
tile_location = new Vector2(10f, 30f);
+
Utility.Shuffle(new Random((int)uniqueIDForThisGame), order);
break;
+
switch (order[currentGemBirdIndex])
case 1:
+
{
island_location = getLocationFromName("IslandNorth") as IslandLocation;
+
case 0:
tile_location = new Vector2(56f, 56f);
+
island_location = getLocationFromName("IslandSouth") as IslandLocation;
break;
+
tile_location = new Vector2(10f, 30f);
case 2:
+
break;
island_location = getLocationFromName("Islandwest") as IslandLocation;
+
case 1:
tile_location = new Vector2(53f, 51f);
+
island_location = getLocationFromName("IslandNorth") as IslandLocation;
break;
+
tile_location = new Vector2(56f, 56f);
case 3:
+
break;
island_location = getLocationFromName("IslandEast") as IslandLocation;
+
case 2:
tile_location = new Vector2(21f, 35f);
+
island_location = getLocationFromName("Islandwest") as IslandLocation;
break;
+
tile_location = new Vector2(53f, 51f);
}
+
break;
currentGemBirdIndex = (currentGemBirdIndex + 1) % 4;
+
case 3:
if (island_location != null)
+
island_location = getLocationFromName("IslandEast") as IslandLocation;
{
+
tile_location = new Vector2(21f, 35f);
island_location.locationGemBird.Value = new IslandGemBird(tile_location, IslandGemBird.GetBirdTypeForLocation(island_location.Name));
+
break;
 +
}
 +
currentGemBirdIndex = (currentGemBirdIndex + 1) % 4;
 +
if (island_location != null)
 +
{
 +
island_location.locationGemBird.Value = new IslandGemBird(tile_location, IslandGemBird.GetBirdTypeForLocation(island_location.Name));
 +
}
 
}
 
}
 +
......
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 65: Line 70:  
::::It is my conjecture, based on game behavior, that the gem bird shuffle is done for each individual game, once for all time, at the first time the player visits Ginger Island on a rainy day. From that time on, the same sequence of four repeats forever on rainy days. If you miss one rainy day, you can catch the missed bird four rainy days later and complete the shrine that way. I am going to add something about this to the article. [[User:Giles|Giles]] ([[User talk:Giles|talk]]) 03:04, 15 September 2021 (UTC)
 
::::It is my conjecture, based on game behavior, that the gem bird shuffle is done for each individual game, once for all time, at the first time the player visits Ginger Island on a rainy day. From that time on, the same sequence of four repeats forever on rainy days. If you miss one rainy day, you can catch the missed bird four rainy days later and complete the shrine that way. I am going to add something about this to the article. [[User:Giles|Giles]] ([[User talk:Giles|talk]]) 03:04, 15 September 2021 (UTC)
   −
Article edit made. I ran a few more tests, hoping I could get the game to do something different. Even when I ran the file from two days before the first rainy day (and the weather changed so it ended up being three days before rain), the resulting bird was the same one in the same location. Not impossible odds, but every type of run is proving to give the same arrangement. In my game, everything begins with a ruby-gem bird in Island North. I assume not everyone experiences that! (?) [[User:Giles|Giles]] ([[User talk:Giles|talk]]) 07:38, 15 September 2021 (UTC)
+
::::Article edit made. I ran a few more tests, hoping I could get the game to do something different. Even when I ran the file from two days before the first rainy day (and the weather changed so it ended up being three days before rain), the resulting bird was the same one in the same location. Not impossible odds, but every type of run is proving to give the same arrangement. In my game, everything begins with a ruby-gem bird in Island North. I assume not everyone experiences that! (?) [[User:Giles|Giles]] ([[User talk:Giles|talk]]) 07:38, 15 September 2021 (UTC)
 +
 
 +
:::::Hi, Gile! Sorry for the incorrect interpretation. I tried to look into the codes again and tested in the game. Also, maybe there are still some mistakes. As you said, the "uniqueIDForThisGame" is unique for the save file. I got it wrong because that I took the name of the function for granted. The function to generate the "uniqueIDForThisGame" which calculated by "current UTC time - (2012, 6, 22)" is called "CleanupReturningToTitle" and executed when the variable "exitToTitle" is true. However, I didn't realized that the game saves the "uniqueIDForThisGame" as you said and then loaded it when you load the game. Therefore, the "uniqueIDForThisGame" doesn't change in the same game save.
 +
:::::Apart from "uniqueIDForThisGame", the game also saves "currentGemBirdIndex" in the save file and can loaded it from the file. The point is that the game executes the codes that I posted once in each rainy day. But the function Utility.Shuffle ouputs the same list when the seed "uniqueIDForThisGame" and imported list keep same. And the "currentGemBirdIndex" = ("currentGemBirdIndex" +1)%4 which means the index circulated in <nowiki>[0,1,2,3]</nowiki>.
 +
:::::Therefore, the location order doesn't change in the same save, and the gem's location is recurrent in each rainy day. Sorry for the wrong interpretation again. You can add extra information to the article if you want. Relating references: <code><nowiki>StardewValley.Game1::_newDayAfterFade</nowiki></code>, <code><nowiki>StardewValley.Utility::Shuffle</nowiki></code>. Thanks! --<small>[[User:Horizon98|Horizon98]] ([[User talk:Horizon98|Discussion]])</small> 07:46, 15 September 2021 (UTC)
1,078

edits

Navigation menu