Version 4.5b (01/2014, compatible with FG 2.12.1 and earlier versions)
...so it does not support Flightgear 3.x yet?
Version 4.5b (01/2014, compatible with FG 2.12.1 and earlier versions)
MountainFlyerN22 wrote in Thu Oct 16, 2014 3:24 am:I tried to install 4.5b but my antimalware program blocked it.
Could there be some thing wrong with it maybe?
LesterBoffo wrote in Sat Nov 29, 2014 9:27 pm:Can someone point to a way that might integrate fixed position scenery static objects as working Bombable anti aircraft guns? It seems that the hard points on the AI aircraft are a start. what I would like to see is some way to get them to selectively track, from the ground 'enemy aircraft' approaching from a distance, yet not shoot up any MP aircraft, tower ops, or other friendlies in their immediate range and airspace. This is a function most air combat sims have in addition to the AI aircraft you encounter.
RevHardt wrote:I have recently been trying out Bombable, trying to get AA batteries to fire at aircraft in their range. As each AA unit has a hemispherical (cylindrical, as a reduced test case) detection range, a cluster of them would have a contiguous volume of effect. Any related/unrelated API that calculates such zones?Hooray wrote:if you want to, you could probably create your own module for $FG_ROOT/Nasal - or even just make it an include file and use io.include() in your lcontroller to add your initialization stuff there.
lcontroller files are only loaded during initialization of the simulator - I don't think we're even handling re-init/resets explicitly ATM (?) Thus, any code added to your lcontroller (or even just included there) would be executed only once. We're kinda using this method in the .symbol files to set up a shared pre-created cache of symbols that can be shared among all instances of a layer.
Regarding your other question, there's quite some related code in several places. xiii's fox2.nas/radar code should be relevant, some aircraft also have code that emulate a rotating radar antenna.
In general, the view handling/camera (FGCamera) code should also contain related computations.
But you could probably adapt some existing code for this:
http://www.calculatorsoup.com/calculato ... sphere.php
http://stackoverflow.com/questions/5674 ... -longitude
Either way, you'll probably want to use debug.benchmark() and run some stress-tests to see how heavy these calculations are, so that you can try to optimize the implementation, or maybe try to build a lookup table, so that multiple AA batteries can update "concurrently" without having a significant frame rate impact.
Several core developers have been wanting to re-implement geo.nas functionality via Nasal/cppbind so that "native" code is used here - so that would be another option here: http://wiki.flightgear.org/Plan-zakalawe.
Another option would be using a Nasal worker thread to run these computations via thread.newthread() - but care must be taken not to call any extension functions then, and locking should be used to serialize access between the FG main loop and shared data structures used by the background thread.
Bomber wrote:Chain home was a directional radar pointing across the channel, there being two 'electronic' systems short and long range. Once you've flown past the chain and got behind it you were in effect off the radar... and this is where local spotters on church roofs using binoculars and hearing the sound of engines over to the north and triangulating this type of info from various sources both on the ground and in the air were used...
But the point of the exercise was that there was a plane coming with bombs to drop and your job was to stop them... (now I know you all know this, but it does no harm to say it)
So isn't that the starting point for an offline mission.... A plane takes off in France, climbs to 11000ft and heads to one of several possible destinations via some way points, either a city, an airfield or a radar station and drops his bombs and then returns.
Now I see that as a basic script that could be used anywhere in the world, any starting point, any destination, and height.
Of course a single plane might not be what you're after, maybe a variable amount... Russian bears flying to North America and you have to intercept in Phantoms.
And the frequency of missions shouldn't be just one set of intruders going for a target, but maybe one on the way, one climbing to alt and another taking off, depending upon difficulty,... the exercise being to stress the game player, forcing decision to be made... intercept this or that...Hooray wrote:Being involved in both efforts to some degree, we could probably come up with a simple "mission" that involves circumventing a chain home radar system, or responding to its alerts.
A first prototype would obviously be "local", i.e. not involve any MP or dual-piloting, but it's not impossible, not even extremely difficult to combine those 3 features. After all, it's really just a bit of scripting tied together. And it's nothing that would take ages to pull off as long as people can live with some compromises initially.
So, we would need a list of positions, e.g. based on: http://en.wikipedia.org/wiki/Chain_Home ... Home_sites
The whole thing could then be turned into a map-editor like this:
Also, tutorials & missions are just XML - Nasal isn't needed to create simple tutorials
As long as someone can provide a list of positions, we can place radar antennas, show them on a map (including radar beams), and even instantiate some piece of Nasal for each antenna that tracks sector violations. This would not be complicated to pull off, not even using just the tutorials system - and once we support Nasal blocks per model, we can easily run custom logic
LesterBoffo wrote in Mon Dec 01, 2014 6:10 am:I can't help but think this radar solution is throwing way too much coding at something that should be much easier to do. I've played two previous WWI air combat sims that ran in OpenGL on much, much slower gaming rigs than my present 'puter, that could run tens of dozens of functional and fairly accurate AA ( and other..) target tracking gun weaponry without causing the least amount of a frame rate hit. Of course the coding for these were not open source, but I can't believe that two, nearly 13 to 18 year old sims had huge lines of code running their AA guns.
I don't do coding from scratch well, making a function in Nasal would be better done by someone who knows the language well, I could copy, doctor and paste something, but would it be optimal?
# lines 2285 and 2286
var msgcallsign = substr(msg, 0, 7);
p = 7;
# line 2288
var type = Binary.decodeByte(substr(msg, p, Binary.sizeOf["byte"]));
# lines 2301 and 2370
var damageAdd = Binary.decodeDouble(substr(msg, p, Binary.sizeOf["double"]));
# lines 2303 and 2372
var damageTotal = Binary.decodeDouble(substr(msg, p, Binary.sizeOf["double"]));
# lines 2305 and 2374
var smokeStart = Binary.decodeByte(substr(msg, p, Binary.sizeOf["byte"]));
# lines 2307 and 2376
var fireStart = Binary.decodeByte(substr(msg, p, Binary.sizeOf["byte"]));
var parse_msg = func (source, msg) {
if(!getprop(MP_share_pp)) return;
if(!getprop (MP_broadcast_exists_pp)) return;
if(!getprop(bomb_menu_pp ~ "bombable-enabled")) return;
debprint("Bombable: typeof source: ", typeof(source));
debprint("Bombable: source: ", source, " msg: ", msg);
var ourcallsign = getprop("/sim/multiplay/callsign");
var p = 0;
var msgcallsign = substr(msg, 0, 7);
p = 7;
var type = Binary.decodeByte(substr(msg, p, Binary.sizeOf["byte"]));
p += Binary.sizeOf["byte"];
#debprint ("msgcallsign:"~ msgcallsign," type:"~ type);
#not our callsign and type !=2, we ignore it & return (type=2 broadcasts to
#*everyone* that their callsign is re-setting, so we always listen to that)
if((sprintf("%6s", msgcallsign) != sprintf("%6s", ourcallsign)) and type != 2 and type != 3 ) return;
#damage message
if(type == 1){
var damageAdd = Binary.decodeDouble(substr(msg, p, Binary.sizeOf["double"]));
p += Binary.sizeOf["double"];
var damageTotal = Binary.decodeDouble(substr(msg, p, Binary.sizeOf["double"]));
p += Binary.sizeOf["double"];
var smokeStart = Binary.decodeByte(substr(msg, p, Binary.sizeOf["byte"]));
p += Binary.sizeOf["byte"];
var fireStart = Binary.decodeByte(substr(msg, p, Binary.sizeOf["byte"]));
p += Binary.sizeOf["byte"];
debprint("damageAdd:", damageAdd, " damageTotal:", damageTotal, " smoke:", smokeStart, " fire:", fireStart);
mainAC_add_damage(damageAdd, damageTotal, "weapons", "Hit by weapons!");
}
elsif(type == 2){
#reset message for callsign
#ai_loc="/ai/models";
#var mp_aircraft = props.globals.getNode(ai_loc).getChildren("multiplayer");
#foreach (mp;mp_aircraft) { # mp is the node of a multiplayer AI aircraft
# mp_callsign=mp.getNode("callsign").getValue();
# mp_childname=mp.getName();
# mp_index=mp.getIndex();
# mp_name=ai_loc~"/"~mp_childname~"["~mp_index~"]";
# mp_path=cmdarg().getPath(mp);
# debprint ("Bombable: mp_path=" ~mp_path);
mp_name = source;
debprint("Bombable: Resetting fire/damage for - name: ", source, " callsign: ", string.trim(msgcallsign));
# if (sprintf ("%6s", mp_callsign) == sprintf ("%6s", msgcallsign)) {
#blow away the locks for MP communication--shouldn't really
# be needed--just a little belt & suspendors things here
# to make sure that no old damage (prior to the reset) is sent
# to the aircraft again after the reset, and that none of the
# locks are stuck.
props.globals.getNode("/bombable").removeChild("locks",0);
resetBombableDamageFuelWeapons(source);
msg = string.trim(msgcallsign) ~ " is resetting; damage reset to 0% for " ~ string.trim(msgcallsign);
debprint("Bombable: ", msg);
targetStatusPopupTip(msg, 30);
# }
# }
}
elsif(type == 3){
# update of callsign's current damage, smoke, fire situation
# ai_loc="/ai/models";
# var mp_aircraft = props.globals.getNode(ai_loc).getChildren("multiplayer");
# foreach (mp;mp_aircraft) { #mp is the node of a multiplayer AI aircraft
# mp_callsign=mp.getNode("callsign").getValue();
# mp_childname=mp.getName();
# mp_index=mp.getIndex();
# mp_name=ai_loc~"/"~mp_childname~"["~mp_index~"]";
# mp_path=cmdarg().getPath(mp);
# if (sprintf ("%6s", mp_callsign) == sprintf ("%6s", msgcallsign)) {
debprint ("Bombable: Updating fire/damage from - name: ", source, " callsign: ", string.trim(msgcallsign));
var damageAdd = Binary.decodeDouble(substr(msg, p, Binary.sizeOf["double"]));
p += Binary.sizeOf["double"];
var damageTotal = Binary.decodeDouble(substr(msg, p, Binary.sizeOf["double"]));
p += Binary.sizeOf["double"];
var smokeStart = Binary.decodeByte(substr(msg, p, Binary.sizeOf["byte"]));
p += Binary.sizeOf["byte"];
var fireStart = Binary.decodeByte(substr(msg, p, Binary.sizeOf["byte"]));
p += Binary.sizeOf["byte"];
mp_update_damage(source, damageAdd, damageTotal, smokeStart, fireStart, msgcallsign);
# }
# }
}
}
Users browsing this forum: No registered users and 1 guest