Page 1 of 1

Desktop minigame - tactical board game

Posted: Sun Apr 09, 2023 5:24 pm
by zxretrosoft
Hello Löve2D friends!

I made a copy of Amoriax to test the possibilities of Löve2D. I'm thrilled!

It is a tactical board game based on Roman board games. Simple rules, huge possibilities.

My version of the game is only 2D, but it should be functional. You can try it out if you want.
PC version only for now. I'll improve the AI over time. (When I get more comfortable with Löve2D, I will make a better 3D version.)

Thank you all so much for the support and the great community! :)

Lua (Löve2D) version for PC:
https://www.indiexpo.net/sk/games/amoriax-lua

Screenshot:
Image

For comparison, the game in 3D (AGK):
https://www.indiexpo.net/sk/games/amoriax

Re: Desktop minigame - tactical board game

Posted: Wed Apr 12, 2023 1:55 am
by knorke
Never heard about that game, interesting gameplay.
I won against the "1 Star" and "2 Stars" AI in around 50 turns.
The sliding stone animations made it easy to follow what was happening.

Small random notes:
1) There should be some small display whose turn it is and what color you play.
2) In the rules it says: "Playing stones can also be shuffled randomly in any part"
But 'shuffle' actually starts a new game with random placement, the previous game is lost. That was not what I had expected.
3) The rules text could be a bit more precise.
"The aim of the game is to control the centre of the board.
The first player to control the center square with the crown wins."

That was not immediately clear to me, maybe because both sentences uses the word "control" but it is unclear what "control" means.
Maybe rewrite second sentence as:
"The first player to place one of his stones on the center square with the crown wins."

On the code:
1) math.randomseed(184)
You can use the current time for random seed, to get a new seed every time.
2) Holy batman, those are LOTS of two-letter variables!
3) function ohodnoceni() is 10.000 lines! Wow!
4) There are many parts that repeat with small variations and many big, long if-blocks. Stuff like:

Code: Select all

...  
  --4
  if vx1 < 9 and vy1 < 8 then
    if not(vx1+1==5 and vy1+2==2) and not(vx1+1==4 and vy1+2==3) and not(vx1+1==5 and vy1+2==3) and not(vx1+1==6 and vy1+2==3) and not(vx1+1==3 and vy1+2==4) and not(vx1+1==4 and vy1+2==4)
    and not(vx1+1==5 and vy1+2==4) and not(vx1+1==6 and vy1+2==4) and not(vx1+1==7 and vy1+2==4) and not(vx1+1==2 and vy1+2==5) and not(vx1+1==3 and vy1+2==5) and not(vx1+1==4 and vy1+2==5)
    and not(vx1+1==5 and vy1+2==5) and not(vx1+1==6 and vy1+2==5) and not(vx1+1==7 and vy1+2==5) and not(vx1+1==8 and vy1+2==5) and not(vx1+1==3 and vy1+2==6) and not(vx1+1==4 and vy1+2==6)
    and not(vx1+1==5 and vy1+2==6) and not(vx1+1==6 and vy1+2==6) and not(vx1+1==7 and vy1+2==6) and not(vx1+1==4 and vy1+2==7) and not(vx1+1==5 and vy1+2==7) and not(vx1+1==6 and vy1+2==7)
    and not(vx1+1==5 and vy1+2==8) then
      if c[vx1+1][vy1+2] == 0 then
        z[vx1+1][vy1+2] = 2
        z_ai = z_ai + 1
      end
    end
  end

  --5
  if vx1 > 1 and vy1 < 8 then
    if not(vx1-1==5 and vy1+2==2) and not(vx1-1==4 and vy1+2==3) and not(vx1-1==5 and vy1+2==3) and not(vx1-1==6 and vy1+2==3) and not(vx1-1==3 and vy1+2==4) and not(vx1-1==4 and vy1+2==4)
    and not(vx1-1==5 and vy1+2==4) and not(vx1-1==6 and vy1+2==4) and not(vx1-1==7 and vy1+2==4) and not(vx1-1==2 and vy1+2==5) and not(vx1-1==3 and vy1+2==5) and not(vx1-1==4 and vy1+2==5)
    and not(vx1-1==5 and vy1+2==5) and not(vx1-1==6 and vy1+2==5) and not(vx1-1==7 and vy1+2==5) and not(vx1-1==8 and vy1+2==5) and not(vx1-1==3 and vy1+2==6) and not(vx1-1==4 and vy1+2==6)
    and not(vx1-1==5 and vy1+2==6) and not(vx1-1==6 and vy1+2==6) and not(vx1-1==7 and vy1+2==6) and not(vx1-1==4 and vy1+2==7) and not(vx1-1==5 and vy1+2==7) and not(vx1-1==6 and vy1+2==7)
    and not(vx1-1==5 and vy1+2==8) then
      if c[vx1-1][vy1+2] == 0 then
        z[vx1-1][vy1+2] = 2
        z_ai = z_ai + 1
      end
    end
  end
  ...
  
There is very likely a better, more compact way.
Maybe with loops?

Obviously you knew what you were doing because the game is functional and the AI plays well enough.
It is amazing actually :) But it is also a bit scary. Did you not get crazy about typos? Or is that code auto-generated in some way?
In another thread I wrote yesterday "It does not matter how crude your code is, as long as the game gets completed." I still stand by that statement but you have taken it to the extreme. :)

Re: Desktop minigame - tactical board game

Posted: Wed Apr 12, 2023 3:13 am
by BrotSagtMist
I better hope it is auto generated, my biggest one file behemoth is 4000 lines and i would not like to get overthrown.

Anyway, thats a cool game, AI is pretty good so far.
It wasnt clear to me from the beginning what this games objective is tho.
Maybe shuffle the rules so that the objective is first and pinpoint it to "move your pieces to the center spot"

Re: Desktop minigame - tactical board game

Posted: Wed Apr 12, 2023 1:33 pm
by zxretrosoft
Thank you so much for the responses, my friends!

Yes, I will correct the English, sorry, I don't speak English well :|

As for the code, you're right, I didn't think much about it, rather I wanted to try to make a complete game in Löve2D and I didn't optimize the whole blocks. The goal was to make it work. Of course it works 1000x better, I myself have prepared a depth of 7 moves ahead where there are only loops. Except that so far the AI hasn't been better than this, so I need to fine tune it first :crazy:

But thank you so much for the feedback! :megagrin:

Re: Desktop minigame - tactical board game

Posted: Fri Mar 01, 2024 8:11 am
by zxretrosoft
I also made an isometric version in AGK, unfortunately I couldn't do it in Love2D :ultrashocked:

Download:
https://www.instaluj.cz/amoriax/download

Browser version:
https://zxretrosoft.itch.io/amoriax

Image

Re: Desktop minigame - tactical board game

Posted: Fri Mar 01, 2024 9:16 pm
by MikeHart
Looking good. Is that 3D?

Re: Desktop minigame - tactical board game

Posted: Mon Mar 04, 2024 7:20 am
by zxretrosoft
Hey, Mike!
Thank you! No, it's more like pseudo-3D. I just did the isometric effect with a set of regression equations.