BAI in blitz3d?

Blitz3D Forums/Blitz3D Beginners Area/BAI in blitz3d?

Caton(Posted 2016) [#1]


how would ai battle scripting work in blitz3d?


Rick Nasher(Posted 2016) [#2]
depends how far you want to take it:

A simple approach would be a collision with a hidden trigger or enemy entity which in turn behaves using a series of If..Then statements to for instance start of an attack with shooting at your player. Or using EntityDistance to check proximity, or simply when certain coordinates are reached.

Also you can let the enemies patrol using predefined paths or semi randomly using A-star pathfinding ways.

And if you want to go even further: you could record your players reactions, evasive maneuvers to enemies in an array/file and next time let them choose a different attack approach.

There are quite a few examples in the code archives about this.


Caton(Posted 2016) [#3]
The Battle AI Data File will use commands like command 52 set music or command 41 load enemy. how would I do ai battle script with commands in blitz3d like what time command happens. and what command on witch enemy to attack


Rick Nasher(Posted 2016) [#4]
If you want to use time driven actions then you can make use of something like:
Global timeDelay = 10000 ; 10 seconds

Global startTime = MilliSecs() ;fill momentarily with current time at time appropriate for your game.

; in mainloop..

If MilliSecs() - startTime > timeDelay Then
   ;perform desired action, e.g. play music..
   ;when done reset startTime again so can be used again.
EndIf



RustyKristi(Posted 2016) [#5]
The Battle AI Data File will use commands like command 52 set music or command 41 load enemy. how would I do ai battle script with commands in blitz3d like what time command happens. and what command on witch enemy to attack



See here, I think you're question is more on how to program or logic than how blitz3d works with its feature set. Blitz3D is not different from any language in terms of what you're asking.

If you have a background in basic or any language then I'm sure you will figure something out.


Caton(Posted 2016) [#6]
What I was asking is how to do AI scripting using commands.
for scripting monster attacks.


Matty(Posted 2016) [#7]
Lots of ways.

It all depends on how complex you want it to be, and where you want that information guiding the script to come from.


steve_ancell(Posted 2016) [#8]
Maybe code a parser which reads instructions from a textfile and then perform actions based on what is read.