time of flight flak news - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 06-15-2014, 09:20 AM   #1
Stonehouse
Senior Member
 
Stonehouse's Avatar
 
Join Date: Oct 2010
Posts: 1,336
Default time of flight flak news & questions

Just wanted to let people know that I seem to have a working very basic prototype of time of flight based flak. One of my main stumbling blocks was I didn't seem to be able to populate a non locally declared table until I found that it seems that I needed to return the tables from each function to get things to update. Which was a surprise as I thought the table being globally declared would have sorted things like that.

Anyway now doing a lot of testing and starting to put back in things like battery quality etc to influence things like the spread of the flak box created but have some questions for those with more scripting knowledge than me in the hope they can help me improve this and deliver something efficient.

Currently the prototype uses the following triggers:
(1) a mission start trigger to load first mist3.3a and then the flak script
(2) a continuous trigger which runs the flak manager function from the flak script - this basically does nothing else than figure out if a flak box should be created and where the explosions happen. This flak manager creates explosions for the entire map and all flak zones. lol theoretically anyway as I still have to test the limits of this.
(3) a continuous trigger per flak zone as before - this pretty much does nothing except add flak box co-ordinates and time for the explosions to happen to some tables which the flak manager reads.

My questions are:
(1) currently to remove a table entry I'm just setting it to nil as remove table didn't seem to work for me. This doesn't seem to actually remove the table entry as such but allows me to ignore it by testing for the nil entry. Reading some lua references it seems that eventually nil table entries are removed in reality freeing memory and reducing the number of entries in the table (ie #table goes from 2 to 1 if one was nil) via a garbage collection routine inherent in lua. Have I understood this correctly? Do I need to worry about this further eg force some sort of garbage collection routine to kick in more often to reduce the iterations in for loops around the tables and other performance related things? How would I do this or where would you look for examples of how this works?

(2) The flak manager is running on a continuous trigger whereas my original thought was to use a once trigger to load the whole script and then use the schedule function command to operate the flak manager at a convenient interval. Unfortunately I had trouble getting the schedule function to work properly for me so sidestepped the issue in preference of getting a prototype going.
Is the schedule function method significantly better from a performance point of view? Can someone give me a basic thumbnail sketch of getting it to work and prerequisites (eg I noticed snafu declares the scheduled function in his GCICAP as a local function but I've never understood if this was important for scheduling - I kind of assumed the main reason was to force each scheduled instance to have a fresh set of variables scope wise)
In other words I'm trying to decide if it is worth trying to rearrange things in this version before adding other nice to haves like battery skill, rate of fire etc.

Hopefully I can progress this some more soon if my workload in my job lets me. One of the nice things about a week off is that you can concentrate on things like this.

Cheers,
Stonehouse

Last edited by Stonehouse; 06-15-2014 at 09:01 PM.
Stonehouse is offline   Reply With Quote
Old 06-16-2014, 12:39 PM   #2
Stonehouse
Senior Member
 
Stonehouse's Avatar
 
Join Date: Oct 2010
Posts: 1,336
Default Release client of time of flight based flak

Ok looks like my questions were too hard or the right people haven't looked at this thread yet.

Not to worry , I ended up pushing on regardless with adding back skill levels, rate of fire etc to arrive at the script attached below. It definitely seems to work and my test bed mission (also attached) seems to run ok without frame rate issues even when all the zones are adding targets and the flak manager is creating explosions all over the place. I can see that if a plane changes their vector that the flak box will get created where they would have gone and likewise if they don't change their vector they start to get bracketed.

I do see some explosions occasionally going off in odd places so I think perhaps that the zones are fighting over the next index for the tables and possibly either overwriting entries or the flak manager perhaps struggles to keep up so it probably needs further work. I also find this version is much less deadly than the old vector based flak and even though I've reduced the skill based errors at great deal it just doesn't seem to be as effective. Perhaps another bug still to find or just more tweaking.......

I suggest you load up my test mission and watch it run through until all the aircraft land or crash and see what you think and then give it a try in your own missions and post up feedback/errors. Not sure how fast I can address things people mention as work is a bit up and down at present so I can't judge my spare time.

Note Mist 3.3a can be found http://forums.eagle.ru/showpost.php?...6&postcount=97

Cheers,
Stonehouse

<edit> sorry found the reason for the lack of effectiveness - got the case of a variable name wrong so the explosions were all strength 1. Updated the script and mission but now it seems too deadly. It's getting very late here so I'm going to head off to bed and will look at the skill based errors tomorrow to sort out the effectiveness of the flak.
<end edit>
Attached Files
File Type: lua flaktofv0_3.lua (14.0 KB, 377 views)
File Type: miz tof.miz (51.6 KB, 92 views)

Last edited by Stonehouse; 06-16-2014 at 01:49 PM. Reason: found a bug
Stonehouse is offline   Reply With Quote
Old 06-17-2014, 09:32 AM   #3
Stonehouse
Senior Member
 
Stonehouse's Avatar
 
Join Date: Oct 2010
Posts: 1,336
Default

I've done some tweaking and I think this version is a reasonable balance. High skill batteries are very deadly unless you aggressively change your vector often, med skill - if you fly on a constant vector for too long expect to suffer damage or die, low skill you probably can get away with reasonably long periods of flying a constant vector unless you are unlucky. Mind you there is randomness at work so each run of the test mission will give different results and I'm looking more at the average experience I seemed to get from running it many times. ie if luck is against you all the aircraft might get shot up, where in another run most will make it.

Updated the notes a bit in the script to the effect that this is meant to model a Flak 36/18 and gave instructions as to what values should be changed and how to modify it to represent a Flak 41 (which came into service during 1943 but pretty much stayed in Germany for home defense and wasn't as anywhere near as common as the earlier model) - if I get time I may try to parameterise this so you can pass a value to indicate the battery is the more deadly Flak41.

Anyway attached is new version of the script and the updated test mission.

Cheers,
Stoney
Attached Files
File Type: lua flaktofv0_4.lua (14.7 KB, 342 views)
File Type: miz tofv4.miz (52.4 KB, 107 views)

Last edited by Stonehouse; 06-17-2014 at 09:34 AM.
Stonehouse is offline   Reply With Quote
Old 06-21-2014, 04:53 PM   #4
Mojeaux
Member
 
Mojeaux's Avatar
 
Join Date: Nov 2009
Posts: 249
Default

Hay Stonehouse; Great work on the flack set up... I've been following all the post and I found the Flack down load in the user files...
I need just a little help here...
My question is;

1. There is no referance to where to install the "flackv1.lua" file! Where dose it go?

2. You mentioned you need a lua called "Mistv3_3" I have never used this can you direct me to where to find the lua? Edit...I just saw your link above for the Mist.lua...cheers...

I'm really interested in your work however I do not speak code....I need it broken down for the regular guy..hehe

Keep up the good work Smokehouse..
__________________

Last edited by Mojeaux; 06-21-2014 at 04:57 PM.
Mojeaux is offline   Reply With Quote
Old 06-22-2014, 09:53 AM   #5
Quip
Member
 
Join Date: Feb 2013
Posts: 212
Default

Excellent

Using this in place of MANPADs in missions where I want to have some sort of danger without having to resort to SAMs all the time. For this purpose I use 3 kg shells, to strike a balance between lethality and playbility.

A tip is to set a "if unit dead" condition for the FLAK-zone, so that the FLAK dies when you kill a certain structure. I use deployed ZSU23 for that purpose.

Thanks!!
Quip is offline   Reply With Quote
Old 06-22-2014, 10:58 AM   #6
Stonehouse
Senior Member
 
Stonehouse's Avatar
 
Join Date: Oct 2010
Posts: 1,336
Default

Quote:
Originally Posted by Mojeaux View Post
Hay Stonehouse; Great work on the flack set up... I've been following all the post and I found the Flack down load in the user files...
I need just a little help here...
My question is;

1. There is no referance to where to install the "flackv1.lua" file! Where dose it go?

2. You mentioned you need a lua called "Mistv3_3" I have never used this can you direct me to where to find the lua? Edit...I just saw your link above for the Mist.lua...cheers...

I'm really interested in your work however I do not speak code....I need it broken down for the regular guy..hehe

Keep up the good work Smokehouse..
Ok the flak lua script is just in a folder which you can reference easily when building your mission. When you add the trigger action DO SCRIPT FILE you get a OPEN button which when clicked gives you the standard Windows browse for a file dialog - you just navigate to where the lua script is and select it and that is it. Ditto for Mist. Your finished mission.miz file will contain both lua scripts (you can open the .miz file with tools like 7 zip). This would be most likely on a MISSION START trigger after you've done a DO SCRIPT FILE trigger action for MIST.

Please see following post for an update on both the vector and time of flight flak scripts.

Last edited by Stonehouse; 06-22-2014 at 11:33 AM.
Stonehouse is offline   Reply With Quote
Old 06-22-2014, 11:13 AM   #7
Stonehouse
Senior Member
 
Stonehouse's Avatar
 
Join Date: Oct 2010
Posts: 1,336
Default

I've integrated the original vector based script with the time of flight based script so you now have a single flak script to load with 4 main functions:
  • flakmgr - this is half the shell time of flight system and creates explosions at co-ordinates given by the addtgt function
  • addtgt - this creates co-ordinates and timing for flak boxes into a table and is the other half of the time of flight based flak. This table is read by the flakmgr function which creates the actual explosions.
  • fill - this is the original script closely based on what Sithspawn built and is really a flak "effect" which creates random explosions across a zone (see example mission and comments in the script itself)
  • vecflak - this is a rebadged version of the old vector based flak script which is still useful for some situations.
Pretty much use a combo of flakmgr + addtgt (which go together), fill and vecflak to get the flak simulation you want, ranging from something that is mostly a cinematic effect to something very lethal.

I have tweaked further the explosion strength and skill based error for the time of flight based flak to try very hard to get something that is reasonably representative and also gives reasonable playability. Do be careful how many high skill flak zones are used as it is likely to be very deadly and requires constant vector changes to avoid damage. IE high skill flak zones are probably very AI unfriendly unless you give them orders to jink around somehow.


Likewise I have slightly changed the vector based flak's rate of fire to be slightly more playable.

On the whole I've tried to build something that will damage you and slowly chip away at you rather than kill you on the spot but there is a random factor at work so it's possible that the first flak burst you see is your last regardless of the flak function you use and the skill level of the battery.

Hope it works ok for everyone who tries it. Let me know how it goes. Open the script itself to see documentation and of course there is the demo mission to give you examples.

Cheers,
Stoney


<edit> I see from checking the main MIST thread just now that version 3.4 has been released which supersedes v3.3a. Please use version 3.4 instead of 3.3a. Link here for 3.4 http://forums.eagle.ru/showpost.php?...&postcount=538
Attached Files
File Type: lua flakv2_0.lua (19.4 KB, 408 views)
File Type: miz flakexamples.miz (62.7 KB, 185 views)

Last edited by Stonehouse; 06-22-2014 at 11:11 PM. Reason: sorry tired, uploaded the wrong mission. correct now
Stonehouse is offline   Reply With Quote
Old 06-26-2014, 01:29 AM   #8
Stonehouse
Senior Member
 
Stonehouse's Avatar
 
Join Date: Oct 2010
Posts: 1,336
Default New version soon

Just an fyi that I've done some more work on this module and have successfully got tof and vector based flak working when attached to a moving unit. I was mainly interested in this for maritime convoy scenarios and having the flak script be able to be attached to a unit via a trigger rather than a zone. My tests used the tanker and dry cargo ships and I was able to attach flak to these ships so enemy aircraft in range are attacked. Few other improvements added like using spherical trigger zones rather than cylindrical ones but the main news really is that I'm nearly done creating a completely new version based around the number of batteries or individual guns determining how many targets can be attacked at one time. My biggest problem with the flak script in use now is that it scales based on the number of enemy aircraft. So a single aircraft will only get a single set of explosions where if 10 aircraft enter the trigger zone you get 10 explosions. The new version will add a new parameter which specifies how many batteries (for time of flight based flak) or how many guns (for vector based flak) and this number will determine how many targets can be attacked in any given cycle. Additionally I'm adding true rate of fire based on skill instead of the statistical approach I use now. Note that this means that if a target is defended by 6 batteries and a single aircraft comes by all 6 will attack it but if more than 6 aircraft go for the target only a max of 6 will get attacked at any one cycle with the target for each battery determined randomly. So the point being that at times some aircraft will be unengaged which I think is much more realistic.

I'm hoping this new version will be ready by the end of the weekend for people to try out assuming real life doesn't interfere.

Cheers,
Stonehouse

Last edited by Stonehouse; 06-26-2014 at 01:57 AM.
Stonehouse is offline   Reply With Quote
Old 06-26-2014, 06:01 AM   #9
dooom
Senior Member
 
dooom's Avatar
 
Join Date: Sep 2009
Location: Saskatoon Saskatchewan
Posts: 2,265
Default

Cool!

I'll update knuckle blood.miz with this pending script and report back
__________________

""This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL
*NOTCH VIDEO F15 vs SU33
*P-51D ANM64 Bombing guide
dooom is offline   Reply With Quote
Old 06-26-2014, 10:08 AM   #10
Stonehouse
Senior Member
 
Stonehouse's Avatar
 
Join Date: Oct 2010
Posts: 1,336
Default

Ok I lied lol, actually no I didn't I just got very keen after I got home from work and got it (hopefully) finished. It was a bit rushed so hopefully no bugs and the doco in the script is alright. Let me know if there are problems. Script and mission attached. Use Mist3.4 please.

Cheers
Stonehouse

<edit> I may need to change the skill based dispersion numbers a bit as some experiments with some friends as guinea pigs tonight demonstrated that as each plane gets killed the flak gets deadlier as the same amount of guns hunt fewer targets..realistic but not so playable if it is not just random bad luck that the first few got hit badly, well actually took direct hits and were converted to flaming fragments.

Probably also have to be more careful how many batteries and guns you choose compared to the earlier script versions and skill level usage. Anyway please experiment and give feedback.
Attached Files
File Type: lua flakv3_0.lua (38.1 KB, 367 views)
File Type: miz flakexamples2.miz (68.4 KB, 113 views)

Last edited by Stonehouse; 06-26-2014 at 01:28 PM.
Stonehouse is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:12 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.