-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Predicting exobiology species on planets #15
Conversation
Is there a specific branch you want this PR to target? This branch branches from |
You can probably target either. |
And tests are failing because I was a bit sloppy when creating the |
Currently with a few FIXMEs ..
This needed to be able to iterate over the `Species` enum, in order to check spawn conditions for each type of specimine.
This commit adds a new function `check_species_can_spawn` to the `exobiology` module. This function is used to check if a given species can spawn on a planet based on the planet scan event. It iterates over the spawn conditions of each species and returns `true` if all conditions are met. The function `get_spawnable_species` has also been implemented, which returns a list of species that can spawn on the given planet.
I’m in the progress of writing tests for these new functions using the test journals, but I’m getting some weird results… Aleoida Coronamus has as one of its spawn conditions a max gavity of 0.27G. This is in line with what ed-dsn and canonn science report. However, that does not add up with our test journals:
{
"event": "Scan",
"BodyName": "Phoi Aed NY-P d6-4 B 3c",
"SurfaceGravity": 2.133268
"SystemAddress": 148872824507,
"BodyID": 38,
}
{
"event": "ScanOrganic",
"Species_Localised": "Aleoida Coronamus",
"SystemAddress": 148872824507,
"Body": 38
} This is rather odd, either ed-dsn and canonn science are incorrect (or maybe drawing knowledge from the same faulty source), or this was a bug in the game. How do we proceed @rster2002? Removing the journal from the test database feels like the wrong decision, unless we can confirm this was an in-game bug. I can do some more digging to see if this is the only occurrence, will have to rewrite the tests for that but I’m rather intrigued now. anyhow i’m blaming the game; frontier pls fix |
I think it's fine to skip this test case for now by either renaming the log file to end in It's either a bug or it is very very very rare that it spawns under these conditions (also looking at the doc) I'll see if I still have the exploration data/system map and if I can see anything special. |
The 'AleoidaCoronamus' on body 'Phoi Aed NY-P d6-4 B 3 c' fails [MaxGravity(0.27)]
'TussockCaputus' on body 'Phoi Aed NY-P d6-4 B 3 c' fails [MaxGravity(0.27)]
'FungoidaGelata' on body 'Phoi Aed NY-P d6-4 B 3 c' fails [Any([ThinAtmosphere(Water), All([ThinAtmosphere(ArgonRich), MinMeanTemperature(180.0), MaxMeanTemperature(195.0)])]), MaxGravity(0.27)]
'ReceptaUmbrux' on body 'Phoi Aed SY-Y d1-3 A 9 f' fails [MaxGravity(0.27)]
'TussockStigmasis' on body 'Phoi Aed SY-Y d1-3 A 9 f' fails [MaxGravity(0.27)]
'OsseusCornibus' on body 'Hypiae Aed AB-M d8-1 4' fails [MaxGravity(0.27)]
'TussockDivisa' on body 'Hypiae Aip CG-V d3-9 AB 1 c' fails [MaxGravity(0.27)]
'TussockVentusa' on body 'Phoi Aed CM-K d9-5 5 c' fails [MaxGravity(0.27)]
'TussockCapillum' on body 'Gludgooe NX-B d0 9' fails [PlanetClass(RockyBody), MaxGravity(0.27)]
'FungoidaBullarum' on body 'Gludgooe NX-B d0 9' fails [MaxGravity(0.27)]
'OsseusPumice' on body 'Gludgooe NX-B d0 9' fails [MaxGravity(0.27)]
'FonticuluaCampestris' on body 'Gludgooe NX-B d0 9' fails [MaxGravity(0.27)]
'TussockVentusa' on body 'Phoi Aed CM-K d9-5 5 d' fails [MaxGravity(0.27)]
'FungoidaSetisis' on body 'Hypiae Aed DL-N d7-2 C 1' fails [MaxGravity(0.27)]
'FrutexaMetallicum' on body 'Hypiae Aed DL-N d7-2 C 1' fails [MaxGravity(0.27)]
'TussockDivisa' on body 'Hypiae Aed DL-N d7-2 C 1' fails [PlanetClass(RockyBody), MaxGravity(0.27)]
'OsseusCornibus' on body 'Phoi Aed OH-C d2 3 c' fails [MaxGravity(0.27)]
'ClypeusSpeculumi' on body 'Phoi Aed OH-C d2 3 c' fails [MaxGravity(0.27), MinDistanceFromParentSun(5.0)]
'TussockTriticum' on body 'Phoi Aed OH-C d2 3 c' fails [MaxGravity(0.27)]
'CactoidaPullulanta' on body 'Phoi Aed OH-C d2 3 c' fails [MaxGravity(0.27)]
'AleoidaArcus' on body 'Phoi Aed NY-P d6-4 B 4 d' fails [MaxGravity(0.27)]
'TussockAlbata' on body 'Phoi Aed NY-P d6-4 B 4 d' fails [MaxGravity(0.27)]
'TubusConifer' on body 'Outorst OJ-Y b14-0 B 4 a' fails [MaxGravity(0.15)]
'TussockIgnis' on body 'Outorst OJ-Y b14-0 B 4 a' fails [MaxGravity(0.27)]
'ClypeusSpeculumi' on body 'Hypiae Aed TE-F d12-1 4 f' fails [MaxGravity(0.27), MinDistanceFromParentSun(5.0)]
'TussockTriticum' on body 'Hypiae Aed TE-F d12-1 4 f' fails [MaxGravity(0.27)]
'TussockDivisa' on body 'Outorst AG-W b15-0 C 6' fails [PlanetClass(RockyBody), MaxGravity(0.27)]
'FungoidaSetisis' on body 'Outorst AG-W b15-0 C 6' fails [MaxGravity(0.27)]
'AleoidaArcus' on body 'Ploea Theia YI-B d3 A 8' fails [MaxGravity(0.27)]
'FrutexaMetallicum' on body 'Ploea Theia TI-B d1 A 7' fails [MaxGravity(0.27)]
'AleoidaArcus' on body 'Ploea Theia TI-B d1 A 7' fails [MaxGravity(0.27)]
'TussockAlbata' on body 'Ploea Theia TI-B d1 A 7' fails [PlanetClass(RockyBody), MaxGravity(0.27)]
'ReceptaConditivus' on body 'Hypiae Aip XL-B d14-2 4 a' fails [MaxGravity(0.27)]
'FungoidaSetisis' on body 'Phoi Aed EX-I d10-3 1 a' fails [MaxGravity(0.27)]
'AleoidaSpica' on body 'Phoi Aed EX-I d10-3 1 a' fails [MaxGravity(0.27)]
'FrutexaFlabellum' on body 'Phoi Aed EX-I d10-3 1 a' fails [MaxGravity(0.27)]
'OsseusSpiralis' on body 'Gludgooe MC-C d0 9 b' fails [MaxGravity(0.27)]
'FungoidaGelata' on body 'Hypiae Aip SN-A d1-8 10 c' fails [Any([ThinAtmosphere(Water), All([ThinAtmosphere(ArgonRich), MinMeanTemperature(180.0), MaxMeanTemperature(195.0)])]), MaxGravity(0.27)]
'TussockCaputus' on body 'Hypiae Aip SN-A d1-8 10 c' fails [MaxGravity(0.27)]
'ConchaRenibus' on body 'Hypiae Aip SN-A d1-8 10 c' fails [Any([All([MaxGravity(0.27), Any([ThinAtmosphere(CarbonDioxide), ThinAtmosphere(CarbonDioxideRich)]), MinMeanTemperature(180.0), MaxMeanTemperature(195.0)]), All([MaxGravity(0.27), Any([ThinAtmosphere(Water), ThinAtmosphere(WaterRich)])])])]
'FungoidaSetisis' on body 'Hypiae Aed VP-D d13-0 5 c' fails [MaxGravity(0.27)]
'ConchaLabiata' on body 'Hypiae Aip XL-B d14-2 5 c' fails [MaxGravity(0.27)]
'TubusConifer' on body 'Hypiae Aip XL-B d14-2 5 c' fails [MaxGravity(0.15)]
'TussockIgnis' on body 'Hypiae Aip XL-B d14-2 5 c' fails [MaxGravity(0.27)]
'FrutexaFlabellum' on body 'Ploea Theia AK-Z d1 ABC 2 b' fails [MaxGravity(0.27)]
'AleoidaSpica' on body 'Ploea Theia AK-Z d1 ABC 2 b' fails [MaxGravity(0.27)]
'FungoidaSetisis' on body 'Ploea Theia AK-Z d1 ABC 2 b' fails [MaxGravity(0.27)]
'TussockDivisa' on body 'Ploea Theia AK-Z d1 ABC 2 b' fails [MaxGravity(0.27)]
'ConchaAureolas' on body 'Ploea Theia AK-Z d1 ABC 2 b' fails [MaxGravity(0.27)]
'TussockDivisa' on body 'Hypiae Aip VK-M d8-9 10 d' fails [MaxGravity(0.27)]
'AleoidaSpica' on body 'Hypiae Aip VK-M d8-9 10 d' fails [MaxGravity(0.27)]
'OsseusSpiralis' on body 'Hypiae Aip VK-M d8-9 10 d' fails [MaxGravity(0.27)]
'CactoidaPullulanta' on body 'Hypiae Aip SN-A d1-8 10 d' fails [MaxGravity(0.27)]
'FungoidaGelata' on body 'Hypiae Aip SN-A d1-8 10 d' fails [Any([ThinAtmosphere(Water), All([ThinAtmosphere(ArgonRich), MinMeanTemperature(180.0), MaxMeanTemperature(195.0)])]), MaxGravity(0.27)]
'TussockCaputus' on body 'Hypiae Aip SN-A d1-8 10 d' fails [MaxGravity(0.27)]
'FonticuluaCampestris' on body 'Wredguia HN-Z b27-0 A 8' fails [MaxGravity(0.27)]
'FonticuluaCampestris' on body 'Wredguia IN-Z b27-2 10 c' fails [MaxGravity(0.27)]
'TussockDivisa' on body 'Gludgooe PP-N d7-8 5' fails [PlanetClass(RockyBody), MaxGravity(0.27)]
'AleoidaSpica' on body 'Gludgooe PP-N d7-8 5' fails [MaxGravity(0.27)]
'TussockSerrati' on body 'Phoi Aed PJ-O d7-3 1 c' fails [MaxGravity(0.27)]
'TubusConifer' on body 'Phoi Aed PJ-O d7-3 1 c' fails [MaxGravity(0.15)]
'FonticuluaCampestris' on body 'Phoi Aed ID-H d11-2 4 a' fails [MaxGravity(0.27)]
'ElectricaePluma' on body 'Phoi Aed ID-H d11-2 4 a' fails [ParentStarClass(A), Any([MinOrEqualParentStarLuminosity(V), ParentStarClass(N)]), MaxGravity(0.27)]
'FonticuluaUpupam' on body 'Hypiae Aip WL-B d14-14 ABC 1 d' fails [ThinAtmosphere(Argon), MaxGravity(0.27)]
'TubusConifer' on body 'Gludgae PI-I d10-1 6 a' fails [MaxGravity(0.15)]
'AleoidaArcus' on body 'Gludgae PI-I d10-1 6 a' fails [MaxGravity(0.27)]
'TubusConifer' on body 'Hypiae Aip XL-B d14-1 C 3 c' fails [MaxGravity(0.15)]
'TussockIgnis' on body 'Hypiae Aip XL-B d14-1 C 3 c' fails [MaxGravity(0.27)]
'ConchaLabiata' on body 'Hypiae Aip XL-B d14-1 C 3 c' fails [MaxGravity(0.27)]
'TussockVentusa' on body 'Phoi Aed CM-K d9-5 5 b' fails [MaxGravity(0.27)]
'TussockVentusa' on body 'Phoi Aed CM-K d9-5 5 a' fails [MaxGravity(0.27)]
'AleoidaArcus' on body 'Hypiae Aip WL-B d14-14 ABC 1 b' fails [MaxGravity(0.27)]
'TussockAlbata' on body 'Hypiae Aip WL-B d14-14 ABC 1 b' fails [MaxGravity(0.27)]
'OsseusSpiralis' on body 'Wregoe YL-L d8-7 6' fails [MaxGravity(0.27)]
'ReceptaConditivus' on body 'Hypiae Aip VK-M d8-9 9 e' fails [MaxGravity(0.27)]
'TussockIgnis' on body 'Hypiae Aip XL-B d14-1 C 3 d' fails [MaxGravity(0.27)]
'TubusConifer' on body 'Hypiae Aip XL-B d14-1 C 3 d' fails [MaxGravity(0.15)]
'ConchaLabiata' on body 'Hypiae Aip XL-B d14-1 C 3 d' fails [MaxGravity(0.27)]
'CactoidaLapis' on body 'Futes C 5' fails [MaxGravity(0.27)]
'TussockSerrati' on body 'Phoi Aed PJ-O d7-3 2 c' fails [MaxGravity(0.27)]
'TussockAlbata' on body 'Swoilz DR-A c2-2 A 6' fails [PlanetClass(RockyBody), MaxGravity(0.27)]
'TussockDivisa' on body 'Hypiae Aip TN-A d1-5 2 b' fails [MaxGravity(0.27)]
'CactoidaPullulanta' on body 'Phoi Aed PJ-O d7-3 1 b' fails [MaxGravity(0.27)]
'AleoidaCoronamus' on body 'Phoi Aed PJ-O d7-3 1 b' fails [MaxGravity(0.27)]
'FungoidaGelata' on body 'Phoi Aed PJ-O d7-3 1 b' fails [Any([ThinAtmosphere(Water), All([ThinAtmosphere(ArgonRich), MinMeanTemperature(180.0), MaxMeanTemperature(195.0)])]), MaxGravity(0.27)]
'TussockCaputus' on body 'Phoi Aed PJ-O d7-3 1 b' fails [MaxGravity(0.27)]
'ConchaRenibus' on body 'Phoi Aed PJ-O d7-3 1 b' fails [Any([All([MaxGravity(0.27), Any([ThinAtmosphere(CarbonDioxide), ThinAtmosphere(CarbonDioxideRich)]), MinMeanTemperature(180.0), MaxMeanTemperature(195.0)]), All([MaxGravity(0.27), Any([ThinAtmosphere(Water), ThinAtmosphere(WaterRich)])])])]
'OsseusSpiralis' on body 'Swoilz VE-E c6 A 5' fails [MaxGravity(0.27)]
'TussockCultro' on body 'Swoilz VE-E c6 A 5' fails [PlanetClass(RockyBody), MaxGravity(0.27)]
'OsseusFractus' on body 'Futes C 6' fails [MaxGravity(0.27)]
'TussockPennata' on body 'Hypiae Aed UO-P d6-0 6 c' fails [MaxGravity(0.27)]
'TussockDivisa' on body 'Schadgue KT-I c25-0 A 11 f' fails [MaxGravity(0.27)]
'CactoidaPullulanta' on body 'Gludgooe MC-C d0 10 b' fails [MaxGravity(0.27)]
'OsseusCornibus' on body 'Gludgooe MC-C d0 10 b' fails [MaxGravity(0.27)]
'AleoidaCoronamus' on body 'Gludgooe MC-C d0 10 b' fails [MaxGravity(0.27)]
'ConchaRenibus' on body 'Gludgooe MC-C d0 10 b' fails [Any([All([MaxGravity(0.27), Any([ThinAtmosphere(CarbonDioxide), ThinAtmosphere(CarbonDioxideRich)]), MinMeanTemperature(180.0), MaxMeanTemperature(195.0)]), All([MaxGravity(0.27), Any([ThinAtmosphere(Water), ThinAtmosphere(WaterRich)])])])]
'TussockDivisa' on body 'Hypiae Aip RC-C d7 E 5' fails [PlanetClass(RockyBody), MaxGravity(0.27)]
'FungoidaSetisis' on body 'Hypiae Aip RC-C d7 E 5' fails [MaxGravity(0.27)]
'CactoidaPullulanta' on body 'Phoi Aed EX-I d10-3 2 a' fails [MaxGravity(0.27)]
'TussockCaputus' on body 'Phoi Aed EX-I d10-3 2 a' fails [MaxGravity(0.27)]
'FungoidaGelata' on body 'Phoi Aed EX-I d10-3 2 a' fails [Any([ThinAtmosphere(Water), All([ThinAtmosphere(ArgonRich), MinMeanTemperature(180.0), MaxMeanTemperature(195.0)])]), MaxGravity(0.27)] It seems like 0.27G is not a hard limit and is not so rare. Out of the 746 |
I've been looking at how Elite Observatory does things https://github.com/Xjph/ObservatoryCore/tree/master/ObservatoryBotanist but also can't find where they have their spawn conditions set. |
welp... i'm a moron..
This can be confirmed with the following {
"timestamp":"2023-01-04T09:00:44Z",
"event":"Scan",
"BodyName":"Flyae Proae YU-V d3-2 1",
"SurfaceGravity":4.227870,
} and EDSM's entry for this body denoting this as 0.43G. 4.227870 / 9.81 = 0.43G. This would fix our test cases, for example the previously mentioned Aleoida Coronamus on Phoi Aed NY-P d6-4 B 3 c with a gravity of 2.133268 / 9.81 = 0.217G, which is within the 0.27G maximum. so.. game not bugged.. me code bugged :) |
Is it an idea to create a |
I think that's a good solution, although you would still need to make sure that Gravity isn't used in serde somewhere where it is expected in Gs stead of m/s^2, but I think planets are the only place where gravity is logged so it should be fine. |
It's ms^2, nog g.. so have to divide by 9.81.
The journals indicate only the |
I was wondering why |
Yeah, this is intentional. The idea being that by making the state serializable it's easier for applications what would use this library to take parts (or the whole state) and pass it around. Not making it serializable would mean that applications would basically have to create a separate models and then need to copy data around which I was trying to avoid. One thing I did consider doing and ended up not doing was putting serialize behind a feature flag, but I found that would add unnecessary complexity vs just making everything serializeable. |
Doing everything in |
Add more doc comments and move shared models around
I think making exobiology |
Also don't worry about the merge conflicts. Just give a signal and I'll merge those. I've moved some things around so once you're ready to merge I'll resolve those for you. |
Okay, everything’s good to go from my end! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very happy with the implementation. A couple of optimizations could still be made, but nothing that should keep this from getting merged.
Closes #13.