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

Refactor: stop duplicating information in the character creation #50772

Merged
merged 24 commits into from Aug 21, 2021

Conversation

hexagonrecursion
Copy link
Contributor

@hexagonrecursion hexagonrecursion commented Aug 14, 2021

Summary

Bugfixes "Fix all the bugs with character creation point pools forever"

Purpose of change

Fixes #50665

Currently the character creation menu tries (and sometimes fails) to keep two pieces of information in sync: the point pools and the choices the player made. This leads to bugs like #50665.

Describe the solution

I propose to recompute the point pools where needed instead of keeping them in a variable and updating them in-place. This should be much less code and remove many opportunities for bugs.

Testing

Opened the character creation menu and played around with it a but. Observations so far:

  • Because choosing a scenario currently always resets profession to the default profession for the scenario it may look as if some scenarios cost more or fever points then they say they do. What actually happens is that the cost of the profession applied as soon as the scenario is selected.

I am going to refactor newcharacter.cpp and to do that i want to remove
all external usage of points_left.
@BrettDong BrettDong added [C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world Info / User Interface Game - player communication, menus, etc. labels Aug 14, 2021
As far as I can tell there is no UI to request random single-pool or
freeform characters which makes my job easier
@hexagonrecursion hexagonrecursion marked this pull request as ready for review August 17, 2021 05:28
@hexagonrecursion hexagonrecursion changed the title [WIP] Refactor: stop duplicating information in the character creation Refactor: stop duplicating information in the character creation Aug 17, 2021
@kevingranade
Copy link
Member

I absolutely love your approach here, this centralizes all the evaluation in a really nice way so it's easier to get a view into how things interact with each other, and also pulls code out of avatar and character, which is great.

@hexagonrecursion
Copy link
Contributor Author

Master is green. I want to take the opportunity to CI this. Close and reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Character creation: selecting same hobby and trait removes too many points
3 participants