I think you should make it so it keeps previously searched positions in a list so it does not keep searching the same positions over and over again. Or you could delete the previously searched positions from the list it's searching the positions from.
Offline
lemonpretzel wrote:
I think you should make it so it keeps previously searched positions in a list so it does not keep searching the same positions over and over again. Or you could delete the previously searched positions from the list it's searching the positions from.
Your first idea is nice, though your second would ruin the game entirely.
To LiqiudMetal:
When I briefly looked through your log of Game 2, one thing that I noticied is that your AI picking spots that it had already shot at and it had checked to see if a ship could fit there, but seeing as it's already been shot at, it had to pick another spot to check. I'll look tomorrow and see what else I can find…
Last edited by ErnieParke (2012-10-14 18:20:19)
Offline
ErnieParke wrote:
Your first idea is nice, though your second would ruin the game entirely
My second idea is simply a faster version of the first idea. It would still be slow if it kept checking to see if the tile picked is in the list or not, so it could instead pick a random one from a list excluding the ones already picked.
Offline
lemonpretzel wrote:
ErnieParke wrote:
Your first idea is nice, though your second would ruin the game entirely
My second idea is simply a faster version of the first idea. It would still be slow if it kept checking to see if the tile picked is in the list or not, so it could instead pick a random one from a list excluding the ones already picked.
Not entirely. What I meant by it ruining the game is that you had said that the AI should delete items from the list of positions it's searching, but there is only one copy of your board, so this would, over time, delete everything on that list, the AI will glitch out or not work in some way, and that would in turn effectively ruin the entire game.
Last edited by ErnieParke (2012-10-14 18:31:41)
Offline
ErnieParke wrote:
lemonpretzel wrote:
ErnieParke wrote:
Your first idea is nice, though your second would ruin the game entirely
My second idea is simply a faster version of the first idea. It would still be slow if it kept checking to see if the tile picked is in the list or not, so it could instead pick a random one from a list excluding the ones already picked.
Not entirely. What I meant by it ruining the game is that you had said that the AI should delete items from the list of positions it's searching, but there is only one copy of your board, so this would, over time, delete everything on that list, the AI will glitch out or not work in some way, and that would in turn effectively ruin the entire game.
Not if every time the game was initiated it added every spot on the board to the list (after deleting all items of course). The AI would wor every game, then.
Offline
zubblewu wrote:
ErnieParke wrote:
lemonpretzel wrote:
My second idea is simply a faster version of the first idea. It would still be slow if it kept checking to see if the tile picked is in the list or not, so it could instead pick a random one from a list excluding the ones already picked.
Not entirely. What I meant by it ruining the game is that you had said that the AI should delete items from the list of positions it's searching, but there is only one copy of your board, so this would, over time, delete everything on that list, the AI will glitch out or not work in some way, and that would in turn effectively ruin the entire game.
Not if every time the game was initiated it added every spot on the board to the list (after deleting all items of course). The AI would wor every game, then.
Or it could copy the "reference" list which is unchanged to a temporary list which only the AI uses. That's what I was thinking about before, but I never typed it.
Offline
lemonpretzel wrote:
zubblewu wrote:
ErnieParke wrote:
Not entirely. What I meant by it ruining the game is that you had said that the AI should delete items from the list of positions it's searching, but there is only one copy of your board, so this would, over time, delete everything on that list, the AI will glitch out or not work in some way, and that would in turn effectively ruin the entire game.
Not if every time the game was initiated it added every spot on the board to the list (after deleting all items of course). The AI would wor every game, then.
Or it could copy the "reference" list which is unchanged to a temporary list which only the AI uses. That's what I was thinking about before, but I never typed it.
Well then that would work somewhat. The way LiquidMetal set up his/her AI was that when it choose a spot, it wouldn't check every possible combination of situations where a ship might fit there, but instead checks one situation. For example, it might pick position 5A and check to see if a submarine can fit there from 5A to 3A, but when it notices that a submarine can't fit there, it will move on. It then does the same thing with 5C, except now it checks to see if a submarine is at 5C to 3C, but since their is no space for one, it again moves on. Again, the same thing happens at 5B, but with 5B to 7B. It sees no space open, so again, it moves on. If there are no other spaces where a submarine could fit, then, using your idea, there will no longer be spots that the AI will try and fire at even though there is a space where a submarine could fit at at 5A to 5C. From there, the AI will never finish its turn and you'll be forced to restart you game. This is a small issue that's not going to happen that often, but still, I thought that I should point it out.
Edit: I fixed some parts of my posts that weren't 100% correct.
Last edited by ErnieParke (2012-10-14 21:57:34)
Offline
Ignore my above post ^^. I had misunderstood the AI. Anyway, LiquidMetal, I noticied a problem with your AI. During turn 45, game 2, at around .39 seconds, your AI was looking for the submarine, and it had checked to see if a submarine could be at J10 (100) to H10 (80). A submarine could fit there, but your AI thought that it couldn't. I don't know what's going wrong, but your AI is drawing false conclusions.
Last edited by ErnieParke (2012-10-15 16:36:19)
Offline
ErnieParke wrote:
Just to make sure, if I see position 7, your AI is referring to A7, and if I see position 11, then your AI is referring to B1. Correct?
Correct.
lemonpretzel wrote:
I think you should make it so it keeps previously searched positions in a list so it does not keep searching the same positions over and over again.
I've thought about doing that, but then It would need to clear that list and do it over each turn. Whatever bug there is might be easier to isolate if I did that...
lemonpretzel wrote:
Or you could delete the previously searched positions from the list it's searching the positions from.
ErnieParke seems to have a pretty good Idea of why this would not work. My current plan might be to switch to the smallest ship standing method, and delete the places from the actual target list.
I had an idea, not sure if it is any good though: What if at the beginning of each AIturn, a list of all the places that AI would want to shoot is made, and it picks randomly from that list? This would need to make the grid to narrow down where largest ship could possibly be (or smallest for the med version), as long as it didn't already have a ship to target. Or maybe, it could even search for the other ships before it finishes targeting the first one! The problem is, finding out which would be the most efficient way to guaranteed hit the largest ship at any one point in time might be difficult, especially when trying to skip over places that a ship was already sunk.
What do you think?
Last edited by LiquidMetal (2012-11-10 21:39:31)
Offline