Natural Selection 2
Bishop - Bot Mod
Bug reports
hey bhaz. I discovered a bug, if you let the alien bot com build in fast forward on e.g. the map ayumi without a player with cheats 1 then it gives this error after building the last hive or tunnel:

[208.706] ServerUpdate : Error: lua/bishop/aliencom/AComActions_Abilities.lua:77: attempt to index local 'selectedMemory' (a nil value)
[Server] Script Error #249: lua/bishop/aliencom/AComActions_Abilities.lua:77: attempt to index local 'selectedMemory' (a nil value)
Call stack:
#1: actionEval lua/bishop/aliencom/AComActions_Abilities.lua:77
bot = CommanderBot-3057 {name="[CMDR] Zavaro", playerEntity=0, team=2, teamJoined=true }
brain = AlienCommanderBrain { }
com = AlienCommander-2280 {activeWeaponId=983, adagradSum=0, alienCommTime=1308.47, alienTime=1308.47, alive=true, animateAngles=false, animateDistance=false, animatePosition=false, animateYOffset=false, animationBlend=0, animationGraphIndex=0, animationGraphNode=-1, animationSequence2=-1, animationSequence=-1, animationSpeed2=1, animationSpeed=1, animationStart2=0, animationStart=0, armor=10, baseYaw=0, bodyYaw=1.485, bodyYawRun=0, botEntityId=3057, cameraDistance=0, cameraYOffset=0, clientIndex=2, collisionRep=0, commAdagradSum=0, commSkill=-1, commSkillOffset=-1, commandStationId=3353, commanderCancel=false, communicationStatus=1, cystVariant=1, darwinMode=false, desiredCameraAngles=0.000000 0.000000 0.000000, desiredCameraDistance=0, desiredCameraPosition=0.000000 0.000000 0.000000, desiredCameraYOffset=0, desiredYOffset=0, drifterVariant=1, eggVariant=1, flinchIntensity=0, followingTransition=false, fov=90, frozen=false, fullPrecisionOrigin=8.985001 33.522118 125.240807, gameEffectsFlags=0, giveDamageTime=0, harvesterVariant=1, healedFromSelf=false, health=75, healthIgnored=false, inventoryUpdateId=3, isMoveBlocked=false, isUsing=false, layer1AnimationBlend=0, layer1AnimationGraphNode=-1, layer1AnimationSequence2=-1, layer1AnimationSequence=-1, layer1AnimationSpeed2=1, layer1AnimationSpeed=1, layer1AnimationStart2=0, layer1AnimationStart=0, locationId=8, marineCommTime=0, marineTime=0, maxArmor=10, maxHealth=75, minimapTargetPosition=0.000000 0.000000 0.000000, mode=1, modeTime=-1, modelIndex=0, moveButtonPressed=false, moveTargetPos=0.000000 0.000000 0.000000, moveTransition=false, nextMoveTargetPos=0.000000 0.000000 0.000000, numIdleWorkers=4, numPlayerAlerts=0, overheadModeHeight=11, overheadMoveEnabled=true, physicsGroup=8, physicsGroupFilterMask=0, physicsType=1, playTime=1308.47, playerLevel=-1, positionBeforeJump=0.000000 0.000000 0.000000, primaryAttackLastFrame=false, processMove=false, pushImpulse=0.000000 0.000000 0.000000, pushTime=0, quickSwitchSlot=1, resetMouse=1, resources=0, runningBodyYaw=0, secondaryAttackLastFrame=false, shellCount=3, skill=-1, skillOffset=-1, slowAmount=0, spurCount=3, standingBodyYaw=1.485, startCameraAngles=0.000000 0.000000 0.000000, startCameraDistance=0, startCameraPosition=0.000000 0.000000 0.000000, startCameraYOffset=0, structureVariant=1, td_adagradSum=0, td_commAdagradSum=0, td_commSkill=-1, td_commSkillOffset=-1, td_skill=-1, td_skillOffset=-1, teamAtEntrance=2, teamNumber=2, teamResources=200, techId=215, tertiaryAttackLastFrame=false, timeLastHealed=23.9476, timeLastMenu=0, timeLastSeasonThrow=0, timeLastVisuallyHealed=23.9476, timeOfLastUse=0, timeOfLastWeaponSwitch=1166.03, timeScoreboardPressed=0, timeUntilPlayerCollisionsIgnored=0, totalXP=-1, transitionDuration=0, transitionStart=0, tunnelVariant=1, tweeningFunction=1, upgrade1=1, upgrade2=1, upgrade3=1, upgrade4=1, upgrade5=1, upgrade6=1, veilCount=3, velocity=0.000000 0.000000 0.000000, velocityLength=0, velocityPitch=0, velocityYaw=0, viewModelId=1894, viewPitch=1.22196, viewRoll=0, viewTargetPos=0.000000 0.000000 0.000000, viewYaw=1.57099, weaponsWeight=0 }
techId = 420
time = 1482.18
targets = { }
selectedMemory = nil
#2: Update lua/bots/PlayerBrain.lua:210
self = AlienCommanderBrain { }
bot = CommanderBot-3057 {name="[CMDR] Zavaro", playerEntity=0, team=2, teamJoined=true }
move = cdata<struct Move>: 0x64e92c48
player = AlienCommander-2280 {activeWeaponId=983, adagradSum=0, alienCommTime=1308.47, alienTime=1308.47, alive=true, animateAngles=false, animateDistance=false, animatePosition=false, animateYOffset=false, animationBlend=0, animationGraphIndex=0, animationGraphNode=-1, animationSequence2=-1, animationSequence=-1, animationSpeed2=1, animationSpeed=1, animationStart2=0, animationStart=0, armor=10, baseYaw=0, bodyYaw=1.485, bodyYawRun=0, botEntityId=3057, cameraDistance=0, cameraYOffset=0, clientIndex=2, collisionRep=0, commAdagradSum=0, commSkill=-1, commSkillOffset=-1, commandStationId=3353, commanderCancel=false, communicationStatus=1, cystVariant=1, darwinMode=false, desiredCameraAngles=0.000000 0.000000 0.000000, desiredCameraDistance=0, desiredCameraPosition=0.000000 0.000000 0.000000, desiredCameraYOffset=0, desiredYOffset=0, drifterVariant=1, eggVariant=1, flinchIntensity=0, followingTransition=false, fov=90, frozen=false, fullPrecisionOrigin=8.985001 33.522118 125.240807, gameEffectsFlags=0, giveDamageTime=0, harvesterVariant=1, healedFromSelf=false, health=75, healthIgnored=false, inventoryUpdateId=3, isMoveBlocked=false, isUsing=false, layer1AnimationBlend=0, layer1AnimationGraphNode=-1, layer1AnimationSequence2=-1, layer1AnimationSequence=-1, layer1AnimationSpeed2=1, layer1AnimationSpeed=1, layer1AnimationStart2=0, layer1AnimationStart=0, locationId=8, marineCommTime=0, marineTime=0, maxArmor=10, maxHealth=75, minimapTargetPosition=0.000000 0.000000 0.000000, mode=1, modeTime=-1, modelIndex=0, moveButtonPressed=false, moveTargetPos=0.000000 0.000000 0.000000, moveTransition=false, nextMoveTargetPos=0.000000 0.000000 0.000000, numIdleWorkers=4, numPlayerAlerts=0, overheadModeHeight=11, overheadMoveEnabled=true, physicsGroup=8, physicsGroupFilterMask=0, physicsType=1, playTime=1308.47, playerLevel=-1, positionBeforeJump=0.000000 0.000000 0.000000, primaryAttackLastFrame=false, processMove=false, pushImpulse=0.000000 0.000000 0.000000, pushTime=0, quickSwitchSlot=1, resetMouse=1, resources=0, runningBodyYaw=0, secondaryAttackLastFrame=false, shellCount=3, skill=-1, skillOffset=-1, slowAmount=0, spurCount=3, standingBodyYaw=1.485, startCameraAngles=0.000000 0.000000 0.000000, startCameraDistance=0, startCameraPosition=0.000000 0.000000 0.000000, startCameraYOffset=0, structureVariant=1, td_adagradSum=0, td_commAdagradSum=0, td_commSkill=-1, td_commSkillOffset=-1, td_skill=-1, td_skillOffset=-1, teamAtEntrance=2, teamNumber=2, teamResources=200, techId=215, tertiaryAttackLastFrame=false, timeLastHealed=23.9476, timeLastMenu=0, timeLastSeasonThrow=0, timeLastVisuallyHealed=23.9476, timeOfLastUse=0, timeOfLastWeaponSwitch=1166.03, timeScoreboardPressed=0, timeUntilPlayerCollisionsIgnored=0, totalXP=-1, transitionDuration=0, transitionStart=0, tunnelVariant=1, tweeningFunction=1, upgrade1=1, upgrade2=1, upgrade3=1, upgrade4=1, upgrade5=1, upgrade6=1, veilCount=3, velocity=0.000000 0.000000 0.000000, velocityLength=0, velocityPitch=0, velocityYaw=0, viewModelId=1894, viewPitch=1.22196, viewRoll=0, viewTargetPos=0.000000 0.000000 0.000000, viewYaw=1.57099, weaponsWeight=0 }
time = 1482.18
nextObjectiveUpdateTime = 1
bestAction = {name="AbilityBonewall", perform=function, weight=0 }
(for generator) = function
(for state) = {10=function, 11=function, 12=function, 13=function, 14=function, 15=function, 16=function, 17=function, 18=function, 19=function, 1=function, 20=function, 21=function, 22=function, 23=function, 24=function, 2=function, 3=function, 4=function, 5=function, 6=function, 7=function, 8=function, 9=function }
(for control) = 5
_ = 5
actionEval = function
#3: Update lua/bots/AlienCommanderBrain.lua:166
self = AlienCommanderBrain { }
bot = CommanderBot-3057 {name="[CMDR] Zavaro", playerEntity=0, team=2, teamJoined=true }
move = cdata<struct Move>: 0x64e92c48
#4: lua/bots/CommanderBot.lua:141
self = CommanderBot-3057 {name="[CMDR] Zavaro", playerEntity=0, team=2, teamJoined=true }
player = AlienCommander-2280 {activeWeaponId=983, adagradSum=0, alienCommTime=1308.47, alienTime=1308.47, alive=true, animateAngles=false, animateDistance=false, animatePosition=false, animateYOffset=false, animationBlend=0, animationGraphIndex=0, animationGraphNode=-1, animationSequence2=-1, animationSequence=-1, animationSpeed2=1, animationSpeed=1, animationStart2=0, animationStart=0, armor=10, baseYaw=0, bodyYaw=1.485, bodyYawRun=0, botEntityId=3057, cameraDistance=0, cameraYOffset=0, clientIndex=2, collisionRep=0, commAdagradSum=0, commSkill=-1, commSkillOffset=-1, commandStationId=3353, commanderCancel=false, communicationStatus=1, cystVariant=1, darwinMode=false, desiredCameraAngles=0.000000 0.000000 0.000000, desiredCameraDistance=0, desiredCameraPosition=0.000000 0.000000 0.000000, desiredCameraYOffset=0, desiredYOffset=0, drifterVariant=1, eggVariant=1, flinchIntensity=0, followingTransition=false, fov=90, frozen=false, fullPrecisionOrigin=8.985001 33.522118 125.240807, gameEffectsFlags=0, giveDamageTime=0, harvesterVariant=1, healedFromSelf=false, health=75, healthIgnored=false, inventoryUpdateId=3, isMoveBlocked=false, isUsing=false, layer1AnimationBlend=0, layer1AnimationGraphNode=-1, layer1AnimationSequence2=-1, layer1AnimationSequence=-1, layer1AnimationSpeed2=1, layer1AnimationSpeed=1, layer1AnimationStart2=0, layer1AnimationStart=0, locationId=8, marineCommTime=0, marineTime=0, maxArmor=10, maxHealth=75, minimapTargetPosition=0.000000 0.000000 0.000000, mode=1, modeTime=-1, modelIndex=0, moveButtonPressed=false, moveTargetPos=0.000000 0.000000 0.000000, moveTransition=false, nextMoveTargetPos=0.000000 0.000000 0.000000, numIdleWorkers=4, numPlayerAlerts=0, overheadModeHeight=11, overheadMoveEnabled=true, physicsGroup=8, physicsGroupFilterMask=0, physicsType=1, playTime=1308.47, playerLevel=-1, positionBeforeJump=0.000000 0.000000 0.000000, primaryAttackLastFrame=false, processMove=false, pushImpulse=0.000000 0.000000 0.000000, pushTime=0, quickSwitchSlot=1, resetMouse=1, resources=0, runningBodyYaw=0, secondaryAttackLastFrame=false, shellCount=3, skill=-1, skillOffset=-1, slowAmount=0, spurCount=3, standingBodyYaw=1.485, startCameraAngles=0.000000 0.000000 0.000000, startCameraDistance=0, startCameraPosition=0.000000 0.000000 0.000000, startCameraYOffset=0, structureVariant=1, td_adagradSum=0, td_commAdagradSum=0, td_commSkill=-1, td_commSkillOffset=-1, td_skill=-1, td_skillOffset=-1, teamAtEntrance=2, teamNumber=2, teamResources=200, techId=215, tertiaryAttackLastFrame=false, timeLastHealed=23.9476, timeLastMenu=0, timeLastSeasonThrow=0, timeLastVisuallyHealed=23.9476, timeOfLastUse=0, timeOfLastWeaponSwitch=1166.03, timeScoreboardPressed=0, timeUntilPlayerCollisionsIgnored=0, totalXP=-1, transitionDuration=0, transitionStart=0, tunnelVariant=1, tweeningFunction=1, upgrade1=1, upgrade2=1, upgrade3=1, upgrade4=1, upgrade5=1, upgrade6=1, veilCount=3, velocity=0.000000 0.000000 0.000000, velocityLength=0, velocityPitch=0, velocityYaw=0, viewModelId=1894, viewPitch=1.22196, viewRoll=0, viewTargetPos=0.000000 0.000000 0.000000, viewYaw=1.57099, weaponsWeight=0 }
teamNumber = 2
gamerules = NS2Gamerules-1677 { }
team = AlienTeam { }
move = cdata<struct Move>: 0x64e92c48

And while we're on the subject of the Ayumi map, why doesn't he drop the first tunnel at the neutral tech point but in the empty corridor between them? Is that what was intended? He seems to have difficulty capturing a tech point before the marines. By the way, the more I play with your mod, the more I notice how well you've implemented the missing things. There's always a gorge and they can apparently switch dynamically between the player bot and their classes. And so many other good things, including things I didn't notice right away :-). I'm impressed. Keep it up!
< >
กำลังแสดง 1-15 จาก 121 ความเห็น
Bhaz  [ผู้พัฒนา] 4 ม.ค. @ 5: 44pm 
I watched some footage of real games when designing the tunnel system, and there's a pattern of actively hiding the tunnel in unexpected places to protect it. I don't think the issue is the tunnel positioning, more than the aliens' inability to use it to aggressively push and secure a tech point. Basically, I'm only halfway there. Maybe there's an argument for manual overrides on certain maps to make sure tunnels land somewhere useful.

In the early game, the "offensive tunnel" is placed in a position to maximise map control. Once tech points are secured by either team those kinds of positions aren't considered. What I might do is forcibly mark the tunnel for replacement when that happens. It also requires an alien (or Drifter) to discover marine buildings (because it uses the memories system,) to add new tunnel considerations to the system, so playing in an empty game means only half of it is working.

I've fixed the error for the next update - turns out I've never tested with an empty game.

Thanks for the feedback. :mac:
That sounds anything but easy. I'm keeping my fingers crossed that you can improve it and that the aliens and the marines can use the shortcuts better.
P.S.: Your Marine Commbot can't build everywhere, you already know that. I solved the problem by setting the drop from the Commstation near Phasegate directly to Techpoint:GetOrigin rather than cs:GetOrigin. There were also problems with the drop of armories etc., which is why I always had the Phasegate placed close to the Techpoint, as I noticed that the comm can always drop the structures. Here is the relevant code for setting the gate on the TP:


local function FindBuildPosition(techId, origin, initialDist, maxDist, increment)
local buildPos = nil
local angleIncrement = math.pi / 32 -- Even smaller increments for the angle

while not buildPos do
for radius = initialDist, maxDist, increment do
for angle = 0, 2 * math.pi, angleIncrement do
local xOffset = radius * math.cos(angle)
local zOffset = radius * math.sin(angle)
local tryPos = Vector(origin.x + xOffset, origin.y, origin.z + zOffset)

buildPos = GetRandomBuildPosition(techId, tryPos, increment)
if buildPos then
return buildPos
end
end

end

return buildPos
end



and here is the code for the commstation, which is calculated from the next phasegate nearby:

function(bot, brain, com)
local name = kMarineComBrainTypes[kMarineComBrainTypes.BuildCommandStation_NearControlledTechPoint]
local senses = brain:GetSenses()
local comTeam = com:GetTeamNumber()
local doables = senses:Get("doableTechIds")

local weight = 0
local buildPos
local isZeroIPs = #senses:Get("activeInfantryPortals") <= 0

if doables[kTechId.CommandStation] and not isZeroIPs and senses:Get("mainPhaseGate") and #senses:Get("phaseGates") then
local emptyTechPoints = senses:Get("safeTechPoints")
for _, techPoint in ipairs(emptyTechPoints) do
local commandstations = GetEntitiesForTeamByLocation("CommandStation", comTeam, techPoint:GetLocationId())
if #commandstations <= 0 then
-- Position des TechPoints direkt verwenden
buildPos = techPoint:GetOrigin()
if buildPos then
weight = GetMarineComBaselineWeight(kMarineComBrainTypes.BuildCommandStation_NearControlledTechPoint)
break
end
end
end
end

return {
name = name,
weight = weight,
perform = function(move, bot, brain, player, action)
if buildPos then
brain:ExecuteTechId(com, kTechId.CommandStation, buildPos, com)
end
end
}
end, -- Build CommandStation (Near PhaseGate)

and here the code for phasegate at techpoint:


function(bot, brain, com)
local name = kMarineComBrainTypes[kMarineComBrainTypes.BuildPhaseGate_NearControlledTechPoint]
local senses = brain:GetSenses()
local comTeam = com:GetTeamNumber()
local doables = senses:Get("doableTechIds")

local kMaxPhaseGates = 8

local weight = 0
local buildPos
local isZeroIPs = #senses:Get("activeInfantryPortals") <= 0

if doables[kTechId.PhaseGate] and not isZeroIPs and senses:Get("mainPhaseGate") and #senses:Get("phaseGates") < kMaxPhaseGates then
local emptyTechPoints = senses:Get("safeTechPoints")
for _, techPoint in ipairs(emptyTechPoints) do
local phaseGates = GetEntitiesForTeamByLocation("PhaseGate", comTeam, techPoint:GetLocationId())
if #phaseGates <= 0 then
buildPos = FindBuildPosition(kTechId.PhaseGate, techPoint:GetOrigin(), 3, 20, 1)
if buildPos then
weight = GetMarineComBaselineWeight(kMarineComBrainTypes.BuildPhaseGate_NearControlledTechPoint)
break
end
end
end
end

return {
name = name,
weight = weight,
perform = function(move, bot, brain, player, action)
brain:ExecuteTechId(com, kTechId.PhaseGate, buildPos, com)
end
}
end, -- BuildPhaseGate (Near Controlled TechPoint)

I hope this solve the problem for you. :tsalogo:
แก้ไขล่าสุดโดย Predator; 5 ม.ค. @ 1: 14am
Bhaz  [ผู้พัฒนา] 6 ม.ค. @ 12: 26am 
Strange, I already had this fix in place. (MComActions_TechPoint.lua line 103 - 104)
I think what you were seeing was the artificial limit I have in place (not building second bases until res >= 40). It only drops the phase gate immediately.
Maybe it needs some tuning if it's taking too long. Perhaps 30 would be a better number.

The reason I did this was so marines can rush jetpacks by 12-13 minutes. Dropping an entire second base + extra buildings can cost over 100 res.

I managed to track down the cause of the alien commander getting locked out of building. It was actually a vanilla bug triggered by a marine ejecting out of an exosuit. It permanently marks that room as unsafe for building.

If you hop in and out of an exo a bunch of times, then run dump_locgroups in console you can see the area is marked as having a ton of marines even though there are none.
I have a fix in progress now.

Also.
:hydra::gorge: soon
Bhaz  [ผู้พัฒนา] 6 ม.ค. @ 12: 32am 
While I'm at it, where do you think Gorges should drop bile mines?
โพสต์ดั้งเดิมโดย Bhaz:
Strange, I already had this fix in place. (MComActions_TechPoint.lua line 103 - 104)
I think what you were seeing was the artificial limit I have in place (not building second bases until res >= 40). It only drops the phase gate immediately.
Maybe it needs some tuning if it's taking too long. Perhaps 30 would be a better number.

The reason I did this was so marines can rush jetpacks by 12-13 minutes. Dropping an entire second base + extra buildings can cost over 100 res.

I managed to track down the cause of the alien commander getting locked out of building. It was actually a vanilla bug triggered by a marine ejecting out of an exosuit. It permanently marks that room as unsafe for building.

If you hop in and out of an exo a bunch of times, then run dump_locgroups in console you can see the area is marked as having a ton of marines even though there are none.
I have a fix in progress now.

:hydra::gorge: soon

Hydras are coming soon, yeaaha!

I always saw the build bug in ns2_descent in Hydroanalyse.

The thing with the res for the 2nd base and the speeding up of researching the tech tree makes sense. I stuck very closely to the template in my bots mod.

Could that be the reason for the exo?

kMarinesNearbyRange = 200 in MarineCommanderBrain_Utility. I did it like that so that the marines don't have to be there directly and no matter where a marine is on the map, a structure can always be dropped. Then they get the move command. Originally it was at 12. It's just a theory.

gorge: you're with his toys :-D! one mine per gorge? then his bile mine could be placed at a point in the direction where the ARCs are going so that they roll over them. so if they are active then place a mine > 15 - 20. but I haven't played online for a long time and don't know exactly how a good Gorge player did it. maybe he can't damage ARCs with it...

ns2 wiki:

Creates an unbuilt bile mine on any surface
Detonates when close
Can be manually detonated with spit
Only deals damage to marine armor and marine structures

how about these suggestions from me:

maybe he can build it when a group of marines comes closer when the distance is >=20 and then drop it, and when the marines come closer and the bile mine is maybe also hidden from a shade and then shoot it with spit when the marines are in its detonation radius. or hide at key points when a shade is built and at a place where the marines are closest together, e.g. at powerpoints.

and from the AI:

Defend Key Points: Place the Bile Mine near strategically important points such as resource extractors (resource nodes) or main structures to defend them and prevent Marines from destroying them.

Chokepoints: Place the Bile Mine in narrow corridors or passages that enemies have to go through. This increases the chance of them falling into the trap and taking damage.

Proximity to Hives: Position the Bile Mine near Hives to better defend them and make it harder for Marines to access them.

Behind Corners and Cover: Place the Bile Mine in places that are hard to see or reach, such as behind corners or in cover. This will protect the mine from direct attacks and increase its lifespan.

Support from other structures: Make sure the Bile Mine is near other defensive structures such as hydrans or whips to create a stronger defensive position.

Surprise Effects: Place the Bile Mine in unexpected places to allow surprise attacks on invading Marines.

and again from me:

Web:

for the Gorge Web between two choke points or passages (doors, entrances, exits)
at important locations like techpoints or hive or double RT. (the only bot that used this was the old wichbot from ns1 and it was pretty good at it)

Build Clog:

According to the devs there were problems with the bots because they couldn't recognize them as obstacles and got stuck on them, but maybe you could use it in the Marine base to make the phasegate inaccessible etc... or they could use it to close off entire areas like Nanogrid Double RT etc if they could recognize them as obstacles.

Build Hydra:

Hydras are often dropped at double RTs or at important locations like the hive I believe. The problem is that they need to be in a good position where they can surprise you first. You could also do it like the marines with the mines, only limit the hydras to 3 per gorge. 2 or 3 for harvester, hive, tunnel...

Maybe a priority for certain areas or structures when they are captured or available, like the original tunnel drop at safe TP. (neutral tech points or harvesters if no double res available, 2 hydras per gorge to a single harvester???? is that effective then????)

I hope that helps a bit.:tsalogo:
แก้ไขล่าสุดโดย Predator; 6 ม.ค. @ 5: 41am
I was just about to post some ideas for troubleshooting. It turns out just in time that you've already fixed quite a few. Awesome, keep up the good work!
โพสต์ดั้งเดิมโดย Bhaz:
Strange, I already had this fix in place. (MComActions_TechPoint.lua line 103 - 104)
I think what you were seeing was the artificial limit I have in place (not building second bases until res >= 40). It only drops the phase gate immediately.
Maybe it needs some tuning if it's taking too long. Perhaps 30 would be a better number.

The reason I did this was so marines can rush jetpacks by 12-13 minutes. Dropping an entire second base + extra buildings can cost over 100 res.

I managed to track down the cause of the alien commander getting locked out of building. It was actually a vanilla bug triggered by a marine ejecting out of an exosuit. It permanently marks that room as unsafe for building.

If you hop in and out of an exo a bunch of times, then run dump_locgroups in console you can see the area is marked as having a ton of marines even though there are none.
I have a fix in progress now.

Also.
:hydra::gorge: soon

it's seems to be fixed now with your construction logic!

I simply combined the methods from my code and yours and now the com can build in hydroanalysis or wherever else.

copy and paste and of course test it!


local function GetBuildPositionAtTechPoint(com, senses, techId, preReq)
local team = com:GetTeamNumber()
local buildClass = kTechId[techId]
local techPoints = senses:Get("safeTechPoints")

for _, techPoint in ipairs(techPoints) do
local locationId = techPoint:GetLocationId()

if (not preReq or IsBuildingInLocation(preReq, locationId, team))
and not IsBuildingInLocation(buildClass, locationId, team) then

if techId == kTechId.CommandStation then
return techPoint:GetOrigin()
end

-- Erweiterung der Positionsbestimmung für mehr Flexibilität
local buildPos = GetRandomBuildPosition(techId, techPoint:GetOrigin(), kMaxBuildDistance)

-- Wenn keine Position gefunden wurde, erweitern wir die Suche innerhalb des Radius
if not buildPos then
for radius = 1, kMaxBuildDistance, 1 do
for angle = 0, 2 * math.pi, math.pi / 32 do
local xOffset = radius * math.cos(angle)
local zOffset = radius * math.sin(angle)
local tryPos = Vector(techPoint:GetOrigin().x + xOffset, techPoint:GetOrigin().y, techPoint:GetOrigin().z + zOffset)

buildPos = GetRandomBuildPosition(techId, tryPos, 1)
if buildPos then
return buildPos
end
end
end
end

if buildPos then
return buildPos
end
end
end

return nil
end

แก้ไขล่าสุดโดย Predator; 6 ม.ค. @ 1: 03pm
Lerk's pathfinding is crazy when he tries to retreat.

Is that the problem when he tries to retreat and flies up and down? If he gets too frantic does he fly to the ceiling or spin in circles????

BotMotion.lua 576

-- gentle up/down gliding flight pattern
local height = 1.3 + (math.sin(now * 1.45) + math.cos(now * 2.15)) * 0.45
desiredHeight = heightMean + height

end

maybe you understand these lines better.
Bhaz  [ผู้พัฒนา] 8 ม.ค. @ 12: 29am 
Yeah I definitely want to look into Lerk pathing, it's absolutely wild when under fire to the point it can't even navigate a hallway.

Well I just found out the hard way that ARC turrets don't set off bile mines. But at least I got them working. I'm going to have a shot at webs, do some testing and polish then release an update. Shouldn't take much longer than a week.
That sounds promising. There are several ways to rein in the Lerk, but one of them would mean that he can no longer fly and that must not happen. He is a lerk and he must fly. Have you also tested the code I posted to fix the build bug and have you also set ForwardObservatory to = 4? Unfortunately, this means that on large maps or with 4 marine-occupied tech points, there are only 2 ARCs. I would recommend going for 3 Observatories so that at least 3 ARCs can always be built or you have a new strategy. And another thing, is it possible to redevelop the pathing altogether, to completely overhaul it with aliens and marines being able to go through ventilation shafts?
I have to address something. Did you remove the scans for Structure under Attack or is that a mistake?
Bhaz  [ผู้พัฒนา] 8 ม.ค. @ 9: 17pm 
I disabled my own scan code because of the conflict with yours and forgot to re-enable the structure scan. Yes it was an oversight, I'll fix it before release.

It's possible to augment the existing pathing, but not redevelop it because many functions are implemented in C++. I do however think vents are possible, but it's not going to be easy. I also have an idea in my head for getting bots out of stuck positions like double in ns2_tanith. I think obstacle hopping (double in ns2_veil) is definitely possible. I also think giving Lerks full freedom of flight is possible.

I'll look into the obs count, that would've been a change I made way back in October so I can't remember. IMO the tech limit is annoying and I wish they never added it, or at least made it a bit higher. NS1 had far less building restrictions. I miss Gorge vent shacks.

As for building positions, I've completely lost patience with UWE's GetRandomBuildPosition function because it breaks on maps with any kind of height variation. Turns out a circular search on non-flat ground doesn't work very well. :macface:
Good that you can fix the scanning problems. With the 4 observation posts and the associated supply restrictions, it is really annoying, but unfortunately there is only the option of either prioritizing things like ARCs or maybe taking a look at it and understanding whether this mod really works and is adaptable for you to increase the supply so that you can also install Sentry (according to the NS1 rules, this would be easier): https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2866651019

The completely revised nav system will probably never work, but it's good that you still have ideas and the skills. One of my suggestions would have been, if the improved navmesh doesn't work, then to integrate separate waypoints that the bots can use in certain situations, e.g. when they go into vents or fall, etc. so that they can get out again without any major problems. The waypoints could, for example, be dropped and displayed directly on the map via a menu or console, as in the old NS 1 bot times (Wichbot, RCBot). In doing so, you have to take the bot's perception of the old navmesh into account, which could possibly lead to misleading results if they check both at the same time. Another idea would be if they fall or walk into pits or vents, they are teleported to the nearest free space on the mesh or straight back to a base before you could kill them with a code after 4 seconds if, for example, they cannot move or move further than a radius of 10.

I haven't noticed the circular search and crashes yet, maybe I play the same maps too often... In any case, it works relatively well for me with your construction logic. I have had crashes, but only shortly after loading the map for the first time, and the second time it worked without any problems. And if circular doesn't work then square or cluster etc... You've already managed that well, I only noticed the construction bug with NS2_Descent.

I wish you the best of luck in fixing the complications and maybe we'll have one or two more ideas for such tough nuts to crack.:tsfmarine::welder:
I keep noticing an unpleasant vanilla bug: When you want to enter the comm station and only the commbot should be deleted, but you press the use button too often, carelessly, hectically or ignorantly, then many or even all player bots are deleted. If possible, can you please fix this so that only the commbot is deleted?
แก้ไขล่าสุดโดย Predator; 10 ม.ค. @ 11: 45am
And one more idea. Unfortunately, when marines get the "defend" command for the ARC, they can't weld or remove cysts. How about you adapting my "defend" template so that the command has to be repeated in a radius and not constantly to keep the bot at the ARC. Once the bot reaches the ARC, you could adapt the code like GuardNearestHuman, as if a bot was protecting a human player. That way it can carry on as normal and stay at the ARC and weld or remove cysts. With the Exos you can leave defend as it is I think, unless something interferes with it...
แก้ไขล่าสุดโดย Predator; 14 ม.ค. @ 11: 36am
< >
กำลังแสดง 1-15 จาก 121 ความเห็น
ต่อหน้า: 1530 50