It is currently Fri Apr 27, 2018 2:59 am Advanced search

C# bot base code (alt starter) open source

Random stuff about the contest, posts that don't fit in the other forums.

C# bot base code (alt starter) open source

Postby Demerzel » Sat Nov 06, 2010 5:58 pm

http://code.google.com/p/planetwars-bot/

I switched to C a while ago but this was my C# recode with an attempt to document everything. Since I'm no longer going to use it and it's all nicely documented etc, thought I'd share it as an alternative to the starter pack since it has:
persistent state
ability to connect to tcp from inside IDE
future state code
basic defense/distribution code

There are a couple injectors set up to hijack Console.In/Out namely TCP and Database, currently it's set up to play on TCP server. If you want to just have it play normally just comment out the TCPInjector lines.

As the project summary states, I don't remember where I was with it so there may be bugs etc. I opened up commits to anyone so feel free to fix them as long as you are sure they are actually fixed ;)

The original version of this bot (that I was reorganizing the code from) peaked just outside top 100 and this one is the BASE CODE ONLY of the one that's hanging out around 400 now but peaked at 150. The one that's up now is tweaked quite a bit from this code.

As far as decision logic goes, in the base code it's pretty simplistic - take the highest cost/value target. Really its state and the framework is the strong point, build on that.

EDIT: Oh and it's extremely fast for C#. You might notice I have nothing but arrays, no LINQ, no generics. Luckily for you they're all commented and working ;)
Demerzel
Colonel
 
Posts: 72
Joined: Sat Oct 02, 2010 6:06 am
Location: themendios at gee mail

Return to Misc

Who is online

Users browsing this forum: No registered users and 1 guest

cron