TFC - Teleporters?
Does anyone know a reliable way to find a teleporter entrance/exit's owner?
Or how to find a teleporter entrance's exit point? I read in an archived post from the old hpb bot forums ( somewhere, found it while looking on google ) and someone said that engineer's buildings do not have pev->owner set. If this is the case, how can we tell who a teleporter belongs to? I have an idea but its a really big hack... When the teleporter entity is created... - Find entities in a small sphere around the teleporter - Is it an engineer? - Do the team colors match up? - Is the engineer's pev->viewmodel cleared? - Found the owner and the teleporter entrance. For the exit its basically the same thing but I'd have to check for entity removals as well. This could cause problems if two engineers build teleporters around the same time close together so thats why I'm asking if there is a better way. |
Re: TFC - Teleporters?
Here's some of my old code from foxbot. If you want to see more you can download the source at foxbot.net
Code:
struct teleport_info_t { |
Re: TFC - Teleporters?
Thanks, I'll take a look sometime today.
|
Re: TFC - Teleporters?
In foxbot, which I don't think evil posted up there, when there is a #Teleporter_Entrance_Built/#Teleporter_Exit_Built message (I think), it will search for nearby teleporters and set the user to the builder (given in the message state 3). I tried this and added a few tweaks, such as checking if "pTeleporter->v.framerate == 0" as it shows it was just built, and ensures it doesn't pick up other nearby teleporters.
(it is rather more difficult doing this with sentries though if you want to pick up the building_sentrygun entitiy as they do not appear when the #Sentry_built message is sent.) It works well, but using teleporters is a bit more complex (see evils code above) typically what I do, is that if they find a teleporter that is nearby them, and the exit is nearer their goal than they are, and they are not closer to the teleporter exit than the goal, then they will use the teleporter. Things like "looping" can happen though which means they use the teleporter over and over again because they had to go back up where the entrance was. What I tried to do was add the teleporter to a list which it ignored when it used it, but I'm having trouble deciding when to do that. |
Re: TFC - Teleporters?
Foxbots only used teleporters if it saved them time to their current goal, time being the overall path cost. This by design wouldn't allow looping. The nice thing about using floyds pre-calculated lookup tables for paths is that you can do path comparisons very cheaply. if(pathCostToGoal > pathCostToTPEntrance + pathCostTPExitToGoal) then use the tele.
My new pathfinder in Omnibot uses A* and recognizes teleporter flagged waypoints and ignores the cost of travel between 2 teleporter waypoints, so there is no need for multiple path queries to take into account teleporters. |
Re: TFC - Teleporters?
Anyone know where to get Foxbot now?
|
Re: TFC - Teleporters?
I have downloads available from the Omni-bot site.
|
Re: TFC - Teleporters?
Never seen those Omni-bots before. They work with steam? Any tutorial on installing them? nm found that on the home page. Still looking for what game they actually are for. Sorry for my newbieness.
|
Re: TFC - Teleporters?
I think that is Enemy-Teritory bot. :)
|
Re: TFC - Teleporters?
Omni-bot is for Enemy Territory, Quake4, Doom3(soon), and in dev for Fortress Forever. As I was a Foxbot developer, and don't have access to the Foxbot web space so I have posted Foxbot files on the Omni-bot site in the downloads section.
|
All times are GMT +2. The time now is 20:38. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.