Comments (8)
Hello! By default, the learnset scheme doesn't include egg moves for evolutions that can't hatch from eggs themselves. So while Gengar can get Astonish from that event, it can also get it by evolving from a hatched Gastly using some inheritance logic which is handled in the validator along with other complex legality rules: https://github.com/pkmn/ps/blob/master/sim/sim/team-validator.ts
from ps.
Thanks, yeah, I've been looking at the calc package already. Haven't gotten that far along though.
There is an exportLearnsets
function in smogon/data
that might do this. But, I think the scope of this project is much wider than what I really need as far as learnsets go. I'm building something small just for me to start with, and just for Gen 8 VGC rules, which seem much easier to implement since moves are a "clean slate" approach when a Pokemon comes from an old gen.
Thanks again for taking the time to answer questions. Very its been very helpful.
from ps.
Hi! https://github.com/pkmn/ps/blob/master/sim/sim/global-types.ts#L69-L90 is where PS documents its learnset encoding scheme. ['6S4']
means astonish
is the 5th event move from Gengar in Gen 6 (thanks @KrisXV for confirming).
It might be worth adding some wrappers around PS's Learnset to expose these in a more friendly way (which is the point of the @pkmn/data
library). I haven't worked with learnsets that much yet so I don't have a good intuition for what such an API might look like, but if you have suggestions I'd love to hear them!
from ps.
Great, thanks for the quick response.
I'd expect though that it would include ['8E', '7E', ...]
and so on in the list as well. https://www.serebii.net/pokedex-swsh/gengar/
Although, I realize not many people would care to use Astonish competitively, so it could be a data quality issue.
I think it would probably make sense to limit what is returned based on the gen you are working in. Essentially, calling this from the Gen8 dex.
expect((await gens.get(8).learnsets.get('bulbasaur'))!.learnset![0])
.toEqual({
name: 'Leaf Storm',
source: MoveSource.TM,
});
And, probably you are going to cross-reference this with the moves list anyways, so including the type, power, accuracy, and description might be reasonable. Probably depends on what you are building if that is useful or not.
from ps.
Although, I realize not many people would care to use Astonish competitively, so it could be a data quality issue.
I would be surprised by that, because AIUI the Learnset data is actually ripped directly from the data files mined from the games, but @Marty-D or @Lusamine may be able to tell you if that's the case. :)
I think it would probably make sense to limit what is returned based on the gen you are working in.
Now that I'm thinking about it a little more, I think I'm remembering why I left it returning all of the data - for validation purposes, the provenance of the move across each gen is important, as it becomes relevant when figuring out complex scenarios like which moves can be bred onto another Pokémon etc. I think (one again, not a pro at learnsets) the presence of a move in the Learnset.learnset
returned currently represents the superset of moves a given Pokémon might have, but the interplay of the exact MoveSource
values is relevant for determining which combination of moves are legal on a mon?
I like the idea of changing the relatively inscrutable '8M'
code to a more structured response though
from ps.
Great! Thank you. I think everything there makes sense now.
from ps.
Nice! I'm going to leave this open to remind myself to take a look at seeing if I can't smooth out the API a little, but I probably won't get to this for a little while. :)
from ps.
And, probably you are going to cross-reference this with the moves list anyways, so including the type, power, accuracy, and description might be reasonable. Probably depends on what you are building if that is useful or not.
I don't disagree that this would certainly be useful, but currently this is out of scope for the @pkmn/data
package. Like Pokémon Showdown it does not 'materialize' ID
references, primarily for performance and practicality reasons. It should be possible to implement such a data layer without performance concerns, but attempting to do so while serving as a wrapper on top of Pokémon Showdown's Dex
becomes difficult. I believe https://github.com/smogon/data (used to power Smogon's dex) handles this (or plans to), and may be worth taking a look at :)
It might be worth adding some wrappers around PS's Learnset to expose these in a more friendly way
I looked into doing this - I think to transform something like '8E'
into {gen: 8, source: 'Egg'}
would require wrapping, transforming, and caching returning Learnset
object and I'm not sure it's worth the effort given the Learnset
data is still going to be intrinsically complicated and require special knowledge (like Marty explained above) to be able to use anyway. I would probably merge a PR that adds such a transformation, but I don't think it's going to end up being valuable enough to spend cycles on myself.
Thanks for the question and for the suggestions! Good luck with your damage calculator (have you seen the @smogon/calc
package?)/team builder tool.
from ps.
Related Issues (20)
- Unexpected Token error when loading pkmn/sim library? HOT 3
- provide event based battle handling for /client HOT 2
- PocketMon HOT 1
- @pkmn/data: `Learnsets.learnable` results are overwritten instead of merged for evolved species HOT 3
- @pkmn/dex: G-Max Move Handling Changed Unexpectedly HOT 6
- ditto sometimes fails to be interpreted by @poke/client battle HOT 2
- team validator HOT 4
- Pack/Unpack does not follow showdown formatting when including team name, format and folder. HOT 1
- No way to load a ModdedDex into battle simulator HOT 8
- @pkmn/client: Only the set info for the first Pokemon on each side is propagated
- @pkmn/client: Level is always overwritten to be 100
- @pkmn/sim: Running `Dex.formats.getRuleTable(Dex.formats.get('gen9lc'))` crashes HOT 2
- @pkmn/sim: Running `Dex.formats.getRuleTable(Dex.formats.get('gen9vgc2023regulatione'))` crashes
- @pkmn/img Wrong icons for certain Pokémon HOT 1
- Unable to easily add custom formats
- gen7vgc2017 team validation HOT 4
- @pkmn/dex: CAP Pokemon Chuggalong does not exist in version 0.9.6 HOT 1
- Protocol typings: Challenges and SearchState interfaces are swapped HOT 1
- Protocol: Support `|deinit` message HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ps.