Multi-Mode Formula
From RoboWiki
From Talk:Multi-Mode
Revision as of 9 September 2017 at 13:39.
The [/w/index.php?title=Talk:Multi-Mode&offset=20170909133922&lqt_mustshow=5665 highlighted comment] was created in this revision.
The [/w/index.php?title=Talk:Multi-Mode&offset=20170909133922&lqt_mustshow=5665 highlighted comment] was created in this revision.
- I was working for a micro bot and I found a new type of multi-mode movement system.(I think)
- Simply it is:
- Complexity starts from 0.
- Every time the bot dies, it increases the complexity.
- Every time the enemy fires call setAhead(getDir(complexity)).
public double getDir(int complexity) { double extraMove; double moveDir = extraMove = 1.0 / complexity; for(int i = 1; i < complexity; i++) { moveDir += Math.sin(getTime() / i / (10.0 / (complexity + 1))); } return Math.signum(moveDir) * ((extraMove + 18) * (complexity + 1)); }
- Just with this code these happen:
- First round: Musashi trick.
- Second round: Stop'n go.
- Third round: Random(not actually random) stop'n go.
- Fourth round: Musashi trick + stop'n go + not random.
- Fifth round: Oscillator movement.
Any thoughts?
Dsekercioglu (talk)
Sorry for double post. Also like this it is possible to make Musashi Trick + Stop And Go + Random Movement
public double getDir(int complexity) { double move = 1.0 / complexity; return move * 36 + (Math.signum(--complexity) * (Math.random() * 256 - 128)); }
Dsekercioglu (talk)
It can easily be done by starting with a complexity of 1.
Dsekercioglu (talk)