Jump to content
avibird 1

Question about the removal objects from a island and improve FPS.

Recommended Posts

 We all know the pathfinding for AI have issues in Arma. The island of tanoa has a large small road system through the jungles of the island. If you are using any random waypoint system or AI enhanced combat system Armor vehicles will attempt to use the road systems and will eventually get stuck or damage in the process of attempting to reach a location. 

 

In the editor either with Zeus or Eden enhanced mods there is a module that allows you to remove  editor terrain objects like trees rocks buildings fences etc and using cup mod you could place down new roads.  I am in the process making all the small road system accessible and maneuverable for armor units. 

 

Two questions. 

Does the module have a limited. Some times if I placed a module down objects are not deleted as expected. I wanted to use at least number of modules as possible throughout the island and 

Shouldn't the removal of all these objects improve FPS ? 

Share this post


Link to post
Share on other sites

Forget modules for this project.

If you want to clear the paths (width < 7 meters), just run in init.sqf (or a trigger set to TRUE as condition):

{{hideObject _x} count nearestTerrainObjects [_x,["TREE","SMALL TREE","BUSH","HIDE"],30] } forEach  (([worldSize/2,worldSize/2] nearRoads (worldSize/1.4)) select {getRoadInfo _x#1 < 7})

 

It's a little bit laggy at start, but you can drive much easier on pedestrian trails. For AIs, it's a waste of time. They are so dumb... Clearing allows deeper waypoints but not a whole usage of the trails. Probably because these "road" segments are not always correctly connected.


 

 

  • Like 1

Share this post


Link to post
Share on other sites

Hey pierremgi thanks for the reply and the bit of code I will definitely check it out but  I don't want to take everything out of the map (area of operation) I just need to make the  small trails  accessible better maneuverability for AI. Vehicle

 

The editor module for removal of objects does have a limited as far as how big of a patch it can remove at once. 100-120 by 24-30 is the sweet spot that I'm finding  Any bigger parameters in the module some objects won't get deleted. My area of operation is 2000 by 1000 with random waypoints for infantry and vehicle patrols. 

 

I have it working pretty good now with no real issues with pathfinding on small trails within the jungles once I use the removal module and setup with a smaller perimeter for removal of items. 

 

Will the modules help or hurt my FPS. On One hand a lot of items are removed but I am using around 45 modules.  Need to evaluate FPS and lag once I'm done.

Share this post


Link to post
Share on other sites
32 minutes ago, avibird 1 said:

Hey pierremgi thanks for the reply and the bit of code I will definitely check it out but  I don't want to take everything out of the map (area of operation) I just need to make the  small trails  accessible better maneuverability for AI. Vehicle

I have it working pretty good now with no really issues with pathfinding on small trails within the jungles once I use the removal module and setup with a smaller perimeter for removal of items. 

 

 

My code removes trees,... around (30 meters) each part of trails (<7m width), not everything out of the map, but on any trail on map. Just try it.

You can "remove" what you want, with all modules or codes you want, AIs stay dumb. "working pretty good"... til they "decide" to loose the path. But I'm curious to test your scenario.

 

32 minutes ago, avibird 1 said:

Will the modules help or hurt my FPS. On One hand a lot of items are removed but I am using around 45 modules.  Need to evaluate FPS and lag once I'm done.

Definitely hurt. "Removing" terrain items doesn't help for FPS (I'm pretty sure about the contrary). You can't delete terrain objects, you hide them!

Share this post


Link to post
Share on other sites

Running this in PreInit is instant, this is a better approach.

 

class KER
{
	tag = "KER";
	class functions
	{
		file = "functions";
		class replace{
			PreInit = 1;
		};
		class teim{};
		class icons{};
		class welcome{};
	};
};

Set up the CfgFunctions like this and put the code in the replace() function.

 

{{hideObject _x} count nearestTerrainObjects [_x,["TREE","SMALL TREE","BUSH","HIDE"],30] } forEach  (([worldSize/2,worldSize/2] nearRoads (worldSize/1.4)) select {getRoadInfo _x#1 < 7})

Then the code will run extremely fast before the main mission loads.

 

Even this is very fast.

 

{{hideObject _x} count nearestTerrainObjects [_x,["TREE","SMALL TREE","BUSH","HIDE"],90] } forEach  (([worldSize/2,worldSize/2] nearRoads (worldSize/1.4)) select {getRoadInfo _x#1 < 7})

 

Edited by jakeplissken
Added extra example.

Share this post


Link to post
Share on other sites

Yes, you can preInit this function. That's OK for running the code (so wait) a little bit earlier. Once run, that will not make difference in game.

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

×