#Sheer Iceman 1197 weeeee

1 messages · Page 1 of 1 (latest)

sonic crag
#

remember about the rules guys

loud thistle
#

That looks like a tow to me, just needs some texturing and getting added into the vehicles that can use them

sonic crag
#

need to figure out how to synchronize it in multiplayer though because right now it aint

#

sending traffic to server and back about where you're aiming is pretty inefficient, because you'd have to send updates very often

loud thistle
#

I don’t know how that would really work but I’m sure it’s possible

sonic crag
#

it's easier to create a fire and forget type projectile because you only need to transmit a target and then every connected reforger game can simulate the same trajectory

loud thistle
#

Ah

#

Maybe range limitations could help?

#

But then again irl TOWs have a lot of range

sonic crag
#

its more about how much traffic you send over the network

cosmic swift
#

something something deterministic pathfinding?

#

Might look super wonky if the update rate is too low though

sonic crag
#

its hard to guarantee the same trajectory when its guided by aiming

#

especially since you are already dealing with delayed updates because of latency

#

maybe the server could aim it

cosmic swift
#

you're probably infinitely more knowledgeable about this, not gonna lie, I don't even know if it's possible to make clients calculate on a relatively similar timestep

sonic crag
#

it might be why a lot of games with homing projectiles dont bother with guided and only do fire and forget, since you only transfer firing position and target

cosmic swift
#

there's probably some compensation in these cases still no?

sonic crag
#

but maybe its simple and im only confused because I've never synced homing projectiles over net

cosmic swift
#

I wonder how many actual updates you'd need to send to get accurate enough

#

It's probably speed/turn arc dependent

sonic crag
#

I think at least one of the previous arma games have had guided projectiles but don't know how that worked

cosmic swift
#

ARMA3 has SACLOS so there's hope

whole salmon
#

Yup, guided is a lot harder, I still remember the days when it was super broken in Battlefield 2, and they struggled to fix that for years and settled for something a bit flawed (who remembers their shot warping trough helis 😄 ?).

It basically requires full loop of input sending, buffering those inputs, then playing them, and rewinding and replaying client if his outputs don't match, it's non trivial issue that can't be solve in script.

An easy way out is to only simulate on server, and send client updates, but that feels super unresponsive and you sort of can't do it in script only (I guess).

Or you could give client complete authority over that projectile and watch people exploit that 😄

cosmic swift
#

they're implementing TCP at the missile level damn

whole salmon
cosmic swift
#

I dearly apologize popcat

sonic crag
#

at least over TCP it would be reliable

#

I don't actually know any case studies on this type of thing

wintry cape
#

What about only sending if position updates?

grave crystal
#

I would give client complete authority; at this time there probably isn't someone with the motivation and technical skills to exploit it.

sonic crag
#

you probably don't want to update its position and velocity every frame over network

#

is it a choice between smooth but inaccurate, and jittery but accurate?

wintry cape
#

this thought process started in riverx's javeline thread, moved to the bradley thread, then ended up here. I don't think anyone is bothered by it, we all just like cool shit.

whole salmon
whole salmon
sonic crag
#

right, just have the server tell clients where it blew up

whole salmon
sonic crag
#

or i can just not do guided

wintry cape
#

maybe collab with @jolly fiber when he gets done with ropes. Multiple minds could figure out the tough parts.

loud thistle
#

Ropes?

wintry cape
#

Yes, ropes

loud thistle
#

Hopefully that’s for helicopters?

#

Could be neat

sonic crag
#

wonder how that worked

hoary moth
#

Not sure but I was playing ofpe on Xbox. Could have been done due to smaller scale but game was made in the early 2000’s

terse beacon
#

This gives me Half Life 2 rocket launcher vibes

plain river
#

To sync on network you could have a target entity and then if you move your mouse only the target entity is moved.
When the missile is replicated on other clients, it simply follows the target entity.
The missile controlling player only sends where the target entity should move to server and server is the authority of it.

target entity -> spawn it like 100m ahead of the missile -> moves at the same speed as missile
then if you move your mouse, it adjusts the trajectory
sth like that?

sonic crag
hollow falcon
#

With MP you could maybe send positions less frequently than per frame, and then interpolate between those positions
Also great work

sonic crag
#

it's interesting that fire and forget/target lock is very easy but user guided is very not easy

#

like to a point I maybe wouldn't even bother doing guided

exotic flower
sonic crag
# exotic flower I have some things that could make use of this if you are interested in helping ...
class Bacon_JankyHomingMissileClass: ProjectileClass 
{};

class Bacon_JankyHomingMissile: Projectile
{
    [Attribute("false", UIWidgets.Auto, "Is guided? otherwise target must be specified")]
    bool m_bGuided;
    
    [Attribute("0 0.5 0", UIWidgets.Auto, "Target position offset for auto homing")]
    vector m_vTargetPositionOffset;
    
    [Attribute("0.5 0.5 0", UIWidgets.Auto, "Missile agility: X yaw, Y pitch")]
    vector m_vAgility;
    
    [Attribute("BTR2", UIWidgets.Auto, "Name of the entity that is the target (for auto homing)")]
    string m_sTargetEntityName;
    
    [Attribute("launchertest", UIWidgets.Auto, "Name of the launcher that would be guiding the projectile")]
    string m_sLauncherEntityName;
    
    [Attribute("100", UIWidgets.Auto, "Projectile velocity")]
    float m_fVelocity;
    
    [Attribute("1000", UIWidgets.Auto, "Guided range")]
    float m_fMaxGuidedRange;
    
    IEntity m_target; 
    vector m_vTargetPosition;
    
    IEntity m_launcher;
    Physics m_physics;
    
    vector m_myAngles;
    vector m_myOrigin;
    
    override void EOnInit(IEntity owner)
    {
        super.EOnInit(owner);
        
        if (SCR_Global.IsEditMode())
            return;

        m_physics = GetPhysics();
        m_target = GetGame().FindEntity(m_sTargetEntityName);
        m_launcher = GetGame().FindEntity(m_sLauncherEntityName);
    };
    
    override void EOnFrame(IEntity owner, float timeSlice)
    {
        m_myOrigin = GetOrigin();

        vector idealDirection;
        
        if (m_bGuided)
        {
            if (!m_launcher) return;
            idealDirection = vector.Direction(m_myOrigin, GetWantedGuidedTargetPosition());
        }
        else 
        {
            if (!m_target) return;
            idealDirection = vector.Direction(m_myOrigin, m_target.GetOrigin() + m_vTargetPositionOffset);
        };
        
        float dotRight = vector.DotXZ(VectorToParent(vector.Right), idealDirection);
        float dotUp = vector.Dot(VectorToParent(vector.Up), idealDirection);

        m_myAngles = GetAngles();

        if (Math.AbsFloat(dotRight) > 1)
            m_myAngles[1] = m_myAngles[1] + (m_vAgility[0] * dotRight*0.1);

        if (Math.AbsFloat(dotUp) > 1)
            m_myAngles[0] = m_myAngles[0] + (m_vAgility[1] * dotUp*0.1);

        SetAngles(m_myAngles);
        m_physics.SetVelocity(VectorToParent(vector.Forward)*m_fVelocity);

        super.EOnFrame(owner, timeSlice);
    };
    
    vector GetWantedGuidedTargetPosition()
    {
        vector mat[4];
        m_launcher.GetWorldTransform(mat);
        
        vector start = mat[3] + m_launcher.VectorToParent(vector.Forward*0.2);
        vector forward = m_launcher.GetWorldTransformAxis(2).Normalized();
        vector end = start + (forward * m_fMaxGuidedRange);

        autoptr TraceParam param = new TraceParam;
        param.Exclude = m_launcher;
        param.Flags = TraceFlags.ENTS | TraceFlags.WORLD;
        param.LayerMask = EPhysicsLayerDefs.Projectile;
        
        param.Start = start;
        param.End = end;

        float hit = GetWorld().TraceMove(param, null);
        float distance; 
        
        if (!param.TraceEnt)
        {
            return end;
        };

        return start + (forward * (m_fMaxGuidedRange*hit));
    };
};
#

its very primitive but i had like 1 hour

#

i just duplicated the rpg rocket and set gravity to 0 in rigidbody and changed the class from projectile to the above entity class from the script, pretty much

exotic flower
#

What was the problem with having gravity?

sonic crag
#

I think it's not relevant, at the start I tried doing it without setting physics velocity but now that velocity is set by script then gravity becomes irrelevant

#

the rocket wouldn't fly in its forward direction (when angles of the projectile changed the movement didnt respond) so setting velocity was my galaxy brain workaround

grand radish
#

Wocket

urban cave
#

Would you be able to put this on a mounted gun?

sonic crag
#

doesnt matter who/what fires it

keen moth
#

@dim wolf

#

^

scenic dew
#

@sonic crag you planning on making a TOW missle?

scenic dew
#

aw