BerryBots forums

It is currently Wed Oct 20, 2021 1:36 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Re: Justin's Bot
PostPosted: Wed Apr 03, 2013 7:30 pm 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
Here's the original post from Justin, which I accidentally deleted:
Quote:

Sweet! I'm stoked to check it out when I get home. Btw, your source code link should be: https://sites.google.com/site/justinsit ... e_v0.4.lua

Feel free to make a page for it on the wiki too. Or I'll make pages for this and Insolitus at some point, if you guys don't. ;)


Top
 Profile  
 
 Post subject: Re: Justin's Bot
PostPosted: Wed Apr 03, 2013 11:09 pm 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
Awesome work with NightShade, dude, I'm super impressed! Totally crushes it in 1v1, and in races, does pretty well on mazes (but not maze2 ;)), and also performed well in the 6-bot melee battle I tried, tho barely lost to BasicBattler.

I really dig the style of your debugging graphics, too. They have a very insect-like feel.

I'm eager to post about NightShade on the BerryBots social medias, but I guess I'll wait until I get the next version out with the touchedZone bug fixes. Without that fix, he gets a little confused on RaceTrack.


Top
 Profile  
 
 Post subject: Re: Justin's Bot
PostPosted: Fri Apr 05, 2013 4:19 pm 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
I'd be happy to check out your race track stage whenever you think it's ready. I'd like to try writing a racing bot myself. I think the work that goes into racing navigation would be useful for battle bots too. The path-finding from Snail might be a good start, but that's not really designed for speed.

I'm not sure I understand your sim code there without seeing project(). But I'm happy to help with any questions you have about the physics. I think the main non-obvious points about the physics are:
  • When you hit a ship or wall, you stop at the last spot before you collided, with your speed/heading updated to bounce next tick. (I.e., you don't bounce mid-tick and you can't bounce off multiple walls/ships in one tick unless you hit them simultaneously.)
  • If you hit a ship/wall 2 ticks in a row, you lose all your bounce momentum. (So you can't stockpile momentum without moving.)
  • To get really nitty gritty... The physics processing actually moves things in sub-tick intervals. Everyone moves a little, it checks for collisions, and repeats until the whole tick has passed and you end up at the last spot before you collided with anything. So you actually can't predict wall collisions with perfect precision because you don't know that interval - it's decided dynamically. It uses as many sub-ticks as needed so that all ships move <= 4 before each collision check. Ideally, you don't need to be aware of this, and can just assume you end up right next to the ship/wall. But I know some of us like to know exactly what's going on.

I was tempted to make much fancier / more realistic physics, but I thought that would be more fun for me as the game author than it was for a bot author to have to deal with, so I kept it pretty simple. You can see the full phsyics processing code here if you want: https://github.com/Voidious/BerryBots/blob/master/stage.cpp#L696


Top
 Profile  
 
 Post subject: Re: Justin's Bot
PostPosted: Tue Apr 09, 2013 11:28 pm 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
Cool, this looks pretty challenging, and fun to see NightShade go around it. :-) I'll add the different colors for stage texts. I should've just done it when I added the debug gfx (debug texts can have colors). I try to be insane about not bloating the API with new features until I'm sure they're worth having, but that's clearly worth the extra parameter, and good to have uniformity with the debug gfx API. You could just use multiple walls around the edge and draw the text on a black background instead, or just until I add the colors.

I'd like to work on a racing bot sometime soon myself. But for now I'm really excited to get the Game Runner and more granular results handling out the door. It's pretty far along and I think it's pretty slick. But I don't want you and Frohman getting bored with nobody to compete with either. :-P


Top
 Profile  
 
 Post subject: Re: Justin's Bot
PostPosted: Fri Apr 12, 2013 5:48 pm 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
Ah, I see, yeah that makes sense. The inner project is projecting the position at constant speed, then you project from there the change due to a constant thruster force over that time. You should be able to factor out howManyTicks and use one project call to get the same result.

Code:
project({x=x, y=y}, heading, howManyTicks * (speed + (thrustForce * ((howManyTicks + 1) / 2))))

Of course this is ignoring walls, so you need to check for intersections and avoid hitting the wall, or do it iteratively and calculate the wall bounce.

Edit: Oops, nevermind, you need the separate call because of the different thruster angle.


Last edited by Voidious on Fri Apr 12, 2013 5:49 pm, edited 1 time in total.
I'm wrong


Top
 Profile  
 
 Post subject: Re: Justin's Bot
PostPosted: Fri Apr 12, 2013 5:53 pm 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
And great work on the new version! I timed battles vs RandomBot and v0.5 took under 15 seconds, vs over 2 minutes for v0.4, and v0.5 also kicks v0.4's butt on your race track.


Top
 Profile  
 
 Post subject: Re: Justin's Bot
PostPosted: Sat Apr 20, 2013 8:15 pm 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
Neat! You are really blazing the trail here, I'd like to get some of your info/code organized onto the wiki sometime too.

By the way, the Game Runner API is almost done. Here's a sample run of NightShade v0.5 vs a few sample bots with the "batchduels" example runner. (It will include that and a few others with the release.)

https://www.dropbox.com/s/6ekr93wr4i63i ... sample.txt


Top
 Profile  
 
 Post subject: Re: Justin's Bot
PostPosted: Mon Apr 22, 2013 1:56 pm 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
FYI, I posted v1.2.0 with Game Runner and better results handling: http://berrybots.com/news.html#1.2.0

I'm curious, do you follow anywhere that you'd see news about new BerryBots versions? Right now I just update the news page and post to Facebook/Twitter/Google+. But I'm wondering if I should also post to a separate forum and/or make a generic RSS feed available.


Top
 Profile  
 
 Post subject: Re: Justin's Bot
PostPosted: Tue Apr 23, 2013 1:52 am 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
Thanks man! I definitely had to do a few practice runs before I got one I liked. :-)

Checked out the new version - really nice job on maze2! And in the end, you actually get through it faster than Snail. And I love the maze debugging gfx. Kind of exciting seeing "waves" in the battle gfx. On ArcadeShooter, I think you'd do a lot better just by not using torpedos at all, or only when it will destroy the target, since they knock the ships out of formation and a lot closer to you.

One thing near the top of my to-do list is to let stages set a rules tag, which would make it a lot easier on you customizing your behavior for the different rule sets. I'm thinking just a string set in StageBuilder and available in World, like "battle", "maze", "race", "fixedshooter", etc.


Top
 Profile  
 
 Post subject: Re: Justin's Bot
PostPosted: Fri Oct 04, 2013 1:41 am 
Offline
Site Admin
User avatar

Joined: Sat Nov 17, 2012 5:03 am
Posts: 88
Hey, dunno if you're still interested in this, but I encountered a racing bug in Nightshade. I'm adding a lap limit to racetrack so I was testing with Nightshade vs sample.racer's and saw him go the wrong way at the start of the match. Hooray for replays! racetrack-2013.10.03-21.36.17.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group