Strip Down the plugin for a 2D game

I recently purchased the plugin and it works great.

My studio is currently working in a 2D game with a simple battle mechanism like the ones we see on Tower Defense Games. So i need the functionality of the 2D elements only of the plugin. From the examples included in the plugin what describes my case is this “Example16_RVO 2D”.

What i need to do is to strip down all the unnecessary files.
We build games for the web and loading times are essential to the game.

I could use some help from the developer for that issue, i am sure it will help other people building games for the web if there was a guide about that!

Hi

There are several things you can do:

  1. Enable ASTAR_NO_ZIP in the Optimizations tab. This will allow you to delete the Pathfinding.Ionic.Zip.dll file. After doing this you will however have to reconfigure all your graph settings. This will also make all your serialized graphs larger because no zipping is used, however if you only save settings (i.e you are not using saving nodes as detailed on this page: https://www.arongranberg.com/astar/docs/save-load-graphs.php) then it should be a net-win.
  2. You can try to add ASTAR_NO_RECAST_GRAPH to your Player settings (the “Scripting Define Symbols” field). Then delete the files RecastGenerator.cs, NodeLink2, NodeLink3 and the whole Voxels directory. This probably will fail to compile because those defines haven’t been used in a long time, but just comment out pretty much anything that refers to the now removed code. It shouldn’t be anything that is actually required if you are using a grid graph. After you have done this and things still work you can delete the dll files Pathfinding.Poly2Tri.dll and Pathfinding.ClipperLib.dll.
  3. Similarly, you can try to add ASTAR_NO_POINT_GRAPH and remove the PointGenerator.cs file. This will probably also fail to compile, but just comment things out until it works.
  4. Enable ASTAR_GRID_NO_CUSTOM_CONNECTIONS in the Optimizations tab. Very minor code reduction, probably will barely register, but why not.

Make sure you use version control so you can revert your changes if something doesn’t work.

thanks a lot Aron, i really appreciate you coming back with a reply :slight_smile:

1 Like