I'm looking for help making medium and hard level Battleship AI players. I already programmed the easy AI player, but I may need to redo that in order to make the entire AI (and the multiplayer modes) use as much of the same script as possible. So... My easy AI player guesses randomly until he hits a ship. When that happens, he shoots around the target until he determines the direction and location of the ship. Once the ship is gone, he shoots randomly again. How should the medium and hard level AI players operate?
Last edited by LiquidMetal (2012-09-25 00:34:49)
Offline
Maybe the advanced AI could have an "insight" once every 8 moves where it correctly guesses the position of a ship, and once every 5 moves for hard. Or you could give the enemy AI extra ships, though then the game wouldn't be original…
Last edited by ErnieParke (2012-09-23 19:59:01)
Offline
ErnieParke wrote:
Maybe the advanced AI could have an "insight" once every 8 moves where it correctly guesses the position of a ship, and once every 5 moves for hard.
That would really be taking the easy way out, no? I want it to be completely fair: no peeking! This means that whatever strategy the AI uses, it would be possible to use in a real game of battleship as well. The thing is, the AI will not forget what it was planning to do, like a human might...
ErnieParke wrote:
Or you could give the enemy AI extra ships, though then the game wouldn't be original…
If I were to give the AI extra ships...
1. the chance of hitting a ship would be greater, so it would seem easier to find them. Technically, it would require more hits to sink all their ships, but finding them is key.
2. that would make the game more original, not less original (right?).
In any case, I'm looking for strategies. What are good strategies for playing battleship? How would I keep track of those in my program?
Offline
A smarter AI would restrict it's shots to a pattern based on the size of the largest ship that is still floating. For instance, if the enemy four hole ship was still afloat, they might pick random locations that had a gap of three holes from all the previous shots - so that a four hole ship could not hide.
It's been a while since I considered the problem - but I think I took an approach kind of like that with my version of Battleship. Other things I did to vary the difficulty of the game were deciding who got the first shot. On Medium I always give the first shot to the human player - and on Easy the human player gets the first shot and an extra shot per turn (my version is a multi-shot per turn version - number of shots normally based on number of surviving ships).
I suggest that you download my project if you want to play it as there is a persistent bug that has been haunting it for years that allows the AI to cheat online. It somehow manages to occasionally locate part of it's fleet off the grid entirely, thus making it impossible to sink.
Good luck with your Battleship project
Offline
I saw this and was about to mention Paddle's game, but I see he's already been here. Good luck with you project!
Offline
Paddle2See wrote:
A smarter AI would restrict it's shots to a pattern based on the size of the largest ship that is still floating. For instance, if the enemy four hole ship was still afloat, they might pick random locations that had a gap of three holes from all the previous shots - so that a four hole ship could not hide.
I see. I use this sort of strategy when I play, but I'm not quite sure how to implement this into my code.
Actually, I was thinking of picking random locations with gaps based on the smallest ship still floating - which is better, and why?
I suppose if you play where you get 1 shot per ship, it makes sense to find the easiest (largest) ship first, but if you play 1 shot per turn (my current method - maybe I'll program in both options), maybe the short ship first way would be better? Why or why not?
Paddle2See wrote:
It's been a while since I considered the problem - but I think I took an approach kind of like that with my version of Battleship. Other things I did to vary the difficulty of the game were deciding who got the first shot. On Medium I always give the first shot to the human player - and on Easy the human player gets the first shot and an extra shot per turn (my version is a multi-shot per turn version - number of shots normally based on number of surviving ships).
I suggest that you download my project if you want to play it as there is a persistent bug that has been haunting it for years that allows the AI to cheat online. It somehow manages to occasionally locate part of it's fleet off the grid entirely, thus making it impossible to sink.
I think I've seen that project before, but I didn't realize the bug was only online. I'll take a look at it and see if it helps me get an idea of how to code the AI.
Paddle2See wrote:
Good luck with your Battleship project
Thank you!
Last edited by LiquidMetal (2012-09-25 13:40:12)
Offline
Ok Paddle2See, I've downloaded and examined your battleship project. We manage the whole thing two completely different ways: You use the yellow box in the corner (color sensing), and I use a list. The advantage of using a list is that the Flash player shouldn't mess anything up, but a disadvantage is that I have to be very careful when using the board, because the list is a single-dimension list operating as a two dimensional list. Some of the code for that becomes very repetitive, so blocks will make it easier in 2.0, but I want to submit it before then, and then optimize it. Anyway, the AI should still be somewhat similar between both projects, but I'm having trouble understanding/locating your scripts. What are your I and J? Which sprite/script is doing the actual deciding of where to shoot?
Last edited by LiquidMetal (2012-09-27 00:37:21)
Offline
LiquidMetal wrote:
Ok Paddle2See, I've downloaded and examined your battleship project. We manage the whole thing two completely different ways: You use the yellow box in the corner (color sensing), and I use a list. The advantage of using a list is that the Flash player shouldn't mess anything up, but a disadvantage is that I have to be very careful when using the board, because the list is a single-dimension list operating as a two dimensional list. Some of the code for that becomes very repetitive, so blocks will make it easier in 2.0, but I want to submit it before then, and then optimize it. Anyway, the AI should still be somewhat similar between both projects, but I'm having trouble understanding/locating your scripts. What are your I and J? Which sprite/script is doing the actual deciding of where to shoot?
I think a list-based approach is a great idea! That's the way I've been thinking of going, if I ever get around to fixing the bug for good. Color sensing with small costumes has been very problematic over the years.
I and J are the horizontal and vertical coordinates of the shot, as I recall. The decision making is happening in the script area of the sprite labeled "Computer" which looks like a duck.
Offline
I finally got around to writing the medium/hard level AI. The medium is supposed to use the hard's script 50% of the time. For some reason, the script has caused the hard AI, (and the medium AI in ~every other turn,) to shoot in the same place again and again and again. Can someone help me figure out the problem?
The following is the current script for setting up a turn of the medium or hard AI. It is supposed to set the variable tmp to the position of a valid shoot coordinate in a list of coordinates not yet targeted.
set [report v] to [0]//report is the variable by which the script knows if the random choice works, or if it needs to pick a new choice. repeat until <(report) = [1]> set [report v] to [1] set [index2 v] to (item (tmp0) of [EnemyTarget v] )//EnemyTarget is a list of the board tiles not yet targeted by the AI set [index v] to [0]//index is a counter for comparing to YLSRS repeat until <<(index) = (YLSRS)> or <<(letter (length of ((index2) - (1))) of ((index2) - (1))) = [0]> or <(item ((index2) - (1)) of [YourBoard v] ) > [5]>>> change [index2 v] by (-1)//YLSRS represents the (size of the largest of your ships still showing) - (1) change [index v] by (1) end if <not <<(index) = (YLSRS)> and <(item ((index2) - (1)) of [YourBoard v] ) < [6]>>> set [index2 v] to (item (tmp0) of [EnemyTarget v] ) set [index v] to [0] repeat until < <(index) = (YLSRS)> or <<( (index2) - (10) ) = [0]> or <(item ((index2) - (10)) of [YourBoard v] ) > [5]>>> change [index2 v] by (-10)//The above equals sign is really a >, but there was an error with the parsing. change [index v] by (1) end if <not <<(index) = (YLSRS)> and <(item ((index2) - (10)) of [YourBoard v] ) < [6]>>> set [index2 v] to (item (tmp0) of [EnemyTarget v] ) set [index v] to [0] repeat until <<(index) = (YLSRS)> or <<(letter (length of ((index2) + (1))) of ((index2) + (1))) = [1]> or <(item ((index2) + (1)) of [YourBoard v] ) > [5]>>> change [index2 v] by (1) change [index v] by (1) end if <not <<(index) = (YLSRS)> and <(item ((index2) + (1)) of [YourBoard v] ) < [6]>>> set [index2 v] to (item (tmp0) of [EnemyTarget v] ) set [index v] to [0] repeat until <<(index) = (YLSRS)> or <<((index2) + (10)) < [101]> or <(item ((index2) + (10)) of [YourBoard v] ) > [5]>>> change [index2 v] by (10) change [index v] by (1) end if <not <<(index) = (YLSRS)> and <(item ((index2) + (10)) of [YourBoard v] ) < [6]>>> set [tmp0 v] to (pick random (1) to (length of [EnemyTarget v] )) set [report v] to [0] end end end end end
Last edited by LiquidMetal (2012-10-03 17:50:21)
Offline
If I need to explain something better, please ask, and if you can help me, please do. Thanks!
Offline
I think that I see what's going wrong. The problem is that your script does not contain a block to delete the space it shot in from your opponent's board, so your script continues to think that it hadn't shot anywhere in your opponent's board. That's why it keeps on shooting in the same spot because the lists and, in turn, the variables are the same each turn.
Last edited by ErnieParke (2012-10-03 18:18:24)
Offline
LiquidMetal wrote:
The following is the current script for setting up a turn...
This fragment only sets up the Enemy's Target variable for the rest of the script to process...
In fact, the very next block is
delete (tmp0) of [EnemyTarget v]Even if I had not done that, the AI should not shoot in the same place every single time! Rather, sometimes, he would shoot in a place he had already shot.
when I receive [AISetup v] delete (all v) of [EnemyTarget v] set [index v] to [0] repeat (100) change [index v] by (1) add (index) to [EnemyTarget v] change x by ((423) / (100)) end set [ELH v] to [0] set [ELHS v] to [0] set [ELM? v] to [0] set [ETCD v] to [0]And the complete script that is executed every time the AI is run:
when I receive [AITurn v] if <<(item (ELHS) of [YourShipHits v] ) = [0]> and <(length of [EnemyTargetShipQueue v] ) > [0]>> set [ELH v] to (item (last v) of [EnemyTargetShipQueue v] ) delete (last v) of [EnemyTargetShipQueue v] set [ELHS v] to (item (last v) of [EnemyTargetShipQueue v] ) delete (last v) of [EnemyTargetShipQueue v] end if <(item (ELHS) of [YourShipHits v] ) > [0]> delete (all v) of [EnemyTargetTemp v] if <(item (ELHS) of [ECYSD v] ) = [0]> if << [EnemyTarget v] contains ((ELH) + (1))> and <not <(letter (length of ((ELH) + (1))) of ((ELH) + (1))) = [1]>>> add ((ELH) + (1)) to [EnemyTargetTemp v] end if << [EnemyTarget v] contains ((ELH) - (1))> and <not <(letter (length of ((ELH) - (1))) of ((ELH) - (1))) = [0]>>> add ((ELH) - (1)) to [EnemyTargetTemp v] end if < [EnemyTarget v] contains ((ELH) + (10))> add ((ELH) + (10)) to [EnemyTargetTemp v] end if < [EnemyTarget v] contains ((ELH) - (10))> add ((ELH) - (10)) to [EnemyTargetTemp v] end else if <(ETCD) = [0]> set [ETCD v] to [1] repeat (pick random (0) to (1)) set [ETCD v] to ((0) - (ETCD)) end end set [Enemy'sTarget v] to (ELH) repeat until < [EnemyTarget v] contains (Enemy'sTarget)> change [Enemy'sTarget v] by ((ETCD) * (item (ELHS) of [ECYSD v] )) if <<<<<(item (ELHS) of [ECYSD v] ) = [1]> and <(letter (length of (Enemy'sTarget)) of (Enemy'sTarget)) = [1]>> or <<(item (ELHS) of [ECYSD v] ) = [-1]> and <(letter (length of (Enemy'sTarget)) of (Enemy'sTarget)) = [0]>>> or <(ELM?) = [1]>> or <<(Enemy'sTarget) < [0]> or <(Enemy'sTarget) > [100]>>> set [Enemy'sTarget v] to (ELH) set [ETCD v] to ((0) - (ETCD)) set [ELM? v] to [0] end end add (Enemy'sTarget) to [EnemyTargetTemp v] end set [tmp0 v] to (pick random (1) to (length of [EnemyTargetTemp v] )) set [Enemy'sTarget v] to (item (tmp0) of [EnemyTargetTemp v] ) set [index v] to [0] repeat until <(item (index) of [EnemyTarget v] ) = (item (tmp0) of [EnemyTargetTemp v] )> change [index v] by (1) end delete (index) of [EnemyTarget v] set [tmp0 v] to [0] if <(item (Enemy'sTarget) of [YourBoard v] ) > [0]> replace item (item (Enemy'sTarget) of [YourBoard v] ) of [YourShipHits v] with ((item (item (Enemy'sTarget) of [YourBoard v] ) of [YourShipHits v] ) - (1)) if <(ELHS) = (item (Enemy'sTarget) of [YourBoard v] )> if <(item (ELHS) of [ECYSD v] ) = [0]> if <<((ELH) + (1)) = (Enemy'sTarget)> or <((ELH) - (1)) = (Enemy'sTarget)>> replace item (ELHS) of [ECYSD v] with [1] else replace item (ELHS) of [ECYSD v] with [10] end end else add (item (Enemy'sTarget) of [YourBoard v] ) to [EnemyTargetShipQueue v] add (Enemy'sTarget) to [EnemyTargetShipQueue v] end replace item (Enemy'sTarget) of [YourBoard v] with [6] switch to costume [Hit v] if <(item (ELHS) of [YourShipHits v] ) = [0]> set volume to (100)% else set volume to (70)% end play sound [Hit1 v] else replace item (Enemy'sTarget) of [YourBoard v] with [7] switch to costume [Miss v] set [ELM? v] to [1] end else set [tmp0 v] to (pick random (1) to (length of [EnemyTarget v] )) if <<(mode) = [3]> or <<(mode) = [2]> and <(pick random (1) to (2)) = [1]>>> set [report v] to [0] repeat until <(report) = [1]> set [report v] to [1] set [index2 v] to (item (tmp0) of [EnemyTarget v] ) set [index v] to [0] repeat until <<(index) = (YLSRS)> or <<(letter (length of ((index2) - (1))) of ((index2) - (1))) = [0]> or <(item ((index2) - (1)) of [YourBoard v] ) > [5]>>> change [index2 v] by (-1) change [index v] by (1) end if <not <<(index) = (YLSRS)> and <(item ((index2) - (1)) of [YourBoard v] ) < [6]>>> set [index2 v] to (item (tmp0) of [EnemyTarget v] ) set [index v] to [0] repeat until < <(index) = (YLSRS)> or <<( (index2) - (10) ) = [0]> or <(item ((index2) - (10)) of [YourBoard v] ) > [5]>>> change [index2 v] by (-10)//The above equals sign is really a >, but there was an error with the parsing. change [index v] by (1) end if <not <<(index) = (YLSRS)> and <(item ((index2) - (10)) of [YourBoard v] ) < [6]>>> set [index2 v] to (item (tmp0) of [EnemyTarget v] ) set [index v] to [0] repeat until <<(index) = (YLSRS)> or <<(letter (length of ((index2) + (1))) of ((index2) + (1))) = [1]> or <(item ((index2) + (1)) of [YourBoard v] ) > [5]>>> change [index2 v] by (1) change [index v] by (1) end if <not <<(index) = (YLSRS)> and <(item ((index2) + (1)) of [YourBoard v] ) < [6]>>> set [index2 v] to (item (tmp0) of [EnemyTarget v] ) set [index v] to [0] repeat until <<(index) = (YLSRS)> or <<((index2) + (10)) < [101]> or <(item ((index2) + (10)) of [YourBoard v] ) > [5]>>> change [index2 v] by (10) change [index v] by (1) end if <not <<(index) = (YLSRS)> and <(item ((index2) + (10)) of [YourBoard v] ) < [6]>>> set [tmp0 v] to (pick random (1) to (length of [EnemyTarget v] )) set [report v] to [0] end end end end end else set [Enemy'sTarget v] to (item (tmp0) of [EnemyTarget v] ) end delete (tmp0) of [EnemyTarget v] set [tmp0 v] to [0] if <(item (Enemy'sTarget) of [YourBoard v] ) > [0]> replace item (item (Enemy'sTarget) of [YourBoard v] ) of [YourShipHits v] with ((item (item (Enemy'sTarget) of [YourBoard v] ) of [YourShipHits v] ) - (1)) set [ELHS v] to (item (Enemy'sTarget) of [YourBoard v] ) set [ELH v] to (Enemy'sTarget) replace item (Enemy'sTarget) of [YourBoard v] with [6] switch to costume [Hit v] if <(item (Enemy'sTarget) of [YourBoard v] ) = [0]> set volume to (100)% else set volume to (70)% end play sound [Hit1 v] else replace item (Enemy'sTarget) of [YourBoard v] with [7] switch to costume [Miss v] play sound [Splash v] end end go to x: ((-214) + ((((Enemy'sTarget) - (1)) mod (10)) * (17))) y: ((80) - ((letter (1) of (((Enemy'sTarget) - (1)) / (10))) * (17))) show stampAgain, if I need to explain something better, please ask, and if you can help me, please do. Thanks!
Last edited by LiquidMetal (2012-10-03 19:23:06)
Offline
Oh, I skipped that part…
Anyway, if I find something wrong, I'll tell you.
Edit: I often find that I'm better at finding where bugs occur if I can mess around with the project in question, so is there some chance that you could temporarily upload your project for me to try and bug fix? I promise that I will not use any scripts, sprites, or anything from your project in any of my projects.
Last edited by ErnieParke (2012-10-03 20:17:39)
Offline
No thanks, but thanks for offering. I can't/won't submit any part of it until the entire thing is done. If noone figures it out here after a week or so, I'll need to go into the code and log each action, or use single stepping for this part, in order to figure out the problem.
Offline
LiquidMetal wrote:
No thanks, but thanks for offering. I can't/won't submit any part of it until the entire thing is done. If noone figures it out here after a week or so, I'll need to go into the code and log each action, or use single stepping for this part, in order to figure out the problem.
Okay. I wish you good luck with fixing your script!
Offline
This isn't working
Offline
I fixed that bug, without help from anyone here , and now it seems to shoot in various places instead of only the first one. it turns out I was only setting the Enemy'sTarget variable if the mode was set to easy. Anyway, there are still a couple issues to iron out. After a while, the project takes way to long to decide where to shoot. The following is a snippet of code which handles the selection of somewhere to shoot. What it does, basically, is checks to make sure that the biggest ship you still have afloat would fit in the potential target location. If not, it will change the target and check again. It seems to take a long time to check after a while, and I'm not even sure it is doing what is supposed to. Maybe there is a better way to do it?
(click to enlarge)
Last edited by LiquidMetal (2012-10-10 00:57:46)
Offline
The reason why your script takes so long is because repeat loops have a small delay built into them, and you seem to have quite a few repeat loops. Maybe instead of using:
repeat until <<(index2) = (YLSRS)> or (ect...?)> change [index2 v] by (10) change [index v] by (1) endYou could use:
repeat until <<(index2) = (YLSRS)> or (ect...?)> change [index2 v] by (10) change [index v] by (1) if <<not<(index2) = (YLSRS)>> and <not(ect...?)>> change [index2 v] by (10) change [index v] by (1) end end
Last edited by ErnieParke (2012-10-10 06:05:39)
Offline
Ahh, my dear friend ErnieParke. The only one who dares to try to help me, but also the one who completely misunderstands my scripts .
First of all, it seems that you took a 3 block script and turned it into a six block script. I don't understand why you think I "built in a small delay."
Oh. Maybe, you are trying to use the repeat block 50% less? It would add to script redundancy, and I don't believe that is the main source of the problem, the repeat delay is not thaaaat much. The problem occurred even using turbo speed.
Maybe the medium player should grid out for the small ship first, and then the hard the other way around? which way is more efficient?
Offline
LiquidMetal wrote:
Ahh, my dear friend ErnieParke. The only one who dares to try to help me, but also the one who completely misunderstands my scripts .
[I try and help everyone, even if they're talking in Turkish. Your comment really heartens me. ]
First of all, it seems that you took a 3 block script and turned it into a six block script. I don't understand why you think I "built in a small delay."
[I didn't.]
Oh. Maybe, you are trying to use the repeat block 50% less? It would add to script redundancy, and I don't believe that is the main source of the problem, the repeat delay is not thaaaat much. The problem occurred even using turbo speed.
[That's what I was going for, but as you said, there might be a different problem.]
Maybe the medium player should grid out for the small ship first, and then the hard the other way around? which way is more efficient?
[I would need to think about this, so I'll tell you later.]
My comments are above and below.
I was thinking that maybe you could create list called "test", copy the the targeting script, and add this to the beginning:
delete [all v] of [test v] reset timerThen add this to the end of all repeat loops starting from the top of the script down:
add (join (timer) (a the first time you copy this, b the second, ect...)) to [test v]Once your done, you'll need to run your game as normal and pause it just when your opponent's turn starts. Then run the copy of the targeting script. Once your done, could you paste the contents of the list "test"? This would help me to figure out what's slowing down your script.
Last edited by ErnieParke (2012-10-11 16:11:43)
Offline
The script is slowed down by the sheer volume of how many times it needs to repeat, I think. I'll try a logging script now...
Offline
Ok, I copied the AI script to another sprite, and redirected the broadcast. I added in blocks for a complete AI logger, and then I played two games. The first one was fine, because the larger ships were located first, but in the second lies the problem. I think there must be a bug, or it would not have continued checking random positions forever until I stopped it. It is also possible that it might have found a place with more time...
game1.txt:
[AI level 3, turn 1] [0.032] Executing hard level AI script... [0.064] No space to the left of position 42, continuing search... [0.088] No space below position 42, continuing search... [0.226] Enemy'sTarget selected. Firing... [0.238] Successful shot: hit Water at position 42. [/AI level 3, turn 1 (1 passes in 0.269 seconds)] [AI level 3, turn 2] [0.005] Executing hard level AI script... [0.127] Enemy'sTarget selected. Firing... [0.134] Successful shot: hit Water at position 99. [/AI level 3, turn 2 (1 passes in 0.14 seconds)] [AI level 3, turn 3] [0.006] Executing hard level AI script... [0.051] No space to the left of position 33, continuing search... [0.06] No space below position 33, continuing search... [0.178] Enemy'sTarget selected. Firing... [0.184] Successful shot: hit Water at position 33. [/AI level 3, turn 3 (1 passes in 0.19 seconds)] [AI level 3, turn 4] [0.004] Executing hard level AI script... [0.127] Enemy'sTarget selected. Firing... [0.137] Successful shot: hit Water at position 8. [/AI level 3, turn 4 (1 passes in 0.149 seconds)] [AI level 3, turn 5] [0.004] Executing hard level AI script... [0.008] No space to the left of position 31, continuing search... [0.014] No space below position 31, continuing search... [0.027] No space to the right of position 31, continuing search... [0.043] No space above position 31, choosing new target... [0.064] The hard level AI script did not yet verify an opening for the largest ship (size:5), so it will run again... [0.209] Enemy'sTarget selected. Firing... [0.22] Successful shot: hit Water at position 6. [/AI level 3, turn 5 (2 passes in 0.233 seconds)] [AI level 3, turn 6] [0.01] Executing hard level AI script... [0.03] No space to the left of position 35, continuing search... [0.043] No space below position 35, continuing search... [0.166] Enemy'sTarget selected. Firing... [0.177] Successful shot: hit Water at position 35. [/AI level 3, turn 6 (1 passes in 0.189 seconds)] [AI level 3, turn 7] [0.005] Executing hard level AI script... [0.101] No space to the left of position 40, continuing search... [0.109] No space below position 40, continuing search... [0.115] No space to the right of position 40, continuing search... [0.122] No space above position 40, choosing new target... [0.148] The hard level AI script did not yet verify an opening for the largest ship (size:5), so it will run again... [0.272] Enemy'sTarget selected. Firing... [0.281] Successful shot: hit Aircraft Carrier at position 30. [/AI level 3, turn 7 (2 passes in 0.303 seconds)] [AI level 3, turn 8] [0.006] Attempting to determine target ship direction... [0.75] Successful shot: hit Aircraft Carrier at position 29... [/AI level 3, turn 8 (0.79 seconds)] [AI level 3, turn 9] [0.004] Attempting to determine target ship direction... [0.008] Targeting an enemy ship... [0.755] Successful shot: hit Aircraft Carrier at position 28... [/AI level 3, turn 9 (0.768 seconds)] [AI level 3, turn 10] [0.003] Attempting to determine target ship direction... [0.007] Targeting an enemy ship... [0.714] Successful shot: hit Aircraft Carrier at position 27... [/AI level 3, turn 10 (0.721 seconds)] [AI level 3, turn 11] [0.005] Attempting to determine target ship direction... [0.009] Targeting an enemy ship... [0.738] Successful shot: hit Aircraft Carrier at position 26... [/AI level 3, turn 11 (0.752 seconds)] [AI level 3, turn 12] [0.005] Executing hard level AI script... [0.102] Enemy'sTarget selected. Firing... [0.107] Successful shot: hit Water at position 79. [/AI level 3, turn 12 (1 passes in 0.112 seconds)] [AI level 3, turn 13] [0.004] Executing hard level AI script... [0.051] No space to the left of position 63, continuing search... [0.058] No space below position 63, continuing search... [0.155] Enemy'sTarget selected. Firing... [0.167] Successful shot: hit Water at position 63. [/AI level 3, turn 13 (1 passes in 0.178 seconds)] [AI level 3, turn 14] [0.01] Executing hard level AI script... [0.02] No space to the left of position 91, continuing search... [0.032] No space below position 91, continuing search... [0.122] Enemy'sTarget selected. Firing... [0.134] Successful shot: hit Water at position 91. [/AI level 3, turn 14 (1 passes in 0.145 seconds)] [AI level 3, turn 15] [0.011] Executing hard level AI script... [0.029] No space to the left of position 22, continuing search... [0.044] No space below position 22, continuing search... [0.112] No space to the right of position 22, continuing search... [0.126] No space above position 22, choosing new target... [0.141] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.25] Enemy'sTarget selected. Firing... [0.255] Successful shot: hit Water at position 86. [/AI level 3, turn 15 (2 passes in 0.26 seconds)] [AI level 3, turn 16] [0.006] Executing hard level AI script... [0.011] No space to the left of position 80, continuing search... [0.017] No space below position 80, continuing search... [0.023] No space to the right of position 80, continuing search... [0.029] No space above position 80, choosing new target... [0.054] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.155] Enemy'sTarget selected. Firing... [0.161] Successful shot: hit Water at position 68. [/AI level 3, turn 16 (2 passes in 0.165 seconds)] [AI level 3, turn 17] [0.009] Executing hard level AI script... [0.019] No space to the left of position 80, continuing search... [0.032] No space below position 80, continuing search... [0.043] No space to the right of position 80, continuing search... [0.057] No space above position 80, choosing new target... [0.101] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.201] Enemy'sTarget selected. Firing... [0.207] Successful shot: hit Water at position 96. [/AI level 3, turn 17 (2 passes in 0.213 seconds)] [AI level 3, turn 18] [0.011] Executing hard level AI script... [0.021] No space to the left of position 43, continuing search... [0.034] No space below position 43, continuing search... [0.167] Enemy'sTarget selected. Firing... [0.173] Successful shot: hit Water at position 43. [/AI level 3, turn 18 (1 passes in 0.179 seconds)] [AI level 3, turn 19] [0.006] Executing hard level AI script... [0.027] No space to the left of position 12, continuing search... [0.034] No space below position 12, continuing search... [0.129] Enemy'sTarget selected. Firing... [0.142] Successful shot: hit Water at position 12. [/AI level 3, turn 19 (1 passes in 0.153 seconds)] [AI level 3, turn 20] [0.005] Executing hard level AI script... [0.027] No space to the left of position 82, continuing search... [0.033] No space below position 82, continuing search... [0.103] No space to the right of position 82, continuing search... [0.109] No space above position 82, choosing new target... [0.127] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.154] No space to the left of position 70, continuing search... [0.16] No space below position 70, continuing search... [0.165] No space to the right of position 70, continuing search... [0.171] No space above position 70, choosing new target... [0.206] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.306] Enemy'sTarget selected. Firing... [0.321] Successful shot: hit Submarine at position 59. [/AI level 3, turn 20 (3 passes in 0.334 seconds)] [AI level 3, turn 21] [0.006] Attempting to determine target ship direction... [0.983] Successful shot: hit Submarine at position 49... [/AI level 3, turn 21 (0.991 seconds)] [AI level 3, turn 22] [0.004] Attempting to determine target ship direction... [1.176] Successful shot: hit Submarine at position 58... [/AI level 3, turn 22 (1.187 seconds)] [AI level 3, turn 23] [0.004] Attempting to determine target ship direction... [0.008] Targeting an enemy ship... [1.171] Successful shot: hit Water at position57... [/AI level 3, turn 23 (1.187 seconds)] [AI level 3, turn 24] [0.006] Attempting to determine target ship direction... [0.016] Targeting an enemy ship... [1.192] Successful shot: hit Submarine at position 60... [/AI level 3, turn 24 (1.204 seconds)] [AI level 3, turn 25] [0.003] Clearing data from last targeted ship... [0.015] Attempting to determine target ship direction... [0.926] Successful shot: hit Tanker at position 48... [/AI level 3, turn 25 (0.932 seconds)] [AI level 3, turn 26] [0.004] Attempting to determine target ship direction... [0.008] Targeting an enemy ship... [0.951] Successful shot: hit Tanker at position 50... [/AI level 3, turn 26 (0.962 seconds)] [AI level 3, turn 27] [0.005] Executing hard level AI script... [0.103] Enemy'sTarget selected. Firing... [0.108] Successful shot: hit Water at position 19. [/AI level 3, turn 27 (1 passes in 0.113 seconds)] [AI level 3, turn 28] [0.01] Executing hard level AI script... [0.053] No space to the left of position 2, continuing search... [0.128] No space below position 2, continuing search... [0.205] No space to the right of position 2, continuing search... [0.211] No space above position 2, choosing new target... [0.229] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.341] Enemy'sTarget selected. Firing... [0.352] Successful shot: hit Water at position 75. [/AI level 3, turn 28 (2 passes in 0.363 seconds)] [AI level 3, turn 29] [0.004] Executing hard level AI script... [0.026] No space to the left of position 77, continuing search... [0.032] No space below position 77, continuing search... [0.062] No space to the right of position 77, continuing search... [0.068] No space above position 77, choosing new target... [0.087] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.097] No space to the left of position 36, continuing search... [0.102] No space below position 36, continuing search... [0.199] Enemy'sTarget selected. Firing... [0.21] Successful shot: hit Water at position 36. [/AI level 3, turn 29 (2 passes in 0.222 seconds)] [AI level 3, turn 30] [0.01] Executing hard level AI script... [0.054] No space to the left of position 66, continuing search... [0.067] No space below position 66, continuing search... [0.087] No space to the right of position 66, continuing search... [0.1] No space above position 66, choosing new target... [0.137] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.148] No space to the left of position 61, continuing search... [0.155] No space below position 61, continuing search... [0.182] No space to the right of position 61, continuing search... [0.189] No space above position 61, choosing new target... [0.211] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.238] No space to the left of position 32, continuing search... [0.243] No space below position 32, continuing search... [0.249] No space to the right of position 32, continuing search... [0.255] No space above position 32, choosing new target... [0.277] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.304] No space to the left of position 52, continuing search... [0.31] No space below position 52, continuing search... [0.555] Enemy'sTarget selected. Firing... [0.567] Successful shot: hit Water at position 52. [/AI level 3, turn 30 (4 passes in 0.577 seconds)] [AI level 3, turn 31] [0.005] Executing hard level AI script... [0.035] No space to the left of position 72, continuing search... [0.043] No space below position 72, continuing search... [0.089] No space to the right of position 72, continuing search... [0.095] No space above position 72, choosing new target... [0.114] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.139] No space to the left of position 32, continuing search... [0.145] No space below position 32, continuing search... [0.15] No space to the right of position 32, continuing search... [0.156] No space above position 32, choosing new target... [0.165] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.252] No space to the left of position 67, continuing search... [0.258] No space below position 67, continuing search... [0.264] No space to the right of position 67, continuing search... [0.27] No space above position 67, choosing new target... [0.288] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.298] No space to the left of position 100, continuing search... [0.303] No space below position 100, continuing search... [0.309] No space to the right of position 100, continuing search... [0.383] No space above position 100, choosing new target... [0.407] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.416] No space to the left of position 81, continuing search... [0.422] No space below position 81, continuing search... [0.545] Enemy'sTarget selected. Firing... [0.55] Successful shot: hit Water at position 81. [/AI level 3, turn 31 (5 passes in 0.555 seconds)] [AI level 3, turn 32] [0.009] Executing hard level AI script... [0.029] No space to the left of position 2, continuing search... [0.101] No space below position 2, continuing search... [0.185] No space to the right of position 2, continuing search... [0.191] No space above position 2, choosing new target... [0.224] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.232] No space to the left of position 82, continuing search... [0.238] No space below position 82, continuing search... [0.311] No space to the right of position 82, continuing search... [0.317] No space above position 82, choosing new target... [0.335] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.361] No space to the left of position 38, continuing search... [0.368] No space below position 38, continuing search... [0.411] No space to the right of position 38, continuing search... [0.417] No space above position 38, choosing new target... [0.463] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.472] No space to the left of position 21, continuing search... [0.479] No space below position 21, continuing search... [0.576] Enemy'sTarget selected. Firing... [0.581] Successful shot: hit Water at position 21. [/AI level 3, turn 32 (4 passes in 0.586 seconds)] [AI level 3, turn 33] [0.01] Executing hard level AI script... [0.029] No space to the left of position 62, continuing search... [0.039] No space below position 62, continuing search... [0.044] No space to the right of position 62, continuing search... [0.051] No space above position 62, choosing new target... [0.086] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.114] No space to the left of position 93, continuing search... [0.12] No space below position 93, continuing search... [0.169] No space to the right of position 93, continuing search... [0.244] No space above position 93, choosing new target... [0.268] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.339] No space to the left of position 89, continuing search... [0.345] No space below position 89, continuing search... [0.364] No space to the right of position 89, continuing search... [0.37] No space above position 89, choosing new target... [0.388] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.439] No space to the left of position 66, continuing search... [0.445] No space below position 66, continuing search... [0.464] No space to the right of position 66, continuing search... [0.47] No space above position 66, choosing new target... [0.488] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.589] No space to the left of position 25, continuing search... [0.595] No space below position 25, continuing search... [0.601] No space to the right of position 25, continuing search... [0.607] No space above position 25, choosing new target... [0.616] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.642] No space to the left of position 88, continuing search... [0.649] No space below position 88, continuing search... [0.692] No space to the right of position 88, continuing search... [0.698] No space above position 88, choosing new target... [0.741] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.768] No space to the left of position 77, continuing search... [0.774] No space below position 77, continuing search... [0.798] No space to the right of position 77, continuing search... [0.804] No space above position 77, choosing new target... [0.826] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.941] Enemy'sTarget selected. Firing... [0.947] Successful shot: hit Water at position 17. [/AI level 3, turn 33 (8 passes in 0.952 seconds)] [AI level 3, turn 34] [0.005] Executing hard level AI script... [0.029] No space to the left of position 62, continuing search... [0.035] No space below position 62, continuing search... [0.041] No space to the right of position 62, continuing search... [0.047] No space above position 62, choosing new target... [0.056] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.108] No space to the left of position 66, continuing search... [0.113] No space below position 66, continuing search... [0.132] No space to the right of position 66, continuing search... [0.138] No space above position 66, choosing new target... [0.182] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.192] No space to the left of position 44, continuing search... [0.198] No space below position 44, continuing search... [0.273] No space to the right of position 44, continuing search... [0.279] No space above position 44, choosing new target... [0.297] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.306] No space to the left of position 20, continuing search... [0.312] No space below position 20, continuing search... [0.317] No space to the right of position 20, continuing search... [0.323] No space above position 20, choosing new target... [0.332] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.342] No space to the left of position 53, continuing search... [0.348] No space below position 53, continuing search... [0.452] No space to the right of position 53, continuing search... [0.458] No space above position 53, choosing new target... [0.477] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.554] No space to the left of position 95, continuing search... [0.566] No space below position 95, continuing search... [0.577] No space to the right of position 95, continuing search... [0.707] No space above position 95, choosing new target... [0.731] The hard level AI script did not yet verify an opening for the largest ship (size:4), so it will run again... [0.741] No space to the left of position 37, continuing search... [0.747] No space below position 37, continuing search... [0.846] Enemy'sTarget selected. Firing... [0.854] Successful shot: hit Battleship at position 37. [/AI level 3, turn 34 (7 passes in 0.859 seconds)] [AI level 3, turn 35] [0.003] Attempting to determine target ship direction... [0.77] Successful shot: hit Water at position47... [/AI level 3, turn 35 (0.775 seconds)] [AI level 3, turn 36] [0.003] Attempting to determine target ship direction... [0.586] Successful shot: hit Battleship at position 38... [/AI level 3, turn 36 (0.591 seconds)] [AI level 3, turn 37] [0.006] Attempting to determine target ship direction... [0.015] Targeting an enemy ship... [0.688] Successful shot: hit Water at position34... [/AI level 3, turn 37 (0.694 seconds)] [AI level 3, turn 38] [0.004] Attempting to determine target ship direction... [0.008] Targeting an enemy ship... [0.635] Successful shot: hit Battleship at position 39... [/AI level 3, turn 38 (0.64 seconds)] [AI level 3, turn 39] [0.004] Attempting to determine target ship direction... [0.008] Targeting an enemy ship... [0.674] Successful shot: hit Battleship at position 40... [/AI level 3, turn 39 (0.68 seconds)] [AI level 3, turn 40] [0.004] Executing hard level AI script... [0.064] Enemy'sTarget selected. Firing... [0.07] Successful shot: hit Water at position 4. [/AI level 3, turn 40 (1 passes in 0.075 seconds)] [AI level 3, turn 41] [0.005] Executing hard level AI script... [0.051] Enemy'sTarget selected. Firing... [0.056] Successful shot: hit Water at position 66. [/AI level 3, turn 41 (1 passes in 0.061 seconds)] [AI level 3, turn 42] [0.005] Executing hard level AI script... [0.01] No space to the left of position 9, continuing search... [0.051] No space below position 9, continuing search... [0.104] Enemy'sTarget selected. Firing... [0.109] Successful shot: hit Water at position 9. [/AI level 3, turn 42 (1 passes in 0.114 seconds)] [AI level 3, turn 43] [0.005] Executing hard level AI script... [0.009] No space to the left of position 31, continuing search... [0.015] No space below position 31, continuing search... [0.027] No space to the right of position 31, continuing search... [0.033] No space above position 31, choosing new target... [0.052] The hard level AI script did not yet verify an opening for the largest ship (size:2), so it will run again... [0.102] Enemy'sTarget selected. Firing... [0.107] Successful shot: hit Water at position 73. [/AI level 3, turn 43 (2 passes in 0.112 seconds)] [AI level 3, turn 44] [0.005] Executing hard level AI script... [0.065] Enemy'sTarget selected. Firing... [0.07] Successful shot: hit Water at position 55. [/AI level 3, turn 44 (1 passes in 0.076 seconds)] [AI level 3, turn 45] [0.011] Executing hard level AI script... [0.021] No space to the left of position 41, continuing search... [0.035] No space below position 41, continuing search... [0.047] No space to the right of position 41, continuing search... [0.06] No space above position 41, choosing new target... [0.181] The hard level AI script did not yet verify an opening for the largest ship (size:2), so it will run again... [0.239] Enemy'sTarget selected. Firing... [0.244] Successful shot: hit Water at position 78. [/AI level 3, turn 45 (2 passes in 0.249 seconds)] [AI level 3, turn 46] [0.011] Executing hard level AI script... [0.02] No space to the left of position 13, continuing search... [0.032] No space below position 13, continuing search... [0.147] Enemy'sTarget selected. Firing... [0.153] Successful shot: hit Water at position 13. [/AI level 3, turn 46 (1 passes in 0.159 seconds)] [AI level 3, turn 47] [0.004] Executing hard level AI script... [0.057] Enemy'sTarget selected. Firing... [0.062] Successful shot: hit Water at position 84. [/AI level 3, turn 47 (1 passes in 0.068 seconds)] [AI level 3, turn 48] [0.004] Executing hard level AI script... [0.009] No space to the left of position 18, continuing search... [0.016] No space below position 18, continuing search... [0.022] No space to the right of position 18, continuing search... [0.029] No space above position 18, choosing new target... [0.073] The hard level AI script did not yet verify an opening for the largest ship (size:2), so it will run again... [0.128] Enemy'sTarget selected. Firing... [0.133] Successful shot: hit Water at position 95. [/AI level 3, turn 48 (2 passes in 0.139 seconds)]
Read that to understand the format of my new AI log. I have the file for game2 as well, but it is well over the upload limit, so I uploaded a zip folder including the two log files and an image from the 2nd game on filedropper.
Offline
Any ideas Ernie? I think it must be a bug, or it should have finished after a while... Maybe I just made a mistake with the entire concept of the script? Or something smaller? I'm lost
Offline
LiquidMetal wrote:
Any ideas Ernie? I think it must be a bug, or it should have finished after a while... Maybe I just made a mistake with the entire concept of the script? Or something smaller? I'm lost
Sadly none. Up to Thursday, I wasn't allowed on the computer, and yesterday as well as today, I got enthralled with adding TNT to City Tycoon II, so sorry for not looking earlier. I'll see what I can do tomorrow.
Offline
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?
Offline