|
#1
|
||||
|
||||
|
There was lengthy discussion at kirupa's battle place for quite a few monthes already, which can be summarized by first senocular reply:
Quote:
|
|
#3
|
|||
|
|||
|
looks like a nice idea. i looked at it, works perfectly. but i don't really have an idea about how the whole thing works. you got some more explanation about what inColors, inDistances means and about how the engine wrks in general?
niq |
|
#5
|
||||
|
||||
|
well if niq didn't get it, I must have been in real rush
![]() well there are 36 directions (angles) that the bot can "see" in. inColors is supposed to be array of "colors" visible in every direction. "colors" are represented by numbers according to "color map" (click "info" button); using inColors you can determine what's there (pickable bullet, enemy, wall, or flying bullet). inDistances are simply distances to things in every direction. whole thing works by polling javascript function from onEnterFrame to exchange in/out data. EDIT: I just thought I'd put sample code here for people to not have to click too much, here it goes: Code:
if (!this.inHasBullet) {
// no bullet, let's get it
var bulletAt = -1;
for (var i=0; i< this.inColors.length; i++) {
if (this.inColors[i] == 2) {
bulletAt = i; break;
}
}
// go up until we see it
this.outMoveAngle = (bulletAt < 0) ? 27 : bulletAt;
this.outMoveSpeed = this.inMaxSpeed;
} else {
// look around for enemy
var enemyAt = -1;
for (var i=0; i< this.inColors.length; i++) {
if (this.inColors[i] == 1) {
enemyAt = i; break;
}
}
if (enemyAt > -1) {
// throw the bullet
this.outThrowBullet = true;
this.outThrowAngle = enemyAt;
this.trace("Throwing @" + enemyAt);
}
// up we go
this.outMoveAngle = 27;
this.outMoveSpeed = this.inMaxSpeed;
} |
|
#6
|
|||
|
|||
|
ok, thanks, i think i'm getting there how it works. i'll spend some time in deep meditation to finally understand your and generate my own script. sth like that thingy should become the contest for flashmove's next anniversary.
@thenovice: just copy and paste puppy's script into the bot's behaviour, then press "fight!" good night - good fight, niq |
|
#9
|
|||
|
|||
|
second bot...
Hi board, my first post here...
I love the idea of the AI battleground, so much so that coding this little dude has eaten up most my Sunday :O) This is my first attempt at AI and i don’t claim to be a great coder so please don't laugh. the code is elsewhere so if i update it, u guys always get the most recent. So… here 'he' is complete with evasive routines etc… My bot Only other bot Battleground Cheers. BTW make sure you paste the code in the right box. (most in the top one- backward i know...) |
|
#10
|
||||
|
||||
|
hello all, just wanned to say it's nice to see interested people. since you are actually using it, I took my time and added reset button (as promised). also, there is a breaking change: you can pick up only 1 bullet. basically, that was the idea; the "feature" that you could pick more bullets was actually a bug. so, add this.inHasBullet check. also, I noticed that sometimes it is possible to walk through walls, but I don't feel like fixing it now
thanks scooby for your time, and sorry to break your script, again ![]() |
|
#11
|
|||
|
|||
|
np puppy,
I'll take a look at this tomorrow and fix it. I look forward to additional feature and maybe improved visuals. Say... if you need any assistace with developing this give me a shout, I think it has real potential & id be happy to help, im not bad with drawing in flash either... I read comments on some other board you had posted about how people might not be participating because they don’t see this as a challenge. The thing is… these boards have visitors and member who have a wide range of skill so the AI battle must appeal to some. Being my first AI attempt, I thoroughly enjoyed the conception of my little ‘creature’, watching him make his own decisions in battle etc . Anyway id like to see an advanced coder set the standard with a ‘difficult to beat’ droid but this is no good if any amatur can come along, make a few tweaks, not really understanding the code, and claim it their own work.At this stage we need only a small number of people interested enough to create their own script. Interest and competition will soon grow I hope you're open to suggestiong because I have some thoughts. One neat feature would be to have the ability to link to script that is hidden somehow. Maybe a link to a compliled swf (not sure how this would be done...) Once you have the ultimate droid you wouldn't want people stealing your best bitskeep up the good work ![]() |
|
#12
|
||||
|
||||
|
actually that was some quick and poor code there. I'm not sure if this is good idea to develop it further; maybe it's better to re-write it from scratch. I mean I can give you fla, no prob, if you want to, but it's just not worth of it, really.
as for hidden scripts... why would you care if someone steal them? there's no money here, after all. you can run your script through some sort of javascript obfuscator, but, I say if you do not want to share you script, then do not post it on the Internet, that's simple. on the other hand, those little tweaks could be fruitfull on their own, like giving you an idea you would never come up with on your own, etc. |
|
#13
|
|||
|
|||
|
Hey, that's cool
I just found this AI game. it's really addictive! I made a script that canes all those other scripts too! Mainly because it avoids bullets pretty well. But, you, whoever made it - scooby??, should get it more organised into a competition, with randomly generated mazes or startpoints so it doesn't always play out the same. It'd be cool to see how intelligent they can become.
Anyway here's my amazing bot. Tho it gets stuck sometimes if the opponent isn't around. I was putting in some randomizing to stop it getting stuck, when I accidently refreshed the page and lost it!! Aarh! But it still wastes all the other scripts I've found on here most of the time. this.outMoveSpeed = this.inMaxSpeed; this.outThrowBullet = false; // Find a bullet closestbullet = 1000; if(!this.inHasBullet){ for(lookang=0;lookang<36;lookang++){ if (this.inColors[lookang] == 2){ if(this.inDistances[lookang] < closestbullet){ bestangle = lookang; closestbullet = this.inDistances[lookang]; } } } } // Find open spaces if (closestbullet == 1000){ maxdist = 0; for(theta=-9;theta<=9;theta++){ lookang = this.outMoveAngle + theta; if (lookang > 35) lookang = lookang - 36; if (lookang < 0) lookang = 36 + lookang; if ((this.inDistances[lookang] > maxdist) && (this.inColors[lookang] == 0)){ maxdist = this.inDistances[lookang]; bestangle = lookang; } if(maxdist < 15){ bestangle = bestangle - 18; if(bestangle < 0) bestangle = bestangle + 36; } } } // Find enemy if (this.inHasBullet){ foundenemy = false; for(lookang=0;lookang<36;lookang++){ if (this.inColors[lookang] == 1){ bestangle = lookang; this.outThrowAngle = lookang; foundenemy = true; } } } // Dodge bullets if(!dodging && this.inMaxSpeed >= 3){ for(lookang=0; lookang<36; lookang++){ if(this.inColors[lookang] == 3){ dodging = true; theta = lookang + 11; if (theta > 35) theta = theta - 36; maxdist = this.inDistances[theta]; bestangle = lookang - 11; if (bestangle < 0) bestangle = bestangle + 36; if(this.inDistances[bestangle] < maxdist) bestangle = theta; this.outMoveAngle = bestangle; } } } // Finish dodging bullets if(this.inMaxSpeed >= 3){ dodging = false; for(lookang=0; lookang<36; lookang++){ if(this.inColors[lookang] == 3) dodging = true; } } else dodging = false; if (!dodging) this.outMoveAngle = bestangle; if (foundenemy && (this.inDistances[this.outMoveAngle] < 80)) this.outThrowBullet = true; |
|
#14
|
||||
|
||||
|
hey ho, if you divide the number of people who have made their scripts (4) by the number of people who knew about this thing (758 views for this thread only), you would end up with less than 1%
there is no free way to "get it more organised into a competition", and I do not feel like spending neither tons of money for prizes and ads campaign nor hours of time perfecting the code. |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Free hosting for skilled folks | aerobus | Work/Job Opportunities | 0 | 08-05-2002 04:36 PM |
| Folks check this out...:) | Sidomatic | Site Check | 2 | 09-12-2000 03:29 PM |
All times are GMT. The time now is 01:43 PM.




TODAY'S POSTS
Commune




thanks scooby for your time, and sorry to break your script, again
(not sure how this would be done...) Once you have the ultimate droid you wouldn't want people stealing your best bits

