Jump to content

IX v1.04: a Strategy Game like Chess


Topher
 Share

Recommended Posts

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]
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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

[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]
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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).

Link to comment
Share on other sites

@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]
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

-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]
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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]
Link to comment
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
 Share

×
×
  • Create New...