]> git.localhorst.tv Git - blobs.git/commitdiff
balancing
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 15 Dec 2017 19:35:07 +0000 (20:35 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 15 Dec 2017 20:56:53 +0000 (21:56 +0100)
src/creature/creature.cpp
src/creature/goal.cpp
src/ui/ui.cpp

index f0f7aac985f30ff3fe36467bb5bc60c8b3ed43a3..cb0f501eaece3e45d5500e3961acdc9486478362 100644 (file)
@@ -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(
index 72fc9a814d4eaec47708301b2c36b923c759275a..c7a7b66ac5f9be93024f8ab8f486edf11aa1b8ca 100644 (file)
@@ -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();
                        }
index 05fd499f376a333dc0b8d0e477fef48bfd9a4ca1..746be3e5295e1fc71fb7e5bbc82217405936964c 100644 (file)
@@ -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()));