Jump to content
Sign in to follow this  
Topher

IX v1.04: a Strategy Game like Chess

Recommended Posts

Topher

Yes, another game. This one is a board game.

Only three piece types, only nine rules. This is very easy to learn. Very hard to master.

Illustration of Game in progress:

Posted Image

If you like Chess you will like this.

Enjoy

Version 1.03

The 'Set' option has been removed, making a play only two clicks.

In-game player prodding has been added.

Some bitmaps have been corrected.

Version 1.04

Resignation option added.

Movement Hints added.

GUI to set game options added.

Sound off option added.

Bitmaps have changed. Reinstall Images\ or things won't quite look correct.

IX v1.04 files

Edited by Topher

[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
jvanegmond

Quite professionally made. Code looks good on the insides too.

Also a nice example of when AutoIt array copy mechanism is actually useful:

$Board = $holdBoard
$Color = $holdColor

One tip, if you set up your constants like this:

Global Const $Tribe = 2^0
Global Const $Clan   = 2^1
Global Const $Hunter   = 2^2  ; used only for comparisions
Global Const $HunterN  = 2^3
Global Const $HunterS  = 2^4
Global Const $HunterE  = 2^5
Global Const $HunterW  = 2^6
Global Const $HunterNE = 2^7
Global Const $HunterNW = 2^8
Global Const $HunterSE = 2^9
Global Const $HunterSW = 2^10
Global Const $Red     = 2^11
Global Const $Green = 2^12

And then repair Func PieceName() to not think that $Red is always 0.

Then for each piece, you are able to check more easily what that piece is with BitAND. For example your Func CheckPiece($piece) becomes:

Func CheckPiece($piece)
    Return BitAND($piece, $AdjustSide)
EndFunc

You can use the same check for other pieces.

Attached a copy of the script for your convenience. So you can see that it works, without going through the painful process of updating all the code. I must say that I really like your solution as well, but I am a little surprised it worked. Usually a system like that is too rigid when your project grows, but you managed to be smart with it and it works. So, kudos! For using a solution most programmers don't use and managing to make it work.

IX.au3

Edited by Manadar

Share this post


Link to post
Share on other sites
Topher

Thanks for the praise.

It took me a little bit to see the advantage to your changes but now I have incorporated the changes.

Started work on the player against the computer version today. That is going to take a long while but I think I have an approach.


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
Topher

I found an error introduced on your change.

During the clan split the hunteradjust routine no longer properly removed the color and so errored out.

I have fixed this as well as fixed a few other minor problems.

Edited by Topher
  • Like 2

[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
czardas

I thought the game was interesting. I didn't read the rules but I did run out of pieces. I found that having to click 3 buttons per move a little long winded though. Perhaps you can get rid of the button SET.

Edited by czardas

Share this post


Link to post
Share on other sites
Topher

I suppose it could be coded to simply have the undo option until the other player moves.

It would streamline things.

Thank you. I will try to code that.


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
jvanegmond

I suppose it could be coded to simply have the undo option until the other player moves.

It would streamline things.

I've added this. : ) You can undo your move if your opponent has not selected his piece yet.

Note that $TotalMoves variable is not yet debugged.

IX.au3

Edited by Manadar

Share this post


Link to post
Share on other sites
czardas

Manadar, I think that makes it more user friendly. ;)

Edited by czardas

Share this post


Link to post
Share on other sites
jvanegmond

That reminds me. I think it would be a good idea to add labels which users turn it is and what they have to do to play that turn. Right now it relies mostly on audible cues and not everyone wants to hear the beep the whole time. Something like:

Red, it's your turn

Click on one of the red pieces on the board to select them, then select an action: Move by clicking on the board, turn or split by clicking the buttons on the side.

I also wanted to show the total number of turns played somewhere too. Right now it shows them at game over (but I haven't debugged that yet so it may crash or be incorrect).

Share this post


Link to post
Share on other sites
Topher

@czardas That really streamlined play. Thank you

@Manadar I wanted to code that myself (so I did).

The suggestion of in game instructions is a good one. I'll have it ready and uploaded by tomorrow evening.

Edited by Topher

[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
Topher

Sorry for the delay, life got in the way.

Version 1.03

The 'Set' option has been removed, making a play only two clicks.

In-game player prodding has been added.

Some bitmaps have been corrected.

The update is in the original post.


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
jvanegmond

Very nice additions. Much better than my own revision.

It is clear you spend a great deal of effort and care on this program. : )

Share this post


Link to post
Share on other sites
czardas

I have to agree, it's much better now. I haven't had a lot of time to study the game, but thanks for sharing it. I do like chess and there are a few free chess programs around. I generally use a chess program called winboard. Perhaps you could add some similar features like highlighting the last move, or available moves. Not that it needs more features. I'm just thinking out loud. Very nice! ;)

Edited by czardas

Share this post


Link to post
Share on other sites
Topher

Perhaps you could add some similar features like highlighting the last move, or available moves.

Replaying the last move seems like a coding mess.

The other I have put into the next version, thank you.

Posted Image

I have to write a small GUI to control the optional variables that I have been dragging my feet on.

If you (or anyone) have some constructive ideas for additions please let me know.


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
Topher

Version 1.04

Resignation option added.

Movement Hints added.

GUI to set game options added.

Sound off option added.

Bitmaps have changed. Reinstall Images or things won't quite look correct.

Minor bugs corrected.


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
Achilles

Really nice work on this.. the images and functionality are well done.

Some thoughts for improving it:

-Integrate the starting GUI into a menu, this would let the user start right at the main GUI (better flow imo) and allow them to make changes during game. The menu could have a help and about section and whatever other fun stuff menus have.

-This kind of goes with above: give the user new game option.. I didn't look at your code so I don't know how easy that would be to do.

-It sort of looks like you redraw the board after every move, that could probably be avoided.. or I'm just seeing things.

-I sort of think there should be a easier way to rotate the smallest pieces rather than all the buttons, but I can't think of one right now.. if those buttons could be removed you could put the count and resign button below the board to shrink up the amount of empty space on the left and right sides.. it feels a bit desolate.

-AI would be fun, and a lot of work..

I enjoyed playing around with this.

Edited by Achilles

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites
Topher

-Integrate the starting GUI into a menu, this would let the user start right at the main GUI (better flow imo) and allow them to make changes during game. The menu could have a help and about section and whatever other fun stuff menus have.

I'm not very good with menus so I have been dragging my feet. But you are correct and I will work on it.

-It sort of looks like you redraw the board after every move, that could probably be avoided.. or I'm just seeing things.

Worse I have to draw both the backing square and then the piece, guaranteeing flicker. But this would require so much extra coding to lower it to just the pieces in involved that I am content to live with the flicker.

-I sort of think there should be a easier way to rotate the smallest pieces rather than all the buttons, but I can't think of one right now.. if those buttons could be removed you could put the count and resign button below the board to shrink up the amount of empty space on the left and right sides.. it feels a bit desolate.

I thought long and hard on that when designing the original setup and never did come up with another way. I am open to suggestions.

-AI would be fun, and a lot of work..

This has been one of my goals but I am stumped at how to go about it. I had a few ideas but after a lot of code it was just a mess.

I would also like to make it playable against another player on a different computer. I at least can learn (I hope) how to do that. This is what I am currently working towards. Currently lost in the jargon alone.

I enjoyed playing around with this.

This is my biggest goal, so glad I achieved it for you. ;)


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
jvanegmond

This has been one of my goals but I am stumped at how to go about it. I had a few ideas but after a lot of code it was just a mess.

I would also like to make it playable against another player on a different computer. I at least can learn (I hope) how to do that. This is what I am currently working towards. Currently lost in the jargon alone.

Do AI as a separate project. Make your program write via console the current board, that looks something like this:

.....
T...Y
.....
T...Y
.....

Make a legend:

. = Empty square

T = blue tribe

Y = red tribe

Then the AI spits out something like "B1->B2" or "B1->Split".

There are some caveats. Do you want me to prototype something?

Share this post


Link to post
Share on other sites
Topher

Do AI as a separate project. Make your program write via console the current board, that looks something like this:

I am more stumped by the logic than the format.


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • TheSaint
      By TheSaint
      An adaption of an adaption.
      A good while back, I created a program, KindEbook Wishlist, that I use most days and is still available here at the forum. It works well, keeping tabs on price changes for Kindle ebooks at Amazon ... at least for my modest wants.
      About a year or so later, I struck upon the idea of adapting that program for CDs, DVDs, Blu-rays etc from the JB Hifi store, where there was a limit of about 50 items on the in-store wishlist. JB Wishlist is kind of a niche program, really only suitable for those from AUS, at the AutoIt Forum, who would want such a thing ... so not many I imagine, so it has never been available here. However, if you meet that criteria etc, and are willing to register at the AutoIt4Life Clubrooms, then it is available in the Project Chat section there ... though not the more recent updates (you need to ask me about them). That too, works quite well for my modest needs, and even includes an additional Preview & Summary window, which KindEbook Wishlist doesn't have ... though both programs do have access to a Details window per item, that is like the Preview window ... just doesn't constantly display alongside the Main program window (see later for an example with IonGoG Wishlist).
      So, now we come to IonGoG Wishlist, which is an adaption of the JB Wishlist program, and used for keeping tabs on GOG Games ... prices, history of changes, bought list, etc.
      IonGoG Wishlist is an incomplete adaption, so still in beta ... though all the really important elements work well enough. I have been working on it in dribs and drabs, and I now think it has come to a reasonable enough stage to share it ... just be advised, that some of the features accessed via the right-click menu etc, may not work or give strange results. Any of the options that I have given an Accelerator key facility to, should be working fine ... and most of the others are too ... and I am not even sure at this point, of what remains to be adapted ... not much I imagine.
      The name by the way, in case you were wondering, is a phonetic mangling on the words - keep an Eye On your GOG Wishlist.
      Here is a screenshot, with the Preview window on left. The Preview window can be placed at right instead or even turned off.

      Download, includes source files.
      IonGoG Wishlist v0.0_b20.zip  (see detail & screenshot at Post #13)
      Enjoy!
      OLDER DOWNLOADS
      SUPPLEMENTARY
      I have another program that GOG users may be interested in, that can assist with getting game images that IonGoG Wishlist gets and doesn't get ... larger versions taken from modified thumbnail links in their GOG Library.
      Downloads Dropbox  (see the GOG example in Post #7)
      ADDENDUM
      In reality, compared to most stores I have come across, the GOG store is great, well setup and laid out. and for most things, including their Wishlist, is more than adequate. So I rarely do a full list Price Query ... so much quicker and easier to just check the two pages of my in-store wishlist. When I first started work on IonGoG Wishlist, the in-store wishlist wasn't as good as it is now.
      All that said, I still find it handy to use IonGoG Wishlist, for a variety of things - Offline browsing, Cover images to use with my bought & downloaded game folders, price changes history (and patterns of GOG behavior for sales etc), a bought list (with price I paid and date etc), Game Notes & Warnings, etc. And while not as quick as just checking the pages of your in-store wishlist, you can just set the full, favorites or non-favorites Query going, while you go away and do something else, and then later come back and look at the highlighted changes that may have occurred.
    • spikespaz
      By spikespaz
      The rule against game automation is misguided and unhelpful for the following reasons.
       
      I am a developer, using AutoIt to automate testing for a game that I am developing. Singleplayer games can be mundane and sometimes cheating can be overlooked. Multiplayer games usually have anticheat against repetitive robotic actions anyways. People want to override the control schemes of games with bad customization. Eg. Axiom Verge, Fortnite (Crouching). Game automation is not always bad. If the user feels the need to automate a singleplayer game for boring or mundane tasks, that is their choice. Similarly, if I wish to use scripts to automate testing, that is my choice.
      Game automation can be a problem for online multiplayer games, giving players a competitive advantage. This could be countered by common sense; ask OP what game they are automating, and is it an online game? What is this script for, and what does it seem to do?

      Please revise the rule as it seems very unnecessary and harmful to people seeking help with innocent attempts at game automation.
    • Barney
      By Barney
      Hi guys, I just finished a Connect 4 game by using MiniMax with Alpha Beta Pruning. I haven't written a program for a long time, but writing an
      AI program is always funny! I have to learn how the algorithm works and try to optimize the code to run faster. Let's play and have fun!

      Oops, I lost the game ...

      Thanks guys!
      Download: Connect 4.zip
    • Mannyfresh31
      By Mannyfresh31
      This is a game that I'm developing for Slot machines I just finished translating it to English my original version is in Spanish so if I miss spelled or translated something wrongly please accept my apologies I just releasing the Compile version this time just the .exe file Because I'm saving the code for myself since the software was originally written for my business or if someone wants it they have to pay but not you you getting it for free here at Autoit .
      once you run the software for first time is going to ask you for a license and it wont work without it you can get an Access code (license) by request just PM me and provide the code that the software will give when you press the cancel button three times.
      anyways once you're in the game the following hotkeys are set for interacting with it
      "q" for slot one or one credit
      "d" for slot two or five credits
      "1" or "2" or "3" or "4" or "5" to play simple, double, threeple, etc.  once you have credits of course
      "p" to stop the numbers once you're playing
      "c" for configurations or settings
      "i" for printing the receipt
      "s" for exit
      "t" for trading points for credits
       
      Link to download the game https://drive.google.com/open?id=1x22AM80fjrDjTwwAp_TqbdWyTabawoQX
       
      and here are some videos so you can see what the game is about
       
       
       
       
       
       
       
       
×