Jump to content
nomisum

Any way to filter small roads on Tanoa

Recommended Posts

Title says it all. I want to reduce my Array of roads to only the bigger ones, not one of the tiny paths introduced in Tanoa.

 

Anyone with ideas how to do this?

Share this post


Link to post
Share on other sites


TAG_fnc_filterJungleRoads = {

     params ['_pos','_radius'];

     private _array_roadListFiltered = [];

     {

          if ((typeName _x) isEqualTo 'OBJECT') then {

               if (!(['jungle',(surfaceType (getPosATL _x)),FALSE] call BIS_fnc_inString)) then {

                    _array_roadListFiltered pushBack _x;

               };

          };

     } forEach (_pos nearRoads _radius);

     _array_roadListFiltered;

};

 

// usage

 

_array_roadSegments = [(position player),500] call TAG_fnc_filterJungleRoads;

  • Like 1

Share this post


Link to post
Share on other sites

Unfortunately your function returns all roads.

qRy8NAk.jpg

 

I modified it to take the road size from the boundingBox, delivers more reliable results as seen in the picture.

Yellow are supposed to be the small jungle pathways.

z2DMjeU.jpg

TAG_fnc_filterJungleRoads = {
     params ['_pos','_radius'];
     private _array_roadListFiltered = [];
     {
          if ((typeName _x) isEqualTo 'OBJECT') then {

_bbox = boundingboxReal _x;
_bbox params ["_a","_b"];
_size = _a distance _b;
if (_size < 25) then {_array_roadListFiltered pushBack _x};

          };
     } forEach (_pos nearRoads _radius);
     _array_roadListFiltered;
};

// usage

_array_roadSegments = [(position player),500] call TAG_fnc_filterJungleRoads;

Still returns a few false positives but you can go from there.

 

 

 

Until BI come out of the closet why their roads have no associated .p3d and return no object type this seems to be the most adequate solution to find jungle pathways.

 

 

Cheers

  • Like 4

Share this post


Link to post
Share on other sites

Thank you very much! Seems like a decent solution to me :D

Didnt think of either surfacetype nor bounding box (even if the first doesnt work).

Share this post


Link to post
Share on other sites

isOnRoad returns false for the dirt trails.

roads = [];
{
    _node = _x;
    _mkr = createMarker[ str _node, getPos _node ];
    _mkr setMarkerShape "ELLIPSE";
    _mkr setMarkerSize [ 10, 10 ];
    if ( isOnRoad getPos _node || [ "bridge", getModelInfo _node select 0 ] call BIS_fnc_inString ) then {
        _mkr setMarkerColor "colorRed";
        _nul = roads pushBack _x;
    }else{
        _mkr setMarkerColor "colorYellow";
    };
}forEach ( [ worldSize/2, worldSize/2 ] nearRoads (( worldSize/2 ) * 1.4142 ));

Will return all roads that are wide enough to take a vehicle. No dirt trials and no runways.

TanoaRoads.png

  • Like 12

Share this post


Link to post
Share on other sites

Holy moly, isOnRoad, never thought about that (not the first logic defying solution heh).

Very smart solution right there. :rthumb:

 

Now lets place some roadside IEDs, jungle trail ambushes and totally non suspicious meet up points with legit non backstabbing local gorilla leaders which is basically the same as my second point but there are always three things all wise men fear.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Oh nice! Thanks a lot.

 

Now for the fun part of finding an way to make the AI dont use the dirtroads for their pathfinding too  :rolleyes:

 

Primitive way would be overuse of "isonroad" waypoints, so chances are low there is actually a faster dirtroad in between.  :ph34r:

 

 

(Or just wait for BIS driving AI to become less stuck/get a Script Command to neglect dirtroads. Its currently reworked after all)

Share this post


Link to post
Share on other sites

Didn't BIS announce pedestrian only roads defined through a specific cfg parameter?

Thought I read something about that.

 

Cheers

Share this post


Link to post
Share on other sites

Hi

I wanted to copy all the road coords from a map. Im using this code but it doesn't seem to include dirt roads & stops at bridges.
 

  copyToClipboard str (([worldSize / 2,worldSize / 2,0] nearRoads worldSize) apply {getPosATL _x})

The code outputs this: [[3111.75,2036.98,0],[3134.69,2032.94,0],[3161.04,2028.5,0] blaa blaa blaa]
Anyone have any idea how to include dirt roads & continue the path over bridges?

Not sure if this thread is still alive ? 🙂

Share this post


Link to post
Share on other sites

Can I ask what is the bottom line goal. What is the author and other people on this thread trying to accomplish.  

 

Yes tanoa small road systems can be very problematic with random patrol scripts and other scripts and mods that provide dynamic waypoints for vehicles.  Most vehicles will get stuck on the small roads and forests resulted in a flipped over vehicles or just unable to move. This can be a game breaker with random patrol vehicles for sure.

The easiest solution that I found is 

A script a mod and remove object module that can correct most of this this.

 

I Have have a script thet will unflip vehicle that flips over during the mission around my makes the crew to get back into the vehicle and continue moving. I have a mod called liability insurance that will only knock down friendly foot units to the ground with no damage. The units will get back up and continue to follow its waypoints with its group.

 

For the issue with the small road systems within the forests I use the editor removal module and open up the road system to allow all vehicles to travel the small road system within the forests adequately. It is still small enough to allow choke points for ambushes. I have the entire AO modified with all the small road systems. This helps in multiple ways. It eliminates majority of the issues of vehicles getting stuck in the forest and on the small roads and it opens up the map to allow for more fighting area with a better gameflow. I also feel it reduces my lag because there's a ton of trees that are taken out of the map in the AO for the mission. 

 

Some of the small Bridges on the dirt roads just remove them as well these vehicles have a very hard time navigating them.

 

 

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

It is/was an issue if you used roads to spawn vehicles. if you spawned vehicles dynamically on roads, often you want them on actual roads, not jungle tracks.

 

The weakness is that there was not a separate road net for infantry, so inf and vics would use the same nodes.

 

If there was a separate infantry road net, then adding infantry nodes thru dense jungle wouldnt have been an issue.

 

but it was silly to add vehicle road nodes thru dense jungle.

 

Finding these was partially alleviated in 2.00 with "roadsConnectedTo" alt syntax

 

https://community.bistudio.com/wiki/roadsConnectedTo

 

ultimately these are just workarounds for lazy/incomplete effort of BIS devs

 

...

 

Your solution of using "hideobject" on jungle tracks to widen them for vehicle is novel but not suitable for procedural missions unless you're happy with the desync associated with large lists of JIP compatible global hidden terrain objects.

 

its still not possible to prevent AI vics from attempting to navigate on the pedestrian tracks, so your solution might be beneficial there!

Share this post


Link to post
Share on other sites

yep! As @avibird 1 said, you can select the road segments you want to clear. See this post. getRoadInfo is fine for that.

 

You don't need to hideObjectGlobal. Run the code locally everywhere (at start on each PC). This will stay local, with no global command leading to desync, and no matter because every PC will have the same permanent result. Use hideObject as I showed.

  • Like 1

Share this post


Link to post
Share on other sites

@pierremgi hey I feel using the removal troyant module better because you can adjust the read system wider when you need it to be as well as taken out or leaving small items like branches twigs rocks that make it difficult for vehicles to navigate through these small road systems. I can keep items on the map if I want to make a choke point at a certain location. I don't know about the overall performance which way is better for lag and multiplayer compatibility. 

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, avibird 1 said:

@pierremgi hey I feel using the removal troyant module better because you can adjust the read system wider when you need it to be as well as taken out or leaving small items like branches twigs rocks that make it difficult for vehicles to navigate through these small road systems. I can keep items on the map if I want to make a choke point at a certain location. I don't know about the overall performance which way is better for lag and multiplayer compatibility. 

 

As rule of thumb, everything you can set at start (on each PC), without necessary sync, is far better for performance. Simple objects, hidden objects..., final textures... can be set locally (see 3den, you have this choice). On the other hand, when things must occur during game, you need, most od the time, to use a global command, so a sync  (example: hide/unhide object alongside (a) player's progress).
Avoid massive sync.

Share this post


Link to post
Share on other sites
14 hours ago, pierremgi said:

 

As rule of thumb, everything you can set at start (on each PC), without necessary sync, is far better for performance. Simple objects, hidden objects..., final textures... can be set locally (see 3den, you have this choice). On the other hand, when things must occur during game, you need, most od the time, to use a global command, so a sync  (example: hide/unhide object alongside (a) player's progress).
Avoid massive sync.

 

actually a decent idea to run hideobject locally on each machine 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×