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

Add animal spawn setting. #28349

Closed
wants to merge 2 commits into from

Conversation

Vasyan2006
Copy link
Contributor

Summary

SUMMARY: Features "Add animal spawn setting."

Purpose of change

Zombies are main enemies and partially loot source while animals are main meat source.
Increasing monster spawn will increase game difficulty but also increase food abundance, so separate spawn setting is required for better balancing.

Describe the solution

  • Add new setting:
    wildlife
  • Add "is_animal" : true to some json monster groups, these groups will use new spawn rate. Other groups will use base scaling factor.
  • Monster groups written in overmap_terrain now will use spawn scaling factor. This includes animals in forests and swamps.
  • Add external option in game_balance.json to disable hardcoded monster clashes on swamps.

Additional context

There are 2 different code parts which choose monsters from the group, probably they must be merged somehow.

@Night-Pryanik Night-Pryanik added Game: Balance Balancing of (existing) in-game features. Spawn Creatures, items, vehicles, locations appearing on map Monsters Monsters both friendly and unfriendly. 0.D Freeze labels Feb 24, 2019
spawn_density = get_option< float >( "SPAWN_DENSITY" );
}

// Apply a multipler to the number of monsters for really high densities.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Apply a multipler to the number of monsters for really high densities.
// Apply a multiplier to the number of monsters for really high densities.


// Apply a multipler to the number of monsters for really high densities.
float odds_after_density = spawns.chance * spawn_density;
float max_odds = 100 - ( 100 - spawns.chance ) / 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be const.

density_multiplier = 1.0f * odds_after_density / max_odds;
odds_after_density = max_odds;
}
int spawn_count = roll_remainder( density_multiplier );
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be const.

@@ -1703,7 +1703,12 @@ void options_manager::add_options_world_default()
);

add( "SPAWN_DENSITY", "world_default", translate_marker( "Spawn rate scaling factor" ),
translate_marker( "A scaling factor that determines density of monster spawns." ),
translate_marker( "A scaling factor that determines density of monster spawns (except animals)." ),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
translate_marker( "A scaling factor that determines density of monster spawns (except animals)." ),
translate_marker( "A scaling factor that determines density of monster spawns (except for animals)." ),

{
"type": "EXTERNAL_OPTION",
"name": "DISABLE_SWAMP_CLASH",
"info": "Disable monster clashes on swamps.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Add some more info on what "monster clashes on swamp" is.

);

add( "SPAWN_ANIMAL_DENSITY", "world_default", translate_marker( "Animal spawn rate scaling factor" ),
translate_marker( "A scaling factor that determines density of wild, formerly domesticated and mutated animal spawns." ),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
translate_marker( "A scaling factor that determines density of wild, formerly domesticated and mutated animal spawns." ),
translate_marker( "A scaling factor that determines density of wild, formerly domesticated and mutated animals spawns." ),

Copy link
Contributor

Choose a reason for hiding this comment

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

That one's actually correct as a singular

Copy link
Contributor

Choose a reason for hiding this comment

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

Enumeration of 1) wild, 2) formerly domesticated, and 3) mutated should be "animal"?

Copy link
Contributor

Choose a reason for hiding this comment

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

"animal spawn" is kinda treated as one thing in this case so the plural would be "animal spawns." Also it just sounds right to me.

Either that or add an apostrophe: "animal's spawns" but that's a little awkward.

"monsters" : [
{ "monster" : "mon_duck", "freq" : 50, "cost_multiplier" : 0 }
]
},{
"type":"monstergroup",
"name" : "GROUP_POND_FISH",
"default" : "mon_null",
"is_animal" : true,
"monsters" : [
{ "monster" : "mon_duck", "freq" : 50, "cost_multiplier" : 0 },
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is an error here: duck shouldn't belong to GROUP_POND_FISH.

@kevingranade
Copy link
Member

kevingranade commented Feb 24, 2019 via email

@kevingranade kevingranade changed the base branch from master to development February 25, 2019 21:11
@Vasyan2006
Copy link
Contributor Author

And now I am getting
obj\Release\src\game.o:game.cpp|| undefined reference to `get_scaling_factor()'|
compilation error. I will better not update this PR until 0.D will be released and all branches will return to usual routine.

@ifreund ifreund removed the 0.D Freeze label Mar 8, 2019
@Vasyan2006
Copy link
Contributor Author

Will reopen it shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Game: Balance Balancing of (existing) in-game features. Monsters Monsters both friendly and unfriendly. Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants