Little Fighter Empire - Forums

Full Version: [2.2]Programmable AI via scripting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12
Go to this thread for updates: https://www.lf-empire.de/forum/showthread.php?tid=10945

Quick Steps! (Thanks to Azriel)
Quote:quick steps:
1. put the dll in the lf2 folder (i.e. /lf2/ddraw.dll).
2. make a folder "ai" in the lf2 folder (i.e. /lf2/ai)
3. in this ai folder, any [id].as files ([id] being the id of ur char) will be used as an ai script for ur char, so you'll have 13.as for an id 13: char.
4. start coding.

2.2:
2.1:
2.0:
1.2:

1.1:
1.0:
0.6
0.5:
0.4:
0.3:
0.2:
Original Post:
cool. is it possible to have access to self's frame_number or an ally/enemy's frame_number?

the possibilities with that will be cool for tag team moves with computer players, and/or story modes where you can get AI to walk to specific places and do actions
i thought ".chai" was short for char-ai till i read the post again



Azriel~
not yet azzy but after id specific chais are done its on the todo list like many other parameters

heres a very simple general AI i just wrote to test everything a little:

Code:
//D>A long ranged
if ((target_y - self_y)*(target_y - self_y) < 100) {
if ((self_x - target_x) > 100) {
if ((self_x - target_x) < 600) {
    DlA()
}}
if ((target_x - self_x) > 100) {
if ((target_x - self_x) < 600) {
    DrA()
}}}

//D>J and DJA mid ranged
if ((target_y - self_y)*(target_y - self_y) < 81) {
if ((self_x - target_x) > 50) {
if ((self_x - target_x) < 300) {
    DlJ()
}}
if ((target_x - self_x) > 50) {
if ((target_x - self_x) < 300) {
    DrJ()
}}
if ((self_x - target_x) > 100) {
if ((self_x - target_x) < 400) {
    DlJ()
}}
if ((target_x - self_x) > 100) {
if ((target_x - self_x) < 400) {
    DrJ()
}}}

//DvJ low health
if (self_hp < 250) {
DdJ()
}
//D^J high health
if (self_hp > 250) {
DuJ()
}

//DvA and D^A short ranged
if ((target_y - self_y)*(target_y - self_y) < 64) {
if ((target_x - self_x) < 50) {
if ((target_x - self_x) > 0) {
if (self_facing == 0) {
DdA()
}}}
if ((self_x - target_x) < 50) {
if ((self_x - target_x) > 0) {
if (self_facing == 1) {
DdA()
}}}
if ((target_x - self_x) < 50) {
if ((target_x - self_x) > 0) {
if (self_facing == 0) {
DuA()
}}}
if ((self_x - target_x) < 50) {
if ((self_x - target_x) > 0) {
if (self_facing == 1) {
DuA()
}}}}

owns me pretty badly with many chars

edit: facing might not work in the first download yet but its already fixed
and there is also D() A() J() but i cannot confirm them to be working yet
and left() right() up() down() still need to be fixed
The syntax is a combination of python and c++. Experimenting now XD
questions:
Does this work only for AI?. I mean can we make states and other things with it in the future?. I don't know but it sounds possible.

And YINYIN! can you please post what these letters/shortcuts means.
Edit:@Azriel: troll? why would I troll. Thanx anyway for clarification.
Hell yeah, finally something to turn random additional chars into killer additional chars :3
i can already imagine "_player1_ style ai" vs "_player2_ style ai" competitions. or maybe, "upload your best ai" competitions that get run through an unknown stage :p.
that's something i would put effort into.



Azriel~
Updated. See first post for info and download.
Here is a suggestion:
I think u should add an armor in your todo list. Atleast if this is even possible using the above method.
(06-09-2012, 02:37 PM)A-MAN Wrote: [ -> ]Here is a suggestion:
I think u should add an armor in your todo list. Atleast if this is even possible using the above method.

What? How does that have anything to do with AI...

Quote:PS: If you post useless things I will kill you.

Seriously, please think before posting things.
(06-09-2012, 02:56 PM)Lord Silva Wrote: [ -> ]
(06-09-2012, 02:37 PM)A-MAN Wrote: [ -> ]Here is a suggestion:
I think u should add an armor in your todo list. Atleast if this is even possible using the above method.

What? How does that have anything to do with AI...

Could be useful for characters who have single and multi-hit attacks... former one won't damage Armor'd characters, latter one do.
I assume you mistook his request for the capability to add armor to specific char ID's, I think he just wants something to determine the target's armor level (similar to fall, frame, etc).

Btw, how about the ability to react differently to specific (target) IDs?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12