Great wall/corners smoothing indeed. One of the next Musashi's improvement is going to be in that direction, by now it just bumps at the walls. By the way, what does means "tweaking"? I'm assuming that is something like "copy by observation", if that is correct, my intend is to tweak this feature, if u don't mind... -- Axe
I don't know what you mean with "copy by observation". =) "Tweaking" means here to "adjust for a given purpose". The example code above doesn't create a very flat profile at different distances and against different bullet powers. To do that you need to tweak the behaviour. Look at the code of Tityus and Aristocles to get some examples on what to use in these calculations.
When it comes to wall smoothing... The example code above implements a "no fear of the walls" strategy. It's what Aristocles does too, and what Tityus 0.70 also tried to do. I would expect that this would be better than bouncing off of the walls, but at least I can't tweak this strategy as good as I can with T's current wall bouncing strategy. Though T tries to go past the walls to some extent before giving up and reversing.
Thnx for the explanation about "tweak", my translation was very wrong. What i meant by "copy by observation" is more like being inspired by watching the move, and then try to reproduce the same kind of behaviour. This without using your code (I really like to do it the hard way). Of course the credits for the idea will be given.
The feature that inspired me is that wall smoothing (the "no fear from the walls" - great name!). As i said, Musashi bounces when he is about to hit a wall. This, of course, makes it more predictable near walls. I am thinking about something like: "sometimes bouncing, and sometimes following the wall", depending in certain parameters. That probably will lead to a more unpredictable moving (and flatter too). -- Axe
Indeed. You are welcome to use my code and ideas for inspiration. I think wall smoothing might be as simple as "shrink the distance a bit at the time until you get a destination inside the field" for many movements. -- PEZ
Nods the trouble with always following the walls is that you end up ramming the opponent or passing right next to them. On the one hand if you bounce you normally either get a big spike at GF 0 or at some negative GF. Raikio uses :-
Point2D.Double newDestination; double distDelta = 0.02 + Math.PI/2 + (e.getDistance() > BEST_DISTANCE ? -2.5 : 2.5)*(Math.abs(e.getDistance() - BEST_DISTANCE) > 100 ? .15 : .1); while (getDistanceToWalls((newDestination = projectMotion(robotLocation, enemyAbsoluteBearing + circleDir*(distDelta-=.2), 170))) < 18); theta = 1.18*modifiers[Math.min((int)(e.getDistance() / (800 / 5)), 4)]/e.getDistance(); if ( Math.random() > Math.pow(theta, theta) || distDelta < Math.PI/4 ) circleDir *= -1; theta = Utils.normalRelativeAngle(absoluteBearing(robotLocation, newDestination) - getHeadingRadians()); setAhead(Math.cos(theta)*100); setTurnRightRadians(Math.tan(theta));
which bounces if you turn into the opponent strongly and otherwise follows walls. This keeps the movement profile very similar whether or not you are approaching a wall. Trouble is it ends up bringing you quite close to the opponent and my movement is bad close up. I might make it bounce based on distance, too. -- Jamougha
Indeed. When i was saying "sometimes bouncing, and sometimes following the wall, depending in certain parameters" i was thinking exactly about this. The "parameters" i was thinking was the bearing angle to the enemy, for example. Something like: if (bearing < 30degrees) then bounces else follow-wall. -- Axe
I doubt it really is a problem always following a wall as such. I think it's just me not finding the right flattener parameters close up. Bouncing off the wall under certain conditions introduces a predictable element. Even if I think it might be a bit better than "plain" wall bouncing. -- PEZ
I agree partially. Bouncing off the wall depending on an enemy bearing parameter will surelly be predictable, but only if the enemy gun is segmented based on that bearing (or with a PM gun using this kind of parameter). And even if that is truth, it wouldn't be more predictable that always bouncing or allways follow-wall.
I can't keep off of my mind that folowing the wall in an acute bearing angle towards the enemy it sounds like a kamikaze strategy... And even if u are moving in an acute angle backwards, it will probably reflect in a spike near GF 0.0. -- Axe
Always following the wall is no more predictable than your regular movement - the idea is that you'll change direction when you're good and ready. -- Kawigi
I'm not sure I fully understand what Kawigi said, but it could be the same as I am saying. With "always follow the wall" I rather mean "don't leave the wall unless your flattener tells you to". If your enemy sees that you will leave the wall if following it gets you closer to it, you are being predictable. On the other hand if you can't do the "pure" movement flat enough it might be worse than leaving the wall. That's what the Tityus versions 0.70 and 0.6.3 shows I think. You can rest assured that I will again try the purer movement scheme. And again. And again. Until I get it right. -- PEZ