Notify Message
Forums
Page 1
Search
#14326487 Mar 15, 2020 at 01:15 PM · Edited 2 months ago
Captain
17 Posts
I would like to propose an extra MP generic/int property for OPRF, such that radar logic etc. knows what to pick up and display without relying on /sim/aircraft and other inferred logic - especially as the number of aircraft and assets is constantly evolving.

Current OPRF properties I know of are:
int[0]: smoke
int[2]: radar (0 for on, 1 for off)
int[17]: model selection (e.g. within depot).

E.g. the values could be:
* 0: aircraft with engines running (default - also if not submitted) - no difference between heli and plane
* 1: aircraft on ground/water with engines stopped (assuming not "hot" anymore)
* 2: aircraft in air
* ...
* 10: ship (not sure whether need to have small boats separate because radar cannot pick them up [if radar flag set to off - due to size]
* 20: vehicle engines on (driving - e.g. asset or future Hunter)
* 21: vehicle engines off
* 30: building
* ...
* 99: crater / visuals

The thing right now is that different airplanes have some logic based on model names (which is brittle) or have no logic at all and everything gets displayed on the radar/HUD. It would be nice if passive stuff like buildings, parked cars/airplanes are not discoverable by the radar / some weapons. And that many weapons will not rely on being target selected (e.g. cannon without radar, bombs).

Steps:
A) Agree on which generic/int will be used
B) Agree on values
C) Update all OPRF assets
D) Update all airplanes/helis (are default 0, but new logic for engines off)
E) Update radar/weapons logic.

It will be quite an effort - but I cannot see how we could continue without doing it.
+2
#14326491 Mar 15, 2020 at 01:33 PM
Captain
17 Posts
I might be wrong, but I believe that some planes like the M-2000 also take some assumptions about elevation over ground - which is inaccurate or at least fragile plus unnecessary overhead to try to deduct what the "ting" is.
+0
#14366184 May 31, 2020 at 12:12 PM
Colonel
46 Posts
From a quick check it appears that int[21] is the first available so we could use that.

As for values I'd much prefer a bitmask; so maybe we just grab a chunk of the generic/bools and call the start bool base and assign as follows.

base+0 - engines running
base+1 - on ground
base+2 - inside hangar
base+3 - moving

base+4 - aircraft
base+5 - maritime
base+6 - ground vehicle
base+7 - has tracks

base+8 - building
base+8 - crater

+1
#14366627 Jun 01, 2020 at 10:52 AM
Brigadier Ge...
482 Posts
Good idea Rick, and I agree with Richard about bitmask.

We can make a notification for creation/removal/moving of craters and other static stuff. As you talked about Rick, good idea to put the bit mask into that also, I suggest a couple of bytes long.

I suggest in second pass of emesary. Lets get missiles and hits rolled out first.
Third pass would be to make missiles visible over MP.
"No one dared to make a slip, the stranger there among them had the big iron on his hip."
+0
#14366644 Jun 01, 2020 at 11:42 AM · Edited 2 months ago
Brigadier Ge...
482 Posts
Here is my suggestion for a crater (and other statics) notification:

I made 16 bit for what you suggest Rick.


var StaticNotification_Id = 25;
var StaticNotification =
{
# new:
# _ident - the identifier for the notification. not bridged.
# _kind - created, moved, deleted (see below). This is the activity that the notification represents, called kind to avoid confusion with notification type.
# _secondary_kind - This is the entity on which the activity is being performed. See below for predefined types.
#
# UniqueIdentity - an identity that is unique to the sending instance of FG. Can be combined with the callsign to create an MP unique ID.
##
new: func(_ident="stat", _unique=0, _kind=0, _secondary_kind=0)
{
var new_class = emesary.Notification.new("StaticNotification", _ident, StaticNotification_Id);
# _ident -> "stat"
new_class.UniqueIdentity = _unique; # random from 0 to 15000000 that identifies each static object
new_class.Kind = _kind; # 1=create, 2=move, 3=delete
new_class.SecondaryKind = _secondary_kind; # 0 = small crater, 1 = big crater
new_class.IsDistinct = 0; # keep it 0
new_class.Callsign = nil; # populated automatically by the incoming bridge when routed

new_class.Position = geo.aircraft_position(); # position
new_class.Heading = 360; # heading
new_class.Flags1 = 0; # 8 bits for whatever.
new_class.Flags2 = 0; # 8 bits for whatever.

new_class.GetBridgeMessageNotificationTypeKey = func {
return new_class.NotificationType~"."~new_class.Ident~"."~new_class.UniqueIdentity;
};
new_class.bridgeProperties = func
{
return
[
{
getValue:func{return emesary.TransferCoord.encode(new_class.Position);},
setValue:func(v,root,pos){var dv=emesary.TransferCoord.decode(v, pos);new_class.Position=dv.value;return dv},
},
{
getValue:func{return emesary.TransferByte.encode(new_class.Kind);},
setValue:func(v,root,pos){var dv=emesary.TransferByte.decode(v,pos);new_class.Kind=dv.value;return dv},
},
{
getValue:func{return emesary.TransferByte.encode(new_class.SecondaryKind);},
setValue:func(v,root,pos){var dv=emesary.TransferByte.decode(v,pos);new_class.SecondaryKind=dv.value;return dv},
},
{
getValue:func{return emesary.TransferFixedDouble.encode(new_class.Heading-180,1,0.65);},
setValue:func(v,root,pos){var dv=emesary.TransferFixedDouble.decode(v,1,0.65,pos);new_class.Heading=dv.value+180;return dv},
},
{
getValue:func{return emesary.TransferByte.encode(new_class.Flags1);},
setValue:func(v,root,pos){var dv=emesary.TransferByte.decode(v,pos);new_class.Flags1=dv.value;return dv},
},
{
getValue:func{return emesary.TransferByte.encode(new_class.Flags2);},
setValue:func(v,root,pos){var dv=emesary.TransferByte.decode(v,pos);new_class.Flags2=dv.value;return dv},
},
{
getValue:func{return emesary.TransferInt.encode(new_class.UniqueIdentity,3);},
setValue:func(v,root,pos){var dv=emesary.TransferInt.decode(v,3,pos);new_class.UniqueIdentity=dv.value;return dv},
},
];
};
return new_class;
},
};
"No one dared to make a slip, the stranger there among them had the big iron on his hip."
+0
#14367340 Jun 02, 2020 at 10:33 PM
Brigadier Ge...
482 Posts
I have now got the StaticNotification to work on a basic level (creating).

Is 14 bools fine?
"No one dared to make a slip, the stranger there among them had the big iron on his hip."
+0
Page 1