#Sheer Iceman 1197 weeeee
1 messages · Page 1 of 1 (latest)
That looks like a tow to me, just needs some texturing and getting added into the vehicles that can use them
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
I don’t know how that would really work but I’m sure it’s possible
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
Ah
Maybe range limitations could help?
But then again irl TOWs have a lot of range
its more about how much traffic you send over the network
something something deterministic pathfinding?
Might look super wonky if the update rate is too low though
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
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
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
there's probably some compensation in these cases still no?
but maybe its simple and im only confused because I've never synced homing projectiles over net
I wonder how many actual updates you'd need to send to get accurate enough
It's probably speed/turn arc dependent
I think at least one of the previous arma games have had guided projectiles but don't know how that worked
ARMA3 has SACLOS so there's hope
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 😄
they're implementing TCP at the missile level damn
Why you gotta bring TCP in to this conversation haha
I dearly apologize 
at least over TCP it would be reliable
I don't actually know any case studies on this type of thing
What about only sending if position updates?
I would give client complete authority; at this time there probably isn't someone with the motivation and technical skills to exploit it.
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?
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.
It's the same problem as with vehicles, when something is client side that means there are multiple sources of truth. Who gets to decide that the rocket has impacted something? According to whom is the damage dealt?
Right now all solutions would be flawed. My advice would be have server authority over it. You will have cases where missile didn't land in the same spot on client and server, but you don't go in to this grey area of client sided stuff.
right, just have the server tell clients where it blew up
Have the missile fly to the aim point that it has currently assigned, clients inputs might get delayed and so you will have differences on client and server naturally from that. Impact/explosion should be synchronized over network afaik.
maybe collab with @jolly fiber when he gets done with ropes. Multiple minds could figure out the tough parts.
Ropes?
Yes, ropes
Ofp had it on the Bradley’s
wonder how that worked
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
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?
oh yea I wonder how they synced that in MP
With MP you could maybe send positions less frequently than per frame, and then interpolate between those positions
Also great work
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
I have some things that could make use of this if you are interested in helping me
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
What was the problem with having gravity?
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
Wocket
Would you be able to put this on a mounted gun?
doesnt matter who/what fires it
@sonic crag you planning on making a TOW missle?
aw

