real time Debug

AI discussion, ideas, and SDK help.
Post Reply
inonzuk
Luxer
Posts: 20
Joined: Thu Apr 19, 2007 7:36 am

real time Debug

Post by inonzuk » Thu Apr 19, 2007 7:41 am

Hello dear robot constructors,

I've decided to start building a robot for Lux, I'm using windows XP system and using Eclipse as my IDE.

Can any of you share some info on how do I debug the robot on real time? (i.e. using "step in"/ "step out" and wathcing variables values while a game is running)

Thanks in advance
Inon

User avatar
guest
Luxer
Posts: 189
Joined: Fri Dec 17, 2004 9:17 pm
Location: Southern NH

Post by guest » Thu Apr 19, 2007 10:31 am


BDF
Luxer
Posts: 330
Joined: Fri Apr 06, 2007 5:47 pm

Post by BDF » Thu Apr 19, 2007 3:55 pm

i have a tip for you (although im not a bot maker myself)
If you look through the forums u will notice that there are certain ideas that people had for what they would like a new bot to have. Many would like a vengeful bot, one that would send a large number of armies to hit you if you killed a set % of its armies. Do you know what i mean? If you are new, this might be beyond you, but if you can do it, try it.

User avatar
RandomGuy
Lux Veteran
Posts: 1463
Joined: Mon Mar 05, 2007 12:02 am
Location: Central American Jungle
Contact:

Post by RandomGuy » Thu Apr 19, 2007 8:16 pm

just an FYI - I've started work on a Revenge bot. Feel free to make one yourself too, but there is (at least) one in the works.

inonzuk
Luxer
Posts: 20
Joined: Thu Apr 19, 2007 7:36 am

I'm using Windows

Post by inonzuk » Sat Apr 21, 2007 3:30 pm

Thanks for the help, but the link you added explains how to work with Xcode (Mac Os).

Does anyone managed to debug in realtime in some windows based IDE ?

User avatar
GregM
Luxer
Posts: 252
Joined: Wed Jun 01, 2005 4:33 pm

Post by GregM » Sat Apr 21, 2007 4:33 pm

You can use System.out.println() and such to have your program output debugging data to the console.

inonzuk
Luxer
Posts: 20
Joined: Thu Apr 19, 2007 7:36 am

Post by inonzuk » Sat Apr 21, 2007 4:35 pm

I am writing to System.out and reading the log file, but I realy need my "Step in\out" options ... what can I say, I'm a stepping adict. :)

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10998
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Sat Apr 21, 2007 4:39 pm

There's got to be a way to setup eclipse for stepping. I don't use it though, so I don't know the steps. Maybe eclipse docs/forum has more info on how to do it?

The LuxCore.jar file is the java executable, so you'll probably have to copy that into your IDE project, along with your new agent files.

inonzuk
Luxer
Posts: 20
Joined: Thu Apr 19, 2007 7:36 am

the main class

Post by inonzuk » Wed Apr 25, 2007 2:15 am

I need to tell the eclipse which file inside the JAR contains the main function to be executed. Can you tell me which file is it ?


O.k !!!! problem solved.

For future viewers I'll just say that eclipse has a feature where it searches the external jars for main functions.

Let's start working now....

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10998
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Wed Apr 25, 2007 6:47 pm

An updated version of Lux was just released today (detailed here). You should update to that since it changes the main class. From version 5.62 and on the main class inside the jar is com.sillysoft.lux.Lux

Oh, I just saw you solved it already, cool. If you could list out any steps you had to take it would surely be useful for more people in the future.

User avatar
Bertrand
Reaper Creator
Posts: 568
Joined: Mon Nov 28, 2005 4:35 pm
Location: Montreal

Post by Bertrand » Fri Apr 27, 2007 6:16 pm

If anyone is interested, real-time debugging is easy to setup in the NetBeans IDE. This is what I use for all my java programming. Once you have climbed the initial learning curve, it is a joy to work with. It can be gotten from http://www.netbeans.info/downloads/all.php?b_id=2323

Here is an overview of the setup steps, once you have downloaded the Lux SDK and Netbeans. I use the Windows version, but it is supported in Linux and OS X.

Create a new project
Add the LuxSDK/src folder to the project
In the project properties, libraries tab, add LuxCore.jar as a compile-time library
In the project properties, run tab, set main class as com.sillysoft.lux.Lux, and set the Working Directory as the Lux folder (where you found LuxCore.jar)
From the main interface, project (or files) tab, select the src directory, drill down to com/sillysoft/lux/agent, creaty a new empty java file and copy another bot (like angry.java) into it
From the build menu, Build the main project (F11)
If you want, set breakPoints in your source (click to the left of any line), and from the Run menu, Debug Main Project (F5).

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10998
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Fri Apr 27, 2007 8:23 pm

Cool, thanks for the steps Bertrand. I added them to (a subpage off of) the WritingYourOwnAI wiki page, and did a little bit of clean up there also.

User avatar
RandomGuy
Lux Veteran
Posts: 1463
Joined: Mon Mar 05, 2007 12:02 am
Location: Central American Jungle
Contact:

Post by RandomGuy » Sat Apr 28, 2007 1:06 pm

Thank you for this Bertrand. I downloaded NetBeans to do my bot dev (windows platform also) and hadn't tried to set it up for real-time debugging yet - this will help immensely.

Post Reply

Who is online

Users browsing this forum: No registered users and 52 guests