From: Daniel Karbach Date: Fri, 15 Dec 2017 19:35:07 +0000 (+0100) Subject: balancing X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=commitdiff_plain;h=7159e493b63552ec7de1fceec4abcb7e0e099ec0 balancing --- diff --git a/src/creature/creature.cpp b/src/creature/creature.cpp index f0f7aac..cb0f501 100644 --- a/src/creature/creature.cpp +++ b/src/creature/creature.cpp @@ -182,8 +182,8 @@ void Creature::Ingest(int res, double amount) noexcept { // 30% of solids stays in body AddMass(res, amount * 0.3 * composition.Compatibility(res)); } else { - // 5% of fluids stays in body - AddMass(res, amount * 0.05 * composition.Compatibility(res)); + // 10% of fluids stays in body + AddMass(res, amount * 0.1 * composition.Compatibility(res)); } math::GaloisLFSR &random = sim.Assets().random; if (random.UNorm() < AdaptChance()) { @@ -782,7 +782,7 @@ void Spawn(Creature &c, world::Planet &p) { double color_divisor = 0.0; if (p.HasAtmosphere()) { - c.AddMass(p.Atmosphere(), 0.01); + c.AddMass(p.Atmosphere(), 0.005); color_avg += c.GetSimulation().Resources()[p.Atmosphere()].base_color * 0.1; color_divisor += 0.1; } @@ -857,7 +857,10 @@ void Split(Creature &c) { a->Name(c.GetSimulation().Assets().name.Sequential()); c.GetGenome().Configure(*a); for (const auto &cmp : c.GetComposition()) { - a->AddMass(cmp.resource, cmp.value * 0.5); + // require at least 0.1% + if (cmp.value > 0.002) { + a->AddMass(cmp.resource, cmp.value * 0.5); + } } s.GetPlanet().AddCreature(a); // TODO: duplicate situation somehow @@ -872,7 +875,10 @@ void Split(Creature &c) { b->Name(c.GetSimulation().Assets().name.Sequential()); c.GetGenome().Configure(*b); for (const auto &cmp : c.GetComposition()) { - b->AddMass(cmp.resource, cmp.value * 0.5); + // require at least 0.1% + if (cmp.value > 0.002) { + b->AddMass(cmp.resource, cmp.value * 0.5); + } } s.GetPlanet().AddCreature(b); b->GetSituation().SetPlanetSurface( diff --git a/src/creature/goal.cpp b/src/creature/goal.cpp index 72fc9a8..c7a7b66 100644 --- a/src/creature/goal.cpp +++ b/src/creature/goal.cpp @@ -285,8 +285,8 @@ void IdleGoal::Action() { GetSteering().ResumeSeparate(); } - // use boredom as chance per minute - if (Random().UNorm() < GetStats().Boredom().value * (1.0 / 3600.0)) { + // use boredom as chance per 30s + if (Random().UNorm() < GetStats().Boredom().value * (1.0 / 1800.0)) { PickActivity(); } } @@ -355,8 +355,8 @@ void IngestGoal::Tick(double dt) { } if (ingesting) { if (OnSuitableTile() && !GetSituation().Moving()) { - GetCreature().Ingest(resource, yield * GetCreature().GetComposition().Compatibility(resource) * dt); - stat.Add(-1.0 * yield * dt); + GetCreature().Ingest(resource, yield * dt); + stat.Add(-1.0 * yield * GetCreature().GetComposition().Compatibility(resource) * dt); if (stat.Empty()) { SetComplete(); } diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 05fd499..746be3e 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -223,7 +223,11 @@ void CreaturePanel::Hide() noexcept { void CreaturePanel::Draw(graphics::Viewport &viewport) noexcept { if (!c) return; - name->Text(c->Name()); + std::string name_str(c->Name()); + if (c->Dead()) { + name_str += " (deceased)"; + } + name->Text(name_str); age->Text(TimeString(c->Age())); mass->Text(MassString(c->Mass())); size->Text(LengthString(c->Size()));