Make builded_auto_turret recognize rendinsts and objects when tracking targets & Smokes

today, i come with a ““simple”” suggestion, and nothing revolutionary.

i would like, if the template: builded_auto_turret stops ignoring buildings and generally, objects in the way between the turret it self, and it’s target.

( so to speak )

used in the moon event.

you may ask, why?

well, thanks to @tommyZZM , “we” found out that builded_auto_turret can be used for AI to shoot onto other players/ team and generally used for different purpose with different type of weapons. that can’t be normally used through the sck_turret .

for example:

and those are great. opens many possibilities for interesting unique weapons and templates.

but the problems, that i found, as a pve maker while using them… are the following:

  • auto tracking:

they always know where the players are once they enter in the range, ( that’s because i speculate it’s correlated to the second problem )

as i use those templates to simulate AI tanks to give Players some opposition when driving vehicles, is that those…

  • templates/guns/AI just straight up ignore hard surfaces/buildings and generally anything in their path
    which then, the AI proceed to shoot through entire buildings ending up killing players behind walls and what not.

that’s cheesy and not fun:


even through smokes grenades:


so, if possible, my suggestion is,

Main Suggestion

allow builded_auto_turret to recognize when objects or smokes are blocking their line of sight between the targets and auto turret it self. especially, disable the tracker of the auto turret when players are in range but there’s also smoke or hardsurfaces.

because once again, a player is in range, the auto turret starts ignoring everything and just aims accurately and shoots no matter what.

when, in reality, it should work that only when a player is both in range, and in line of sight it should then rotate the turret ( aim ), and then start to engage ( firing ).

all of this, just to prevent unpleasant surprises and getting blown up behind walls / houses when you shouldn’t.

thanks for hearing me out. that’s all from me.

correct me if i’m wrong, but i don’t remember the moon turret firing through walls. was it like this? i could be missremembering.

PS

( @Enginya i know we discussed about this in dms, and you told me it wasn’t designed for AI tanks, but i feel like if we modify the base template from the game to actually work like an AI, we could use those templates for tanks…
granted, with many shortcomings, such as not actually recognizing the tank physic and it will sunk in the ground when i try to apply the correct models and physic from an actual tank. ( as we had to modify collres_res & Phys_objcet_net_phys in order for the tank to fire and look like a tank. )

but to the very least, those can function normally

here is the code if you want to take a look more accurately. and, a code for modders if they want to use.
although, as hinted, there are few “drawbacks”.
because i had to change the collres & Phys_objcet_something-something, the tank in question will not have any collisions.
that means, it’s sort of a fake tank. you can actually walk inside as a " human ".
and in order to destroy it, you’ll need to use explosives pack, tnts, artillery & HE.

AP from will do no damage. they will go right through.

also, in order for the template it self to shoot onto targets, you will need to set targets, or include a template in the base spawn:

( add this as a postfix: base_moon_soldier )
( i generally, only apply it to tanks spawns. so that it won’t fire on the infantry, but you can make it that fires on infantry too. if you want. )

you have been warned:

entity{
  _template:t="builded_auto_turret+tank_ammo_distribution_default+resupply_vehicle"
  transform:m=[[-0.0899937, -0.0166697, -0.995803] [-0.0159425, 0.999756, -0.0152951] [0.995815, 0.0144991, -0.0902375] [484.205, 1.23328, -535.059]]
  team:i=3
  hitpoints__hp:r=90
  hitpoints__maxHp:r=90
  phys_obj_net_phys__blk:t="content/enlisted/gamedata/units/cannons/germ_20mm_flak38_flakvierling.blk"
  animchar__res:t="m18_hellcat_char"
  collres__res:t="cannon_germ_20mm_flak38_flakvierling_collision"
  turret__enemyTeamLight:c=233, 233, 233, 1
  turret__allyTeamLight:c=233, 233, 233, 1
  phys__maxMassRatioForPushOnCollision:r=999
  turret__teamLightTemplate:t=""
  burning__isBurning:b=no
  killLogName:t="M18 Tank Destroyer From the 2nd Armored Division"
  dmg_animchar__res:t="m18_hellcat_dmg_char"
  pair_collision__tag:t="collidableToVehicle"

  "net_sound__descs:object"{
    "resupplyStart:object"{
      path:t="aircraft/effects/part_destroy_by_fire"
      toPlayer:b=no
    }

    "resupplyEnd:object"{
      path:t="aircraft/effects/part_destroy_by_fire"
      toPlayer:b=no
    }
  }

  "turret_gun_flash_fx__flashFx:shared:array"{
    turret_gun_flash_fx__flashFx:t="muzzle_ground_150mm"
  }

  "turret_gun_flash_fx__flashNodes:shared:array"{
    turret_gun_flash_fx__flashNodes:t="emtr_gun_flame"
  }

  "turrets__initAmmoDistribution:array"{
    "turrets__initAmmoDistribution:object"{
      slot:i=0
      fill:b=yes
    }

    "turrets__initAmmoDistribution:object"{
      slot:i=1
      fill:b=no
    }
  }

  "turretsInitialComponents:array"{
    "turretsInitialComponents:object"{
      gun__shotFreq:r=0.5
      gun__maxAmmo:i=20
      turret__yawSpeed:r=30
      turret_ai__amplitude:p2=0.001, 0.003
      gun_deviation__maxDeviation:r=120
      gun__ammo:i=0
      turret__limit:p4=-180, 180, -12, 76
      gun_spread__maxDeltaAngle:r=1.3
      gun_deviation__onShotDeviationChange:r=0.1
      turret_ai__attackTimerr:r=1
      turret_ai__sleepTimer:r=4.1
      turret_ai__atackDist:r=50
      turret_ai__period:p2=0.002, 0.001
      turret__pitchSpeed:r=99
      turret_ai__pauseTimer:r=1

      "gun__shellsAmmo:array"{
        gun__shellsAmmo:i=50
      }
    }
  }

  "turret_control__turretInfo:shared:array"{
    "turret_control__turretInfo:object"{
      turretGroup:t="main_turrets"
      salt:i=1
      gun:t="builded_sg_gun+tankgun_76mm_m1+base_76mm_m1+turret_with_several_types_of_shells+main_turret"
      turretName:t="turret_01"
    }
  }
}

so, about the shortcomings, i judt decided to hide a car inside the chassy, and use it as a hitbox:

8 Likes

Interesting suggestion. I hope you understand why it’s working this way. For performance reasons, of course. Because frequent checking of ray collisions to lots of distant targets will be quite slow. Then you suggest to also check all the smoke occluders for each ray. And then you should multiply this by lots of auto turrets in the event. It will force server to its (virtual) knees. Until carefully optimized to share performance between turrets, between frames, checking not more than N targets at once, and making smarter AI logic for which it will be enough to react accordingly. It could be done still. I suggest adding it to next requests list.

2 Likes

ugh…

sorry. i’m not really a developer.

i’m just a blondie in the middle of nowhere trying to make things works.

so, any in depth explanations are always welcome.

anyway, back to the thread at hand,

what you are telling me, is that essentially it would take alot to process for the servers. right?

but, correct me if i’m wrong,

if i’m not mistaken ( unfortunately, i can’t check due to not having the moon missions at my disposal )

turrets were able to differentiate targets, ranges, and not auto lock on players. ( i mean, they kinda did, but were fast in doing so )

and as far as i know, they weren’t able to shoot through buildings.

so, i don’t understand what has changed.

are we missing something from the event parameters that we should include to our mission for making them work?

without wasting too much of your time of course, i’m fairly sure you are busy, and i’m thankeful that you check editors related threads.

i’m just trying to understand.

maybe i’m becoming crazy and seeing / thinking things that aren’t simply currently possible.

but… as long those will come at some point, i guess that’s enough for me. i guess…

EDIT. hold on a second.

the turret SKC works just like i described.

it just doesn’t work on vehicles.

why is that.

and why the auto turrent can’t do that’?

1 Like

Which turrets? Auotmatic AI turrets? Or just turrets for players? Because physics of real shooting is one thing, but AI scanning for targets is completely different thing, which could require much more processing time.

so,

what i meant is,

if you use turret_105_skc_32 or ship_gun_105mm and add a normal weapon,

those will fire based on the weapon properties.

which it’s great to simulate maxim / mg42 / browning mg or anything to resemble gun nests.

where, there’s a machinegun that fires upon soldiers that are in the visual area.

but, if soldiers / players go behind for example, a house, those will stop fire.
they don’t go through like builded_auto_turret

and if there is smoke in their way, they will also stop fire.

the only problems with those template, is that do not work on vehicles.

like, those are just not suited for vehicles. either makes the game crash, or it won’t fire.

the builded_auto_turret ( from the moon event ) actually works on vehicles. so, it’s somewhat identical ( with just different paramters ) as a Skc/Shipgun yet, collisions and dynamics are a bit… different.

what i’m saying is, why does it work with the SKC on normal weapons, and the auto turret on vehicles, yet both work differently?

i can somewhat understand they are not the same thing.

but… you’re telling me that it’s… complicated?

i’m genuinely trying to understand.

Like, shouldn’t be relatively “simple” to adapt the skc onto vehicles?

the builded_auto_turret can.

yet… it’s… complicated to explain,

but what one does, should be able to do what the other does too.

why isn’t that the case.

and why would build_auto_turret have more issues with recognition / ai behavior when the skc don’t.

it’s… what i’m trying to get at.

EDIT.

it doesn’t crash anymore:

it… just won’t fire.

because… i don’t know.

It was. I remember how my turrets keep open fire to statue. Even able find screenshot:

It ignores smoke. But part about walls is true. They don’t open fire.


I think we can try to mix ai turrets? Or use ai turret propertes on tank cannons. As result you will able do ai tanks. With normal hitboxs.

1 Like

ah okey.

cheers for the correction.

then i must had one of those mandela effects… ( again ).

what do you mean

EDIT. ahhh

i see what you are saying.

i’m dummy…

sorry… today is not my day.

alright so,

as i said, i did some attempts when i spoke with @Enginya and you @Devenddar about the various results.

the problem that i faced was, i tried to use the type_89_127mm_naval_gun_go

which, it did worked, but it only targeted airplanes.

my next attempt was with base_ai_gunner_targer

problem is, if i integrated it through the entities, those would just make my game crash.

and then… i lost hope.

1 Like

It’s just not the same code. Static turret can remember max distance of shooting. But moving/rotating turret can’t do this with same effectivity.

2 Likes

so… the last questions that i have is…

is it… possible to merge them?

perhaps… through entities?

in the current state.

or… it requires a new thing of it’s own.

as much as i can be patience and wait for a new one, i understand it’s not a priority on your part. but… i have few mods waiting from almost when the editor got introduced… and it would truly be a new experience in enlisted ( granted, i’d still have the issue of customs still being the same that does not allow me to lock teams for ai to join team 2 and let the players on team 1 play. or the fact that i would have to work around, ).

it’s just… that i haven’t found working method for AI to use a goddamn tank ( just shoot. not move ) while having the actual tank phisic.

is it… really too much to ask?

don’t we have the same templates as war thunder? i suppose not.

actually, i suppose i already know the answer. so… don’t answer that.

guess we’ll have to wait more…

fair enough.

3 Likes