## Issue
We want to discard-but-remember any slots that aren't a perfect fit, on the off chance that a better one exists later in the search space. If there's no better match, then we gotta go with what we got.
## Example:
Wurmple exists in area `X`, and also has a more rare slot for Silcoon, with the same level for both slots.
* We have a Silcoon that we've leveled up a few times.
Was our Silcoon originally a Wurmple, or was it caught as a Silcoon?
* To be sure, we have to check the EC/PID if the Wurmple wouldn't evolve into Cascoon instead.
* We don't want to wholly reject that Wurmple slot, as maybe the Met Level isn't within Silcoon's slot range.
---
Existing implementation would store "deferred" matches in a list; we only need to keep 1 of these matches around (less allocation!). We also want to differentiate between a "good" deferral and a "bad" deferral; I don't think this is necessary but it's currently used by Mystery Gift matching (implemented for the Eeveelution mystery gifts which matter for evolution moves).
The existing logic didn't use inheritance, and instead had static methods being reused across generations. Quite kludgy. Also, the existing logic was a pain to modify the master encounter yield methods, as one generation's quirks had to not impact all other generations that used the method.
---
The new implementation splits out the encounter yielding methods to be separate for each generation / subset. Now, things don't have to check `WasLink` for Gen7 origin, because Pokémon Link wasn't a thing in Gen7.
---
## Future
Maybe refactoring yielders into "GameCores" that expose yielding behaviors / properties, rather than the static logic. As more generations and side-gamegroups get added (thanks LGPE/GO/GameCube), all this switch stuff gets annoying to maintain instead of just overriding/inheritance.
## Conclusion
This shouldn't impact any legality results negatively; if you notice any regressions, report them! This should reduce false flags where we didn't defer-discard an encounter when we should have (wild area mons being confused with raids).
See the EncounterSlotDumper with the memoization logic & json tree listing.
Simplifies things a lot, and improves checking speed. Unreachable trees are now treated the same as no-trees maps.
ez 1.5KB reduction in file size :P
This only matches the weather table with the Pokemon and does not fully
account for whether a location can spawn a particular weather.
Additional minor changes:
- Adds ScriptedNoMarks to Regis and Glimwood Tangle static encounters
- Corrects a few version-specific Pokemon such as Ludicolo/Shiftry
- Removes erroneous encounters such as Milotic in East/West Lake Axewell
- Removes an unused Motostoke Stadium encounter
AltForm & Form & Forme => Form
GenNumber & Generation => Generation
Extract out SpeciesForm interface, and re-add IGeneration
For those using PKHeX as a dependency, this should be a pretty straightforward manual replacement... GenNumber and AltForm should be quick find-replace`s.
Slap in friend safari at the end during object construction; saves about 1KB of allocation on startup (lol)
Change internal array types to match object types, similar to other encounter-generation definitions.
Trees:
- Only retain the objects needed after calculation
- Reduce size of TreeCoordinates and remove allocation penalty (now a struct)
No more warnings for Release compilation :D
Move form-info logic from FormConverter to AltFormInfo; now FormConverter is entirely form=>string[]
Add a bunch of xmldoc
Make pogo no-end-date cmp agaisnt UTCnow rather than local now.
Extract common abstract class for GO transferred encounters
Clamp minlevel instead of met level
Add optional parameter for GO IV randomization
Update go legality binaries with latest
PKHeX.Core now accepts generated pkl binaries from PoGoEncounterTool (PGET).
Refer to pporg's repo. This will be treated like event data; occasionally updated.
took me less than an hour to do these changes, and i can flag bad form movesets no problemo
Expect tightening of restrictions (ball, level, shininess) later
if someone wants to curate met date restrictions, go ahead!
Introducing a new PKM format: SK2
Split ICaughtData2 off of PK2 so it can be shared with SK2 when type-checks occur
Add conversion for PK2<->SK2
Split the split-buffer handling for GBPKM to GBPKML (what a name), so that I can reuse shared accessor logic for SK2.
* Rework gen1 slot loading
Slot templates are precomputed from ROM data and just loaded straight in, with tight coupling to the encounter area (grouped by slot types).
* Revise fuzzy met check for underleveled wild evos
Example: Level 23 poliwhirl in RBY as a level 50 poliwhirl, will assume the chain is 25-50 for poliwhirl (as poliwag evolves at 25). Instead of revising the origin chain, just ignore the evo min level in the comparison.
Previous commit fixed it for gen1.
* Rework gen2-4 slot loading
Gen4 not finished, Type Encounter data and some edge encounters not recognizing yet...
* Add feebas slots for old/good encounters
* Begin moving properties
Great news! Gen5-7 need to be de-dumbed like Gen1-4.
Then I can remove the bang (!) on the Area accessor and ensure that it's never null!
* Split off XD pokespot slot encounter table type
* Set area in constructor
* Deduplicate g3 roaming encounters
* Deduplicate xd encounter locations (rebattle)
Only difference is met location; no need to create 500 extra encounter objects. A simple contains check is ok (rarely in gen3 format).
* Make all slots have a readonly reference to their parent area
* Minor clean
* Remove "Safari" slot type flag
Can be determined via other means (generation-location), allows us to reduce the size of SlotType member to a byte
Output of slot binaries didn't preserve the Safari flag anyway.
* Update SlotType.cs
* Handle type encounters correctly
* Merge safari area into regular xy area
* Merge dexnav accessor logic
* fix some logic so that tests pass again
rearrange g5 dw init to be done outside of static constructor (initializer instead)
PIDGenerator: friend safari slots now generate with required flawless IV count
* Add cianwood tentacool gift encounter
* Remove unnecessary abstractions
Fake area just returned a slot; since Slots have a non-null reference to the area, we can just return the slot and use the API to grab a list of possible slots for the chain.
Increase restrictiveness of location/type get-set operations
* Minor tweaks, pass parameters
DexNav observed state isn't necessary to use, only need to see if it's possible to dexnav. Now that we have metadata for slots, we can.
* Remove unused legality tables