A bot's view may be outdated when the bot moves

89 views
Skip to first unread message

georg

unread,
May 8, 2012, 1:52:50 AM5/8/12
to scal...@googlegroups.com
Discussion of a game implementation detail I'm not happy with

In the current implementation (and supported by the rules), on a map with more than one bot, my bot may get the following view:
_____
_____
m_M__
_____
_____

Assume that my bot decides to move 1 left, and the other bot decides to move 1 right. According to rules and implementation, one of the bots (indeterminate) will move and the other will just bonk. In other words: A position that is seen "free" in the view may already be occupied when my move is executed. That is more or less fine, since the same rule applies for all bots, and since this way all bots can process their reactions in parallel, speeding up the game on multi-core machines.

The problem is: If I need to know (and my bot does need to know), it is hard to detect whether my bot has moved or bonked. Did I overlook something? To ameliorate the issue, I propose

1) In the React command of the server, include a parameter "position=x:y" that tells the bot its position relative to the starting point.
or
2) In the React command of the server, include a parameter "bonked=true" if the bot's last command included a move that was not executed.

I'd be willing to give the implementation a go if there is a chance this will be taken over into the game.

Georg

Greg Scalatron

unread,
May 9, 2012, 12:04:59 PM5/9/12
to scal...@googlegroups.com
Sorry for the delay, I rarely look at this e-mail address (I use scal...@hotmail.com). Added forwarding...

So:
1) is not ideal: the bots by design do not know where they are in absolute terms
2) seems better: I actually quite like it.

If you send a pull request for 2), I'm happy to include it. Some pointers:
- Check out the file AugmentedDynamics.scala and look for the Move command; then place the "bonked" setting into the bot's state parameters
- (maybe, need to check) in Dynamics, make sure that "bonked" is cleared (there is other stuff there, too, like the Debug log output)
- add it to the docs: Scalatron Protocol.md - also the copy in the /docs/tutorial directory
- I would take care of the pdf version

Thanks for the suggestion! I'm happy to help, too.

- Greg

Scalatron

unread,
May 14, 2012, 4:20:26 AM5/14/12
to scal...@googlegroups.com
Hi Georg,

thanks for sending the pull request! I've merged it this morning. It will go into 1.0.0.3.

- Greg
Reply all
Reply to author
Forward
0 new messages