The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
Please vote in the Forum Structure Poll. Polling will close at 2PM EST on January 21, 2025.
I don't think this is causing the problem, but shouldn't the two lines in the switch statement use the variable ships instead of p2.NumShips() + 1 since that's the number of ships you're sending?
What do you mean by "crash?" Is this on the official server and your games just stop? You can always run locally against the examples/yourself/use the TCP server if it's an actual fault.
What do you mean by "crash?" Is this on the official server and your games just stop? You can always run locally against the examples/yourself/use the TCP server if it's an actual fault.
But, by itself, I can't see that code crashing
I'm using the Galcon Bot Testing Arena (courtesy of the AI Challenge forums) to test my code. And the test match ends when my bot crashes. Which I don't get either.
The Anonymous on
0
The AnonymousUh, uh, uhhhhhh...Uh, uh.Registered Userregular
On Windows 7 it took me a couple of minutes to figure out why I couldn't run the visualizer tool... it helps to add the java bin directory to the system path variable.
Also, Notepad++ -> TextFX -> Reindent C++ code is pretty nice.
edit: So I got the visualizer to play against itself... it comes with java files for the bots. Is there a way to get the offline visualizer play my cpp bot? I don't understand.
On Windows 7 it took me a couple of minutes to figure out why I couldn't run the visualizer tool... it helps to add the java bin directory to the system path variable.
Also, Notepad++ -> TextFX -> Reindent C++ code is pretty nice.
edit: So I got the visualizer to play against itself... it comes with java files for the bots. Is there a way to get the offline visualizer play my cpp bot? I don't understand.
You should be able to replace the bolded parts with your compiled bots:
Just make sure you use "java -jar tools/PlayGame.jar maps/map43.txt 1000 200 log.txt "YourAwesomeBot.exe" "AWorthyOpponent.exe" | java -jar tools/ShowGame.jar" instead, since games only last 200 turns right now
edit: Also, from my experience, only dualbot and ragebot are worth playing against
You have two different versions of IBot.cs, one in the root folder and one in /Bot/.
I'm guessing Engine.cs is incomplete? It doesn't have any code for planets fighting, nor does it seem to be called from anywhere in your code. If you do get that working, it'd be useful to pipe the output of the game into http://github.com/DanielVF/Planet-Wars-Canvas-Visualizer.
I just pulled up the actual VS project and noticed those files weren't in the project. You might want to clean that up, otherwise looks fine, great work.
You have two different versions of IBot.cs, one in the root folder and one in /Bot/.
I'm guessing Engine.cs is incomplete? It doesn't have any code for planets fighting, nor does it seem to be called from anywhere in your code. If you do get that working, it'd be useful to pipe the output of the game into http://github.com/DanielVF/Planet-Wars-Canvas-Visualizer.
I just pulled up the actual VS project and noticed those files weren't in the project. You might want to clean that up, otherwise looks fine, great work.
I have been further refactoring the gamestate stuff to make it easier to pick what fleets or planets you want. Linq makes it very easy to read and select. I am still working on the Engine.cs so that it works completely and allows for threading. This way I can run my bot on multiple threads and have multiple battles going on at the same time. Ofcourse I cant use threading for submissions but I can for my internal testing.
So apparently, and I did not know this, they use mono to compile c# code. So there goes my .NET 4.0 work. Fucking hate Mono.
Monoxide on
0
HalibutPassion FishSwimming in obscurity.Registered Userregular
edited October 2010
Okay, the way they are compiling java projects is dumb. All of the source files have to be in the root directory, meaning there is no way to organize code. I had to manually go through about 25 files to fix package and import declarations.
The good news is that my first bot with no offense made it up to about 800 yesterday.
So apparently, and I did not know this, they use mono to compile c# code. So there goes my .NET 4.0 work. Fucking hate Mono.
Don't worry, I didn't mean all forms of Mono. Just the partially implemented open source kinds.
Lux782 on
0
HalibutPassion FishSwimming in obscurity.Registered Userregular
edited October 2010
Made a slight change and moved up to around 600.
Does anyone know if sharing each others bot (source or binary) is against the rules?
I started dominating the starter kit bots, and it's difficult to determine what changes work well and which ones don't. Does anyone have a decent bot that they want to share so that we all have something more competitive to test against?
I understand that for languages that decompile easily (or don't even compile) that most people probably don't want to give away any kind of competitive advantage, but maybe you've got an older version? Once I make a few improvements to my current bot, I don't mind sharing the current version.
I cant get the TCP server to work. I reprogrammed my bot in Java and when I run from netbeans I have no issues but once I try to use the TCP server it says it cant find the class named MyBot. I have checked and there is a class named MyBot in the Jar file. It isn't in a package. WTF is wrong?
Well that map is interesting because if you overextend at all you instantly lose. Normally, when I'm close to an enemy I don't do colonization at all, unless I have enough numbers to do it safely, in that case it looks like we had similar logic going on. Although it would have been safe to send 25-30 ships out for colonization in that case.
So far, I've been splitting all my functionality, I've got pieces of code that handle colonization, interception, reinforcement and attack, all separate, which has kept things pretty simple
So after trying to code in Java and in C++ I have given up and will try mono again. I just like C# too much to program in anything else when given the choice.
Lux782 on
0
HalibutPassion FishSwimming in obscurity.Registered Userregular
So after trying to code in Java and in C++ I have given up and will try mono again. I just like C# too much to program in anything else when given the choice.
I totally get that. If they had a Scala starter kit, I'd be dumping Java in a heartbeat.
Halibut on
0
SirUltimosDon't talk, Rusty. Just paint.Registered Userregular
edited October 2010
Alright, so I'm entering this. I only have the sample uploaded. I'm gonna try and tweak it over the next few days.
Well that map is interesting because if you overextend at all you instantly lose. Normally, when I'm close to an enemy I don't do colonization at all, unless I have enough numbers to do it safely, in that case it looks like we had similar logic going on. Although it would have been safe to send 25-30 ships out for colonization in that case.
So far, I've been splitting all my functionality, I've got pieces of code that handle colonization, interception, reinforcement and attack, all separate, which has kept things pretty simple
Hmm... the close-starting-planets scenario is something I never considered before. So, I guess in that situation you would be better off sending out some ships to a far-away low-cost planet on your side of the map. Then you would slowly amass enough ships to colonize other planets and you would quickly have the upper hand.
It seems like getting your initial planet colonization right is the key. Pretty much as soon as one player gets an advantage in ship count (or ship growth rate) it's all over.
Also as far as separating attack, defend, etc... I was doing that. The problem is that I further separated it into smaller sub-contexts. For instance, I made a distinction between attacking neutral planets that the opponent is sending ships to, and attacking a neutral planet that was previously not under attack.
My new strategy is going to simplify all of this though.
So after trying to code in Java and in C++ I have given up and will try mono again. I just like C# too much to program in anything else when given the choice.
I totally get that. If they had a Scala starter kit, I'd be dumping Java in a heartbeat.
I'm sure you could get it supported if you posted in the forums.
Well that map is interesting because if you overextend at all you instantly lose. Normally, when I'm close to an enemy I don't do colonization at all, unless I have enough numbers to do it safely, in that case it looks like we had similar logic going on. Although it would have been safe to send 25-30 ships out for colonization in that case.
So far, I've been splitting all my functionality, I've got pieces of code that handle colonization, interception, reinforcement and attack, all separate, which has kept things pretty simple
Hmm... the close-starting-planets scenario is something I never considered before. So, I guess in that situation you would be better off sending out some ships to a far-away low-cost planet on your side of the map. Then you would slowly amass enough ships to colonize other planets and you would quickly have the upper hand.
It seems like getting your initial planet colonization right is the key. Pretty much as soon as one player gets an advantage in ship count (or ship growth rate) it's all over.
Also as far as separating attack, defend, etc... I was doing that. The problem is that I further separated it into smaller sub-contexts. For instance, I made a distinction between attacking neutral planets that the opponent is sending ships to, and attacking a neutral planet that was previously not under attack.
My new strategy is going to simplify all of this though.
Yeah, close starting positions lead to very interesting games.
An extreme example would be this: p1 & p2 start off as usual, but only 6 distance apart. There is a growth 5 planet with 40 neutral ships on it 10 distance away from p2 (and 16 from p1). Obviously p1 won't try to colonize it, but p2 loses the game every time if he tries to colonize it.
The hard maximum you can safely send out to colonize in that case is your ships - enemy ships + growth rate * distance
I have similar separations in my code, but the actual chunk that does the AI is only about 200 lines. One thing I did was add a lot of functionality to the engine. You're going to want to be able to do a full simulation of the game state to arbitrary turns; it makes answering the question of "how many reinforcements do i need and when do they have to arrive" trivial - simulate until the planet flips.
Hahaha. I'm in the top 200 only because the first game of my new bot was a fluke win over a guy rated at ~200. I don't expect to stay here for long though.
jogernaut on
0
SirUltimosDon't talk, Rusty. Just paint.Registered Userregular
edited October 2010
So now my bot won't compile and they're not even sending me an email explaining why. I think it's still a problem with Mono and not my code, which makes it even more frustrating. It a couple of submissions last night before it would even compile the starter package.
So now my bot won't compile and they're not even sending me an email explaining why. I think it's still a problem with Mono and not my code, which makes it even more frustrating. It a couple of submissions last night before it would even compile the starter package.
This was my frustration. I ended up trying some C++ and then some Java and gave up on those and I am now using Mono to test compile. I use 1.2.6 and made a simple batch file I run every now and then to make sure things work. Just tried submitting a base project that does nothing (no bot logic) but does parse the game state. Going to hope that works.
Edit: I have .NET along with mono. No problems thus far.
Edit 2:
Well there goes that idea.
Oct 5th 16:49:07 error while compiling submission C#
Ain't that just fine and dandy... I had 0 issues compiling on my end with Mono. I even compiled with the SAME SETTINGS they used on my 1 sucessful submission which was this:
Posts
But, by itself, I can't see that code crashing
Decisions decisions.
I am also going to write up a game engine so I can debug if needed.
You could try F# or OCaml? They're nice functional language, but impure (meaning you can do some awesome imperative things).
Robots Will Be Our Superiors (Blog)
http://michaelhermes.com
Also, Notepad++ -> TextFX -> Reindent C++ code is pretty nice.
edit: So I got the visualizer to play against itself... it comes with java files for the bots. Is there a way to get the offline visualizer play my cpp bot? I don't understand.
Robots Will Be Our Superiors (Blog)
http://michaelhermes.com
You should be able to replace the bolded parts with your compiled bots:
e.g. the example from the tutorial:
becomes
Robots Will Be Our Superiors (Blog)
http://michaelhermes.com
edit: Also, from my experience, only dualbot and ragebot are worth playing against
Comments would be nice. Use it if you like it.
http://www.0x5eeded.com/PlanetWars.zip
I'm guessing Engine.cs is incomplete? It doesn't have any code for planets fighting, nor does it seem to be called from anywhere in your code. If you do get that working, it'd be useful to pipe the output of the game into http://github.com/DanielVF/Planet-Wars-Canvas-Visualizer.
I just pulled up the actual VS project and noticed those files weren't in the project. You might want to clean that up, otherwise looks fine, great work.
I have been further refactoring the gamestate stuff to make it easier to pick what fleets or planets you want. Linq makes it very easy to read and select. I am still working on the Engine.cs so that it works completely and allows for threading. This way I can run my bot on multiple threads and have multiple battles going on at the same time. Ofcourse I cant use threading for submissions but I can for my internal testing.
The good news is that my first bot with no offense made it up to about 800 yesterday.
Don't worry, I didn't mean all forms of Mono. Just the partially implemented open source kinds.
Does anyone know if sharing each others bot (source or binary) is against the rules?
I started dominating the starter kit bots, and it's difficult to determine what changes work well and which ones don't. Does anyone have a decent bot that they want to share so that we all have something more competitive to test against?
I understand that for languages that decompile easily (or don't even compile) that most people probably don't want to give away any kind of competitive advantage, but maybe you've got an older version? Once I make a few improvements to my current bot, I don't mind sharing the current version.
tcp.exe 72.44.46.68 995 username -p password java -jar MyBot.jar
I finally won though. Battle of the pacifists.
Battle of the pacifists, take two. I'm not sure why neither of us colonized the 20 & 32, or the 7
My bot started getting way too complicated, and is currently hovering around 600th on the leaderboards.
I'm going back to the drawing board to implement something like Kanban which should be a lot easier to maintain and tweak.
So far, I've been splitting all my functionality, I've got pieces of code that handle colonization, interception, reinforcement and attack, all separate, which has kept things pretty simple
I totally get that. If they had a Scala starter kit, I'd be dumping Java in a heartbeat.
Hmm... the close-starting-planets scenario is something I never considered before. So, I guess in that situation you would be better off sending out some ships to a far-away low-cost planet on your side of the map. Then you would slowly amass enough ships to colonize other planets and you would quickly have the upper hand.
It seems like getting your initial planet colonization right is the key. Pretty much as soon as one player gets an advantage in ship count (or ship growth rate) it's all over.
Also as far as separating attack, defend, etc... I was doing that. The problem is that I further separated it into smaller sub-contexts. For instance, I made a distinction between attacking neutral planets that the opponent is sending ships to, and attacking a neutral planet that was previously not under attack.
My new strategy is going to simplify all of this though.
Yeah, close starting positions lead to very interesting games.
An extreme example would be this: p1 & p2 start off as usual, but only 6 distance apart. There is a growth 5 planet with 40 neutral ships on it 10 distance away from p2 (and 16 from p1). Obviously p1 won't try to colonize it, but p2 loses the game every time if he tries to colonize it.
The hard maximum you can safely send out to colonize in that case is your ships - enemy ships + growth rate * distance
I have similar separations in my code, but the actual chunk that does the AI is only about 200 lines. One thing I did was add a lot of functionality to the engine. You're going to want to be able to do a full simulation of the game state to arbitrary turns; it makes answering the question of "how many reinforcements do i need and when do they have to arrive" trivial - simulate until the planet flips.
This was my frustration. I ended up trying some C++ and then some Java and gave up on those and I am now using Mono to test compile. I use 1.2.6 and made a simple batch file I run every now and then to make sure things work. Just tried submitting a base project that does nothing (no bot logic) but does parse the game state. Going to hope that works.
Edit: I have .NET along with mono. No problems thus far.
Edit 2:
Well there goes that idea.
Ain't that just fine and dandy... I had 0 issues compiling on my end with Mono. I even compiled with the SAME SETTINGS they used on my 1 sucessful submission which was this:
Ofcourse I added a few more files that need to be compiled but all of them are in the same directory. I am going to try removing namespaces.
edit 3:
removing namespaces did nothing.
edit 4:
removing useless using statements did nothing.
edit 5:
used the c# starter package, that failed as well.