AiBattleground / BotWars

The AiBattleground website and NetBots Game Engine. Serves as an artificial intelligence challenge where AI bots can compete in programming game.
http://aibattleground.com
MIT License
5 stars 5 forks source link

Botlet Spontaneously combusts, destroyed by energy it should have collected. #13

Open Pabreetzio opened 10 years ago

Pabreetzio commented 10 years ago

I've noticed bots spontaneously disappear when no other bots were anywhere around. I noticed that there was energy in the square next to the bot when it happened. I suspect it may be an issue resolving what happens when the bot should be picking up energy. When it happens there is no indicator showing the bot's demise, merely the energy that the bot should have collected.

Pharylon commented 10 years ago

I've seen this too, but I'm not sure it's a bug. As far as I can tell, this is happening when a bot tries to move into an Energy square. That can happen if energy spawns right next to a bot. That leaves the bot in the situation where it will collect the energy next turn if it just doesn't move. However, if the bot tries to move into the energy's square, the bot just sort of disappears, because two objects can't occupy the same space, and energy seems to "win".

Pharylon commented 10 years ago

Actually, I guess that would still be a bug. There should be a death marker regardless.

Pabreetzio commented 10 years ago

Seemed like a one-liner and should be fixed now. You were right that it happened when the bot tried to move to the square where the energy was. We were updating the energy count but not updating the square the bot move to. The bot was collecting energy, disappearing, and the energy would stay. Or did the bot teleport home o.O?

Pharylon commented 10 years ago

Uh-oh! Things are worse now! I added a line note here but the basic problem is now if two bots try and move onto energy at once, instead of them both disappearing, the first one who's moves get processed gets the energy, and then both bots die! We need a better long term solution, but for now we need to revert this change, so at least the game is symmetric.

I've commited a change that does just that.

Pabreetzio commented 10 years ago

Thanks, and good catch. I thought I noticed Blue winning more battles than it should.

I think that we'll just adopt this bug as a common law rule for the game for this tournament.

What is the correct behavior? Here are some possibilities:

Second item seems easier to explain. I'm leaning towards it. Just want to know if there are any other suggestions.

Pharylon commented 10 years ago

What about moving onto Energy ALWAYS kills botlets? They have to harvest it from a safe distance (the adjacent square).

I like this idea because it's a simple rule that applies no matter how many botlets are trying to move into the square.

Pabreetzio commented 10 years ago

I like that better than my first thought, though I'm still partial to it only spawning in locations that are not right next to a bot. One reason is that making energy kill bots introduces a new rule to beginners that's pretty basic to what they need to consider when going after energy: Don't actually touch it. It makes it harder for them to get to the point where they consider things like probability. It also makes the more advanced tactic of calculating potential energy spawn points less interesting because there are fewer spaces it can rule out. I'd like the more advanced players to get a bigger boost from realizing that there may only be 6 symmetric spots that aren't next to any bots and taking advantage of that knowledge to increase their odds of getting there first.

Dubman25 commented 10 years ago

What about letting them both collect the energy?

Pharylon commented 10 years ago

So they would both collect energy and then die from being in the same space?

Pharylon commented 9 years ago

So let's get us some consensus here! :D

I do like the idea of not allowing energy to spawn next to a bot, just because it seems a bit unfair sometimes. But in big games, I think it could really reduce the number of symmetrical squares down to just a couple. That might be a bigger rule change than "energy kills bots." It also doesn't completely solve the core issue of bots moving into energy. It can still happen when two bots from opposing sides reach the energy at the same time. Neither can harvest since they have the same number adjacent, so the energy just sits there. Then if one bot moves into the energy, it (currently) disappears. The other then scoops up the energy. So even if we make it so energy can't spawn adjacent, we need to consider what happens when two move in at once.

So, while I'm provisionally in favor of energy not spawning next to bots (I'd really like to see how it plays out in practice) I think in the end it's an issue that should be considered separately.

If we leave energy spawning aside for a moment, I see the following resolutions to "bots moving into energy"

  1. If a bot moves into energy, it dies.
  2. If a bot moves into energy, it collects it. If two do, they both collect it and then they both die from collisions.
  3. If a bot moves into energy, it collects it. If two do, neither collect it and they both die from collisions.
  4. We need to consider energy-spawning-next-to-bots at the same time as this issue, as they're too closely related.
  5. None of the above.

I think my vote is for either #1 or #3. I like the simplicity of #1 as a rule, and I think #3 also makes sense too. #2 is my last choice but I'm not, like, super strongly opposed or anything.

What's everyone's opinion on this?