Ranking
Original Post
Targeting Coach
Overview
Script tracks speeds of all parts on the target's body, and paints a rating on the specified number of highest priority targets, based on speed and the individual part's damage multipliers, showing the best spots to aim for solid hits.

When damage multipliers aren't considered, ratings range from 0% to 100%, with 100% showing the slowest moving target on a body, and 0% showing the fastest. Values inbetween are rated on a scale relative to the slowest and fastest moving parts.

When damage multipliers are considered, the speed rating is multiplied by the damage multiplier for each respective body part. The head and neck have the highest multiplier (1), for example, so those targets are weighed most heavily. All other ratings are reduced on account of the part's damage multiplier.

Issues - Read me
The original version (targetingCoach.lua) uses the new_game event hook, which isn't supported in multiplayer in 2.6. For multiplayer support in 2.6, use targetingCoachHack.lua, which doesn't run as clean, but will work.

For either version to work, the draw3d event hook must also be enabled. The attached file, startup.lua, has the required changes. Simply replace startup.lua in your data/script folder.

Configuration Options

target - Which player to display targets for (0 for red, 1 for blue/Uke, 2 for both)

frameForecast - When targets are consolidated, option is available to show a forecasted position, based on average velocity over the number of targets, with gravity factored in. Specify as a Lua table of integers.

i.e.
{10, 25, 50, 70, 100}
This table will show forecasted positions at 10, 25, 50, 70 and 100 frames after the current frame.

Because average velocities are used, and because rotation is not considered, position forecast is unreliable for small sets of targets, but fairly reliable when all possible targets are used.

gravity - You may specify the acceleration due to gravity in the z axis (negative values are downward), which is used in the consolidated target forecast. Specify gravity in meters per second squared. Classic toribash defaults to -1.


Options Which may be Changed at Runtime

Controls Summary:
o
: toggle factor damage
+ : increases the target count by one
shift and + : increases the target count to max (41)
- : decreases the target count by one
shift and - : decreases the target count to min (1)
0 : resets the target count to default
m : toggle consolidation of targets


Options:

factorDamage - Toggled in-game by the 'o' key.
Option toggles the target prioritization model. Toggles between factoring only speed, with the slowest targets being the highest priority, and factoring damage multipliers in addition to speed (so head and groin, etc. are weighed more heavily)

consolidateTargets - Toggled in-game by the 'm' key.
Option toggles between labeling individual targets with their rating and taking an average position and labeling it with an 'X', in addition to showing the consolidated target position forecast.

numTargets - Adjustable via +, -, 0. See above.
Option sets the number of targets shown. The number of targets also affects the consolidated target, by changing how many points the average is based on.
Attached Files
targetingCoach.lua (9.5 KB, 932 views)
targetingCoachHack.lua (9.9 KB, 358 views)
startup.lua (1.4 KB, 337 views)
Last edited by Dafe; Jul 30, 2007 at 04:48 AM.
I'm confused...
凸[◣_◢]凸 PRAISE LID 凸[◣_◢]凸 FUCK THA HATERS 凸[◣_◢]凸 PUT THIS IN YO SIG IF U DOWN 凸[◣_◢]凸
Good job
I haven't tested it too much yet, but I'm glad to see someone being innovative with LUA
this needs to be combined with uke-bot to make him swing at the enemy, instead of random joints that sometimes work out well... Best lua script I've een yet Dafe, keep up the good work!
I actually did write this with the intention of using it as an AI component, but I figured it could stand alone as a coaching tool for more inexperienced players. It's also handy when you're up in the air and you're trying to figure out how many frames it will be before you land, if you set up your forecast table right (remember to max out the number of targets).
Originally Posted by Jam0864 View Post
this needs to be combined with uke-bot to make him swing at the enemy, instead of random joints that sometimes work out well...


As of 2.7 we'll have get_body_angular_rotation and stuff, so I'll improve Ukebot a lot with regular type of AI. Probably two versions. >.>

And as for your script...

<Jok`Lua> Dafe, btw, neat script :o

Originally Posted by Jumpah View Post
my head hurts...so ,IN ENGLISH,what does it do?

With rated targets, aim at the part with the highest percentage. With consolidated targets, aim at the X's. Really, this is much too simplistic and won't give you great results. Read the document to understand what's going on.

Originally Posted by kikoman View Post
Where is 2.7 for mac!!!!!!!!!!!!

2.7 isn't out for any platform yet. Should be sometime this week, depending on bugfix time.