Forum Archive

Go Back   3D Realms Forums > 3D Realms Topics > Duke Nukem > Duke Nukem 3D Modifications
Blogs FAQ Members List Social Groups Calendar Mark Forums Read

Notices

 
 
Thread Tools
Old 07-24-2006, 06:02 PM   #1
DeeperThought

DeeperThought's Avatar
Beacons
Let's suppose I wanted to make a fake multiplayer game. And let's suppose that I already had bots that performed fairly well when in line of sight of a player. But now suppose these bots don't do so hot when the player leaves the area because they don't know how to navigate the map.

One solution is to create beacons; these would be invisible actors placed throughout the map which guide the bots. If the bots aren't in sight of a player or any items they can pick up, they find the next beacon and go to it. What I am trying to figure out is how to tell the bots to go to the correct beacon when they are already at one: I don't want them to stop at a beacon or go back and forth between two beacons. One solution would be to number the beacons in the sequence that I want the bots to traverse them. Then, if the bot reaches beacon N, it sets its target to beacon N+1. This might work, but it seems to require that the beacons already have the correct sprite IDs in the map file. I worry that this might be problematic. Anyone have any better ideas?

EDIT: I think I figured out a way to do it without using sprite IDs.
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
Last edited by DeeperThought; 07-25-2006 at 02:52 AM.
DeeperThought is offline  
Old 07-25-2006, 03:33 AM   #2
Chip

Chip's Avatar
Re: Beacons
What I've done resently was make it so occasinally the player would spawn an invisible actor and so when enemy actors can't see the player it would follow these actors spawned by the player, When an enemy actor reaches the first player trail, the trail actor deletes itself and the enemy actor calls any other actor near by to follow him (The ones that can't see Duke)

And then The leader enemy actor goes around following these player trails till it can see the player (or if the trail actors expire)
Chip is offline  
Old 07-25-2006, 09:45 AM   #3
DeeperThought

DeeperThought's Avatar
Re: Beacons
Quote:
Originally Posted by Chip
What I've done resently was make it so occasinally the player would spawn an invisible actor and so when enemy actors can't see the player it would follow these actors spawned by the player, When an enemy actor reaches the first player trail, the trail actor deletes itself and the enemy actor calls any other actor near by to follow him (The ones that can't see Duke)

And then The leader enemy actor goes around following these player trails till it can see the player (or if the trail actors expire)
Do your actors have trouble following the player around corners and through doorways?
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 07-26-2006, 02:12 AM   #4
Hellbound
 

Hellbound's Avatar
Re: Beacons
Maybe I can help, because I've just finished something like that.
I've made a flags, spawned by player ifcount is 2.
The flag actor:
useractor notenemy PATHFLAG1
findnearactor 3449 500 TEMP
findnearactor 3342 500 TEMP2

ifvarn TEMP -1 killit
ifvarn TEMP2 -1 killit
cstat 32768
ifpdistl 9000 { } else killit
sizeat 20 20
enda

And there was a problem. The ally is always heading to the "newest" flag. But it could help in some things - for exaple if you'll walk around the room and he is at the center, he will not make the whole walk as you did, but he just arrive to you with the closest way. But if we want to make him not go through the walls when you leave the room, we have to insert

canseespr THISACTOR <flag var> <gamevar>
if<gamevar>e 0 { } else { go to that flag }
So, he will go to the closest flag he will see, that method is avoiding his blocking in doors etc.

And I would say, that this is good to make him look for flag, only when
a) he can't see player
b) he can see player but is not moving ( blocked or something - ifnotmoving )
Otherwise, I'm using faceplayer or faceplayersmart.

I hope it will be useful. It works for me quite good. I also made friends crouching when they go through the low-ceiling areas and jumping when the player is higher and they not moving (to detect if they are stuck).
Hellbound is offline  
Old 07-26-2006, 03:36 AM   #5
DeeperThought

DeeperThought's Avatar
Re: Beacons
It's a good system for getting a bot ally to follow the player. I especially like the way you make it switch between newest flag / nearest flag depending on whether the player is visible. I may use that idea to make my Dukebot better at following.

The reason I wanted a system with beacons placed in a map ahead of time is for fake multiplayer, where bots need to be able to move around the entire map even when they are not following a player and even when the player isn't in the game (or only in the game as an observer).
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:05 PM.

Page generated in 0.14287806 seconds (100.00% PHP - 0% MySQL) with 16 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.

Website is 1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.