Author Topic: Man vs AI (New Map!)  (Read 18399 times)

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Man vs AI (New Map!)
« on: October 19, 2011, 05:26:47 AM »
Test yourself against my first (messy) attempt at making an AI!

Normal has 30 asteroids

Epic has 50 asteroids

Have fun!

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 30
  • Posts: 205
Re: Man vs AI (New Map!)
« Reply #1 on: October 19, 2011, 08:16:40 AM »
Interesting approach to AI. I need to play more games, but so far it seems to need more restraint in its attacks- somewhat suicidal right now. I'm already looking forward to some 4-way AI war action!

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #2 on: October 19, 2011, 09:49:58 PM »
AWESOME!

I immediatly tested it and it looks awesome, didn't do much resistance against it though.

After I made it fight MAI and it...
(click to show/hide)

I can releast the map here if you want me to, but your choice(disabled the win/loss functions) :)

EDIT:
Also fix the not colonising players empty asteroids, even though that seems like a rare thing to happen, it's simple to fix. Use IsBarren() to find out if the asteroid is barren and then tell what to do with the asteroid. I also do speed tests, and MAI is very effective at speed tests as well as normal-speed tests.
« Last Edit: October 19, 2011, 09:55:52 PM by Aino »

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Re: Man vs AI (New Map!)
« Reply #3 on: October 19, 2011, 10:16:06 PM »
Thanks for trying the AI guys and thanks for the suggestions. I know many ways of improving it, but it felt formidible enough to release. My plan at present it to clean up the code and make several distinct AI's. I'm aiming for an epic sized map with 7 enemies :P. The suicidal behaviour was intentional

If there's anything big that needs changing (prevents the enemy from winning, crashes the map) mention that and I'll update the files. I won't be making an AI changes at the moment though, although suggestions are welcome as I can use any of them in follow up maps.

Also, I'd love for you to release that map Aino. An AI competition would lead to many maps!

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #4 on: October 19, 2011, 10:41:54 PM »
Ok, I release will!

Also, love the map generation :P

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #5 on: October 20, 2011, 12:30:04 AM »
Oh, there'll be another in the mix soon, if all goes to plan.

Bonobo

  • Achiever
  • Old Oak
  • ****
  • Thank You
  • -Given: 139
  • -Receive: 12
  • Posts: 670
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #6 on: October 20, 2011, 02:17:27 AM »
Whoa, very nice map, Mihhaelo! I played the smaller version last night and enjoyed it a lot, though towards the end it was too easy … but then again I’m always glad when I’m at all able to win a map ;)

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #7 on: October 20, 2011, 02:31:26 AM »
Hurry then, pilchard! I wanna see your monster in the cauldron with all the others :P

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #8 on: October 20, 2011, 04:39:11 AM »
My monster is fairly toothless at the moment, I scrubbed most of the code out because I forgot what it did in the time that I was away from working on it. Now I'm probably going to rewrite everything again, and it will do...exactly the same thing as before! :D

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #9 on: October 20, 2011, 04:51:53 AM »
*Cough* commenting *cough*

Even though I NEVER comment my stuff(which I really wanna do!) I remember everything, I can go into a 6 months old code and remember everything 'cause I just have theese pictures in my head which I can zoom in at, zoom out at and everything. I guess the journey I make while coding is so fun that I remember everything :P

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Re: Man vs AI (New Map!)
« Reply #10 on: October 20, 2011, 04:59:58 AM »
The way you did your "vs" file broke my AI, meaning it would always lose. I've updated the file and my AI now loses 99% of the time  ;D. I did notice your AI uses information a human player wouldn't have though; whereas mine doesn't. My AI would still lose though as it's not as good!

This attachment is the fixed version of our two AI's going at it. I've also changed the colour scheme a little and auto-zoomed, so the whole map is always on the screen and lastly I changed the win/lose conditionals to print which AI won  :P

It's sadly fun to have on in the background when I can't be bothered to play.

I think I'm going to make an AI vs AI template map (this code is far too messy to use!), so I can make an AI wars thread!  ;D

Oh and Pilchard, if you haven't already recoded most of your AI, It would be nice if you set your AI's behaviour to only use Globals. As then I could easily intergrate it into my future AI wars thread.

For example..

(click to show/hide)

instead of...

(click to show/hide)

Doesn't matter if you don't bother though, I'm sure I'd get around to it myself at some point, heh

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #11 on: October 20, 2011, 05:05:45 AM »
Hehe, I never tought of using globals when creating my AI. I guess it'll work out anyways, as nothing will happen if having it 10 :P

Edit: and how did it break your AI? I didn't change anything else than making one asteroid the players and ADDING in my AI. o.O

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Re: Man vs AI (New Map!)
« Reply #12 on: October 20, 2011, 05:16:17 AM »
Because my AI won't plant trees on owned asteroids that have no trees (Something it should do!). When you added a human player with 1 seedling, it caused my AI to dump all it's seedlings there and do nothing else.

I removed the human player in the updated file  ;D

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #13 on: October 20, 2011, 05:16:58 AM »
Also, fix those flower! 70% of the winnning if cause mine uses flowers!

Just copy paste from annikks AI, or mine :) Uppon approach of talkin' about Annikk, where is he? Hiding under that rock again?

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 30
  • Posts: 205
Re: Man vs AI (New Map!)
« Reply #14 on: October 20, 2011, 05:22:47 AM »
I agree- the map generation is very clever!

I've run several AI war scenarios with the MAI (Mihhaelo- are you going to name yours?). They both were even in their unimpeded expansion, but once they encounter one another there is no contest, at this point. Both AI's suffer from the phenomenon I've noticed with MAI- they tend to "freeze" on an asteroid and will not expand further. This sometimes occurs on the "player" asteroid, or an asteroid that is barren.

I'd like to run more scenarios but will be away from my computer for a month or so...

Great- I see there is a new version available- no time to retest!

Attached a few screenshots:

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #15 on: October 20, 2011, 05:29:53 AM »
Updated your V2, with names being drwn, to simplify which AI is which :)

And Seedling, awesome thing with the graphs :D
It would be awesome if anyone frapsed these two AIs fighting and just releasing(or sendling link of it to here too) it here :D

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Re: Man vs AI (New Map!)
« Reply #16 on: October 20, 2011, 05:37:58 AM »
I've never thought of using the Globals previously either. I plan to have two templates though, one at normal speed and one at a faster speed.

If AI's aren't coded via the globals then I can only make the game faster by making the asteroids spawn seedlings faster. Which changes the nature of the game. As an example, my AI tends to win a lot more when all the spawn numbers are set to one second, because "growth" is suddenly a lot more important than having troops to defend. My AI is being rewarded for growing uncontrollably in stupid fashion instead of being smart.

I can maintain the games balance by increasing the treecost, but as you can imagine that would break the AI's.

And Wow! I love version three :) Nice job.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #17 on: October 20, 2011, 06:49:05 AM »
I did think of using globals, but then thought it'd slow it down slightly. Might run a couple of speed tests on referencing Globals.* as opposed to a completely user-defined variable or a constant. Mind you, I think mine'd be pretty slow anyway...stupid single-thread Lua.

Also, holding back on mine lets me learn from the weaknesses of others', like stopping on a treeless asteriod, etc.

Anyways, a little tasteless of me to be talking about how my as-yet-unfinished AI may be here. I haven't downloaded this map yet, or many others recently. This one and Keep Your Acids look good from all the comments.

Finally, I thought that a map like Infected Empire would be a good AI battlefield since the map is symmetric and has thin chokepoint areas (the arms) and also a big free-for-all in the core. It can also be easily expanded for more AIs - simply add a new arm. Yes? No? Maybe? [/pascal sauvage, jumped up Frenchman]

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Re: Man vs AI (New Map!)
« Reply #18 on: October 20, 2011, 08:53:45 AM »
I've just realised that I shouldn't be changing the Treecost to make it faster, and I should just change all the speed globals. So avoiding saying things like 10 seedlings wouldn't be required. Ughhh. My head has been too muddled today.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #19 on: October 20, 2011, 09:31:08 PM »
Pilchard, using globas won't slow I believe, Globas are fields/variables, just like any other variables created in the lua file.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #20 on: October 20, 2011, 10:11:31 PM »
Got so inspired by the AI war map, I'ma make a map myself, where yuo can implent the AI's with I/O :)

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Re: Man vs AI (New Map!)
« Reply #21 on: October 20, 2011, 10:17:51 PM »
Lolnuts, that's what I was making! Maybe I should make a tower defense instead  ;D

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #22 on: October 20, 2011, 11:00:34 PM »
Made one already, maybe you can take stuff from it? :P

Also: how did you make the game accept the player not being present?

Mihhaelo

  • Sapling
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 67
Re: Man vs AI (New Map!)
« Reply #23 on: October 20, 2011, 11:23:58 PM »
That was quick coding! Yeah, I wouldn't mind seeing it if you don't mind.

To remove the player from the game without getting an error, you need to set every asteroid to an owner of 2 or above. Then you can change them all back to neutral in LevelLogic().

If you wanted a blank screen (but wanted to add asteroids later in LevelLogic(), you can do the following.

(click to show/hide)

The latter is more useful if you want to make a game in eufloria with no asteroids present really.


Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #24 on: October 20, 2011, 11:34:07 PM »
thx, now that works :P

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 30
  • Posts: 1,527
  • Eufloria: Yes
Re: Man vs AI (New Map!)
« Reply #25 on: October 22, 2011, 12:36:49 AM »
It's TIME!

To update my AI to support globals :D
Anything else I should update? I'll run through the AI war map a few times to see :P

Edits:

Add List for now:

    -"Safe advancing" or attack asteroids that can't reach the attacking asteroid.
    - Replacing "Safe Advancing" with the AI giving each neighbour a rate and the one with highest gets the seeds. Attributes will be a cruecial part of this, it will turn the least wanted thing into the most wanted :D
    So I guess this means creating a totally(almost, the priority setting is different!) new Priority system, I hope it won't fail D:

    Plan for how to do this:
    Have the old system, works great that old one. Then the AI checks the neighbours priority, then priority2 which include all it's stats in one large bunch, simple said. Then it sees which one has the lowest priority(not 2) and then, if several, it will check which one has highest priority2. Then attack! This will not happen if it's gonna follow a roid :P
    Some other time maybe, hard to do this thing :S

    -Ignore enemy asteroids being pwned by themselves, if they have 300% more seedlings than the enemy this can happen
    -Fix some o fthe attack bugs, like not attacking if the asteroid got no seedlings on it(not always, certain times appearantly...).
    [/list]
    « Last Edit: October 22, 2011, 07:49:54 AM by Aino »

    Aino

    • Ent
    • ******
    • Thank You
    • -Given: 4
    • -Receive: 30
    • Posts: 1,527
    • Eufloria: Yes
    Re: Man vs AI (New Map!)
    « Reply #26 on: October 22, 2011, 09:37:13 AM »
    And thus, MAI vs AI v4 is born. Now with FreeCam,AI Name toggler and LeaderBoard and my new MAI, improved alot, as it does much more, it defends easier and attacks faster(as far as I have knowledged).

    Also, Clean up your AI Mihhaelo :D

    I also got plans for the leaderboard, I'm gonna make a map :)

    w4tc

    • Achiever
    • Shrub
    • ****
    • Thank You
    • -Given: 0
    • -Receive: 0
    • Posts: 170
    Re: Man vs AI (New Map!)
    « Reply #27 on: October 23, 2011, 09:30:37 AM »
    That is o my I dont have words this time ......
    Go for it man !