Jump to content



Photo

IX v1.04: a Strategy Game like Chess

game games

  • Please log in to reply
22 replies to this topic

#1 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 23 April 2012 - 07:05 PM

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, 05 June 2012 - 03:18 PM.

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)








#2 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 25 April 2012 - 01:41 PM

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.

Attached Files

  • Attached File  IX.au3   24.77KB   120 downloads

Edited by Manadar, 25 April 2012 - 01:47 PM.


#3 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 26 April 2012 - 09:53 PM

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.

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)


#4 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 30 April 2012 - 04:43 PM

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, 05 June 2012 - 03:28 PM.

  • Manadar and JScript like this

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)


#5 czardas

czardas

  • Active Members
  • PipPipPipPipPipPip
  • 5,173 posts

Posted 07 May 2012 - 03:21 AM

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, 07 May 2012 - 03:21 AM.


#6 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 09 May 2012 - 09:19 PM

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.

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)


#7 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 10 May 2012 - 08:35 AM

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.

Attached Files

  • Attached File  IX.au3   26.65KB   95 downloads

Edited by Manadar, 10 May 2012 - 08:36 AM.


#8 czardas

czardas

  • Active Members
  • PipPipPipPipPipPip
  • 5,173 posts

Posted 10 May 2012 - 09:24 AM

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

Edited by czardas, 10 May 2012 - 09:24 AM.


#9 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 10 May 2012 - 12:28 PM

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

#10 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 11 May 2012 - 10:30 PM

@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, 11 May 2012 - 10:32 PM.

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)


#11 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 13 May 2012 - 09:10 PM

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.

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)


#12 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 14 May 2012 - 07:26 AM

Very nice additions. Much better than my own revision.

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

#13 czardas

czardas

  • Active Members
  • PipPipPipPipPipPip
  • 5,173 posts

Posted 14 May 2012 - 01:28 PM

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, 14 May 2012 - 01:30 PM.


#14 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 15 May 2012 - 07:35 PM

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.

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)


#15 czardas

czardas

  • Active Members
  • PipPipPipPipPipPip
  • 5,173 posts

Posted 16 May 2012 - 10:17 PM

That's so cool! ;)

#16 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 19 May 2012 - 01:58 PM

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.

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)


#17 Achilles

Achilles

    Achilles == Ichigo

  • Active Members
  • PipPipPipPipPipPip
  • 2,897 posts

Posted 21 May 2012 - 06:37 AM

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, 21 May 2012 - 06:38 AM.


#18 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 21 May 2012 - 08:38 PM

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

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)


#19 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 22 May 2012 - 07:40 AM

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?

#20 Topher

Topher

    Adventurer

  • Active Members
  • PipPip
  • 105 posts

Posted 23 May 2012 - 04:40 PM

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.

 

$mood = "whimsy" $mode = "confused" $randomChaos = True Do Something() Until $Tired

Reflex (Arcade game)

IX (Board game)

The Word Game (Word game)

Plastic Sliding Squares Puzzle (Puzzle)






Also tagged with one or more of these keywords: game, games

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users