Toribash
Yeah, the challenge is really that an effective ai MUST be aware of the physics of the game at all times. You can run through glorified openers all you want, but for anything to be effective past the opener stage of the game you're going to need a bot that is aware of things like 'ground near, extend elbow to move arm to x position and avoid DQ'.

e: this gave me a fucking good idea, which I discuss in this chatlog:

16:41 <&Eleeleth> am I right in thinking
16:41 <&Eleeleth> if we had a lua api like
16:41 <&Eleeleth> get_ghost_joint_pos(frame, joint_id)
16:42 <&Eleeleth> we would easily be able to make a working tb ai
16:42 <&Eleeleth> right?
16:42 <&Eleeleth> because you can just brute force it
16:42 < charles> it would make the process a lot simpler, i'd think
16:42 < charles> don't know about easy, cause it still seems tedious as shit
16:42 <&Eleeleth> I mean basically the struggle with my process
16:42 <&Eleeleth> was I needed to re-implement all of fucking tb's physics model
16:43 <&Eleeleth> because I need a way to predict my position
16:43 <&Eleeleth> if I have access to ghost data, that's fucking solved
16:43 < charles> Eleeleth: I'm not sure AI for TB is that viable tbh bro
16:43 <&Eleeleth> and it becomes getting over the tedium of implementing it
16:43 < charles> because even knowing how things will play out from here
16:43 <&Eleeleth> charles: it's more a toy thing to point to
16:43 <&Eleeleth> 'hey I built an AI for a physics game'
16:43 < charles> Eleeleth: what kind of logic would you put in place
16:44 < charles> like always aim a extremity at their vital parts
16:44 <&Eleeleth> charles: first iteration is a bot that tries to not DQ
16:44 <&Eleeleth> easy to test, right
16:44 < charles> relatively simple (but tedious)
16:44 <&Eleeleth> hit uke, if he doesn't dq it works
16:44 < charles> y
16:45 <&Eleeleth> second iteration is 'attempt to get points and not dq
16:45 <&Eleeleth> '
16:45 < charles> would make for some nice desparate looking replays
16:45 < charles> Eleeleth: but how many frames ahead is it looking
16:45 <&Eleeleth> and by 'attempt to get points'
16:45 < charles> like is it looking to do it in the next immediate turn
16:45 <&Eleeleth> minimum implementation is a basic opener script
16:45 < charles> what if it cant reach the person in that amount of frames
16:45 <&Eleeleth> charles: that's a later iteration
16:46 <&Eleeleth> where it tries to predict opponent movement
16:46 <&Eleeleth> apply the same logic you're running to your opponent
16:46 < charles> Eleeleth: i've never actually tried to do any sort of AI (unless you
                 consider complex automations to be AI)
16:46 <&Eleeleth> and choose the move that results in the highest likelyhood of success
16:46 <&Eleeleth> it's literally just a brute force solution
16:46 < charles> or anything self-teaching
16:46 < charles> i assumed
16:46 <&Eleeleth> you could elegance can come later
16:47 <&Eleeleth> I want a proof of concept
16:47 < charles> you can see it in a lot of existing games
16:47 < charles> where you can predict the behavior based upon the situation, and
                 manipulate the logic to do the same shit over and over
16:47 <&Eleeleth> yes
16:48 <&Eleeleth> charles: ideally it would learn and apply things to similar situations
16:48 <&Eleeleth> but that requires some fudging of details
16:48 <&Eleeleth> time to bug hampa for that api
Last edited by Eleeleth; May 21, 2014 at 11:04 PM.
<~suomynona> TITS OR ELEELETH
Originally Posted by psycore View Post
And then I punch uke, he falls over and looks like he's having a seizure on the ground.
If it's so easy to write a good bot, write one.

2 posts back bro.. 2 posts back... ^^

http://forum.toribash.com/showpost.p...1&postcount=47
Last edited by zh0ul; May 21, 2014 at 11:50 PM. Reason: Adding referenced link
Originally Posted by zh0ul View Post
2 posts back bro.. 2 posts back... ^^

http://forum.toribash.com/showpost.p...1&postcount=47

Correct me if I'm wrong, but isn't that still just playing back sequences of moves?

e: and call 'playing back a sequence of moves' whatever the hell you want, except for an AI, because that's not what that means.
Last edited by Eleeleth; May 22, 2014 at 12:05 AM.
<~suomynona> TITS OR ELEELETH
zh0ul, is your space bar broken? Who uses 12 spaces for a single level of indents, and furthermore:

if    ( cur_ ...
What is that?
Originally Posted by Juntalis View Post
zh0ul, is your space bar broken? Who uses 12 spaces for a single level of indents, and furthermore:

if    ( cur_ ...
What is that?

Space bar is just fine... I use a programmers editor, with wordwrap off, so I can 'paint' code in easy for *me* to read ways ;)

And then you ask me, whats this?

if ( string.find(cur_user_input,"[+-]") ~= nil )
        then
well, thats a part of

--------------------------------------------------------------------
-- COMMAND: /pc - Preset Cycle
--------------------------------------------------------------------

Which I use to test cycling presets. Not required for 'use' of the script in any way.

And if you mean

---------------------------------------------
-- This will retrieve moves from .rpl files.
---------------------------------------------
-- CUR_PLAYER=0 ; CUR_RPL=/mnt/jakeC/Games/Toribash-4.41/replay/Head_Cannon.rpl ; CUR_JOINTS=( $( for idx in {0..19} ; do printf " 5" ; done ) ) ; cat "${CUR_RPL}" | dos2unix | grep "^JOINT ${CUR_PLAYER}" | sed s,"^.*; ",,g | while read -r -a line ; do CUR_JOINT_NUM= ; for EL in ${line[@]} ; do if [ ${#CUR_JOINT_NUM} -eq 0 ] ; then CUR_JOINT_NUM=${EL} ; else CUR_JOINTS[${CUR_JOINT_NUM}]=${EL} ; CUR_JOINT_NUM= ; fi ; done ; printf "{%s" ${CUR_JOINTS[0]} ; printf ",%s" "${CUR_JOINTS[@]:1}" ; printf "}\n" ; done

^^ that thing.. well its commented out (as noted by the -- in front of the line) , and its an old linux/method i used to use to retrieve joint settings from replay files. Surely , since I log all fights properly now, I dont need it. Its just there for its historic value.
It's pretty clear that he was talking about the awkward spacing.
Last edited by Eleeleth; May 22, 2014 at 03:02 AM.
<~suomynona> TITS OR ELEELETH
I don't get it. Why does yours say:

/mnt/jakeC/Games/Toribash-4.41/replay/Head_Cannon.rpl
while mine says:

C:\Games\Toribash-4.41\replay\Head_Cannon.rpl
Is it broken? If so, how long do you expect it will take to fix it? I really want to fight the AI computer player.
/mnt/... => Linux (maybe OS X has that too)
C: => Windows
Signature temporarily out of order.
Gents, Please completely ignore that entirely massively long string of linux/bash code you saw at the top.

I've removed it from the most recent version available here:
(Download URL removed due to DNS issues ATM. Attached required files)

1) All 3 files found ^^ there, should go into:
Example: C:\Games\Toribash-4.7\data\script
The files:

# ps.lua
- Dont mod this, unless you know wtf you are donig.
- Its the engine. It does not have moves itself, but rather, drives the interface/bot.

# TORIBASH_PRESETS.twinsword4fixed.tbm.lua
- Contains presets, specifically for the mod twinsword4fixed.tbm
- Each time you load into another mod, if one of these files does not exist, one will be created. (which separates the moves between mods).


2) Once in toribash, type:

/ls ps.lua
3) I suggest you try one of the mods which I've provided default settings for:

/lm  twinsword4fixed.tbm
4) Start fighting

5) Look in the data\script directory. You will find at least 2 new files:

TORIBASH_PLAYER_0_RECORDED_MOVES.lua (or .txt if older version)
TORIBASH_PLAYER_1_RECORDED_MOVES.lua (or .txt if older version)

These contain the 'recorded' joint settings in every fight and are 100% accurate (unlike the very inaccurate settings you get from replay files). This file is not loaded by the UI, so is just a log.. but! it can be copy/pasted into the configuration file,as its really just lua code (looks exactly like the lines in the config).

If you downloaded the configs already, get a fresh copy. I just updated the twinswords file to have a few more default moves, and in a much better format. Easier to understand/modify.

- Z
Attached Files
ps.lua (129.0 KB, 22 views)
Last edited by zh0ul; May 22, 2014 at 05:53 PM.