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

Initial implementation of variable difficulty #19398

Merged
merged 6 commits into from Nov 28, 2016

Conversation

Projects
None yet
5 participants
@mugling
Copy link
Contributor

commented Nov 21, 2016

The current slow/fast/tough zombie mods are a bad design:

  • Only support arbitrary changes (typically 50% and 200%)
  • Currently dependent on dda content pack
  • Needlessly tested in --check-mods
  • Only available for Lua builds

This PR exposes them as percentages on worldgen.
The next step is to support difficulty presets, 'Easy', 'Medium', 'Hard' etc.

difficulty

@@ -172,7 +174,8 @@ class options_manager : public JsonSerializer, public JsonDeserializer
void add( const std::string sNameIn, const std::string sPageIn,
const std::string sMenuTextIn, const std::string sTooltipIn,
const int iMinIn, int iMaxIn, int iDefaultIn,
copt_hide_t opt_hide = COPT_NO_HIDE );
copt_hide_t opt_hide = COPT_NO_HIDE,
const std::string &format = "%i" );

This comment has been minimized.

Copy link
@codemime

codemime Nov 21, 2016

Member

options_manager clearly needs refactoring: 9th parameter was added to two of six monstrous overloaded functions.

This comment has been minimized.

Copy link
@mugling

mugling Nov 21, 2016

Author Contributor

Could not possibly agree more. It's a horrendously bad design and should probably be replaced en-masse. I'm looking into this for a separate PR.

For now though a minimal number of lines gets rid of a worse evil (spurious mods) and as a bonus provides two meaningful configuration options.

@harald921

This comment has been minimized.

Copy link

commented Nov 22, 2016

Allow free scaling of monster hp at worldgen

Mugling! <3

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Nov 23, 2016

Monster hp should never reach 0. Rounding would be preferable to truncation there.

ssTemp.precision(precision);
ssTemp << std::fixed << fSet;
return ssTemp.str();
return string_format( format, fSet );

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Nov 23, 2016

Contributor

Are you sure it won't affect precision?

This comment has been minimized.

Copy link
@mugling

mugling Nov 23, 2016

Author Contributor

We don't have any options with more than two decimals precision

@mugling

This comment has been minimized.

Copy link
Contributor Author

commented Nov 23, 2016

Monster hp should never reach 0. Rounding would be preferable to truncation there.

Good point, needs a lower bound

@mugling

This comment has been minimized.

Copy link
Contributor Author

commented Nov 23, 2016

Monster hp should never reach 0. Rounding would be preferable to truncation there.

Good point, needs a lower bound

Fixed

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Nov 28, 2016

Annoyance: the query keeps the '%' sign from the display. This means you can't just add '0' at the end of it, because "100%0" is just "100" and not "1000".

@Coolthulhu Coolthulhu merged commit d17ae92 into CleverRaven:master Nov 28, 2016

1 check passed

default
Details
@mugling

This comment has been minimized.

Copy link
Contributor Author

commented Nov 28, 2016

Annoyance: the query keeps the '%' sign from the display. This means you can't just add '0' at the end of it, because "100%0" is just "100" and not "1000".

Can you rephrase?

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Nov 28, 2016

  • Go to world options
  • Select monster speed
  • Press enter to edit it

Expected:

  • Query displays 100, adding 0 at the end and pressing enter sets it to 1000%

Got:

  • Query displays 100%, that % sign is useless and only makes parsing stop at it
@mugling

This comment has been minimized.

Copy link
Contributor Author

commented Nov 28, 2016

I didn't know you could press Enter!

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Nov 28, 2016

It doesn't work in main menu for some reason. But in a loaded world it does and it much better than holding left/right.

@harald921

This comment has been minimized.

Copy link

commented Nov 29, 2016

Is it possible to update and change the variable HP without regenerating the world? Mostly curious whether or not I will be able to tweak the settings without regenerating all the time.

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Nov 29, 2016

Yes, I did it during testing.
You need to save and reload the world, though.

@mugling

This comment has been minimized.

Copy link
Contributor Author

commented Nov 30, 2016

I didn't know you could press Enter!

Where does the code for this live. I'm looking in world_factory.cpp but it's not obvious

@mugling

This comment has been minimized.

Copy link
Contributor Author

commented Nov 30, 2016

Found a candidate in options.cpp

@mugling

This comment has been minimized.

Copy link
Contributor Author

commented Nov 30, 2016

Go to world options
Select monster speed
Press enter to edit it

Expected:

Query displays 100, adding 0 at the end and pressing enter sets it to 1000%

Got:

Query displays 100%, that % sign is useless and only makes parsing stop at it

Nothing happens when I press ENTER

@sick-trigger

This comment has been minimized.

Copy link
Contributor

commented Dec 7, 2016

@mugling could this be changed to only affect zombie monsters? I liked the balance of fast+tough zombies but doing the same for all monsters is a little overwhelming

@mugling

This comment has been minimized.

Copy link
Contributor Author

commented Dec 7, 2016

@mugling could this be changed to only affect zombie monsters? I liked the balance of fast+tough zombies but doing the same for all monsters is a little overwhelming

Not easily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.