Posts mit dem Label action costs werden angezeigt. Alle Posts anzeigen
Posts mit dem Label action costs werden angezeigt. Alle Posts anzeigen

Mittwoch, 10. November 2010

Secure your steps, how to disengage from a move action

Update: This feature has been removed in with the beginning of the 3rd season. Instead use look_at for agents in level Clone War.

In Zero X the simulation and all agents are running continuously. That's one big difference to other programming games, that usually are round based. The consequence is, that in the time between an agent inspects his environment with a look_around and the action he takes, with a move_to for example, the environment can change.
For example a field is free, when he makes the look_around, but has been occupied in the meanwhile by another agent, when he moves. This would result in a unintended attack against this other agent.

Although this case is rare, as a look_around and a move_to are very close. But this time gape can grow bigger as the analysis of the environment takes more time. In general agents have to deal with this kind of insecurity about their perception. This one of the many challenges in this game.

But in order to handle better this kind of insecurity, starting with season 2, move_to can now take a block.
move_to(x,y) {|target| ... }
The argument passed to the block is another view of the target field at the exact time of the movement. This gives the agent the chance to check the preconditions of his action. If they are not fulfilled anymore, he can now disengage from the move action.

move_to(x,y) do |target|
  unless target.has_no_population?
     disengage 'field is not free anymore!'
  end
end
Disengage can take a message, that will then be displayed in your reports. The action is canceled and the agent remains on his starting field. But disengage comes not for free. A move_to would cost 6 action points, disengage from this action still costs 3 action points.

Disengage can only be used within an action block like the one in move_to.

Dienstag, 25. Mai 2010

Decoupling action costs from time units

The first tournaments showed, that the resources grow too fast. Fields with no population reach soon the maximum of their capacity and when an agent fights another agent, it can recover from the combat damage in no time.
As SayCheese pointed out, at the time the game is stopped, the winner is more or less random, as all survived populations are more or less at their maximum. Actually there's no real fight for the best remaining resources.

To bring some more challenge in the game, the simulation should run a little bit slower, while the agents still have the same time for their actions. Therefor the action costs will be decoupled from the time units in the simulation. Action costs are now a fraction of a time unit. A look_around doesn't take 2 time units anymore, but 2 action costs.
For the next tournament an action cost will be a quarter of a time unit. Means the simulation will run 4 times slower until now. In consequence the resources and the populations will grow 4 times slower.