Log In  

Cart #gacko_nim64-1 | 2023-09-15 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

NIM⁶⁴

This is a creation of the game Nim for pico8. Nim is a 2 player, mathematical game of strategy (well sort of). It includes the following features:

  • Two forms of Nim are available - Simple or Single Stack Nim and Normal Nim with multiple stacks
  • Beautiful chill music by @Gruber
  • A campaign of sorts to work through
  • Working AI and many different stack variations
  • Single games. All games should be winnable.
  • Low res mode because 128 is too much! 8)
  • A fireworks show!

CONTROLS

Should be easy to follow - Turn based game so no rush.

  • Arrow keys - move about and select things
  • (O) or Z - Main button to advance and confirm
  • (X) or X - Generally cancel or go back.

Additionally the PICO-8 cart menu has the following:

  • reset your campaign data - start again etc
  • go back to the menu at any time

OPTIONS MENU

The options menu is a little obscure. So I've included a quick run through here:

Change any item with left or right or (O) button

  • The Number Selector: You press (O) button to toggle between Random and Select Number mode
  • v2 The Player order Selector: You press (O) button to toggle between normal, alternate or random player order select.
  • Music: On or Off
  • Game Mode: Simple (Single Stack) or Normal (Mutliple Stacks)
  • Player Selector: Toggle through "Human - AI" or "AI - Human" or even "AI - AI" for some automated fun OR press (O) to cycle through Alternate selection (Default: player goes first then AI goes first etc) or Random selection.
  • Display Mode: Squares or Numbers - Squares I think is best but both should work
  • Number Selector: Toggle Random mode with (O) button -- otherwise use left right to pick set of numbers/game to play or the amount of random stacks in Single mode.
  • Prompt option: Prompting or Automatic - Useful for AI vs AI to automatically move to next game.
  • AI Difficulty: More about this below. Easy - Medium (Default) - or Perfect

DEV DIARY

I started making this game because I was trying to work out AI for turn based games and wanted a simplified game to try this on and came across Nim. I'm sure I have seen it before but essentially rediscovered it.

I also used Nim to explore the Minmax algorithm for Turn Based games and - yeah - that was a bit of an effort BUT I did get it working and can now understand it reasonably well with the alpha/beta tuning and all. I did create a nice prototype to visualize and explain it to me better also which I may post. BUT anyway turns out MinMax is probably not the best for Nim - it might work with some different kind of approach and more optimization (caching, de-duplication) maybe but I could not get it to work well enough. For small numbers it would work well but large numbers would kill the poor pico8 8( But I did learn a lot 8)

So the AI in the game is a bit more brute force which is a lot simpler and will always win if it can. If it cant then it will generally pick random although it will try not to make it easy. The different levels (easy or medium) mean that the AI will make a random move if the numbers are too large for it. The Medium AI should provide a decent challenge during the campaign but once you get the idea of Nim I would switch to Perfect AI and treat the game more like a puzzle game.

I also wanted to make a game in the lowres mode that was a lot of fun. I enjoyed the larger pixels and getting things pixel perfect.

Another thing I really enjoyed was making a campaign of sorts - Something I have never created and it was really cool and I learnt a lot.

I enjoyed working out how to use the cartdata and a few technical things around using that data. This gave me a lot of ideas for other things to use it for.

Regrets:

  • I really would have liked to make each pip all free moving particles. Then the pips could explode and move around in a more animated fashion but alas. I have a workable prototype that does this but it was going to be a lot of work to refactor. I should have created from the start.
  • I spent way too much time seeing if MinMax would work properly and feel sad it went nowhere but I did learn a lot trying to nut it out.
  • Perhaps not a meaty and interesting game and it does not have that much replay-ability. I do find it interesting from a computer tech point of view.
  • I need to get better at making music for pico8. I would have liked to create the music tracks but I could not get exactly what I was looking for. Thankfully @Gruber is an awesome guy and I found something that fit perfectly with what sound I was getting at. Please listen to the Jam here: https://www.lexaloffle.com/bbs/?tid=52518

Updates

v1 - release 2023-07-15
v2 - 2023-09-15

  • lol fix the final ending
  • add alternating player order or random player order NOTE: All games are winnable by the player
  • default alternate single play and random simple playboard.
P#132004 2023-07-15 16:37 ( Edited 2023-09-15 11:16)

Cool, that works really well. Low res mode was a good idea, and I liked the idea of a 'world map' for the campaign. Also thanks for the Dev Diary write up, it's always great reading things like that.

P#132061 2023-07-17 08:28
1

Thanks @Godmil -- Yeah I've always wanted to create a world map type level selector. Next time I want it to be an actual map..

It was interesting working our how to represent the path progress correctly

and the bonus levels
8)

P#132084 2023-07-17 22:18

I missed this earlier and found it when scrolling through old stuff, and wow I'm glad I tried it eventually. This is really cool, haven't got more than 5 levels in the campaign but I really like it. The aesthetic really fits the game/gameplay.


I'm excited for those bonus levels :)

P#132585 2023-07-31 05:37

Thanks @Munchkin -- Yeah I was keen on a low colour variation with a few poping colours. I really like the 64x64 view -- although after a while you start seeing square pixels everywhere 8)

P#134386 2023-09-15 08:46

[Please log in to post a comment]