Duke4.net Forums: Improved AI? - Duke4.net Forums

Jump to content

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

Improved AI?  "Any ways to increase intellegence?"

User is offline   Sanek 

#1

Is there any ways to increase enemy's intellegence?
Build/Eduke is a great engine to work with but unfortunately, enemy's AI in Duke Nukem 3D and other titles is worse than in most of it's сontemporaries and games that was even older than Duke. Aliens just go in your direction and that's it.
Is it possible to make enemies in Duke3D just a little bit smarter? Search for alternate routes when they saw you? I remember that enemies in vanilla Blood behaved different than ones in Duke - like cultists that come up from the other side.
I attached a pic from mapster here. There's a slimer that waiting for the player behind the door and it's supposted to be triggered by you. Is it possible to make slimer smart enough to come to you from the vent?

Attached thumbnail(s)

  • Attached Image: capt0015.png

0

User is offline   oasiz 

  • Dr. Effector

#2

Well, I think anything is possible if you really want to code it.
With CON though, the smarter you make them, the resource intensive it's going to get.

You might want to just cheat your way around and use hints that lure the enemy someplace else.
Nothing is really "impossible". You'll just have to do some work.
0

User is offline   Mark 

#3

Sorry I don't have a name or a link but someone here posted about their new AI code and had a video demonstration of it in action. I'm not sure if he had it refined enough for release or not. But it looked very good. It would allow the enemy to do what you said. Find smart ways to reach the player.

This post has been edited by Mark.: 31 August 2017 - 04:45 AM

0

User is offline   XThX2 

#4

All this time it really struck me as odd that Duke's AI was never really improved beyond simple enhancements. I remember someone was working on a A* implementation using CON but I think it was buggy or unfinished. I believe however that this is one of those things that should be implemented on the engine side rather than CON scripting.
0

User is offline   BestViking 

#5

IIRC, enemies must be defined as useractor notenemy for them to activate before you see them. This however, will not add them to the enemy count at the status screen at the end of the level.
0

User is online   Danukem 

  • Duke Plus Developer

#6

View PostSanek, on 31 August 2017 - 04:01 AM, said:

Is there any ways to increase enemy's intellegence?

...snip...

Is it possible to make slimer smart enough to come to you from the vent?


There are many different ways to accomplish what you want, but all of them require that you have pretty good skills with CON scripting, or at least good enough to port over code from other mods that have the functionality you need.

If the problem is confined to specific rooms that you are working on, then the simplest solution would be to put paths in the rooms and code the enemies to follow them (similar to the use of locators in the base game). From the player's point of view, the enemies will seem intelligent, as long as you allow the enemies to attack and resume normal behavior anywhere along the path, when appropriate.

I have also had good results with a breadcrumb type of system, wherein the player is periodically spawning invisible waypoint sprites which enemies can trace back to him -- that won't help if the player has not walked the path from the monster to his current location, though. More sophisticated systems are quite possible but are probably not worth the effort for your project.
0

User is offline   Perro Seco 

#7

What about making the enemy move in random directions very fast while the player is in the other room and resume his normal behavior when he can see the player again? It sounds pretty shitty but I think it would work at least in this case.
0

User is offline   NNC 

#8

Sentry Drones have by far the best AI in this game, and people usually bemoan how annoying and frustrating they are.
0

User is online   Danukem 

  • Duke Plus Developer

#9

View PostNancsi, on 31 August 2017 - 02:27 PM, said:

Sentry Drones have by far the best AI in this game, and people usually bemoan how annoying and frustrating they are.


They just seem smart because they have an extremely high chance to dodge and they move pretty fast. Their code is actually among the simplest of all the enemies. They are also typically placed in more open environments where they aren't required to navigate much.
0

User is offline   Sanek 

#10

View PostTrooper Dan, on 31 August 2017 - 12:48 PM, said:

There are many different ways to accomplish what you want, but all of them require that you have pretty good with CON scripting, or at least good enough to port over code from other mods that have the functionality you need.

Yep, I was sure somebody would say that. I tried to do that thing by learning the code that Eddy did for the game we've worken on (before he ran out), but failed to do anything besides enemy walking back and forth.

I'm working on a map right now that requires new code. Enemies that will search for a player once they will be triggered. Unfortunately, I don't know how to code all these things. I hope that once I do enough progress I will show my map to somebody who knew how to code. However, even if I finish the map doesn't guarantee that people will write a code for it. So the only thing to do right now is don't work on map at all.


View PostTrooper Dan, on 31 August 2017 - 12:48 PM, said:

If the problem is confined to specific rooms that you are working on, then the simplest solution would be to put paths in the rooms and code the enemies to follow them (similar to the use of locators in the base game). From the player's point of view, the enemies will seem intelligent, as long as you allow the enemies to attack and resume normal behavior anywhere along the path, when appropriate.

Sounds simple enough. Will it work for a spawned enemies?

View PostMark., on 31 August 2017 - 04:45 AM, said:

Sorry I don't have a name or a link but someone here posted about their new AI code and had a video demonstration of it in action. I'm not sure if he had it refined enough for release or not. But it looked very good. It would allow the enemy to do what you said. Find smart ways to reach the player.


Nice. Let's hope the man who made it reply here.
0

User is offline   Jaap 

#11

Reaperman did something with A*. I tried using those con files. But they didn't always work for me so I started my own implementation. In "Ich will" I used it to a small degree but there were still a lot of bugs in it and I put it on the back burner for now. I might go back to it in a while (or when we get eDuke with full on Lua support since it would be way easier to code in lua than con).

A (very) simple demonstration of it in action:
https://forums.duke4...042#entry267042
0

User is offline   Mark 

#12

Yeah, thats the one I was referring to in my previous post that I couldn't think of the person who did it. It was you. :)

This post has been edited by Mark.: 07 September 2017 - 11:38 AM

0

User is offline   Sanek 

#13

View PostJaap, on 07 September 2017 - 11:16 AM, said:

Reaperman did something with A*. I tried using those con files. But they didn't always work for me so I started my own implementation. In "Ich will" I used it to a small degree but there were still a lot of bugs in it and I put it on the back burner for now. I might go back to it in a while (or when we get eDuke with full on Lua support since it would be way easier to code in lua than con).

A (very) simple demonstration of it in action:
https://forums.duke4...042#entry267042


Hey, it looks very good! It's exactly what I needed! Do you plan to share it with anyone, or we will never see it? The thing that you showed in that video is perfectly ok for me.
0

#14

I'm pulling this out of my ass, and I'm pretty sure those suggestions are full of pitfalls. Just throwing ideas.

The first part of your navigation code would be a list of sectors that can be used so one can reach sector 2 from sector 1; either parse all walls of the starting sector, seek every neighbor sector and do a recursion until you find a combination that leads to Sector 2... Or, for each sector list all their neighbors. Then you can assume that if Sector 1 is neighbor with Sector 2, and Sector 3 is neighbor with Sector 1, then Sector 3 and can also reach Sector 2 via Sector 1, but you'll need a bunch of reachability tests to make sure, and these tests would depend on each actor's moving ability). Or don't use sectors and stick to walls instead? Trace a ray between the starting and ending point, get the first wall you meet (that belongs to the outer loop) and follow it until you end up in the destination sector? Full of pitfalls, but that could be worth a try.

The second part would handle the navigation within the sector, so actors can enter and exit sectors as needed (like your C-shaped vent duct). Maybe, join each and every vertex, if the center of the line linking the two vertices is inside the sector (ie. The number of walls on the left side of the point is odd), you may use it as a waypoint (two waypoints may be linked if they can see each other). Or convert the sector into a set of convex areas and pinpoint their center?

I'd try that in any other language, but I'm afraid it would be painfully slow in CON (unless you can do arrays and precache the navigation data somewhere?)

This post has been edited by alias conrad coldwood: 15 September 2017 - 04:05 PM

1

User is offline   Maisth 

#15

I Would honestly like to see this happen someday since the original duke and most custom levels rely too much on ambushes.
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