Okay math geniuses

I am looking for a new function for AI. This can be re-used for many purposes for other modders.

I want to have the AI make platforms and then dispense within a sphere at random locations equal distance to each other just like a mine layer lays mines. LUA math is not my specialty.

This will look like a carrier or mother-ship is defending its territory to the player. It also has the added ability to add some human like behavior to the AI. I can do all the scripting for the function, it is calculating the values to send that I do not know.

So if there is math genius out there willing to accept this challenge… the gauntlet has been laid!

1 Like

Do you mean at equal distances or all at the same radius? Is the idea to start sparse and then slot in other platforms as they are built to make it more “dense”? E.g. if there are only 4 platforms, would they be facing N/E/S/W and then if the AI builds more, they should be slotted in between the existing ones? Our would it decide on the total number of platforms to be built first?

also, is the idea to fill the volume of the sphere, so there would be platforms anywhere inside it, or to place them on the surface of the sphere like sphere formation?

Think mine laying, and apply that to platforms (or whatever) with equal distance apart from other platforms to be at least the range of a platform.

If i were trying to tackle this I would probably produce a table of coordinates based on a seed value of distance from each point… then leave it up to the developer using the table to pick which coordinates to use or not use(if the order was a spiral with a starting point identified). This opens the function up to many uses.

If a sphere of 5000 was create and a table of coordinates was made… then if i wanted to have a carrier at the center of that sphere send out platforms randomly using the coordinates but not reusing ones already placed.

I could make sphere of 10,000 and use the random coordinates to place AI scout ships to move to looking for probes around a mother ship.

I could use sphere of 30,000 in middle of the map and use a random point to triangulate an attack path from a unit to the other end of the map that would not be predictable to a human player.

I could use points around a mother-ship to create a more random location for units made to parade so the AI did not look as uniformed.

I could produce sphere around an enemy unit or strategic map location and use random points to place a warp gate.

I could use it to dynamically produce patrol points around an area that was not predicable to a human player and looked more human like than ships just sitting in a location waiting to be acted upon.

and so on… and so on.

If that does not paint a picture… i can paint a picture? hehe