MSXdev’20: #17 – Anchors Aweigh!

MSXdev’20: #17 – Anchors Aweigh!

by MSXdev Team on 30-07-2020, 00:25
Topic: Challenges
Tags: msxdev20, Shooter
Languages:

Another surprise entry, that’s based on the classic “Battleship” tabletop game. You know, where you have to guess the positions of the ships in your opponent’s fleet and throw bombs on them.

Practically last minute, a very nice MSX rendition of this concept surfaces at the cost, like a submarine that nobody knew about.

Could there be some kind of theme, this MSXdev edition? We’ve seen quite some cats and military vehicle combat in the past time.

Anyway, some cool features of the game:

  • Thematic soundtrack, based on american folk and naval music (press shift+m on the loading screen for the music menu).
  • Custom player
  • 4 languages.
  • Integrated instructions
  • Practice and campaign modes: reach the rank of admiral of the navy!
  • Undo feature on the puzzle (up to 256 actions)
  • Simple interface
  • Music adapted to the time left
  • Achievements will go on Twitter
  • Code in C will be available and the author states that he will be forever ashamed of it
  • R800 enabled to speed up graphics and puzzle generation.
  • Cheats, and a good and a bad finale

Tested on (emulated) MSX1 (50Hz and 60Hz), MSX2, and Turbo-R.

  • Name of the game: Anchors Aweigh
  • Game size: 160Kb (megarom, K5 mapper)
  • RAM size requirements: 16KB
  • Genre: Puzzle
  • Names of the individuals involved: Manuel Martínez

Relevated link:
MSXdev homepage

Media browser (6)

  • MSXdev’20: #17 – Anchors Aweigh!
  • MSXdev’20: #17 – Anchors Aweigh!
  • MSXdev’20: #17 – Anchors Aweigh!
  • MSXdev’20: #17 – Anchors Aweigh!
  • MSXdev’20: #17 – Anchors Aweigh!
  • MSXdev’20: #17 – Anchors Aweigh!

Comments (22)

By tfh

Prophet (2377)

tfh's picture

31-07-2020, 22:41

By salutte

Expert (100)

salutte's picture

01-08-2020, 08:41

The code is available at:
https://github.com/MartinezTorres/anchors_aweigh

and it uses the sdcc_msx library at:
https://github.com/MartinezTorres/sdcc_msx
(soon to be renamed module_msx)

By Uninteresting

Master (165)

Uninteresting's picture

01-08-2020, 19:27

I really like this; I've taken to watching Cracking the Cryptic this year, but I wonder if I'm missing something important in how the puzzles in Anchors Aweigh are supposed to be solved. I got to Admiral without failing a puzzle (one took me 16 minutes, though), but I don't know how good the solution paths are (for example, am I expected to bifurcate the search at some points) and if the solutions are unique (I don't think the easiest levels necessarily have unique solutions).

By salutte

Expert (100)

salutte's picture

01-08-2020, 19:50

I'm glad you liked it! Thanks!

Puzzles are auto-generated, and are all solvable, but it was hard for me to adjust the difficulty level. I had almost no time for beta testing. I found it easy because I love this kind of puzzles, but I thought that for the casual player it was ok to have this level of difficulty. I will increase the difficulty at post-captain levels.

The generation works as this. Up to captain, some ships are missing (the aim is to let the user get used to the interface). Then, from captain to "admiral of the navy" there are less hints. However, due to the generation process, it can be that a puzzle with few hints is more difficult to solve than a puzzle with more hints.

Also, the solutions do not need to be unique, any solution that fills the puzzle is accepted. Checking if the solution was unique on a Z80 is not trivial (I need to solve the autogenerated puzzle and find all solutions). I started the effort, aiming to have a better tool to adjust the difficulty, but it wasn't ready for the dev.

About bifurcation, it is expected, specially on later levels where the 4-cell ship can fit many possible locations. Could you solve all puzzles without bifurcating? If so, I definitely need to increase the difficulty.

I'll work on the auto-solver, but, in the meantime, if you have ideas on how to improve the puzzle generation (or the rest of the game), I'm all ears!

By Uninteresting

Master (165)

Uninteresting's picture

01-08-2020, 21:49

I was most of all interested in if you had proven a fancy theorem on how to generate suitable puzzles. The 15-puzzle is the infamous example where half of all the possible random initial states are such that the solution cannot be found.

I gave up around admiral-level. Had a case of eight empty slots in a column and I had to place seven ship pieces there. Maybe I should've tried to look at some other clue...

Not sure if reaching captain in 6min 26s is too quick?

By salutte

Expert (100)

salutte's picture

01-08-2020, 22:56

As far as I know, there is no fancy algorithm. And actually, I find that there are several ways to make the puzzle challenging.
There are different apps, newspapers, etc. that feature the game, and you can see that the style of the puzzles, despite being based on the same rules, it's pretty different.

You can make a difficult puzzle by distributing the ships very uniformly, then you strongly need to rely on clues to start making progress. On the other hand, if all ships are compacted in just a small part of the map, it is also challenging because there are many combinations to place the large ships! I find it an interesting problem.

The seven ship pieces in a row with 8 empty slots happens from time to time, and is a strong indicator of a capital ship. A good place to start (with the backtrack).

About timings, reaching captain in 6 minutes 26 seconds is pretty quick! And you got close to the ending! there is "rear admiral", "vice admiral", "admiral", "admiral of the fleet", and "admiral of the navy", and if you solve this one you reach the finale (which is just a text sentence, one new image, and an image).

There are cheats, to speed up progress (shift key is your friend there), but if you use cheats you reach only the bad finale.

By Uninteresting

Master (165)

Uninteresting's picture

01-08-2020, 23:07

I still haven't got to the end. Vice Admiral took me 13:38, admiral 20:08 and that's as far as I get (without having to repeat earlier levels). Maybe one day...

By salutte

Expert (100)

salutte's picture

05-08-2020, 20:07

A few people got a little bit confused about the mechanics of the puzzle, to help in this regard, I made a video tutorial, albeit in Spanish:

https://www.youtube.com/watch?v=nys20gwjldA

if there is demand, I'll do an English version :)

By Uninteresting

Master (165)

Uninteresting's picture

23-08-2020, 21:00

I spotted a minor bug in the version available on tfh's site: the game accepted a "solution" where two ship pieces were touching diagonally.

This happened when I was mucking about, hammering the space bar to edit the incomplete solution. The conflict was in the two bottom rows (2-4 squares from the right edge).

By salutte

Expert (100)

salutte's picture

25-08-2020, 11:04

Wow! Thanks a lot for finding the issue! I'll investigate it asap.

By salutte

Expert (100)

salutte's picture

25-08-2020, 12:11

Solved the bug. There was a routine that labels touching ships as invalid (and displays them in red), but the ship count routine did not check the label if the ship was labeled as correct or not before counting it Smile

The new version is available at:
https://github.com/MartinezTorres/anchors_aweigh/releases/do...

By tfh

Prophet (2377)

tfh's picture

25-08-2020, 12:18

By Uninteresting

Master (165)

Uninteresting's picture

25-08-2020, 18:49

If only all bugs were that quick to fix... and I had known how to use the bug to actually beat the game before it got fixed Wink

By JohnHassink

Ambassador (5457)

JohnHassink's picture

05-09-2020, 21:48

Could somebody please explain how to start a game?

By tfh

Prophet (2377)

tfh's picture

05-09-2020, 21:59

JohnHassink wrote:

Could somebody please explain how to start a game?

Press space on the title screen and select "Join the navy"

By Uninteresting

Master (165)

Uninteresting's picture

05-09-2020, 22:00

Press space to show the starting menu, then space to choose "Join the navy", then space once more after the instructions have been displayed.

The game board should then show up and you can start marking empty squares and squares occupied by enemy ships with space bar.

Or this is how I get to the game on tfh's site.

By JohnHassink

Ambassador (5457)

JohnHassink's picture

06-09-2020, 19:40

Thanks guys but my question was because I can't get out of that map screen.

By Uninteresting

Master (165)

Uninteresting's picture

06-09-2020, 20:59

There is a map screen other than the actual gameplay grid with the clues for rows, columns and the number of ships you need to place? I'm just verifying you know this game is not Battleship and have read the in-game instructions.

Once you've met the column and row constraints, outlined all the ship pieces (place water in the orthogonally adjacent tiles) and matched the number of ships of different size with the numbers given at the bottom of the screen, you've cleared the puzzle and taken to the next one.

(I made a very short gameplay guide to the game in English. I pressed only cursor keys + space during the gameplay. The video is/will soon be up at https://youtu.be/lx5ANGy74iY )

By salutte

Expert (100)

salutte's picture

07-09-2020, 00:49

@Uninteresting,
Tanks a huge lot for the video!
Due to work schedule, I never had the time to translate mine to English!

By Uninteresting

Master (165)

Uninteresting's picture

07-09-2020, 07:01

@salutte This video is a one-shot clip with no prepared script, done hastily so that I can post the link during a comment's editing period and spoken in a foreign language -> I fumble for words and make misleading statements. It is not good and I intend to delete it in a few days.

By salutte

Expert (100)

salutte's picture

07-09-2020, 11:27

@uninteresting,
still I appreciate a lot what you did! I'll try to do a short video in English with less bugs than the one I did in Spanish Smile

By JohnHassink

Ambassador (5457)

JohnHassink's picture

07-09-2020, 16:49

Thank you, I get it now.