Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I make the robot split? #379

Closed
eric-m opened this issue Sep 6, 2015 · 15 comments
Closed

How do I make the robot split? #379

eric-m opened this issue Sep 6, 2015 · 15 comments

Comments

@eric-m
Copy link

eric-m commented Sep 6, 2015

I could have sworn I already saw an answer to this, but now I can't find it. How do I make the robot split as if I entered space as a player? I'm looking at keyAction and trying to figure out how to simulate it. Thanks!

@Apostolique
Copy link
Owner

You can press space. The bot doesn't split on it's own.

If you mean how to send the action yourself, use opCode(17);

@eric-m
Copy link
Author

eric-m commented Sep 6, 2015

Thanks. opCode worked. How does 17 translate into space? Is there a mapping to ascii codes, or is it arbitrary?

@Apostolique
Copy link
Owner

It makes you split in the direction that you are heading to.

btw, in the next version of the launcher, while opCode will still be there, I'll probably make two new functions called split() and shoot(). Shoot will press W. And those functions will be disabled when the bot is turned off.

@eric-m
Copy link
Author

eric-m commented Sep 6, 2015

Thanks.

My version now (optionally) fires at where the targets used to be. Next, I need to start tracking and add location prediction. :)

Do you have any interest in my pushing up any of my features? If so, I'll want to reformat into your code style. When I'm in unfamiliar code, I tend to line up braces in the places where I'm making changes, otherwise I confuse myself as to which braces match.

If I might make a suggestion, I'd use feed instead of shoot. I tend of thinking of shooting as being bad for the recipient. :)

@kaue
Copy link

kaue commented Sep 8, 2015

Hello @eric-m i think the split is very important and we should develop a logic to use it.

I created a issue on ZeachCobbler rep about this RealDebugMonkey/ZeachCobbler#52

@henopied
Copy link
Contributor

henopied commented Sep 8, 2015

I could give you the ogar bot split code but it doesn't split much.

@eric-m
Copy link
Author

eric-m commented Sep 9, 2015

I've updated my split logic. By default, the bot won't split if it senses danger. Danger is defined as the standard split size + player size + other cell size. So if another cell that is >2x the player size appears within the player circle, the bot is afraid to auto-split.

It tracks targets that are small enough to split and eat. If the closest target has followed a straight line for 4 sample points, then it tries to split on what would be the 6th point. I started off with just going to the next point on the line, but I found the bot wasn't leading enough. It still misses with jumping ahead 2 points, but it's better.

I'm sending size/lifetime data to parse.com when the bot dies. That way, I can spin up several bots when I'm not around and then analyze the data later to see if my mods had any effect. Before the latest targeting change, I can say just splitting at where the closest target was didn't seem to improve anything beyond not splitting. :)

My virus counter is wonky. I did something to break it, and I'm not fixing it tonight.

Pressing 1-9 changes the range at which the bot will split from 10% to 90% of the max splitting range. If you don't press anything, it will just be a random range between 0 and 100. I'm doing the latter to help me collect better data when I'm not around.

@henopied
Copy link
Contributor

henopied commented Sep 9, 2015

2.66 please.

@eric-m
Copy link
Author

eric-m commented Sep 9, 2015

p.s. I think the next most important item in terms of improving the bot's score is to cycle through and find the best move for all pieces after its split. It doesn't do any good to split and successfully grab a target, just to drag your other piece into a virus or into another player. So that's what I'll look at next before trying to optimize the targeting more.

@henopied
Copy link
Contributor

henopied commented Sep 9, 2015

I have an idea for that for food dist use the centerpos of all cells i have centerpos code in my applezbot that we could use and for enemies it will pick the 4 farthest out cells in each direction and if an enemy goes into the "danger zone" of one of those 4 it will move accordingly or just compute bad angles for all cells and put all bad angles on the biggest cells and use goodangle handling on the one biggest cell to get out.

@eric-m
Copy link
Author

eric-m commented Sep 9, 2015

2.66?

@henopied
Copy link
Contributor

henopied commented Sep 9, 2015

Indeed that is the split threshold.

@eric-m
Copy link
Author

eric-m commented Sep 9, 2015

I haven't changed the 2.8 value used by the canSplit method. If anything, I might increase that so there's more room for error with the aiming. :)

Above, I referenced 2x. That's for determining if it's safe to split. If another cell is on top of the bot, and that cell is big enough to eat the half size split cell, then I don't want the robot splitting. Does that make sense?

@henopied
Copy link
Contributor

henopied commented Sep 9, 2015

you could change this split code a bit to get a good starting point for split code

@ermiyaeskandary
Copy link
Contributor

Original issue resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants