Skip to content
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

not an issue but a feature request #3

Open
Falcon911 opened this issue Jan 8, 2025 · 10 comments
Open

not an issue but a feature request #3

Falcon911 opened this issue Jan 8, 2025 · 10 comments

Comments

@Falcon911
Copy link

Falcon911 commented Jan 8, 2025

Love what you have done so far.

Suggestion... In Material Type allow "ALL" in order for the end user to see if SOL has minable rings or not. I had to guess on Void opals and SOL would finally come up.

Also...If a system is in Unoccupied/Expansion/or Contested status.(know as Acquisition) We can see what system in the area must be mined in the nearby Fortified (20LY) or Stronghold (30LY) system which is supporting the Acquisition. Your does that but the markets are pointing to the systems and not what our target system needs (SOL in this case)

So. in an example. Lets say I want to acquire SOL.
SOL would be in the exploited state and my power is Archer.
I would type in SOL and state its exploited with the check box. Leave the Material Types to ALL
Hit enter...
Sol would come up with the current ports that take the top products (as you show now)
Also the results would come up with Systems that are currently in Stronghold (within 30LYRS) and Fortified (within 20LYRS) status under the Archer Power with Mineable rings.

Example 2.
SOL is now Fortified or stronghold under Archer or want I want to undermine it. My power is Duval lets say
SOL would be what I typed and Checked either Fortified/Stronghold/Undermine. (does not matter in the end due to I can only use the commodity in the system not from outside)
SOL would come up with the Rings available in the system as well as the ports with the best prices at the time. Nothing else shows up due to Mining Commodities cannot come from outside the SOL system to help undermine/fortify/or stronghold a system.

Note: If the system in question does not have Mineable rings and your choosing Stronghold/Fortified/Exploited/undermine. then it should not come up or state no available rings in X system.

I know this is a lot.. Again this is a feature REQUEST.. Not a Demand. You time is valuable and I understand that. Just glad that you took the time on making this in the first place. Doing via SPANSH is crazy....

subzerofun added a commit that referenced this issue Jan 9, 2025
subzerofun added a commit that referenced this issue Jan 10, 2025
@subzerofun
Copy link
Owner

subzerofun commented Jan 10, 2025

hi falcon, sorry it took me so long to reply.

the app logic now is: take reference system + max distance specified as initial filters, then apply ALL other filters for multiple results, order them by price.

your new requested logic for example nr. 1 would be:

  • take reference input as "search for THIS system", not reference (important distinction!)
  • distance calculations from max distance are not relevant
  • distance plays this role here: get stronghold (30Ly) and fortified systems (20Ly) of same power (if any?) of input system?
  • add them to the results
  • show best prices of stations buying in a) searched system b) systems that fall under distance search by type
  • does the whole material filter logic also apply? i guess that would decimate the results too much, because the focus here is you want to see systems in certain distance and what you can do there?

do i understand that correctly? are we searching for systems that have multiple powers trying to acquire it?
say i add that feature in, it would confuse some people as to how the search is working.
how can you make that obvious that this kind of search is requested?
i don't engage in strategical powerplay so i don't know how supplying certain systems influences the powers hold on said system.

pfff... my head is spinning thinking about the filtering logic. of course i can add something like that (but i need to really understand what is important here for this kind of powerplay stuff).

AND - it should really be obvious to the user that the main search is sorting foremost by price. the search you need sorts by power state type and distance to other systems based on one system (maybe applies material filters - or not?). i'm thinking of how to add that logic with the requirement of:
a) not confusing people
b) make understandable at first glance what this search does (could be a separated input check box "Powerplay search", but should be distinct and probably named better to tell people what it does)

example nr. 2 has a different power than your own owning the system in a specific power state=fortified/exploited/stronghold and you want to aquire it. only results from that system are relevant since that is the only thing influencing it.

did i understand correctly that in both examples SOL is theoretically in range to be aquired by your power? is the initial condition to check if this system can be aquired by your power?

i also now see that i handle the "Exploited" status wrong! because one system can have one controlling power, but multiple other powers trying to exploit/aquire it... i now only have ONE entry for the controlling power. i have to change that.

we also have "prepared" and "in Prepare Radius" which currently do not work! because the initial database conversion script would need to write multiple system entries for a system which is for example in aquisition by 2 powers. the current logic only looks for a field called "controllingPower", there is no option now for "power_aquiring". i did not correctly add in those two other parameters as well as "Exploited", "Stronghold" and "Fortified" - all those only have one entry for controlling power. but as i understand it now the logic should be:

  • "Stronghold" = in control by one power, influenced by none, one or multiple other powers
  • "Fortified" = in control by one power, influenced by none, one or multiple other powers
  • "Exploited" = in control by one power, influenced by none, one or multiple other powers
  • "Prepared" = in reach and active acquisition by one or multiple powers without controlling power
  • "In Prepare Radius" = is potentially able to be aquired based on distance?
  • "Contested" = multiple powers at war trying to aquire it, not used for anything in our search

i will fix the converter.py first to handle those cases.

can you help me understand how we should call this type of search?
"Power Goal" Checkbox: ☒ Gain Merits (default) ☐ Influence System State/Aquire System"
or

"Power Goal" Dropdown:
- Gain Merits (default) 
- Influence System State/Aquire System
- more types in future?

Doing via SPANSH is crazy....

yes it is, but in a different way too. because downloading 1.6gb for every update is:
a) inefficient
b) not fair to spansh, driving server bandwidth up

i hope people understand that they need to download the json from spansh and run the sqlite converter everyday to get new data in, there is no way to update it without pulling data from multiple sources, downloading multiple hundreds of MB everyday. and it still does not guarantee up-to-date price results with all these functions. only a full snapshot will update the whole database.

that is why i am working on a web tool right now! so i probably wont update the local installation in the future.

so please be a little patient and first thing i will release is the website. then you won't need to update the local install anymore BECAUSE we then have: 🎉 24h-live-automatic EDDN player sourced updates and an always up-to-date database ⏰(until the updater process crashes 😁).

it would help if you could ELI5 your search additions, my head hurts from converting this to a live website in the past few days (needs different database, postgres instead of sqlite which messed up the whole search query... hundreds of new bugs that weren't there before).

@ArcherSmythe
Copy link

ArcherSmythe commented Jan 18, 2025

Good morning,

Falcon asked me to chime in.

My suggested algorithm is below. This should work for any user. For people that just want merits to unlock modules, they'll select a power, a reference system, and a wide radius. For players that are trying to meet a specific powerplay objective for a specific system as part of an organized group, they will most likely enter the objective system as the reference system, set a radius of 0, and specify a power. After that, the algorithm below should give the best credit mining opportunities for systems in the given radius of the reference system. (Note: this doesn't account for either of the Penalties: Undermining in a high penalty system can cut merits by 75%, even though you receive full credits for the mined materials.)

  1. User sets a Reference System, Radius, and Power. Optional fields: Power Goal (acquire, reinforce, or undermine), mining methods, commodities, and/or price display.
  2. User clicks Search.
  3. MeritMiner goes to work:
    • MeritMiner makes an initial list of target systems near the Reference System inside the Radius.
    • MeritMiner determines the state (Unoccupied, Exploited, Fortified, Stronghold) and Power (if any) of each system in that list.
    • MeritMiner iterates through the initial list of target systems and creates a final list of target systems based on Power and Power Goal. (Note: if all three Power Goals are selected, just copy the initial list to the final list.)
      • If "Acquire" is one of the selected Power Goals and the target is Unoccupied, add the system to the final target list.
      • If "Reinforce" is one of the selected Power Goals and the target is Controlled (Exploited/Fortified/Stronghold) for the Power selected in step 1, add the system to the final target list.
      • If "Undermine" is one of the selected Power Goals and the target is Controlled by a different power, add the system to the final target list.
    • MeritMiner iterates through the final list of target systems:
      • Get the prices of metals and minerals in the target system.
        • If no station in the system is buying the metals/minerals that were optionally selected in step 1, remove the target system from the final list.
      • If a target is Unoccupied:
        • Generate a list of source systems: these are Stronghold systems for the given power within 30 Ly and Fortified systems for the given power within 20 Ly. (Don't limit this by the radius set in step 1.)
        • Prune that list of source systems based on whether they have rings of appropriate types or hotspots, based on what the user selected for mining methods or commodities.
        • If there aren't any source systems that meet the criteria, remove the target system from the final target system list.
      • If a target is Controlled by any Power (not just the selected Power):
        • Get the list of rings and hotspots in the target system.
        • If there are no rings or hotspots that meet the selected mining methods or commodities, remove the target system from the final target system list.
    • At this point, MeritMiner has a list of target systems and places where commodities can be mined.
    • Sort the target system list based on either:
      • maximum commodity price (assumes that someone is going to focus on one specific commodity by mining in a hotspot)
      • average commodity price (assumes that someone is just going to drop at a random location in a ring and mine anything with a decent price)
  4. MeritMiner displays the results:
    • One Target system per line
    • First column is the target system, with the commodities sorted by price.
    • Remaining columns are the source systems, with planets, ring types, and hotspots.
      • Might want to consider sorting the source systems based on hotspots for commodities with the highest prices.

One optimization for this is to do an initial selection for systems. This selection would be the first action for step 3. If Acquisition is selected as a Power Goal, find all systems within ( Radius + 30 ) Ly of the reference system. Otherwise, find all systems within Radius Ly of the reference system. The remaining searches in step 3 (either for target systems or source systems) can be done based on this limited list, instead of having to go through all systems in the bubble.

And I'll second Falcon911's final sentiment: this is a suggestion/request, not a fix or demand. Completely up to you if you want to use it.

@subzerofun
Copy link
Owner

Thank you @ArcherSmythe for the the clarification and in-depth explanation! You've made a solid outline on how to implement the acquisition/reinforce/undermine functions.

It's not that easy to wrap your head around things like Aquisition system radii and other powerplay specifics when you don't engage with them regularly. I just wrote this tool in the first place to get merits fast, but now since i have access to all modules that i initially wanted i will dive more into other powerplay related game loops.

I will separate the searchform a little bit with a small submenu where you then find:

  • Mining for merits (current search)
  • System Finder (new powerplay search) : name is open, but should ideally be two short words
  • Highest Prices (not just a button, but also a searchform)
  • Res Hotspots (searchform with power filter)
  • Platinum Spots+ (searchform with power filter)

I've made a mockup of the new search function showing results for acquisition systems and will code it in the next days:

Image

But the table layout is of course only showing when selecting "Acquire a System" - otherwise you will get the current layout.

Now since i've added all Acquisition functions to the "System Finder" i'm not quite sure why i kept "Mine for merits" as a separate menu point 🤦‍♂️ ... i guess i thought those two searches were for separate purposes, but when i now look at it, after thinking it through, the new search should be able to do everything the old does. Quite like the icons though... maybe i find a different function to add at a later point.

I could use "Mine for merits" as the introduction to the GUI since a lot people asked how to even use the search. Maybe deliver some powerplay related facts. You said this:

Penalties: Undermining in a high penalty system can cut merits by 75%, even though you receive full credits for the mined materials

Where can i find some documentation of how different actions or system states affect merit output? That would be interesting to a lot of users too.

Thanks again for taking the time to put this all together.

@ArcherSmythe
Copy link

For Undermining penalties, the best source of information I found is this:

https://forums.frontier.co.uk/threads/powerplay-2-0-activities.629227/post-10490223

It's not great, but I don't think FDev has released any actual documentation.

Mining for acquisition or reinforcement usually gives 750 merits per million credits of commodity sold. In a very high/high penalty system, I only received 190 merits per million when undermining.

@subzerofun
Copy link
Owner

Hi @ArcherSmythe and @Falcon911 !

i'm nearing the completion of the acquisition system search. Was difficult to implement, but it is working now by giving you a list of unoccupied systems +station prices and their mining systems with matching mining sources.

The search is now structured in:

Power Goal:

  • Acquire ✅
  • Reinforce ✅
  • Undermine 🟢 next step
  • None ❌
    (am wondering if i should combine all methods there, but displaying would require new css and a really complicated sql query – so i will probably leave it out for not)

I had to split the different search modes because otherwise it would have made the SQL query so complicated that i keep losing track what is going on where and the css display of acquisition systems is quite different than the reinforce (standard) search.

So next step would be "Undermine".

How would the filter work here again?

The same as acquisition, except that instead of searching for unoccupied systems - as the systems were we sell in - we search for systems controlled by an opposing power where we sell at? Do the rules of fortified/stronghold radii apply here too OR can you mine in any system controlled by your power and sell it in the opposing system? There has to be some distance restriction there, doesn't it?

I have added a dropdown called "Opposing power" for this case, which will have "Any" as default. But you can select any opposing power you like - when searching for specific systems on the boundary between territories.

So the powerplay related search options are now:

  Controlling power: "Controlling power"
  Power Goal: "Reinforce (default)"
  Opposing Power: "Any (default)"

So after adding the new power goals i would need to rewrite some small things for:

  • Highest Prices Search
  • Res Hotspots
  • Platinum Hotspots

I also plan to add a "Landing Pad" selector and a Ordering function, "Order results: By price, By system name, By distance, etc." (probably in the next next update).

And a small guide how the search works is probably necessary too and then i can upload everything. Hoping it won't break 😁.

@ArcherSmythe
Copy link

ArcherSmythe commented Jan 24, 2025

Ouch: I hadn't realized you were doing this in SQL. I was assuming you were writing Python, Java, or Javascript. Yes, I can see how writing SQL for this would be difficult. (If you wanted to dip into Java or Javascript (or Python), you could do an initial SQL query to get all systems within Radius + 30 Ly of the reference system, and then do all of the conditional logic in one of the other languages.)

As for Undermining: 95% of this should be the same as Reinforce. The only difference is that the controlling power isn't my commander's power. The system must be controlled/occupied though.

@subzerofun
Copy link
Owner

No, the main language is Python, but you have to use SQL to get the Postgres data (via psycopg2 library). There are 265k stations and 22k systems to search for. It is more efficient getting the candidates down with SQL than to load everything into a Python object and parse that. So i use a python library that executes the SQL queries - of course the initial filters bring the candidates down somewhat, but in the systems table every x,y,z coordinate has to be checked against your reference system. I could do clustering by power, but since this is 3D space that would not help that much.

I just went with the most direct way to interact with the database but after researching a little bit it seems using SQLAlchemy would be a better approach... oh no so much time wasted.

I just read that using direct SQL is the most efficient/cpu friendly method to query the database - so i used that for it.

But speaking of powerplay again, so that i can finish this:

My main question is just - i thought that Undermining rules are somewhat the same as Acquisition?

Reinforce: Mine in same system where you sell

Acquisition: Mine in system in 20ly radius of Fortified, 30 ly of Stronghold, sell in Acquisition system
Question: Do Reinforced/Exploited systems in the radius of Fortified and Stronghold influence also count as mining sources?

Undermining: Mine in system in 20ly radius of Fortified, 30 ly of Stronghold, sell in system controlled by a power other than yours where your power is undermining
Question: Do Reinforced/Exploited systems in the radius of Fortified and Stronghold influence also count as mining sources?

Like you said

"As for Undermining: 95% of this should be the same as Reinforce."

doesn't make sense since you can't mine in a system that is controlled by another power and sell there for merits? So here comes the distance calculation from Acquisition systems in effect? Or am i understanding that wrong?

Did you by any chance mean "As for Undermining: 95% of this should be the same as Acquisition"?

I'm now more confused than before 😅. If you could clear that up i'd be having an easier time writing the filters.

@ArcherSmythe
Copy link

ArcherSmythe commented Jan 24, 2025

No, the rules for Undermining match the rules for Reinforce: mine and sell in the system you want to undermine (or reinforce). I have done mining to Undermine, so I can confirm it works the same as Reinforce.

If you want, you can get a second opinion from the forums. US means Undermine System in the quote below.

Sell mined resources - sell goods mined in US in same US (see notes)

On the other hand, if you have mined in an opposing Power's system and sold in a nearby Fortified or Stronghold system for your power, you might want to post that in the forums. Folks would like to know.

@subzerofun
Copy link
Owner

OK thank you very much, that makes things easier!

So "Undermine" will simply show you systems:

  • controlled by another power than your own
  • but where your power opposes
  • can both find, mine and sell the same resource
  • same filters as main search apply; excluding systems controlled by your own power of course

So you can't undermine by getting the resources from any other system than the one you are trying to undermine - that is the info i needed!

@GLWine
Copy link

GLWine commented Jan 26, 2025

Sorry @subzerofun if I butt in on the matter.
In #3 (comment) you used an asteroid as an example image for the "merit miners", what do you think about this instead?

Version 1 to 100 MK I 1 to 100 MK II
Colored
White

I manually reconstructed the two logos in vector, based on 16K screenshots.. obviously it's not perfect, but it's enough for me.
To do this I simply drew all the components on the left and then mirrored them to minimize the symmetrical differences.

Version Lv 1 Lv 100
Colored
White

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants