Hero Size

Hi there,

I’ve only just started working on my bot, so I don’t have anything meaningful to test the engine with yet. However, I do have a question.

According to the rules:

:ledger: Note: Your hero is not added to the HeroWindow. Since they are in they are in the center, they are easy to calculate.The hero takes up 4 tiles to make a square.

In my mind, this implies a hero has a size of four tiles (i.e. 2 x 2), where each tile is a cell on a grid that can contain a pickup or a hazard or whatever else that has a size of one tile (i.e. 1 x 1).

Based on the game logs and the actual source code of HeroEntity.cs, the width and height of a hero is 1. Can you please confirm? Does this mean that the hero takes up four tiles or one tile?

public HeroEntity(Guid id, CyFiGameSettings settings) : base(new HeroInput(), new HeroPhysics(), id)
        {

            Width = 1;
            Height = 1;
            this.settings = settings;
            this.radarData = new List<Movements.RangeData>();
            MovementSm = new MovementSM(this);
            MovementSm.Start();
        }
				"Hero": {
					"Collected": 0,
					"TimesDug": 0,
					"MovementSm": {
						"CurrentState": {
							"name": "Idle"
						}
					},
					"radarData": [],
					"Width": 1,
					"Height": 1,
					"NextXPosition": 23,
					"NextYPosition": 14,
					"XPosition": 23,
					"YPosition": 14
				},
				"CurrentLevel": 0,
				"Id": "65ca23ba-0fb4-4d9a-b3f2-35d1d54ceab8",
				"NickName": "JavaBot",
				"ConnectionId": "HHafd9vlP2OGNmwCa3WazA",
				"TotalPoints": 0
			},

Cheers.

Hey @rfnel , I’m not sure how that width and height gets used, but the hero width is definitely 2x2 (and the coordinates received from the engine is the top left cell of the hero)

4 Likes