Feedback round: bots that keep working, Sky Mower, calmer HUD, faster menus, new map

- Robot docks and drone pads with no belt ship straight to Earth; robots widen
  their rings up to 4x once everything in reach is mown, travel 2.5x faster
  empty, hoppers 60/150 kg. Drone reach 70 m + 25 m per upgrade.
- New Sky Mower: a big mowing drone on a pad, 91 sectors, flies over the grass.
- Cut paint follows the blade as a strip, no disc ahead of the machine.
- Sector toasts aggregate, chimes and till sounds throttled, toasts moved and
  narrowed.
- Menus no longer rebuild on every money change (price tint follows the
  wallet), scroll position kept.
- Map drawn as one mesh, opens near the player, ME / + / - / GLOBE, scale bar.
- Key-art still (x_key) and -shotsize for the store stills; -demobots test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NiemandKG
2026-11-09 15:38:37 +06:00
parent d1c3761e58
commit 27d075103b
44 changed files with 6801 additions and 5733 deletions

View File

@ -0,0 +1,60 @@
using System.Collections;
using System.Linq;
using UnityEngine;
namespace GrassCutter
{
public partial class DemoBot
{
/// <summary>
/// -demobots: a Robot Mk I, a Sky Mower and a Drone Pad, none of them with a belt. All three should keep earning on
/// their own: the robot and the sky mower widen their rings once they are done, the pad ships what its drones bring.
/// </summary>
IEnumerator Bots()
{
TeamState.DeleteSave();
yield return new WaitForSeconds(2f);
NetSession.Instance.HostLocal();
while (!Me || !Ts) yield return null;
yield return new WaitForSeconds(3f);
Clock(11f);
var robotAt = Soil17(140f, -40f);
var skyAt = Soil17(-120f, 60f);
var padAt = Soil17(40f, 150f);
Quaternion Face(Vector3 p) => Quaternion.LookRotation(Vector3.ProjectOnPlane(Vector3.forward, Planet.Up(p)), Planet.Up(p));
var robot = Spawner.Instance.SpawnPiece(PieceId.RobotI, robotAt, Face(robotAt), robotAt, true).GetComponent<RobotDock>();
var sky = Spawner.Instance.SpawnPiece(PieceId.SkyMower, skyAt, Face(skyAt), skyAt, true).GetComponent<RobotDock>();
var pad = Spawner.Instance.SpawnPiece(PieceId.DronePad, padAt, Face(padAt), padAt, true).GetComponent<DronePad>();
for (int i = 0; i < 9; i++)
{
var a = Quaternion.AngleAxis(i * 40f, Planet.Up(padAt)) * Vector3.ProjectOnPlane(Vector3.forward, Planet.Up(padAt)).normalized * (12f + i * 6f);
Spawner.Instance.SpawnCargo(CargoKind.Grass, Planet.Surface(padAt + a) + Planet.Up(padAt + a) * 0.6f, Quaternion.identity, Vector3.zero);
}
yield return new WaitForSeconds(1f);
Log($"bots built: robot {(robot ? "ok" : "MISSING")}, sky {(sky ? "ok" : "MISSING")}, pad {(pad ? "ok" : "MISSING")}");
if (!robot || !sky || !pad) yield break;
double money = Ts.Money.Value;
Mowbot.Haste = 25f;
yield return new WaitForSeconds(3f);
var skyUp = Planet.Up(sky.Shown);
yield return Look("bot01_sky_mower", sky.Shown + skyUp * 5f + Vector3.ProjectOnPlane(Vector3.right, skyUp).normalized * 9f, sky.Shown, 0.2f);
yield return Look("bot02_robot", robot.Shown + Planet.Up(robot.Shown) * 3f + Vector3.right * 4f, robot.Shown, 0.2f);
for (int k = 1; k <= 6; k++)
{
yield return new WaitForSeconds(15f);
Log($"t+{k * 15} s at {Mowbot.Haste:0}x: earned {Ts.Money.Value - money:0}, closed {Ts.Closed.Value}");
Log($" robot: {robot.Prompt}");
Log($" sky: {sky.Prompt} alt {Planet.Altitude(sky.ShownBody.position) - Planet.Altitude(sky.Shown):0.0} m");
Log($" pad: {pad.Prompt}, delivered {pad.Delivered}");
}
skyUp = Planet.Up(sky.Shown);
yield return Look("bot03_sky_late", sky.Shown + skyUp * 7f + Vector3.ProjectOnPlane(Vector3.forward, skyUp).normalized * -12f, sky.Shown, 0.2f);
yield return Look("bot04_pad", padAt + Planet.Up(padAt) * 6f + Vector3.right * 8f, padAt, 0.2f);
Mowbot.Haste = 1f;
Log("bots done");
Application.Quit();
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 054f406d5f753b04ea40bd5f12cbd553

View File

@ -3003,6 +3003,11 @@ namespace GrassCutter
yield return Sizes();
yield break;
}
if (CommandLine.Has("-demobots"))
{
yield return Bots();
yield break;
}
if (CommandLine.Has("-demobelts"))
{
yield return Belts();

View File

@ -51,6 +51,7 @@ namespace GrassCutter
Cheats.Run("ship 60");
BuildRules.AnyGround = true;
yield return new WaitForSeconds(0.5f);
yield return StillKey();
yield return StillCrew();
yield return StillMachines();
yield return StillFactory();
@ -79,6 +80,55 @@ namespace GrassCutter
// ───────────────────────── by day ─────────────────────────
/// <summary>
/// `x_key`: the key art, from the game itself. The crew mows across the meadow in a staggered line, each trailing a
/// cut stripe, under the ringed giant. The camera looks the giant's way, so it hangs over the field; `-shotsize`
/// picks the frame (wide for the capsules and hero, upright for the library and vertical capsules), and the
/// lens widens on an upright frame so the giant and the crew both fit.
/// </summary>
IEnumerator StillKey()
{
if (!Wanted("x_key")) yield break;
Sky(0.55f, false);
bool tall = H > W;
// the spot and the lens can be tried from the command line without a new build
float x = Arg("-keyx", -80f), z = Arg("-keyz", 300f);
float dist = Arg("-keydist", tall ? 11f : 10f), aimUp = Arg("-keyaim", tall ? 10f : 9f), fov = Arg("-keyfov", tall ? 66f : 58f);
float spread = Arg("-keyspread", tall ? 2.4f : 3.6f);
// the giant hangs at (-0.55, 0.42, 0.72) in the sky above the base: look past it to the right, so it hangs
// over the left of the field and leaves the right for the logo
var giant = new Vector2(-0.55f, 0.72f).normalized;
var look = Rotate(giant, -Arg("-keyturn", tall ? 4f : 12f));
var right = new Vector2(look.y, -look.x);
var walk = (right * 0.55f - look * 0.85f).normalized; // toward us and a little across, faces showing
var abreast = new Vector2(walk.y, -walk.x); // across the frame
Vector3 At(Vector2 p, float h = 0f) => On(p.x, p.y, h);
var mid = new Vector2(x, z);
var who = new[] { 4, 1, 6, 2 };
var tools = new[] { ToolId.WideScythe, ToolId.LongScythe, ToolId.WideScythe, ToolId.Scythe };
for (int i = 0; i < who.Length; i++)
{
// a shallow V: the middle two lead, the outer two a step behind
var start = mid + abreast * ((i - 1.5f) * spread) - walk * (Mathf.Abs(i - 1.5f) * 1.4f);
MowMap.Cut(At(start - walk * 45f), At(start), 2.4f);
var s0 = start;
Actor(who[i], At(start), new Vector3(walk.x, 0f, walk.y), tools[i], true, s => At(s0 + walk * (s * 1.1f)));
}
var cam = mid - look * dist;
var aim = mid + look * 30f;
yield return Still("x_key", t => new Lens(At(cam, tall ? 2.6f : 2.8f), At(aim, aimUp), fov), 2f);
Strike();
}
static float Arg(string flag, float fallback) =>
float.TryParse(CommandLine.Get(flag), System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out float v) ? v : fallback;
static Vector2 Rotate(Vector2 v, float degrees)
{
float r = degrees * Mathf.Deg2Rad, c = Mathf.Cos(r), s = Mathf.Sin(r);
return new Vector2(v.x * c - v.y * s, v.x * s + v.y * c);
}
IEnumerator StillCrew()
{
if (!Wanted(X("x_crew"))) yield break;

View File

@ -117,7 +117,14 @@ namespace GrassCutter
[DefaultExecutionOrder(-2000)]
public partial class Trailer : MonoBehaviour
{
const int W = 2560, H = 1440;
/// <summary>The frame: 2560x1440 unless `-shotsize WxH` asks for another (key art is shot big, and upright too).</summary>
static readonly int W = ShotSize(0, 2560), H = ShotSize(1, 1440);
static int ShotSize(int i, int fallback)
{
var p = (CommandLine.Get("-shotsize") ?? "").Split('x');
return p.Length == 2 && int.TryParse(p[i], out int v) && v >= 64 && v <= 8192 ? v : fallback;
}
public string Folder;
Camera _cam;
RenderTexture _rt;