Jump to content

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

AHK Programming Arena suggestions, questions and bug reports


  • Please log in to reply
91 replies to this topic
MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
I intended to do that from the beginning.
Damn, there goes my secret strategy. LOL

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


lagomorph
  • Members
  • 403 posts
  • Last active: May 15 2014 03:41 PM
  • Joined: 02 Apr 2010

I intended to do that from the beginning.
Damn, there goes my secret strategy. LOL

TRICKY!!!

I just finished my official submission for Season 1!
Check it out on the Ladderpage---and don't cry too hard if it pwns your script!! =P

Also have a preview of some upcoming changes for next version:
*new visual distinction for units with the build module.
*unit death animation
*new visual distinction for unscanned units and minerals
*new gui background color (thanks to tidbit)

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
Something tells me that a few functions I created will be copied once I submit my code...

Hey lagomorph, you could add something to avoid infinite matches.
Like 3 radio buttons and a Slide or UpDown control:
Max. Turns: 2000 <---- default: 1000, min: 500, max: 2000
o Auto-Restart Match
o Auto-Discard Match
• Ask
[/list]

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


LiquidGravity
  • Members
  • 156 posts
  • Last active: Oct 11 2014 04:11 PM
  • Joined: 26 Jan 2009

Something tells me that a few functions I created will be copied once I submit my code...

I thought of this too. But the upside will lead to much smarter code overall. We will obviously have to have some kind of policy for nearly identical files though. Like if there is a code dispute whoever submitted it first should get the higher rank.

[edit]
I was going to suggest something about the infinite loops. I thought of adding a stalemate button. Perhaps having it check every 10/20 moves to see if there is any change in either players stats (resources, unit count,...) and to stalemate after such a condition. Leaving it go to 2000 or some high number would really mess with the averages (unless it tossed out that round).
[/edit]

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009

We will obviously have to have some kind of policy for nearly identical files though. Like if there is a code dispute whoever submitted it first should get the higher rank.

Great!

Leaving it go to 2000 or some high number would really mess with the averages (unless it tossed out that round)

Well, that's the idea. And I guess that limit is more trustable than one or more conditions involving any other variables you mentioned.

Also, I'd be happy to help with the whole project but I won't have time for this until the end of July. :(

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


lagomorph
  • Members
  • 403 posts
  • Last active: May 15 2014 03:41 PM
  • Joined: 02 Apr 2010
Good ideas, guys. I'll add the stalemate-check into the next version.

Eedis
  • Members
  • 1775 posts
  • Last active: Aug 14 2015 06:33 PM
  • Joined: 12 Jun 2009
1: The script I tried last night seemed to bug out a little with the gatherer's. I tried a base defense type strategy, where whenever my gatherer's ran below 2, it'd build another gatherer, but never seemed to. I added a little tooltip on one of the variables and found out that once one of the gatherer's dies, the unit-count doesn't go down.

MorphaClass1:
ToolTip, Class2 = %morphaClass2unitcount%`nClass3 = %morphaClass3unitcount% ;Whenever a unit dies, it's corresponding unit-count doesn't go down.
If (morphaResources > 3)
	{
	If (morphaClass2unitcount < 2)
		AA_Build(101020, 1currentunit, 2)
	If (morphaClass3unitCount = 0 AND morphaClass2unitCount > 1)
		AA_Build(00301, 1currentunit, 3, "L")
	If (morphaClass3unitCount = 1 AND morphaClass2unitCount > 1)
		AA_Build(000301, 1currentunit, 3, "R")
	If (morphaClass2unitCount > 1)
		AA_Build(101101, 1currentunit, 3)
	}
return

2: Also, I think you should find a workaround for having to type in the player's name exactly. I think the game should just read the name in the player's script and updates itself.

*Edit* I tampered with the game a bit.

I took out the first two inputboxes for the names and added this.
;~ InputBox, player1, Player 1's Name?, Please enter Player 1's name exactly as it appears in their script.,, 200, 160
;~ InputBox, player2, Player 2's Name?, Please enter Player 2's name exactly as it appears in their script.,, 200, 160
Player1:=Player1Script()
Player2:=Player2Script()
InputBox, gamecount, Number of games?, Games will automatically continue until the number of games chosen have been played.,, 200, 160

Then at the beginning of each script, I added this.
If ! Ran1
{
	Player1=Morpha
	Ran1++
	Return Player1
}

AutoHotkey state, the forum, Poly, and Drainx1. The short story.
I love my wife, my life, my atomic-match; for giving me the greatest gift a man could ask for, such a perfect and beautiful little girl.
9rjbjc.png

lagomorph
  • Members
  • 403 posts
  • Last active: May 15 2014 03:41 PM
  • Joined: 02 Apr 2010

1: The script I tried last night seemed to bug out a little with the gatherer's. I tried a base defense type strategy, where whenever my gatherer's ran below 2, it'd build another gatherer, but never seemed to. I added a little tooltip on one of the variables and found out that once one of the gatherer's dies, the unit-count doesn't go down.

MorphaClass1:
ToolTip, Class2 = %morphaClass2unitcount%`nClass3 = %morphaClass3unitcount% ;Whenever a unit dies, it's corresponding unit-count doesn't go down.
If (morphaResources > 3)
	{
	If (morphaClass2unitcount < 2)
		AA_Build(101020, 1currentunit, 2)
	If (morphaClass3unitCount = 0 AND morphaClass2unitCount > 1)
		AA_Build(00301, 1currentunit, 3, "L")
	If (morphaClass3unitCount = 1 AND morphaClass2unitCount > 1)
		AA_Build(000301, 1currentunit, 3, "R")
	If (morphaClass2unitCount > 1)
		AA_Build(101101, 1currentunit, 3)
	}
return

2: Also, I think you should find a workaround for having to type in the player's name exactly. I think the game should just read the name in the player's script and updates itself.

You're running an out-of-date version of the game! Both of these issues have been fixed.

Please Update your Game Files!

And check the AHK Arena blog for future version changes!

LiquidGravity
  • Members
  • 156 posts
  • Last active: Oct 11 2014 04:11 PM
  • Joined: 26 Jan 2009
I think you missed a few pages in the topic. Both of those issues were brought up and I think they were both fixed in the last "build". Check out the newest version on the wiki Game Files page.

[edit] I wish the forums told you that someone has posted since you clicked Reply. [/edit]

Eedis
  • Members
  • 1775 posts
  • Last active: Aug 14 2015 06:33 PM
  • Joined: 12 Jun 2009

I think you missed a few pages in the topic. Both of those issues were brought up and I think they were both fixed in the last "build". Check out the newest version on the wiki Game Files page.

[edit] I wish the forums told you that someone has posted since you clicked Reply. [/edit]


I agree, because I just kept the post open in edit and went to fix it myself. O.O Lolz.
AutoHotkey state, the forum, Poly, and Drainx1. The short story.
I love my wife, my life, my atomic-match; for giving me the greatest gift a man could ask for, such a perfect and beautiful little girl.
9rjbjc.png

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
Another suggestion...

Suffix for Unit Position: _PosX , _PosY
Suffix for Mineral Pos.: X , Y

I think there should be a unique suffix.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


lagomorph
  • Members
  • 403 posts
  • Last active: May 15 2014 03:41 PM
  • Joined: 02 Apr 2010
Version 1.2 is out with some new visual changes!

Please update your game files.

New in Version 1.2:

* After 2000 turns if neither player's resources increase or decrease in 20 more turns, a stalemate is declared and a new game is started.
* new visual distinction for units with the build module.
* unit death animation
* new visual distinction for unscanned minerals
* new gui background color (thanks tidbit)

camerb
  • Moderators
  • 573 posts
  • Last active: Sep 14 2015 03:32 PM
  • Joined: 19 Mar 2009
Carcophan pointed out that the links to the player files behaved inconsistently (some automatically downloaded the file, some redirected you to a page with the plain-text code on it). So, I uploaded a zip file that contains all of the files (none of the files were changed, it's still version 1.2). Beginners can now just download the zip file, extract it, and start playing.

Thanks Carcophan, for pointing that out!
Aren't you glad that I didn't put an annoying gif here?

lagomorph
  • Members
  • 403 posts
  • Last active: May 15 2014 03:41 PM
  • Joined: 02 Apr 2010

Carcophan pointed out that the links to the player files behaved inconsistently (some automatically downloaded the file, some redirected you to a page with the plain-text code on it). So, I uploaded a zip file that contains all of the files (none of the files were changed, it's still version 1.2). Beginners can now just download the zip file, extract it, and start playing.

Thanks Carcophan, for pointing that out!

good idea. wikispaces is trying to automatically recognize file types and failing ^_^

Ace Coder
  • Members
  • 362 posts
  • Last active: Mar 13 2012 11:44 PM
  • Joined: 26 Oct 2009
Oh I would love to participate, however I can't visit the wiki, it is an https site. I'm using PdaNet as my home internet for awhile and it won't allow for https sites to show. :/ Can anyone possibly pm me the quick start guide?