Duke4.net Forums: Modifying enemy AI? - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Modifying enemy AI?

User is offline   DeadSnow 

#1

I've been trying my hand at creating my own Duke Nukem 3D mod and have a couple of roadblocks since I'm still new to CON scripting.
First, I want to know how I can modify enemy AI to do the following:
-Detect when it is hitting a wall when trying to pursue player and take a different path.
-Be 'deaf' (DooM engine has this as an option) when player sees enemy from side or behind
-Sometimes stop and wait to draw the player (like Perfect Dark)
-Also curious to know to make them operate doors

I have a feeling some of this may not be possible with the vanilla/DOS con coding

This post has been edited by DeadSnow: 24 June 2018 - 03:42 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#2

View PostDeadSnow, on 24 June 2018 - 03:40 PM, said:

I've been trying my hand at creating my own Duke Nukem 3D mod and have a couple of roadblocks since I'm still new to CON scripting.
First, I want to know how I can modify enemy AI to do the following:
-Detect when it is hitting a wall when trying to pursue player and take a different path.


Impossible to do welll with vanilla CON coding. You would need to use EDuke scripting to make them smart. Doable, but it's work.

View PostDeadSnow, on 24 June 2018 - 03:40 PM, said:

-Be 'deaf' (DooM engine has this as an option) when player sees enemy from side or behind


Hard to do with vanilla CON coding. You will have to rewrite a lot of the enemy scripting to make them not turn towards the player when they become active, and instead wander around until the player is in clear view or the enemy is shot or whatever.

View PostDeadSnow, on 24 June 2018 - 03:40 PM, said:

-Sometimes stop and wait to draw the player (like Perfect Dark)


There are some pretty easy ways to do this. One way would be to mark certain enemies as "stayput" using the already existing stayput actors, but have an expiration date on the stayputness where they set their htactorstayput to -1 after a while. A more sophisticated approach would require a lot of ai coding.


View PostDeadSnow, on 24 June 2018 - 03:40 PM, said:

-Also curious to know to make them operate doors


Just have them use the operate command, already in the vanilla game.
0

User is offline   blizzart 

#3

View PostDeadSnow, on 24 June 2018 - 03:40 PM, said:


-Be 'deaf' (DooM engine has this as an option) when player sees enemy from side or behind



In the Brute Force TC demo you can sneak at enemies by crouching from behind so they donĀ“t notice you.

Link: http://www.r-t-c-m.c...rute-force.html
0

User is offline   DeadSnow 

#4

I've poked around the CON scripting wiki a bit (and also checked out that 'Brute Force' demo above, which appeared to have some coding that I could not quite comprehend),
and while I do have a 'deaf" state in progress, I am not sure about to go making the enemy start moving (or even shoot at Duke!) when the player sees the front sprite of the enemy.
So far the enemy is just remaining 'deaf', even when the player circles around to the front of the enemy as seen here:
Posted Image

Here's some of the code from my GAME.CON

action APIGWALK  0  4 5 1 20
action APIGRUN      0  4 5 1 11
action APIGSHOOT    30 2 5 1 58
action APIGCOCK     25 1 5 1 16
action APIGSTAND    30 1 5 1 1
action APIGDIVE     40 2 5 1 40
action APIGDIVESHOOT  45 2 5 1 58
action APIGDYING    55 5 1 1 15
action APIGHIT      55 1 1 1 10
action APIGDEAD     60 1 1 1 1
action APIGFROZEN    0 1 5
action APIGGROW      0


move PIGWALKVELS 72
move PIGRUNVELS 108
move PIGSTOPPED

ai AIPIGDEAF APIGWALK PIGSTOPPED seekplayer
ai AIPIGSEEKENEMY APIGWALK PIGWALKVELS seekplayer
ai AIPIGSHOOTENEMY APIGSHOOT PIGSTOPPED faceplayer
ai AIPIGFLEEENEMY APIGWALK PIGWALKVELS fleeenemy
ai AIPIGSHOOT APIGSHOOT PIGSTOPPED faceplayer
ai AIPIGDODGE APIGRUN PIGRUNVELS dodgebullet
ai AIPIGCHARGE APIGRUN PIGRUNVELS faceplayer
ai AIPIGDIVING APIGDIVE PIGSTOPPED faceplayer
ai AIPIGDYING APIGDYING PIGSTOPPED faceplayer
ai AIPIGSHRINK APIGWALK SHRUNKVELS fleeenemy
ai AIPIGGROW APIGGROW PIGSTOPPED faceplayerslow
ai AIPIGHIT APIGHIT PIGSTOPPED faceplayer

state pigdeafstate
ifcansee
ifactor 2000
{
ai AIPIGSEEKENEMY
}
ends



Upon reading the description for the if'actor' variable, I was hoping that I had my answer but nothing has changed.
So how do I go about properly coding the enemy 'deaf" state to where the Pig Cop remains unaware until either of these conditions is fulfilled?:
A ) Player comes around to front of the enemy
B ) Player shoots the enemy (ifhitweapon probably takes care of this, but doesn't hurt to mention anyway)

This post has been edited by DeadSnow: 28 June 2018 - 10:02 AM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options