Elixar Posted April 29, 2019 Share Posted April 29, 2019 (edited) Im looking for the direction of knowledge to help advance my own scripts, I assume If/else statements are to slow to respond to character actions but I want to know how things are done with games and other situations like: Dark Souls Threatre of Blood You can tell most of runescape Npcs just throw 1 move at your character whether it's a magic/range/melee. Obviously a simple Attacking state and then healing states... but even zulrah just changes it's attack styles in a cycle and based on it's HP. In more advanced games, how do developers get NPCs to defend from attacks? Would most game NPCs simply have 5 different attack moves which then get selected at weighted-random? Then when the HP is lower... Would stronger Attack methods become avaible to the NPC because of critical health booleans becoming true? I thought maybe they use Decision Trees, Is this where I should be looking? I never went to university for game Dev so the concept of advanced Decision models is hard for me to study, I know advanced games probably don't use java but I'm sure these things are still achievable within it because Threatre of Blood looks quite complex, or is it...? It's got to be more then if else's... Thanks for any responses Edited April 29, 2019 by Elixar Quote Link to comment Share on other sites More sharing options...
YoHoJo Posted April 29, 2019 Share Posted April 29, 2019 This should help getting you started down a rabbit hole of research: https://en.wikipedia.org/wiki/Artificial_intelligence_in_video_games#In_modern_video_games Quote Link to comment Share on other sites More sharing options...
Tom Posted April 29, 2019 Share Posted April 29, 2019 Conditionals are definitely used, and they aren't slow enough to be even close to noticeable. If i were to guess, I'd say all combat in games is handled on the same thread, so when a player attacks, the developer could call an event and have all other NPC's react accordingly, as there would be quite a few frames between when someone presses a button, and when the effect of that button press happens Quote Link to comment Share on other sites More sharing options...
liverare Posted April 29, 2019 Share Posted April 29, 2019 Someone built a Dark Souls bot. Quote Link to comment Share on other sites More sharing options...