Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do Game Devs program NPC attack decisions?

Featured Replies

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:cate:

Edited by Elixar

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

 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.