So I have created an terrain generation system similar to armored patrol with random mountains big thanks to @okeanskiy for the triangle terrain generation, @ThanksRoBama for the fractal noise generator and introducing me to Red Blob Games, that website is amazing
Edit: Side view I believe is better:
Now the question is how would I choose the already generated random mountain points as a capture point in a way so it’s a bit more fair for both teams?
Armored patrol for reference and goal, the flags are placed within the middle:
My current method I’m going to try out is this:
-
Choose number of capture points, ex 3 points
-
Iterate through all the possible combinations of the already generated mountains of the three mountains selected as capture points.
-
While Iterating measure the mean distances from a base.
-
Choose the best set with the mean closest to the middle of the map (map is 5000 x 5000 studs so best mean is 2500 studs from a corner)
But this doesn’t seem exactly optimal kind of like dart throwing. That’s why I made this to post help brainstorm of methods to do this, currently can’t find any or the proper search terms for this problem.
Any ideas and any help are appreciated for a problem of this complexity.
local XSize = 5000 -- mapsize in studs
local ZSize = 5000-- mapsize in studs
local mountainRandom = Random.new()
local mountainDataTable = {}
for i=1,10 do
--current method of generating mountains, just random with certain conditions
--cannot be too close to each other or out of map bounds, also dart throwing method
--that is closed source tho :P
local randomX = mountainRandom:NextNumber(-XSize/2, XSize/2)
local randomZ = mountainRandom:NextNumber(-ZSize/2, ZSize/2)
local mountainPosition = Vector3.new(randomX,0,randomZ)
local mountainData = {mountainPosition}
table.insert(mountainDataTable,mountainData )
end
local BaseCorner1 = Vector3.new(-XSize/2,0,-ZSize/2)--team 1 map corner position
local BaseCorner3 = Vector3.new(XSize/2,0,ZSize/2)--team 2 map corner position
for i,mountainData in pairs(mountainDataTable) do
local mountainXZPosition = mountainData[1]
--Ways to choose 3 mountains to be somewhere around the middle?
--most important is that it's "fair"
--in between the two teams
end
Edit: Also I believe AP compensates if a capture point is too close to the enemy base by rewarding less points, even so the capture point still is generated somewhere around the middle somehow which is what I’m trying to achieve.