Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[2.2]Programmable AI via scripting
#11
Oh I see. Armour is ID based, not object based, so I guess making ID specific things would kill two birds with one stone. I might do it :p.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by: A-Man
#12
(06-09-2012, 03:28 PM)Lord Silva Wrote:  Oh I see. Armour is ID based, not object based, so I guess making ID specific things would kill two birds with one stone. I might do it :p.

Je, but shouldn't there be an armor counter of sorts linked to objects somewhere? Afaik hitting somebody with armor reduces the armor by 1 for a few ticks, that counter would be useful to have. Could as well be the more resonable way of implementing Armor-detection then just via ID. Imagine someday people use a modded exe to assign custum armor values to other IDs... going by ID wouldnt work anymore then :P
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.


Greetz,
Alblaka
Reply
Thanks given by:
#13
extremely laggy print all stats code:
Code:
clr()
//target
print("target: ${target_frame}")
print("F ${target_fall} D ${target_bdefend}")
print("${target_mp}mp")
print("${target_hp}/${target_dark_hp}/${target_max_hp}hp")
print("F ${target_facing} X ${target_x} Z ${target_z} Y ${target_y}")
print("A${target_a}  ${target_up}")
print("J${target_j} ${target_left}+${target_right}")
print("D${target_d}  ${target_down}")
print(" ")
//self
print("self  : ${self_frame}")
print("F ${self_fall} D ${self_bdefend}")
print("${self_mp}mp")
print("${self_hp}/${self_dark_hp}/${self_max_hp}hp")
print("F ${self_facing} X ${self_x} Z ${self_z} Y ${self_y}")
print("A${self_a}  ${self_up}")
print("J${self_j} ${self_left}+${self_right}")
print("D${self_d}  ${self_down}")
print(" ")
//distance
print("distance: X ${((self_x-target_x)*(self_facing-0.5)*2)} Z ${(target_z-self_z)} Y ${(target_y-self_y)}")
print("XZangle : ${((self_z-target_z)/((self_x-target_x)*(self_facing-0.5)*2))}")
print("XYangle : ${((self_y-target_y)/((self_x-target_x)*(self_facing-0.5)*2))}")
use anything in there as condition for doing moves

next up: some AI for maveric/frozen/clide/other

edit: @Alblaka armor is initially just a higher capacity for the bdefend value and being in a kind of state 7 (almost) all the time
so the AI could basically just subtract that on anything involving bdefend conditions depending on the faced id and also have differing tactic as the ids with armor have a constant defense
so id should be enough
Reply
Thanks given by:
#14
(06-09-2012, 03:37 PM)Alblaka Wrote:  
(06-09-2012, 03:28 PM)Lord Silva Wrote:  Oh I see. Armour is ID based, not object based, so I guess making ID specific things would kill two birds with one stone. I might do it :p.

Je, but shouldn't there be an armor counter of sorts linked to objects somewhere? Afaik hitting somebody with armor reduces the armor by 1 for a few ticks, that counter would be useful to have. Could as well be the more resonable way of implementing Armor-detection then just via ID. Imagine someday people use a modded exe to assign custum armor values to other IDs... going by ID wouldnt work anymore then :P

It's not object based, it's ID based. This stuff is buried inside the onHit() (made up name) function. So every time any object gets hit at all, it checks what ID it is and stuff. I'm 99% sure there is no armour thing per object thingy.

https://docs.google.com/spreadsheet/ccc?...IWVE#gid=0

See the spreadsheet.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by:
#15
AI that mimics the targets movements
Code:
if(target_d==1){D()}
if(target_down==1){down()}
if(target_up==1){up()}
if(target_left==1){left()}
if(target_right==1){right()}
if(target_j==1){J()}
if(target_a==1){A()}

AI for clide
Reply
Thanks given by:
#16
Updated. YinYin's mimic AI requires version 0.3.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by:
#17
Code:
if(target_d==1){D()}
if(target_down==1){down()}
if(target_up==1){up()}
if(target_left==1){left()}
if(target_right==1){right()}
if(target_j==1){J()}
if(target_a==1){A()}
if(target_DuJ==3){DuJ()}
if(target_DrJ==3){DrJ()}
if(target_DdJ==3){DdJ()}
if(target_DlJ==3){DlJ()}
if(target_DuA==3){DuA()}
if(target_DrA==3){DrA()}
if(target_DdA==3){DdA()}
if(target_DlA==3){DlA()}
if(target_DJA==3){DJA()}
improved AI mimic
Reply
Thanks given by:
#18
Updated. You need to put a return 0 or return 1 at the end of the script or it crashes! This is important!
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by:
#19
ok then even further improved mimic AI for 0.4:

Code:
if(target_d==1){D()}
if(target_down==1){down()}
if(target_up==1){up()}
if(target_left==1){left()}
if(target_right==1){right()}
if(target_j==1){J()}
if(target_a==1){A()}
if(target_DuJ==3){DuJ()}
if(target_DrJ==3){DrJ()}
if(target_DdJ==3){DdJ()}
if(target_DlJ==3){DlJ()}
if(target_DuA==3){DuA()}
if(target_DrA==3){DrA()}
if(target_DdA==3){DdA()}
if(target_DlA==3){DlA()}
if(target_DJA==3){DJA()}
if(target_facing!=self_facing && self_facing==0) {left()} else if (target_facing!=self_facing) {right()}
return 1;

will also update the tutorial and clide's AI
Reply
Thanks given by:
#20
(06-11-2012, 09:16 PM)Alblaka Wrote:  Ow, I'm totally going to write AI scripts for all my chars :3

Btw, how about
- RNG
- self_weaponid
- detecting T0 objects on same x/y coordinate (sticking ik8's)?
(06-11-2012, 10:14 PM)YinYin Wrote:  @Alblaka: the self_weaponid i understand, the other two i don't - maybe elaborate those in the actual hex project thread from silva
also looking forward to more AI

RNG = Random Number Generator = Something to generate randomness.

The third point would permit some of my chars to react accordingly if they're using upgrade moves or similar. It would be great if there would be a function/call to access a
-T0 object (Actually, scrap the T0, it should better grab all objects)
-which is currently on the exact same x & z coordinates as self <<< Effectively an object sticking to the character via ik8
Sort of "enchant_*".
This would permit some of my characters to deal with the fact they can use special abilitys granting "charges" and similar stuff.

Would love to have the tags
-enchant_id
-enchant_frame
-enchant_hp
(and probably -echant_weaponid , something none of my characters currently uses, but could be used for even more advanced DCing in future)

(06-10-2012, 03:11 PM)Lord Silva Wrote:  It's not object based, it's ID based. This stuff is buried inside the onHit() (made up name) function. So every time any object gets hit at all, it checks what ID it is and stuff. I'm 99% sure there is no armour thing per object thingy.

https://docs.google.com/spreadsheet/ccc?...IWVE#gid=0

See the spreadsheet.
Random guess, B4? "Shaking" pretty much describes the effect of armored people getting hit without taking damage. Unless it's an entirely different thing.
As well I remember to have read about "bdefend" being used for determining an armors remaining strength as well, not sure whether that's correct though.

I think you probably still didn't understand what exactly I want. I'm aware armor is coded via ID. But if you hit Julian twice, wait half a second and hit him two more times, the fourth hit punches through the armor, indicating there must be any sort of counter to determine when the "armor" of an object is temporally depleted.

Or probably I'm just constantly missunderstanding you and you're trying to tell me even that is stored ID wise? (though that should cause retarded buigs if fighting multiple opponents of the same ID, f.e. a group of knights)
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.


Greetz,
Alblaka
Reply
Thanks given by:




Users browsing this thread: 4 Guest(s)