Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AI behavior more varied (code) #2048

Closed
earthpig opened this issue Apr 26, 2012 · 2 comments
Closed

Make AI behavior more varied (code) #2048

earthpig opened this issue Apr 26, 2012 · 2 comments

Comments

@earthpig
Copy link
Contributor

Instead of checking for SquadSize dudes hanging around the base every 20 ticks and attacking if SquadSize dudes are present, throw a bit of randomness into the mix (but have the size of AI attack forces still trend towards SquadSize, which is 10 for HardAI). The idea is that sometimes, the bot should attack sooner and with fewer dudes (so it feels like the opponent "decided" to rush) and sometimes save up more, and once in a great while save up a whole bunch (so it feels like the opponent "decided" to turtle) and then attack.

sample implementation: earthpig@b8c834b

On line 284: lowering that from 300 to, say, 250 or 200, will make the bot more likely to attack at around SquadSize units. Having it higher, say at 500, will make it more likely to save up way more. 300 was an arbitrary pick.

On lines 282 and 323: This is the minimum possible attack force. Lowering this will cause the attack sizes to trend more towards SquadSize. 3 was an arbitrary pick.

Playing 1v4 HardAI bots with the above HackyAI.cs, and recording how many units were in each bot's first attack force (recall that SquadSize is 10 for HardAI):
Game 1: 7, 10, 13, 17
Game 2: 11, 14, 16, 20
Game 3: 9, 14, 15, 15

(In light of that sample of 3 games, perhaps use 200 instead of 300)

@earthpig
Copy link
Contributor Author

earthpig@fb84924

@chrisforbes
Copy link
Member

Merged, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants