Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ai for any char
#1
:) 
Finally i am on the lfe forum, for so long i was having problems with registering on this forum, but i am now here to give lf2 chars human thinking ai to defeat any human player and also to do more things. Now this is the ai i have been making for int ego ai, about dodging attack which is very simple:


    AI-Code:
int ego(){
 
//DODGE ENEMY ATTACK
if (target.state == 3 && abs(target.z-self.z) < 19
&& (self.x-target.x)*((self.facing?1:0)*2-1) > 0
&& (self.x-target.x)*((self.facing?1:0)*2-1) < 70){
down(1,1);return 1;
}
if (target.state == 3 && abs(target.z-self.z) > 19
&& (self.x-target.x)*((self.facing?1:0)*2-1) > 0
&& (self.x-target.x)*((self.facing?1:0)*2-1) < 70){
up(1,1);return 1;
}
 
return 0;
}



So now you can select it and copy and paste it to try it out for any char.
Reply
Thanks given by:
#2
Heya, welcome to LFE!

Something to keep in mind is that this is just a snippet, you'll have to manually load a target first, otherwise this will not work at all. I have felt so free to add that:
    AI-Code:
int ego(){
 
for (int i = 0; i < 400; i++) {
 if (loadTarget(i) == 0 && target.team != self.team) {
//DODGE ENEMY ATTACK
if (target.state == 3 && abs(target.z-self.z) < 19
&& (self.x-target.x)*((self.facing?1:0)*2-1) > 0
&& (self.x-target.x)*((self.facing?1:0)*2-1) < 70){
print("Dodge down!\n");
down(1,1);return 1;
}
if (target.state == 3 && abs(target.z-self.z) > 19
&& (self.x-target.x)*((self.facing?1:0)*2-1) > 0
&& (self.x-target.x)*((self.facing?1:0)*2-1) < 70){
print("Dodge up!\n");
up(1,1);return 1;
}
}}
 
return 0;
}



This will just try to avoid close-combat-situations; projectiles are completely ignored (as those frequently run on states 3xxx, 2xxx, or 1xxx). Overall, this caught me off-guard a few times due to the AI not blindly walking into random punches but it's not fast enough to react to dash attacks and the like. Still a good way to go until it's a truly evasive AI! :wobble:
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by:
#3
Yes Silverthorn, you are free to show any of your ai that you create for a char and thanks for showing your dodging move ai, also i will be showing some more ai that i will be creating for every char or new char that is on this lfe forum :D.
Reply
Thanks given by:
#4
Just putting here what I did in relation to Dbsqhad's work (https://www.lf-empire.de/forum/showthread.php?tid=10924):


anyway, best of luck! do feel free to consult me on skill of the charachters, though you should talk to experts: I am pretty good with Freeze and John. Israeli community: Danny1114 is pretty baddass with all the 10 but he is only seldom in our community lately, Rashar is a god with Rudolf (and pretty good generally but I am not sure if he would know to give good advise on the others), Hasa is good with pretty much the 10 but out of practice and mainly do other things, Yusuke is an Expert with both Davis and Dennis, and T@l is also a god with Deep (he did spectacularly win Yusuke [only 10-7 though] and all the other top players that played in our last league which was held only about 3 months ago-ish. Also good with other charachters, can't recall which. Rock Lee is also excellent, if I remembers right mainly with Woody, Davis and Dennis, but I am not sure if he is also familiar with the rest of them, worth trying. Eitan is good with Woody. Feel free to contact/ask me to contact any of those.

I think you guys should collaborate, assign different charachters, et cetera.

I would like to help on the skills side with creating high-level AI for the charachter Wanda, I like it very much.
Reply
Thanks given by:
#5
I will be working on wanda ai first then i will continue with the other chars :D.
Reply
Thanks given by:
#6
(11-11-2018, 06:32 PM)open source nature Wrote:  I will be working on wanda ai first then i will continue with the other chars :D.

If so, we should work together. I will play with her and see how we can improve her AI and you will script it. what do you say?
Reply
Thanks given by:
#7
:D Coorporation is a good thing but, i would prefer i work alone, not in groups yet, i am working on a void id ai for wanda, so i will soon paste the ai text for anyone to try it out or put a download link.
Reply
Thanks given by:
#8
Very well.
Reply
Thanks given by:
#9
Wanda ai is now finished and ready to test, here is the download link: http://www.mediafire.com/file/2bk7wib8d3...+number.as
Reply
Thanks given by:




Users browsing this thread: 3 Guest(s)