Seeker Missile Order

I am not quite sure in which order the missile checks. I can see from the code that it orders by distance, but I am not sure what happens in cases where multiple positions exists that share the same distance. It would be nice to know the ordering in which the seeker missile works.

For example, let’s say I shoot a seeker missile at {x=7,y=7} on a completely empty map, with two ships, one that terminates at {x=7,y=6} and the other at {x=7,y=8}. Which one will the seeker missile hit?

Hi Sparky,

The seeker missile will do a check starting from the most left moving up upwards and then starting on the next column at the bottom left corner, does this make sense?

In other words, in the following order, 00, 01, … 12:

xx xx 11 xx xx
xx 03 05 08 xx
09 02 00 07 12
xx 01 04 06 xx
xx xx 10 xx xx

Is my understanding correct?

Hi Sparky,

Like this

xx xx 09 xx xx
xx 04 08 12 xx
01 03 07 11 13
xx 02 06 10 xx
xx xx 05 xx xx

No, that does not make sense… shouldn’t the closest be hit first?

Hi Sparky,

Sorry you were correct the first time, I misunderstood the question.

The first reply is indeed correct in which order it chooses the point to fire at

Hey guys,

I would suggest that the following order is incorrect:

xx xx 11 xx xx
xx 03 05 08 xx
09 02 00 07 12
xx 01 04 06 xx
xx xx 10 xx xx

I would assume that the diagonal blocks have a distance of 2 (They are definately further than the 4 blocks that is in the center:

xx xx 09 xx xx
xx 07 03 11 xx
05 01 00 04 12
xx 06 02 10 xx
xx xx 08 xx xx

I would say that the above example would be much more practical. If this is not more or less how the engine behaves already. I would like if someone can give confirmation on the seeker missile trace sequence?

I also believe it wouldn’t hurt to add randomizaion to the seeker missile so that the shot diagram becomes the following:

Where the 01’s are checked in random sequence and all fired before moving to the 02’s.

xx xx 02 xx xx
xx 02 01 02 xx
02 01 00 01 02
xx 02 01 02 xx
xx xx 02 xx xx

Regardless, can anyone give some confirmation on the seeker missile’s check. I thought I had it sorted but I am not sure what the case would be now…

I believe the best way to do this is to run some test. Placing ships around where you would fire. and moving them with each test. This will give you a clear indication of the order in which it checks. Shouldn’t take that long.

We are after all programmers. :stuck_out_tongue:

Hi Willie.

I will have a look at changing up the search order as you suggested. Thanks for the idea.

Hi Guys,

The seeker missile order has been updated and a release has been made, the new order is as follows

xx xx 03 xx xx
xx 02 01 02 xx
03 01 00 01 03
xx 02 01 02 xx
xx xx 03 xx xx

There is no random starting point for the search but rather the most bottom left corner first, moving upwards then starting at the next column moving rightwards.

I hope this helps with clarity

Thank you for the confirmation.

I am spending a bit of time on the seeker missile this week, I will post here if I find anything strange.

Hi Foamy

Your explanation does not match the numbering. Based on what you just said (“no random starting point”), the ordering should be:

xx xx 11 xx xx
xx 06 03 08 xx
09 01 00 04 12
xx 05 02 07 xx
xx xx 10 xx xx

I am now well and truly confused.

Hey Foamy, Thank you for the update, I tested he Seeker comprehensively and it works as expected.

There is one issue I still picked up. I am not sure if this is intended or not (It does not influence my implementation much, and I don’t want to be a nuisance, The numbering I received is already enough to up my bot. But It seems that the seeker missile targets damaged / sunk ships.

I hard coded the ship placements and forced my seeker missile on the same block when it has energy available. It seems that my seeker still hits a sunken ship. I am doing more tests on this. Getting my bot ready for the next event…

Willie, I think that actually makes sense. It introduces a bit of complexity that forces you to look at existing hits before launching a seeker. Without that, the seeker might be overpowered, in my opinion at least.

That is a good point. With my AI the above does not matter too much, In fact I prefer the seeker the way it is now due to strategy.

I just found that behavior odd while running my tests. I prefer hat it hits existing tiles. Well, I should finish my competition bot today. Goodluck on your side.

A bit of additional complexity I get, and hitting damaged ships I get, but surely there is no intuition to make anyone think a missile should hit a sunk ship?!

Also, it seems like the cells that are filtered by the LINQ queries start out being held in a Dictionary type, which is unordered. So, there shouldn’t be any well defined order in which cells with equal distances from the centre are checked (in the current implementation at least).

Hi guys,

@sparky you are indeed correct with how the searching for the closest ship cell works, my numbering scheme showed which section of cells were checked first, so the center is first evaluated then the for perpendicular blocks in the order you mentioned, then the corners and then finally the 4 outer blocks. Sorry if it was confusing.

@Malman from my testing it always did the ordering in that way, I believe that when the cells are pushed to the dictionary in the order they are created, starting from the bottom left moving up, that that is the order which is kept when doing the filtering for the seeker missile.

Before I saw this discussion I made a topic here: Seeker missile seeking to already hit cell

I agree that a seeker should atleast not seek to hit a cell of a sunk ship.