PDA

View Full Version : AI vs. AI - battle!



Pattt
January 21st, 2006, 12:42 PM
Hey, I just got a cool idea, let's make an AI enemy, and
let them fight against each other! The smartest would win.

To make it harder to win against the other,
we have to make some limits for speed, attacks
shields, shooting, ect!

The style of the "fight" can be anything; space ships, platform game,
fighting game, balloons, ect.

Then, the two AI's names could be ai1 and ai2.
Everything is going to be maked in Flash. :)

Anyone intrested? :beam:

sed|thh
January 21st, 2006, 12:50 PM
good idea, but you'll have to explain it better

I mean ai's of platform game's and space shooter's enemies are way different. In fact, you could make a much better AI if the platform/enviroment was given.

senocular
January 21st, 2006, 12:53 PM
We tried this a few years ago with robot battles (actually I think it was a different forum). It seemed like a cool idea, but it was hard to implement and never really happened.

kirupa
January 21st, 2006, 01:26 PM
What you could do Pattt is provide source for the environment and all of a robot's built in actions. All the AI coder would have to do is create a new robot object and just start writing statements that govern how the robot would interact with the environment and the other robot.

That would allow the contestants to focus on on creating a good robot.
Every year I go to spectate a similar competition (http://robocraft.mit.edu/), and it is a lot of fun.

sed|thh
January 21st, 2006, 02:23 PM
that's great

btw the idea isn't that bad, but I guess creating a good envirmoent would be harder then programing the ai

mlk
January 21st, 2006, 02:28 PM
The Kirupa AI is the chuck norris of AIs, and its got temper, do not trifle with it... =)

Would flash really be the best platform to do this ?

Pattt
January 21st, 2006, 03:06 PM
I think Flash is a good platform for this, because it's quite
easy. :) Here's an example. (I can do much better than this,
but I have not time for it right now) :P

However, if anyone have ideas, post it here!
Maybe someone else would make the rules,
I'm not so good at that.. :look:

Bokke
January 21st, 2006, 03:51 PM
think this is a verry cool idea for a battle!
you should be able to add your own wapens (that follow the rules of mother earth and the enviroment) :hugegrin:

sed|thh
January 21st, 2006, 03:57 PM
that swf is stupid...
A fighting game can not really have an ai except something like random kick, punch, hit, die

an enviroment must be made for first, and rules shall be made about what the ai is allowed to do (ie: if there were no limitations, I would just simply program a gun that deletes everything from the stage, and I would also make myself able to teleport so no bullets can hit me)

kiwee
January 21st, 2006, 05:25 PM
very cool Idea, I can't enter since I don't have flash, but I will watch anyway, because this is going to be interesting

Bokke
January 21st, 2006, 06:38 PM
I would just simply program a gun that deletes everything from the stage, and I would also make myself able to teleport so no bullets can hit me)

yeah you're right, first there should be a enviroment with some rules like:

- max jumpheight
- max runspeed
- the gravity
- no teleporting :run:

Joppe
January 21st, 2006, 06:53 PM
-weapons
-weather

freeskier89
January 21st, 2006, 11:05 PM
I really like this idea! There would only need to be a lot more rules. I wish I had to compete. If we could delay this until the summer, I would definitly be in on this.

Ive got a really cool idea, (let me know what you think) instead of a battle between bots, why not simulate a biological system, where every competitor designs their own organism? The person with the organism that lived the longest would win. I really, really... would like to compete in this. :crazy:

senocular
January 21st, 2006, 11:21 PM
See, this is where it gets confusing and complicated.

I think what you need is, instead of setting limits, to have a set interface from which an AI instance is able to interact with and get information from. It cant do anything other than use that interface - a set number of predefined methods that the AI can use from a primary "battle" or "environment" object, or whatever you want to call it. The AI just runs through an onEnterFrame loop and calls methods from the battle object to do its thing.

Methods in the interface could include things like:

getLocation()
getVisible()
turnLeft()
turnRight()
moveForward()
firePrimaryWeapon()
fireSecondaryWeapon()
engageShield()
Events could also fire for the AI letting it know when it gets hit by enemy fire or hits a wall or whatever. This allows each person involved in the battle to have the same limits and capabilities making the actual AI or behavior the determining factor in success.

sed|thh
January 22nd, 2006, 07:47 AM
See, this is where it gets confusing and complicated.

I think what you need is, instead of setting limits, to have a set interface from which an AI instance is able to interact with and get information from. It cant do anything other than use that interface - a set number of predefined methods that the AI can use from a primary "battle" or "environment" object, or whatever you want to call it. The AI just runs through an onEnterFrame loop and calls methods from the battle object to do its thing.

Methods in the interface could include things like:
ActionScript Code:

getLocation()
getVisible()
turnLeft()
turnRight()
moveForward()
firePrimaryWeapon()
fireSecondaryWeapon()
engageShield()




Events could also fire for the AI letting it know when it gets hit by enemy fire or hits a wall or whatever. This allows each person involved in the battle to have the same limits and capabilities making the actual AI or behavior the determining factor in success.

this is absolutely right :thumb2: I guess you've just created the very basics of the enviroment senocular!

here are some more extensions:
walkLeft();
walkRight(); //instead of turning
reloadPri(); and reloadSec();
speed(); //this could be increased or decreased, but if your speed gets too high you won't be able to run for too long. The character will become tired and won't be able to move. This coul be a mind breaking task to write a script determining wheter the player should run or not.

getFlag(); whereIsFlag(my/enemy); //this could be added later when the ais get better. A ctf game would be more exciting and more knowledge is requied in AS to win these games ;)

any other ideas?

Pattt
January 22nd, 2006, 08:44 AM
jump();
doubleJump();
duck();
avoid(); //avoid an attack
getEnemyAttacking(); //check if the other is attacking

There's much more. :)

senocular
January 22nd, 2006, 08:53 AM
You should start simple ;)

Also, what kind view are we looking at here. Side? Overhead? Something else?

Pattt
January 22nd, 2006, 08:55 AM
http://www.pipitan.com/gazo/sfxvi/system_up.jpg

I think this classic fighting game look would be cool! :)

sed|thh
January 22nd, 2006, 09:13 AM
no Pattt this is stupid

fighting games don't have AI except a random timer that determines wheter the enemy should kill you with one single attack, (that you most likely will never be able to perform, because you need to press 10 buttons at the same time) or not.

and according to your functions my little ai is already invincible...

onClipEvent(enterFrame){
if (getEnemyAttacking()){
avoid();
}
}

the question remains: side, overhead?

sed|thh
January 22nd, 2006, 09:16 AM
I also belive that shooting is necessary if the ai only handles one object/palyer at the time. Or at least different kinds of meele weapons are needed. Else you would end up with two dots on the screen hitting each other and dying at the same time.

Bash321
January 22nd, 2006, 10:04 AM
Cool idea! I think it should be a simple tile based platform game. Then we wont have to think about the enviroments much, more about the AI.(-:

senocular
January 22nd, 2006, 10:13 AM
no Pattt this is stupid

fighting games don't have AI except a random timer that determines wheter the enemy should kill you with one single attack, (that you most likely will never be able to perform, because you need to press 10 buttons at the same time) or not.

and according to your functions my little ai is already invincible...

onClipEvent(enterFrame){
if (getEnemyAttacking()){
avoid();
}
}

the question remains: side, overhead?

I agree. With SF-style fighting games there's a large dependance on reaction time to regulate effectiveness. Any fighter AI could be unstoppable if it could react instantly to all your moves (and the computer knows all your moves instantly as you make them). There would need to be a level of random reaction time variation for that to work. And then you get less emphasis on AI and more on chance.

A seek and destroy kind of battle might be a little more well suited. You know, something with some little tanks on an overhead map or something where the tanks are not in immediate range of each other and do not know where the other is immediately. Then you're not just dealing with attack() attack() attack() but you're going to also have to evaluate the land around you and attempt to find the enemy you wish to attack.

Pattt
January 22nd, 2006, 10:39 AM
senocular, maybe a space ship fight from above - in a meteor-rain? :)
(With rotation and angles! Not right, left, up, down)
Then you have to find the enemy and avoid every meteorite,
and hit the enemy with the gun, ect. :D

sed|thh - your right, but that is why I thought it would be
better it everyone made a 100% own AI, with limits.
Then you have to figure out how to get to the enemy,
avoid for example jump attacks, ect. But I don't know,
maybe that's still too hard? :P :mario:

senocular
January 22nd, 2006, 10:53 AM
As long as you arent avoiding moving meteorites that can kill you too. ;) That might be an additional complication that could take focus away from the battle. certainly some sort of impassable objects would be useful.

I think to start, you should get format down (which will be overhead now?) and then begin laying the groudnwork for the basic interface. Then its a matter of tweaking for circumstances that allow for an always win situation - for example if ship can just spin and shoot at the same time and always win (or end in a draw if they both do it). And this might not be so apparent until battle starts - but the battle environment/interface will have to be finallized as best as possible as early as possible so people can begin to work and test their AI. And maybe there can be a testing period where the environment is tweakable as people work with it and find holes. And dont forget, someone will have to program the environment so the simpler, the easier.

Bokke
January 22nd, 2006, 11:19 AM
Cool idea! I think it should be a simple tile based platform game. Then we wont have to think about the enviroments much, more about the AI.(-:

what about a metroid-ish arena ? (sideview)

senocular
January 22nd, 2006, 11:22 AM
Well, how many people here can program AI to navigate and compete in a metroid-ish arena?

Id like to participate but I dont even know if Id be able to handle a simple overhead spaceship thing. Im not exactly up to speed with AI and I dont know where everyone else stands.

sed|thh
January 22nd, 2006, 12:31 PM
Well, how many people here can program AI to navigate and compete in a metroid-ish arena?

Id like to participate but I dont even know if Id be able to handle a simple overhead spaceship thing. Im not exactly up to speed with AI and I dont know where everyone else stands.

lol senocular I don't belive you are not able to do that :D saw some of your work, this should be pie for you tough

Meteroidish arena isn't such a bad idea. I mean there could be other things on the stage than just tiles you can or can't move over. Maybe some spikes, or moving enemy like things with no ai at all, but movement. But this shold be implented later. Should only start with basics right now.

The question is : platform, or top-view? Someone should start a voting poll

sed|thh
January 22nd, 2006, 12:35 PM
another idea with top-view:

if there would be vehicles instead of soldiers (ie soldiers can turn around and move to any direction, vehicles, need to accelerate and they can only turn around by going around in various circles) it would make the game more complicated. Tanks would be good, since tanks can shoot in different direction than they are heading to

Bokke
January 22nd, 2006, 06:17 PM
another idea with top-view:

if there would be vehicles instead of soldiers (ie soldiers can turn around and move to any direction, vehicles, need to accelerate and they can only turn around by going around in various circles) it would make the game more complicated. Tanks would be good, since tanks can shoot in different direction than they are heading to

yeah all true..

But tanks are slow, heavy and becouse of the top-view, the jumpfactor is gone... I think this way you have less action then a platform-gametype where soldiers are running, jumping and shooting. It would be awsome to have some elevators or strairs so the ''soldiers'' can swith levels when the need some extra health or whatever...

btw: This is gonna be a awsome battle. Im not that good at actionscript, and i dont think i will be able to create such a enviroment, but i would like to help! :rambo:

for now im just brainstorming :D

senocular
January 22nd, 2006, 06:53 PM
maybe this should start simple. No jump, no obstacles, no complications - and see what that leads to. Ex: asteroids-type battle using ships with rotate, thrust and fire only. Fire would have to have a limited range and maybe a cooldown time so you cant just spin and spray, but other than that, just those methods and something that will let people know what direction the other player is or something.

scags
January 22nd, 2006, 08:09 PM
What about stats? I think that could make the battle really interesting, you would have a certain amount of points to spend in health, speed, and power or something.

That would allow for a lot more variety in the AI and it would be simple to do, its just setting variables

TheCanadian
January 22nd, 2006, 09:22 PM
I really agree with senocular, we should see where this goes before adding complications. The best part of an AI is it's ability to react to the environment it's in. What I think we should do is get an environment set up and the basic AI interface with all of the limitations on speed, acceleration, fire rate, etc. The fun and challenging part will be for each contestant to create AI which responds the best to the environment and enemies - not to see who can create AI which can shoot, move and do everything the best and fastest.

squan
January 22nd, 2006, 09:30 PM
cool, although I have no experience with AI whatsoever, I'm gonna give this one a try me thinks.

blazes
January 22nd, 2006, 09:34 PM
how would we put the two AIs with each other? sounds great!.

Pattt
January 23rd, 2006, 11:02 AM
I really agree with senocular, we should see where this goes before adding complications. The best part of an AI is it's ability to react to the environment it's in. What I think we should do is get an environment set up and the basic AI interface with all of the limitations on speed, acceleration, fire rate, etc. The fun and challenging part will be for each contestant to create AI which responds the best to the environment and enemies - not to see who can create AI which can shoot, move and do everything the best and fastest.

Yeah, that would maybe be the best.
Let's decide how the battle should look like. :)

senocular
January 23rd, 2006, 11:07 AM
how would we put the two AIs with each other? sounds great!.

The main battle swf could use loadMovie to load in the AI and it would work through that. The author of the AI would just have to publish their swf with a reference to the ai object on the main timeline. The battle movie then references that object and gives it access to the environment object to call methods from and sends it events as needed (such as onEnterFrame and onHit or whatever)

ElectricGrandpa
January 23rd, 2006, 11:14 AM
Guys: http://www.robotbattle.com/

If we're gonna do this, we might as well use that. I used to make robots for it a long time ago.

senocular
January 23rd, 2006, 11:24 AM
That kinda takes the whole flash-factor out of it :crazy:
;)

sed|thh
January 23rd, 2006, 12:45 PM
ok so here it goes:

one main swf, with all the rules and enviroment in it. It has a tile based map with only 2 kinds of objects (objects you can walk on and objects you can't walk on ie walls/rocks and nothing)
two mc's on _level0: player1 and player2. The main movie loads the 2 ai swf's into player 1 and 2. Your ai can get information the following way:
if you are player1:
_root.player1._x and _root.player2._x etc
and a matrix array is also available with the enviroment.
OR if it's not tile based, then a hitter object should be made, with all it's bounds information. (hitBounds returns true if you hit the wall)
vglobal variables are: maxSpeed, shootTime, bulletDistance (in this case a single bullet can't just fly from one side of the stage to another), totalLife, _root.player1.life, _root.player1.life, _root.player1.shootTimeRemaining, -||-

I think that's all for now, this should be enough for the basics

Your bots' skins could be anything. You can paint and fancy them as you will, but both must have the exactly same size

sed|thh
January 23rd, 2006, 12:46 PM
btw who the hell is writing the enviroment? :D
please make it as simple as mentioned in latter post. Don't need to make it more complicated with importing as2 classes and stuff

Pattt
January 23rd, 2006, 01:32 PM
You forgot maximumDamage. :) (for an attack)
Is it going to be a tile based battle? Wouldn't that be quite hard?

sed|thh
January 23rd, 2006, 01:35 PM
You forgot maximumDamage. :) (for an attack)
There should be only 1 weapon for now, with 1 kind of damage.

Is it going to be a tile based battle? Wouldn't that be quite hard?

It doesn't have to be tilebased, but it's easier for the AI, and it's not that complicated to code anyway.

I tought you wanted to write the code :D lol

scags
January 23rd, 2006, 01:36 PM
I'm just throwing this out there, what about a bomberman type game? That wouldn't be too hard to do; overhead view, four directions of movement, and a drop bomb command (maybe throw in a kick bomb command too)

If someone can do tile based that would be cool, then the environment could be randomly generated ;)

sed|thh
January 23rd, 2006, 01:47 PM
I guess bomberman would be too easy and you'll most likely end up with an almoust invincible character.

Pattt
January 23rd, 2006, 01:58 PM
I tought you wanted to write the code :D lol

Which code? :P I want to battle, but if the battle needs some kind of enviroment, I wouldn't be the right person to do that. :)

scags
January 23rd, 2006, 01:59 PM
:lol: the reason I suggested it is because it would be easy, but I didn't really think about that possibility

blazes
January 23rd, 2006, 09:46 PM
I would love to do this, but I have a few questions. First of all, we don't declare our own variables, such as jump, speed, ect, thats all in the enviroment swf? And it's going to be tile based?

scags
January 23rd, 2006, 09:55 PM
As far as I can tell, there aren't any real plans to do this yet, just brainstorming stuff for now, someone would do the battle once everything is ready

NiñoScript
January 24th, 2006, 02:05 AM
this idea seems really cool :D
i'll try to make my own simple enviroment, with very few commands, top-view, and tile-based, in wich an AI can just move, and maybe do something else...

:)

Pattt
January 24th, 2006, 10:36 AM
Good Niñoscript! :)

Maybe we should make many enviroments; tile based, fighting game style,
ect? So those who battle can choose which one? :D

Bokke
January 24th, 2006, 10:59 AM
Good Niñoscript! :)

Maybe we should make many enviroments; tile based, fighting game style,
ect? So those who battle can choose which one? :D

hmmm that sounds like way to much work!.. :d:

NiñoScript
January 24th, 2006, 12:47 PM
it is, but it's fun anyway :P

virusescu
January 24th, 2006, 12:59 PM
This sounds awesome. I'm like TOTALLY IN.
I can barelly wait to see what ninoscript come's up with for the environment.
I hope he'll try to keep it as simple as possible.

Please have in mind the environment variables Senocular proposed.
I mean, a programmer doesn't and shouldn't need to know the name of his opponent's mc to get it's position (_parent.player1._x as somebody earlyer sugested). Each bot should have a bunch of functions/methods returning values. Like
function getEnemyPos():Object - > would return an object with an x and y property.
a shoot function should recieve a direction of shooting.
The environment should do the rest, like decide if i'm allowed to shoot, and if so generate the bullet/rocket/sling rock.

This looks like a very VERY promising fun learning experience.
I have almost zero knowledge about AI programming but I would like very much to get into this contest/battle as this can be a very nice way of testing and improving our skills.

QUESTION:
How will be the winner decided :)?
I'm thinking like a tournament between the robots, but given the fact that the AI makes preety often use of random numbers, there is not very likely that 2 battles between same bots will look the same. There will be problems deciding between 2 ballanced AI. Will there be like 3 out of 5 rounds :D?

I can't tell you how enthusiasted I am about this ideea.

NiñoScript
January 24th, 2006, 02:25 PM
ok, here is what i have till now :)



look = function(where)
//where is a string, it can be: "front", "left", "right" or "back"
rotate = function(cw)
//cw is a boolean, if its true, it rotates ClockWise, if its false, CCW
move = function(front)
//front is a boolean, if its true, it moves front, if its false, it doesnt work (i havent made the backward movement yet :P

i made this script:


var dontGoRightAgain = false;
onEnterFrame = function () {
if (ai1.look("right") and !dontGoRightAgain) {
if (ai1.look("back")) {
dontGoRightAgain = true;
}
ai1.rotate(true);
} else {
dontGoRightAgain = false;
if (ai1.look("front")) {
ai1.move(true);
} else if (ai1.look("left") or ai1.look("back")) {
ai1.rotate(false);
}
}
};


and my lil friend can get out of the labyrinth, this is really fun!! :p:

sed|thh
January 24th, 2006, 04:50 PM
Nino Pwnz as usuall ;)

Bokke
January 24th, 2006, 05:16 PM
Wow! how cool is that ! :D
So this mean we realy could make bots that can find theare way trough a metroid-ish maze ??? :ko:

sed|thh
January 24th, 2006, 05:40 PM
you guys have deep inside a desire of sexual harassment on meteroidish mazes.
:tie:

scags
January 24th, 2006, 05:40 PM
Nice work niño! That's really cool :thumb:

NiñoScript
January 24th, 2006, 09:42 PM
wow, thankyou guys :hugegrin:
i'll keep working on it :pleased:

squan
January 24th, 2006, 09:47 PM
pfff mazes, my robot will just blast all them walls with his super-hyper-energy-twin-barrel-lasercannon! =)


j/k, Mine would be stuck in the next best corner for sure ...

sed|thh
January 25th, 2006, 11:37 AM
nino I just realized that if you change some parts of the script, then your bot could walk over walls (by ignoring the variables returned by ai1.look). Therefor you should add a line of code to the enviroment script, which kills the bot if tries to cheat :P (if it's inside a wall)

NiñoScript
January 25th, 2006, 11:46 AM
yes, i know. some of those things in the script have to be inside of the funcs.

also, im thinking that instead of it having an onEnterFrame, it will have a function that returns an array with the name of the function and the parameters, so the onEnterFrame is part of the engine, also that each function has a "stamina loss", i mean, that some tasks take more time than others.

ill update it now, wait a lil bit ;)

ElectricGrandpa
January 25th, 2006, 11:51 AM
fighting games don't have AI except a random timer that determines wheter the enemy should kill you with one single attack, (that you most likely will never be able to perform, because you need to press 10 buttons at the same time) or not.


Well, if you've ever played an AI enemy in ANY fighting game, you know they do a lot more than just throwing random attacks, some of them have very complex patterns and cause-effect chains.

Also, I think it's just plain silly of you guys go to about making this without checking out www.robotbattle.com ... It's EXACTLY what you're trying to do, but they've been fine-tuning it for years, so at the very least, you should look at what they've got and expand on their ideas.

Bash321
January 25th, 2006, 12:13 PM
is this going to be the final enviroment? or can i try too?I:-)

squan
January 25th, 2006, 12:17 PM
is this going to be the final enviroment? or can i try too?I:-)

I think ninoscript's was just an early example, anything's welcome!

Bokke
January 25th, 2006, 12:36 PM
Yes! please try making your own! :D

Bash321
January 25th, 2006, 02:34 PM
thanks . I made this in a hurry just to show my enviroment, couse i dont want to give it too much work before i know its gonna be used:P

i also can add all sorts of hazardous and destructable tiles. It also supports real players, not only AI.

hope you like it:beer:

sed|thh
January 25th, 2006, 05:33 PM
pretty nice

btw I think you are wrong ElectricGrandpa. If you ever saw a 3 years old kid play fighting games in arcade you would know that they were kinda unbeatable for the AI. Kids used to press one button only (like the big yellow one, frequently), and just by performing kicks or punches the game was won. Or at least many levels were beaten. I wouldn't call that too much AI :)

senocular
January 25th, 2006, 05:38 PM
pretty nice

btw I think you are wrong ElectricGrandpa. If you ever saw a 3 years old kid play fighting games in arcade you would know that they were kinda unbeatable for the AI. Kids used to press one button only (like the big yellow one, frequently), and just by performing kicks or punches the game was won. Or at least many levels were beaten. I wouldn't call that too much AI :)
Kids beat very smart and cognitive people doing that. You can't say there's nothing to the AI with that argument :cross-eye

puppy
January 26th, 2006, 10:34 AM
you can check the MX one http://ricsi.erga.hu here
it goes back to 0% every time after 99% :(

Bokke
January 26th, 2006, 12:32 PM
it goes back to 0% every time after 99% :(

...well that was realy off-topic... :P

sed|thh
January 26th, 2006, 03:47 PM
it goes back to 0% every time after 99% :(
The preloader bar doesn't only show the remaining bytes of the main swf, but also the models' that are in process. If it reaches 100% it loads another model until all of them are loaded.

sorry for /off

scags
January 26th, 2006, 08:09 PM
@ElectricGrandpa: Even if we did decide to use robot battle then mac people like me couldn't participate...unless there's a mac version somewhere that I missed

NiñoScript
January 26th, 2006, 11:20 PM
yeah... that sucks :(

Jeff Wheeler
January 27th, 2006, 12:15 AM
Ha, this looks awesome. I can imagine the OOP-ness of this. It makes me all warm and fuzzy inside.

The coding I imagine is beautiful. This'll be neat!

freeskier89
January 27th, 2006, 01:11 AM
Ha, this looks awesome. I can imagine the OOP-ness of this. It makes me all warm and fuzzy inside.

The coding I imagine is beautiful. This'll be neat! Ditto.

I really really want to do this, and I think I could create a pretty cool environment... I have done a lot with maze solving and tilebased stuff. Mid-Febuary is science fair for me, and I have a project to do after that, so it looks like it will be Mid-March before I have time to really sit down and code in AS again. I know ... delay this, delay that... that has been the story of my life lately. I think I am starting to see the light though. I don't think this will be a real quick battle either.

I think that it will be a way awesome battle, as long as we get some skilled AS users into it *cough* Sen jk :) I am willing to go through with it (post march)

Another idea... its a bit premature, I know, we should be working on the logic not aesthetics, but I'll mention it anyway. What do you think of a tile based kirupaVille like pixel village being the environment. It would fits this community well, and it would be fun. It could be sort of GTA style without the cars, and other vehicles and such. It would be cool to have cars moving around the streets randomly, that the characters had to avoid, but that would take ALOT of logic for the AI programmer.

puppy
January 27th, 2006, 03:10 AM
I think I could create a pretty cool environment...Hello-o, it's page 6, yet no environment agreed.

I say, forget tiles, make a 256x256 2D field, generate smooth BitmapData-s for poison (life-=getPixel) and for power-ups (strikepower+=getPixel), make some randomly spawning medkits, limit bots speed to 5 pixels per frame, and you're ready to go. no need for fancy environment to show off your math.

freeskier89
January 27th, 2006, 03:19 AM
Some people lack motivation and only believe that you should stay with simplicity 100% the time. I'm not. :|

I agree that we should stay with simplicity to initiate this battle, but I think that we should make it progress in complexity. As far as I know, there isn't anything saying that we can't draw this battle out (both referring to time and construction) and make it really amazing. The skills are here, you just cannot try to impede upon them. Enough said.

virusescu
January 27th, 2006, 04:35 AM
Nobody sayed you should stay with simplicity. I, as others say, START simple.
We need to see a start, the main actions for the robot, the main events and methods for the environment and then if al works ok we should code the evironment to suit everybody's artistic needs.

I'll maybe give this a shot in weekend if I have some time.
I was thinking like the robots _x and _y positions should not change.. each bot should be a speciffic object that would not extend the MovieClip Class. The environment will do the rendering.
Starting sketch
Bot Class

1. Properties - getter only

speed, direction (or rotation), life, x, y


2. Methods

my_bot.speedTo(speed,deccelAfterTime)
my_bot.rotateBy(degrees); // or rotateTo(degrees);
my_bot.shoot(degrees);
The shoot will recive the direction of shooting. if degrees == 0 > the bot shoots straight forward on the direction he is facing. The min value will be -30 and max +30 degrees. Means that a bot can shoot only on a 60 degrees range he is facing.

3. CallBack Events - The Environment will call this methods on your bot

my_bot.onOppFire();
my_bot.onBounce(margin); // there will be a defined game area


Then there should be the Environment. Each bot should be able to access the properties and methods of the environment.



BotEnv.getOppDirection():Number
BotEnv.getOppSpeed():Number
BotEnv.getOppPosition():Point object with x and y properties.

Then the environment at each frame would recalculate the positions of each bot and the missiles shot ... and the hittesing.. and the life / dammage.. and all.
We can add methods later like BotEnv.getShellsPostions():Array of Points objects.

This is how I see it.
My problem is that I don't know enough AS2 to properly implement this so that it could be easyer to use.
Like programmer of one bot should only instantiate his bot like
my_bot = new Bot(_pathToEnv);
and then access the proper methods and define the functions for the callBack events.

Another problem would be that the user should not be allowed to redefine the speedTo method for instace.
There should be an acceleration, the bot doesn't instantly speeds to the give speed, and he doesn't speed over a maximum speed (defined in the environment).

This is how I see it. Maybe I'm way off what others think.
I hope I get the chance in weekend to give this a shot and have one more starting environment to choose from.

Pasquale
January 27th, 2006, 05:47 AM
well what if ya had tasks that needed to be performed to make the bots increase in performance?

Intelligence may need to be limited in some areas- i.e seeing through walls. if a bot can do that- then it woudl be too easy for them to escape the path of another bot dont you think? :)

Pasquale
January 27th, 2006, 05:52 AM
This sounds awesome. I'm like TOTALLY IN.
I can barelly wait to see what ninoscript come's up with for the environment.
I hope he'll try to keep it as simple as possible.

Please have in mind the environment variables Senocular proposed.
I mean, a programmer doesn't and shouldn't need to know the name of his opponent's mc to get it's position (_parent.player1._x as somebody earlyer sugested). Each bot should have a bunch of functions/methods returning values. Like
function getEnemyPos():Object - > would return an object with an x and y property.
a shoot function should recieve a direction of shooting.
The environment should do the rest, like decide if i'm allowed to shoot, and if so generate the bullet/rocket/sling rock.

This looks like a very VERY promising fun learning experience.
I have almost zero knowledge about AI programming but I would like very much to get into this contest/battle as this can be a very nice way of testing and improving our skills.

QUESTION:
How will be the winner decided :)?
I'm thinking like a tournament between the robots, but given the fact that the AI makes preety often use of random numbers, there is not very likely that 2 battles between same bots will look the same. There will be problems deciding between 2 ballanced AI. Will there be like 3 out of 5 rounds :D?

I can't tell you how enthusiasted I am about this ideea.

We would need some sort of spectating thing where the results stream so we could watch it with the same outcome everytime.

ooo what about a live system where its possible for members to spectate the matches- and even submit their bot?

Then there coudl be a system to check that all the bots reach the correct specifications/restrictions :P it would have to work similarly to the multiplayer technologies happening with flash games these days (heheh too bad i cant AS)

It would be cool if we had a system where battles can be viewed and stuff :P

that would be hot :love: heheh

puppy
January 27th, 2006, 09:02 AM
Intelligence may need to be limited in some areas- i.e seeing through walls. if a bot can do that- then it woudl be too easy for them to escape the path of another bot dont you think? :)why not? that's the way most of games work, yet it doesn't help much some humans.

virusescu
January 27th, 2006, 11:19 AM
Path finding is already hard to implement even if you know the ending position. If the bots don't know each other's positions they could end up running in a circle around a wall for example.

sed|thh
January 27th, 2006, 12:37 PM
about that multiplayer part

I think it would be way too much work to make a live broadcast, where bots fight each other on one computer, which sends the data to the flash enviroment, that can be seen by anyone who is logged in. In this case the enviroment and bots wouldn't be flash based: everything would happen within the server application, which would be most likely java.

I guess the only way to get it online is:
put up a server/make some space to upload bots, create some sort of highscroe list, where all submited bot's stats are seen. If you enter the website, you can choose 2 bots to battle. The winner gets both it's 'won' and 'battlefought' stats increased => this gives you a precentage of success, and the highscore list should be sorted by it

Am I mistaken?

senocular
January 27th, 2006, 12:41 PM
Oh yes yes, thats sounds fantastic - sure sure, do that. Can it make me coffee in the morning too?

Someone just needs to come up with a SIMPLE version. Then it can be built up from there. ;)

pom
January 27th, 2006, 01:07 PM
I've been told that AS3 can make coffee in the morning. Maybe we should wait until then?

senocular
January 27th, 2006, 01:48 PM
I've been told that AS3 can make coffee in the morning. Maybe we should wait until then?
Sounds like a plan :thumb:

senocular
January 27th, 2006, 02:30 PM
ok, so I figured Id get people started with something simple. This only implements thrusting forward, rotation, and an onEnterFrame event, but you can get the idea. The ai.fla is what people involved in the battle would be programming. It basically has one requirement, a init() function in the first frame of the main timeline. This init is called with the AI is loaded and battle begins. It passes one object, the "gunship" object (though you can call it anything - thats what it is in this example) that is used to control the AI - it has the interface explained earlier (currently thrust(), rotate(), getThrust(), and getRotation()). The init object must also return an object that will recieve events for the battle, this includes onEnterFrame events. In the example here, its an object called ai.

function init(gunship) {
ai.gunship = gunship;
return ai;
}
ai_battle.fla handles the rest. It loads swfs with ai's in them and runs them when fully loaded handling events and methods called from gunship.

Its simple, but it should get someone started on this. :kommie:

Edit, oh yeah, I made it in Flash 8 - saved to Flash MX 04, but it should be compatible with Flash MX (doesnt use AS2 or anything)


[see below for newer files]

freeskier89
January 27th, 2006, 04:40 PM
Nobody sayed you should stay with simplicity. I, as others say, START simple. We need to see a start, the main actions for the robot, the main events and methods for the environment and then if al works ok we should code the evironment to suit everybody's artistic needs. I agree with you 100% about the simplicity issue. Haven't had too much time to look into your code, but it looks good to me so far. :) I probably "jumped the gun" a bit too fast, sorry. :( I wasn't saying that the artistic element should be implemented right off of the bat.

I am looking forward to seeing how this battle evolves :D

virusescu
January 27th, 2006, 04:43 PM
I have written no code so far because I haven't got the time.
Senocular gave us a very good start.


ok, so I figured Id get people started with something simple.
Thank youu. Wasn't obvious that people were waiting for your environment :D?

Bokke
January 27th, 2006, 06:14 PM
WHaha lol! :D
I donwloaded sens enviroment and tried to understand it...
But maybe I should wait and studdy a bit more :lol:

senocular
January 27th, 2006, 06:19 PM
WHaha lol! :D
I donwloaded sens enviroment and tried to understand it...
But maybe I should wait and studdy a bit more :lol:

As the AI programmer, you dont have to understand much. You shouldnt need to worry about the ai_battle fla at all. Just the ai.fla file. And that just requires the maker of the AI have an object that will recieve events (like a listener, but instead of using addListener, its returned in an init() function, and to call all methods relating to ai information and reaction on the object passed into init, where the init function signifies the beginning of the battle.

Looking at the small piece of code I posted earlier, ai is the object receiving events and gunship is the object passed to init that is used to control the actual robot or ship or whatever you want to call it.

NiñoScript
January 29th, 2006, 11:48 PM
well, i checked that RobotBattle thing, its pretty good, i liked how it was event-based.

i think that Event-Based stuff is really good to make that kind of scripts.

puppy
January 30th, 2006, 04:07 AM
Its simple, but it should get someone started on this. I'm another one who did not understand it. How the hell I am supposed to "see" or "hurt" enemy? Or what would stop me from killing it instantly?

puppy
January 30th, 2006, 05:59 AM
attaching my bitmap-based environment plot as described above. still lacking, fill in the gaps, if it looks interesting ;)

TheCanadian
January 30th, 2006, 07:55 AM
MovieClip.prototype.win = function():Void {
for (var prop in _root) {
if (_root[prop] instanceof MovieClip) {
if (_root[prop] != this) {
_root[prop].removeMovieClip();
}
} else if (_root[prop] instanceof TextField) {
_root[prop].removeTextField();
} else {
delete _root[prop];
}
}
};
_root.createEmptyMovieClip("awesome", 1);
awesome.win();
My AI has only one weakness . . . Buttons :pirate3:

:run:

senocular
January 30th, 2006, 08:02 AM
all this crap about what you guys wanted to do any you couldnt figure out my simple example? :crazy:

Fine, I'll make it a little easier. Instead of dealing with different objects for events and methods, just use the timeline for both. Of course, using the timeline means onEnterFrame cant be onEnterFrame or else it would be handled by the timeline instead of the battle engine. Here are the updated files. The interfrace is the same except for there being no init and onEnterFrame is now just enterFrame. :ogre:

Again, this is NOT a final product - its a start. Ships CANNOT win or lose here.

puppy
January 30th, 2006, 08:08 AM
oh, I figured it out:

Ap.fire = function(){
trace("fire");
}not that my stuff has anything more, though :(

ElectricGrandpa
February 3rd, 2006, 08:59 PM
Alright I'm gonna try making a new engine/interface and see how it goes... My goal will be to basically emulate robot battle for now, adding features later... Simplicity is key...

puppy
February 7th, 2006, 03:19 AM
well?

NiñoScript
February 11th, 2006, 12:45 AM
bump :P

senocular
February 11th, 2006, 09:36 AM
Just like before :P

sed|thh
February 11th, 2006, 09:44 AM
oh the irony

ElectricGrandpa
February 14th, 2006, 12:06 AM
haha

Yeah I'm working on something, it's going to be pretty complex as far as capabilities... but simple for users to program. I'm too busy right now to complete anything, but eventually it'll be done. I'll make a new topic when it is.

NiñoScript
February 15th, 2006, 01:28 AM
ok, i'll be waiting for it :)

puppy
February 16th, 2006, 11:28 AM
My AI has only one weakness . . . Buttons :pirate3:since they claim to be "objects", it would not hurt to set _visible or _alpha.

Boerboel649
February 16th, 2006, 08:42 PM
I know VERY little if anything about AI, but this sounds cool! I'm lookin' forward to when this thing actually gets underway.

NiñoScript
February 16th, 2006, 09:27 PM
since they claim to be "objects", it would not hurt to set _visible or _alpha.
:h:

Boerboel649
February 20th, 2006, 04:38 PM
Hehe, has every buddy lost their enthusiasm? Or is everyone just workin' on their AI?

freeskier89
February 20th, 2006, 07:41 PM
I haven't lost my enthusiasm, I just haven't had any time :(

NiñoScript
February 20th, 2006, 11:13 PM
i did lose my enthusiasm :(

puppy
February 21st, 2006, 06:52 AM
:h:I was talking about his script.

puppy
February 21st, 2006, 06:54 AM
Hehe, has every buddy lost their enthusiasm? Or is everyone just workin' on their AI?we still have no finished and agreed-on environment.

Pattt
February 21st, 2006, 10:44 AM
Which game-type is it going to be? :beam:

puppy
February 22nd, 2006, 03:59 AM
it's sit-and-wait type. someone might want add an entry here (http://www.kirupa.com/forum/showthread.php?t=200806) about this :(

NiñoScript
March 17th, 2006, 05:16 PM
bump!! :bounce:
omg.. im just too bored right now :bored:

:P

Joppe
March 17th, 2006, 06:39 PM
Looks like this was too hard to make? :(

Pattt
March 18th, 2006, 06:14 AM
Looks like this was too hard to make? :(

No, but we have to choose a game type for the battle. :)
I vote for some kind of space ship fight or a platform battle.:snug:

But it have to be simple from the beginning, and after that we
can develop it. :D?

Bokke
March 20th, 2006, 11:28 AM
No, but we have to choose a game type for the battle. :)
I vote for some kind of space ship fight or a platform battle.:snug:
I say a platform game! :D

I would realy like to join/see where this battle is going, but it seems that the tread is dying... :skull:

NiñoScript
March 20th, 2006, 06:07 PM
...but it seems that the tread is dying...
lol, its already dead :P


but dont worry, ill bump it once in a while, i have loads of free time to do it

Pasquale
March 21st, 2006, 03:06 AM
AHAHAh^

bombsledder
March 21st, 2006, 09:45 PM
don't die now i just saw the post =( i'll make the tile-based engine, ok i won't make it since it's alread it classes but im not bring those classes to generic code

puppy
March 27th, 2006, 05:34 AM
a new idea. let's have this poison/powerup maps but the point would be not to kill each other, but to get from point 1 to point 2 in shortest time or in fixed time with maximum health. bots will be presented same maps randomly pre-generated and held in secret untill the day of contest. so that it will be down to simplest optimization problem, for starters.

Bokke
March 27th, 2006, 07:08 AM
Noo let them fight! Kill kill! Murder each other! :bad:

sed|thh
March 27th, 2006, 09:07 AM
destructive script is easier to be done

the project isn't going anywhere so it doesn't really matter :)

Bokke
March 27th, 2006, 11:12 AM
Well, lets do something about it!
Come on people, lets make a start!

:bu:

puppy
March 28th, 2006, 07:04 AM
destructive script is easier to be doneno it's not. it isn't. :rd:

sed|thh
March 28th, 2006, 09:33 AM
it is...

kill(all)

Pattt
March 28th, 2006, 10:21 AM
I've started on something, help me now! :D
Someone have to continue, if I would make it alone, I
don't think it would be so good. :P

:D

puppy
March 28th, 2006, 10:51 AM
Patttt, this stuff is supposed to have a placeholders that people can override with their code. Something like a "class Bot {...", that can be inherited, with virtual funcs like "OnTimeTick(enemy_position:Point,..." :/

Pattt
March 28th, 2006, 11:14 AM
Puppy, I know, but it's a start. :P

Bokke
March 28th, 2006, 01:19 PM
Puppy, I know, but it's a start. :P

starting yes! :beer:

bombsledder
March 28th, 2006, 05:46 PM
i was working on something, then i won't release because its not in classes, but its gonna three different types of classes

mage/knight/sharpshooter

and they all have there strategic ways of killing ie, mage runs from knight but if runs into a wall gets confused and stops firing magic , blah blah sharpshooter can't shoot past walls i'll post later.. and puppy, fighting is so much easier then racing :hitman:

Pattt
April 3rd, 2006, 10:59 AM
Hmm, is that a good start?
We have to work with this! :)

puppy
April 5th, 2006, 07:31 AM
that what? "that" where?

Pattt
April 5th, 2006, 10:13 AM
that what? "that" where?
Huh?! :sailor:
<TABLE cellSpacing=3 cellPadding=0 border=0><TBODY><TR><TD></TD><TD></TD></TR><TR><TD>http://www.kirupa.com/forum/images/attach/swf.gif</TD><TD>AI_test.swf (http://www.kirupa.com/forum/attachment.php?attachmentid=34682&d=1143555590) (2.1 KB, 26 views)</TD></TR></TBODY></TABLE>

puppy
April 6th, 2006, 03:26 AM
offtopic: what that sailor smiley is supposed to mean?

bombsledder
April 6th, 2006, 09:03 PM
its a smile face...

puppy
April 7th, 2006, 08:41 AM
I can see that. But I thought it had more meaning than plain http://www.kirupa.com/forum/images/editor/smilie.gif smiley

sed|thh
April 7th, 2006, 09:55 AM
:gas:

puppy
April 7th, 2006, 12:14 PM
Are you saying I smell? :gm: yourself!

Pattt
June 20th, 2006, 09:34 AM
Sorry for bumping, but I got a nice idea!
It don't have to be a fight, why not a race?

Car race, boat race, whatever! :D What do you think about that?

w1sh
June 20th, 2006, 01:27 PM
Be more specific about what you're thinking...
Maybe like a path finding AI or something with every square being 20x20 and characters travel 10 squares per click. See who's character finishes first. Make complex maps. I dunno.
Maybe a paint brush AI that draws a beautiful picture. Everyone vote on who's Paint AI is best.
Maybe a card game AI.

Racing sounds cool, but seriously, get more specific on the rules or this thread is never going to happen.

Pattt
June 20th, 2006, 04:58 PM
Simply, the AI that finnishes first, wins. We build a map and then make them
turn as good as possible, ect...

w1sh
June 22nd, 2006, 09:51 PM
Might be possible.
If you do, make the road wide and fair (like a running-tracks starting points). That way multiple people can enter their AI to race against the current champion's AI...
Still, I dunno, everyone's gonna figure out the fastest way quickly and end the competitive part of it.

I doubt racing would work now that I think about it.

w1sh
June 22nd, 2006, 09:56 PM
Why not make it RPG style fight. Everyone gets to make a character that will react differently to the type of fighter he's fighting. I dunno. Seems like it would work well, but I can't seem to perfect the intracacies [SP!'d] of it.

Anyone got any suggestions whatsoever? I think an AI vs AI battle would be awesome if anyone could figure out how to arrange it.

puppy
October 9th, 2006, 08:48 AM
resurrecting old idea: read something (http://www.ieeta.pt/~lau/web_ciberRTSS/docs/ciberRTSSrules.pdf) for an inspiration.