Page 1 of 1

Simulate commercial/civilian maritime traffic

Posted: Sat Apr 29, 2023 3:59 pm
by C7M3s0g1T8
I would like to incorporate civivlian and commerical maritime traffic/shipping lanes such as can be seen on https://www.marinetraffic.com/en/ais/home/. For a non-programmer, what is a logical way to set this up with lua scripts?

I think I would need to:
1. create a zone or multiple zones (with Reference Points) for the ships to be created in and navigate within
2. have a lua script that generates multiple civilian/commercial ship DBIDs randomly within the zone(s) at the start of the scenario
3. create waypoints and destinations using Reference Points
4. prevent the ship creation script from running a second time upon loading a save of the scenario

but what else needs to be established?

Keywords: civilian maritime, commercial maritime, shipping lanes

Re: Simulate commercial/civilian maritime traffic

Posted: Sun Apr 30, 2023 4:33 pm
by lumiere
1-3. Examine and testing "/lua/BrassDrum/CivilianShipping.lua" file script used in standalone scenario of same name is good way to start with. This generates neutral surface unit and sets waypoint based on RP. Please note some functions used will work only after loading LuaInit.lua.

4. Just turn off ship generation event "event is repeatable" checkbox.

Other factor to consider I could came up:

-Proper ship type by location: There is no Junk or sailboat at the center of Pacific ocean and they should be around coastal. Strait of Hormuz may be full of tankers rather than passenger liner.

-Generating too many ships could cause the simulation to lag.