Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Infection [Game]


  • Please log in to reply
24 replies to this topic
jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006
Here is my latest game. I've been coding it off and on ever since I finished Tic-Tac-Toe, so it's been quite a while in the making.

Infection (commonly known as Ataxx) is a 2-player strategy game in which you attemt to maneuver your colored pieces near your opponent's and thereby infect his pieces: convert them into your own. Whichever player has the most pieces at the end wins. Games of Infection are subject to dramatic reversals of fortune, so having a commanding lead early on in no way guarantees victory. There is no such thing as momentum in Infection; every move is a battle.

The script includes a Help menu with 3 links to more information about the game. The first link (Pressibus.org) is the Internet's most comprehensive site on this game including its history, rules, and links to many other games. The second link (Extreme Ataxx) is a game with a much more difficult AI. Once you get used to the rules, and can easily beat my script, you'll want to try out Extreme Ataxx.

My goal with this game was not to make it hard to beat, but rather to make it simple to play. Infection is a little tricky to learn, so the Delay feature I've built in to slow down the game in Level 1 can be very helpful. I had trouble following some of the other versions from Pressibus.org because they move too fast.

Note that Level 2 is slow and processor intensive. It uses a lot of Loops. It is still not very difficult compared to the higher levels in Extreme Ataxx, but offers a little more of a challenge than Level 1, especially in games using a lot of Blocks (you'll have to discover what those are).

>DOWNLOAD<

Here's an icon, for those who compile.
Posted Image >Download Icon<

Posted Image

Enjoy! In my not-at-all-humble opinion, this is the best self-contained AHK game produced to date... and I'm issuing that statement as a challenge to the AHK community to make some more great games! Check out this topic if you're interested: Ideas wanted for new project.

autocoldkey
  • Guests
  • Last active:
  • Joined: --
damn what's impossible with ahk?

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
Very nice! When learning the game it could be helpful if the valid moves were highlighted by changing the color of the squres where a new piece can be put and using a third color to squares, where the selected piece can jump.

Tuncay
  • Members
  • 1945 posts
  • Last active: Feb 08 2015 03:49 PM
  • Joined: 07 Nov 2006

damn what's impossible with ahk?

what's IMPOSSIBLE with AHK?

jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006
@Laszlo
I considered adding that feature, and there are other Ataxx games that do. It was just a low priority compared to actually finishing the game; and now that I've posted it, it feels good to be done. :sigh: It's probably the #1 feature I'd like to add (an Undo button would be nice as well), but I'll likely take a breather from Infection and not delve back into this code for awhile. I will keep it in mind, though.

Thank you for trying out my game. I'm glad you liked it! 8)

MaxWeiss
  • Members
  • 62 posts
  • Last active: May 24 2010 10:24 PM
  • Joined: 15 Sep 2007
Wow i just get owned at this game every time. I suck at this. Nice AHK though...

z80
  • Guests
  • Last active:
  • Joined: --
Hey jaco0646,

Thanks for the game, i have been looking for a good windows version of othello/reversi for awhile and recently settled for the mame version of ataxx which is tough but beatable.

I was wondering, the mame version has four blocked squares, 2 squares in diagonally from each corner. Have you played that version and have you considered using that layout?

Thanks again, z80.

jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006
If you select "Blocks..." from the Infection menu, you can choose any custom configuration of blocks you like. A few setups that I've played a lot are shown here: https://ahknet.autoh...Blocks-Favs.PNG.

Thank you for the encouragement. I really appreciate it. :)

jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006
Ha! I beat Level 1 today: 41-8. It's the first time I've ever achieved a score in the 40s (excluding the games when player 2 is eliminated of course).

I've also been thinking more about Laszlo's suggestion (hey, I said I'd keep it in mind) and ultimately I've decided against it. My reasoning is this: I believe there is a difference between making a game easy to learn and making it easy to play, and these two designs can be at cross-purposes.

In the case of highlighting all valid moves, I think it would make the game much easier to play, but would actually impede learning by encouraging laziness. If the game illustrates every move, you don't have to think nearly as much, which I believe is an integral part of the game play.

I'm sure others will disagree, especially since AHK is primarily used to cheat at computer games; but in my experience there is more enjoyment in fair play and much more satisfaction in winning fairly.

Thrillski
  • Members
  • 195 posts
  • Last active: Mar 17 2016 03:47 PM
  • Joined: 18 Jul 2007
Wow... What coding you've done... Just discovered the game and it is quite amusing. As always though, I have a couple of "minor" suggestions.

[1] On the version I played, you had black font on a black background. Kinda hard for pull down menus. :)

[2] An option for the human player to go last. (Passing on the first turn.)

[3] If you really want to get into the AI's head, # players = 0.

[4] I like how you implemented the blocks. It is annoying to know I can win on an open board, but closed boards mess w/ me. Maybe an option to randomize the block placements?

From what I've seen, this is an excellent implementation of Ataxx.
Have a nice day!
Thrillski

jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006
Thrillski, thank you for the feedback. I've been on vacation, hence the slow reply. I will address your suggestions sequentially.

[1] The black-on-black menu font was intentional. I tried different shades to make the menus visible while the game is being played, but personally I found all black to be more aesthetically pleasing. I wanted it to look like a game board, and felt a more obvious menu detracted from that; but again, it was just personal preference.

To compensate for the blacked-out menu, I placed the "Pass" button on the board (even though it is used somewhat rarely) so that none of the menu items are used during game play. The only menu items I expect to be regularly used are "New Game" & "Blocks" and since there are only 4 short menus, I felt it was a small learning curve to remember their placement. Note also that the menus are visible when the window does not have focus, as in the picture I took for the original post.

Finally, the menu color can easily be changed by entering a custom RGB number at line #48:
Menu, MenuBar1, Color, 000000, Single
It's towards the top of the script, amongst all the Menu commands. Simply replace 000000 with your own color.

[2] I had never heard of Ataxx before I started looking for a game to code, so I simply followed the rules from Pressibus.org.

The computer has the blue pieces, at up-right and down-left. The human player has the red pieces (up-left and down-right), and he plays first

While coding the game, I further researched several of the theories behind board games and learned that alternating the first move is only critical in games to which the Strategy-stealing argument applies. Conversely, situations of zugzwang frequently arise in Ataxx, particularly during endgames. Basically, it is not a significant advantage to move first.

[3] There are a few reasons that a PC vs PC option wasn't coded, and never will be (at least by me). First, it's more work than I want to do. :lol: Second, I know there are bugs in Level 2 that would need to be worked out before it could be used to play against itself; but I was relieved to see this project finished and since no one else reported them, I don't think there is enough interest to make it worthwhile. Third, I'm not "good enough" at Ataxx to even be able to produce a quality AI. :p

[4] Blocks can be tricky, I agree. Infection supports all legal (according to Pressibus.org) block arrangements, as well as at least 1 illegal setup. Extreme Ataxx randomizes block placement by default, but I wanted the user to have to think a little more about it. If you're looking for ideas, all possibilities up to 11 blocks are listed at the bottom of the Blocks-Configs page.


Thank you again for your interest and support!

Thrillski
  • Members
  • 195 posts
  • Last active: Mar 17 2016 03:47 PM
  • Joined: 18 Jul 2007
Jaco, I hope you enjoyed your vacation.

[1] Main thing that I do when I critique something is to mention points I discover. What someone does w/ that is up to them. You had a reason for the black on black, ok. I found out how to change it myself and my copy is black on white. Although I do appreciate the thought since I'm sure others who aren't as adept would like that.

[2] Really? I didn't know that Ataxx was a turn-neutral game. My experience w/ it was the arcade version and there, I discovered going first made a big difference. I guess putting in a time factor helps...

[3] I understand. It plays a fair game and if it has a fair chance of winning and losing, I consider that good. Plus, that would be a lot of work and I think you'd rather code a new game instead. :D

[4] I thought it would have been a fairly simple thing to do a randomization of the block placement. I do agree that planning it out has some trickiness to it as well.

Great game nonetheless.
Have a nice day!
Thrillski

z80
  • Guests
  • Last active:
  • Joined: --
Hey jaco0646,

Just wanted to thank you again! I have been playing this for about 2 months now and agree with you said in your first post "the best self-contained AHK game produced to date"

I still play it on a daily basis and although i win most of the time its still fun and challenging!

Only additional thing i might add is to save block placement settings on exiting, but thats minor.

Look forward to seeing what you come up with next.

Take Care,z80.

jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006
Cool. 8) Thanks z80.

Zer07even
  • Members
  • 19 posts
  • Last active: Dec 01 2009 08:32 AM
  • Joined: 01 Aug 2008
This is brilliant!!! Im amazed that its all ahk and so seamless no GUI flashes very nice! only suggestion is:

When you complete a game make the Pass button change its text to "New Game" and when its clicked it can start you off again!

Brilliant very nice I tried getting inside and checking out how it works but wow that is some complex code