-
Notifications
You must be signed in to change notification settings - Fork 49
[Theory] Possible temporary solution to non-dynamic cpp filters #40
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
base: cpp-rewrite
Are you sure you want to change the base?
Conversation
|
Hmm, this is a good start towards generalized filters. My idea was to use a JSON system to create filters like these with many more capabilities. There should be some discussion on how exactly that would work before we get into integrating JSON with something like this |
|
It would probably be helpful to have an enum for itemtype and a generalized search function for each type. Itemtype referring to the comments in the item enum (i.e. below). What do you think? https://github.com/MathIsFun0/Immolate/blob/448ae244760d0feb6f8d43a0a5244b2088cf4e48/src/items.hpp#L10-L13 |
|
@MathIsFun0 I created a filters.hpp and filters.cpp with a sample class. Ideally it would just be plug and play with your current threading system, but I don't have much experience in C++ threading to say. I can't build & test stuff on my end because I'm just using a steam deck and getting a dev environment working on there is a pain. Hence why I'm just writing boiler plate code to suggest paths to take. I made some "efficiency" changes like doing a for loop on the ante instead of the search list. It's still brute force, but doesn't check every item for every type. I noticed one of your latest commits mentioned instance.next over instance.reset, would that effect something like this? |
Awfully slow at ~1m-500k seeds/s with just the search for 1 joker Further optimizations needed, but it did find seeds with a blueprint joker in shop.
|
I was able to get it to build and test on my steam deck. The filter is slow, but I think it has some room for optimization. Probably limiting/better function calls or using less memory. I might wait on the SIMD branch to see how you are going to use that. What JSON library were you planning to use if any? I think I can start working on that if you like the direction I'm going. |
Started using Tracy to profile the performance.
This is a brute force approach to looking for items in a seed given some variables. It works by checking every item that you can encounter in ante(s) against your list of items.
itemListis the items you want to findamountListis the amount of each item you want to findanteListis how deep an ante you want to go for each itemThink of it as whiteboard code as I haven't tested it, just trying to get a feel for what direction you were thinking of. It's incomplete and could be optimized further, was just giving this a concept review before further refinement.
Another thing I was thinking about was lua or json as a scripting languag, but that's outside my expertise atm.