Funny, one of the first issues reported for Genesis was the exactly what you described: https://bitbucket.org/rpgframework/shadowrun-6/issues/30/reverse-mode
In theory, this could be done. Genesis works by recalculating necessary investments every time you change something in your character. At the moment it does that by assuming your choice on priorities and karma converted to nuyen to be fixed. SInce we already have the basis of necessary investments being calculated, one could think of a mechanism that tests multiple combinations for the optimum of remaining karma and nuyen.
It would be necessary to implement this as an extra creation mode. The calculations will take a lot longer, so you wouldn't want this to happen as soon as you just e.g. raise an attribute. It would be more a kind of "I'm done - please check my character'. It also would need to take multiple systems (e.h. Sum-To-Ten, Point-Buy ...) into account, when they are published. All in all, this would be a great feature - but still a very complex and time consuming one.
Taranion, thanks for the reply! (BTW, your software is excellent, I was finally able to get the right version of Java on my PC and use it, very impressive!)
I've been thinking about algorithms that could do this work. On reflection, I don't think it would be that computationally intensive; I think it could be done after each change to the character (although I freely admit I am no expert on Java code efficiency). Let me know what you think.
-------------------------------------------------
Minimal priority pick/spend Karma first algorithmWith this algorithm, a few things are necessary in the app interface:
1) you have to be able to tab back and forth freely between the different screens (attributes, skills, qualities, magic, equipment, etc.)
2) there needs to be a "Priority" display at the top/bottom/side of the interface. This would display the current set of priority picks and the leftover "space" in each category, as well as the current unspent Karma.
The algorithm initializes the character as if the player has chosen Priority E for all categories.
The algorithm updates after every change to the character. Each update involves three steps.
Karma step - the app spends as much Karma as possible (up to 50 points) in the following fashion:
1) buy any selected qualities (this may end up with a net positive amount of Karma)
2) buy all specializations with Karma
3) starting with the lowest valued skill/attribute, buy it with Karma instead of points
Adjustment/Attribute optimization step - this is what you are currently doing in your system, minimizing the total adjustment/attribute points spent. I'm assuming this spends adjustment points first on this adjustment points can be spent on, then spends the attribute points.
Minimal Priority Pick step - the app then checks the totals spent so far in each category against the cut offs in the priority table, and displays the minimum priority pick necessary to get that total and updates the remaining "space" for that category. For example, if the current character requires (based on the first two steps) 3 adjustment points, then the app interface would show the minimum Metatype Pick as D, with 1 adjustment point remaining. If there are still at least two categories with the same pick, the warning message is displayed.
As the player adds stuff to their character (increasing attributes and skills, buying qualities, getting spells/adept powers, etc.) the app would update the Priority display.
The algorithm generates these messages (based on the current rules, a future system might require different messages):
* as long as any two priority picks are the same, a message like "Unbalanced Priorities" or similar is generated.
* if at any point there is no E minimal pick left (i.e. all priority picks are D or greater), a message like "Overpowered, cut back on something" is generated.
* if ABCDE picks have been achieved, but there is still "space" in that category (e.g. some unspent skill points), a "Balanced Priorities, Incomplete" message is generated.
* if ABCDE picks have been achieved and all points/money have been spent (except for the allowed 5000 nuyen), then a "CHARACTER COMPLETE!" message is generated.
----------------------------------------------------------
As I said, this does not seem very computationally intensive. It doesn't actually "optimize" the character priority picks, per se, but it does allow a player to much more easily optimize the picks for themselves by seeing, at a glance, how their choices matter in terms of necessary priorities.
Character creation would proceed, I think, in one of two manners:
* Back off from target - the player goes crazy and makes their "Perfect" character. Then they start taking things away until the get the "CHARACTER COMPLETE!" message.
* Start from scratch - the player incrementally adds things to the character, building the character up to "CHARACTER COMPLETE!"