Quick checkin - glad to see this thread has a few replies
responses to everyone in roughly posting order -
@mathias Yup Boids are a beautiful model (and pretty solid, having been tested for 30 yrs, i remember hearing about them in the 80s). Starling swarms in the evening in european cities follow a very similar pattern. A friend told me similar local-global effects were used in the LOTR crowd scenes where for example an orc getting agitated would spill over , agitating a bunch of orcs, before the commotion gradually dies out . Effectively, boids are using a 1/r/^2 radial basis function , but they also have the concept of a "squad leader" which is nifty- might be worth playing with. Good suggestion, tks!
@scottlegrand great find! i had no idea about Lennard-Jones (i did math not chem) but its fascinating that the a similar shape appears for essentially the same problem : defining a potential sink for 2-body interactions. I used a difference-of-2-gaussians, and thats why my potential doesnt go to infinity. Neat- great find, TIL lennard jones, thanks
@hsperr Apologies- I said "move in the direction induced by the surface" but i should have also specified "as fast as you can". (generally, thats a good pattern- move as fast as you can- most bots do so i took it as given) I also assume users have a good navigation function with collision detection already (the starter kits have one for example). When i said no need for conflict resolution, i meant amongst ones own ships.
So, the more detailed algorithm is
if ship can dock with nearest planet
dock with nearest planet
move in direction of surface as fast as you can, upto 7.0 speed, subject to not colliding with a planet or docked ship
(you can generally handle this with something like speed = min(7.0,distance to nearest planet or docked ship in the direction i want to travel)
that will sort out issues in your questions 1,2,3 . As the gradient is never truly zero, (or extremely unlikely to be totally zero, youd need to be trapped in a perfectly symmetrical region) - i never get trapped . Also, (try it) if you have ships on the edge of the map they will repel other ships from the edge of the map, back towards the interesting interior. Now eventually you want ships to escape to the edge of the map and refinements to the potential functions will give you rabbit/defect behaviour.
Your q 4 deserves a deeper dive
yes! you can get to 90-ish (given the field as of dec 22 ish) only tuning the gxs with wx = 1 for friendly ships and -1 otherwise. But that leaves the q : how to tune efficiently? given what you said about your bots , i think i know what may help:
Important: if you train by marking your param-bot against another-bot, care must be taken (just like in GAN training) that the two adversaries are not totally mismatched.
eg lets say you train your param-bot on 72 games vs an adversary bot. If the adversary is too weak, you will already be winning 72 out of 72 and wont be able to improve your score no matter how you locally bump the 5 params. If your adversary is too strong, same problem: you will win 0 out of 72 for a large neighbourhood of your params.
So, you want to tune your adversary so it wins about 50% of the games, and then tune your params so your param bot goes from losing 50% to doing better, say losing 10%. Then repeat. An easy way to do it would be to cripple or randomize your existing adversary bot until it wins around 50% of test games
Optimization is a bit of a craft (art+science) and balancing-adversaries is analoguous to maximizing the derivative of the function to be minimized- so you always have somewhere to move to .
Hope that makes sense, feel free to pm me directly for more, or pm me on the thread if it is of general usefulness