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

feat(UI): add iteration config for item group debug spawn test #5875

Conversation

OrenAudeles
Copy link
Collaborator

Checklist

Required

Purpose of change

When testing item distributions in item groups we don't always need to check 100 or 1000 iterations of item spawning. Making it configurable seems like the best compromise to match user desire by allowing options for how accurate they want to be while testing an item group's spawns.

Compromise for #5033 and #5872

Describe the solution

Adds an additional picker UI for how many iterations to run while testing item group spawns. Provides logarithmic progression options: 10, 100, 1000, 10000. More options can be added, or it can be changed to a text input, in a future PR if these options are not satisfactory.

Describe alternatives you've considered

I'd like to make it so we don't need to spawn items at all, even temporary items, and make it purely mathematical. Pick an item group, and then it calculates the chance of an item to spawn as if there were infinite iterations.

Testing

Tested multiple item groups with multiple iteration selections, including invalid / exit selection. Works as expected

Additional context

Future work / idea:

Items that can spawn with some variation, such as UPS spawning with differing charge take up multiple lines in the results list. Future work would probably be to make a collapsible list for those so the root level of the results list would have count of item type and expanding would show count of item type spawn values.

1x UPS (N / 1000)
1x UPS (M / 1000)
1x UPS (J / 1000)

would become

3x UPS [>]

and expand to

3x UPS [V]
- 1x UPS (N / 1000)
- 1x UPS (M / 1000)
- 1x UPS (J / 1000)

@github-actions github-actions bot added the src changes related to source code. label Jan 4, 2025
@scarf005 scarf005 changed the title refactor: add iteration config for item group debug spawn test feat(UI): add iteration config for item group debug spawn test Jan 4, 2025
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i hate how our choice API returns index aaahhhhh

@OrenAudeles
Copy link
Collaborator Author

i hate how our choice API returns index aaahhhhh

yeah. I think it's pretty useful in a lot of cases, but sometimes it'd be useful to have some other result type. I'd really dislike having to convert back from a string to an int/size_t to get the number of iterations in this case.

Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image

@chaosvolt chaosvolt merged commit c8491de into cataclysmbnteam:main Jan 4, 2025
16 checks passed
@OrenAudeles OrenAudeles deleted the item-group-debug-spawn-iterconfig branch January 5, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants