Skip to content

Minecraft plugin FactionsX addon that visualises faction borders using particles and colours them according to faction relations.

Notifications You must be signed in to change notification settings

Braffolk/FBorder-Addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FBorder-Addon

Minecraft plugin FactionsX addon that visualises faction borders using particles and colours them according to faction relations.

faction with borders visualised various borders

The visualisation can be enabled by calling /f visualise-borders or /f v-b. The command also has a performance option

  • /f visualise-borders Fast - fewer particles
  • /f visualise-borders Normal - normal amount of particles
  • /f visualise-borders Fancy - a lot of particles

Colors:

  • green - ally or home faction
  • blue - truce faction
  • yellow - neutral faction
  • red - enemy faction

The colours can be changed inside the config.

How to install

Get the plugin from SavageLabs or from the releases section.

Drop the .jar inside the /plugins/FactionsX/addons folder

The configuration file can be found at /plugins/FactionsX/addons/FBorder-Addon/border-config.json

Ideas for improvement

I'm looking for alternative ideas on how to make it more readable and visually appealing. If you have any ideas, drop them down here: https://github.com/Braffolk/FBorder-Addon/issues

If you want to contribute, feel free to open a PR. If you found a bug, report it in issues.

Planned features

  • more configurable server performance settings
  • optimisations for mesh updating

Performance optimisations and considerations

Since this addon requires hundreds or thousands of particles to be created constantly it has a big toll on lower end machines. Without optimisations, with a lot of lines particles took around 45% of render and tick time on the fancy setting. After optimisations the number has come down to 10% in a similar situation.

The addon has 5 main optimisations:

  • only lines that are in the field of view of the player are updated. In large factions this can give a 2x-3x speedup
  • particles are sent one by one during a 550 millisecond period, where each send is distributed equally during that interval. This keeps the burst of particles low and and attempts to mitigate the early rapid particle bursts
  • faction mesh caching. Each factions chunk borders are turned into a shape of lines on the X and the Z axis. There are two levels to these meshes. The chunk level meshes simply store the x and z coordinates for lines and are only updated upon claiming and unclaiming. Block level meshes are updated whenever a block is placed or broken. These meshes use the data previously generated by chunk level meshes. This ensures that no performance is wasted on regenerating everything after a block change.
  • faction world specific bounding boxes. If the players view bounding box is outside of a factions bounding box, no further checks will be done.
  • async sending. When looping through players to sendi them particles, it doesnt calculate the border boundaries or block heights as explained above, so this allows the whole particle sending to be async and as lightweight as possible. Here we simply filter out the lines that are in view distance, field of view and then filter only the amount of blocks the player specified in their performance setting.

About

Minecraft plugin FactionsX addon that visualises faction borders using particles and colours them according to faction relations.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages