Sillysoft
Steam users, please help Greenlight Lux Delux!
Sillysoft Forums
Forums Of Universal Domination 
Games
About - FAQ
Download - Buy
Lux Delux
Maps - Rankings
Download - Buy
Castle Vox
Maps - Rankings
Download - Buy
Forums
Join the Forums
Log in - Memberlist
  RSS feeds  
Art - Wiki
News - Search
Help Getting Up and Running

 
Post new topic   Reply to topic    Sillysoft Games Forum Index -> Robot House
View previous topic :: View next topic  
Author Message
mctuble
Lux Newbie


Joined: 21 Aug 2006
Posts: 2

PostPosted: Mon Aug 21, 2006 7:46 am    Post subject: Help Getting Up and Running Reply with quote

Can someone help me get my java ide set up so I can compile an AI please? I am currently using Eclipse v 3.1.2 and using Java version 1.5.0. Eclipse runs and I can program in it. The problem is getting it to work with the Lux SDK. After that another quick question. How do I compile the program? Do I make a program that uses the AI class I made then run it then I use the .class file created from it? Thanks in advance.
Back to top
View user's profile Send private message View mctuble's ranking
dustin
Lux Admin
Lux Admin


Joined: 15 May 2003
Posts: 9134
Location: Vancouver

PostPosted: Mon Aug 21, 2006 3:32 pm    Post subject: Reply with quote

Hey,

This link has some details about how to get set up writing an AI:
http://sillysoft.net/wiki/?WritingYourOwnAI

I don't use eclipse, so I can't give exact steps. As long as you can compile all the java files into their corresponding class files that's all you need. Then make a copy of an agent's java file, mod it to be your own, and compile again. Then stick your compiled class file into the Lux agents folder.
Back to top
View user's profile Send private message Send e-mail Visit poster's website View dustin's ranking
mctuble
Lux Newbie


Joined: 21 Aug 2006
Posts: 2

PostPosted: Mon Aug 21, 2006 4:07 pm    Post subject: Reply with quote

Ok so my second question is answered now thanks. Back to my first one. Actually coding the AI is not a problem as of yet. The problem is setting up Eclipse to recognize the Lux libraries. If anyone here has set up Eclipse to make an AI please help. At this point I'm willing to scrap Eclipse and use whatever method. So any help is appreciated.
Back to top
View user's profile Send private message View mctuble's ranking
Bertrand
Reaper Creator


Joined: 28 Nov 2005
Posts: 585
Location: Montreal

PostPosted: Mon Aug 21, 2006 5:48 pm    Post subject: Reply with quote

I can't help you with eclipse, since I use the NetBeans IDE. NetBeans is free and can be downloaded from http://java.sun.com/j2se/1.5.0/download-netbeans.html
The setup in NetBeans is very simple: just create a new project and add the luxSDK\src directory in the Files tab. Then, drill down to com\sillysoft\lux\agent, create a new empty java source file and as a starting point copy one the sample bots (I recommend Angry.java) into it.
To compile just hit F9. To run your bot copy the class file to the Lux\Support\Agents folder and restart Lux.
Back to top
View user's profile Send private message Send e-mail View Bertrand's ranking
GregM
Lux Newbie


Joined: 01 Jun 2005
Posts: 257

PostPosted: Mon Aug 21, 2006 7:18 pm    Post subject: Reply with quote

For the development of my bot I mostly used a text editor and command line functions.

On my computer the Lux SDK is located at "C:\Program Files\Lux\LuxSDK." There are SDK classes located at "C:\Program Files\Lux\LuxSDK\src\com\sillysoft\lux" and "C:\Program Files\Lux\LuxSDK\src\com\sillysoft\lux\util." You have to first compile these SDK classes (Board.java, Country.java, CountryIterator.java, etc.). I did this by going to those two directories with the command prompt and then using javac:

javac -cp "c:\program files\lux\luxsdk\src" *.java

I think there are also some build scripts provided with the SDK if you can figure them out.

Now you're ready to start writing your bot. My bot is in package "org.mcglynns.lux" so it is in the directory "C:\Program Files\Lux\LuxSDK\src\org\mcglynns\lux." When I want to compile my bot I go to this directory with the command prompt and type

javac -cp "c:\program files\lux\luxsdk\src" MyBot.java.

This generates MyBot.class in the org\mcglynns\lux directory. Lux will not look for the bot here: you need to put it in the Agents folder. On my computer this is at "C:\Program Files\Lux\Support\Agents," so I copy the .class file to there.

Now I start up Lux from the command line by typing "java -jar LuxCore.jar" in the "C:\Program Files\Lux" directory. Running Lux this way allows you to see any output the bot makes via System.out.printlns or any exceptions that are thrown in real time in the command prompt. Then you can make modifications to your bot, recompile it, copy the new version into the Agents folder and run Lux with the new version.

After writing all I imagine the process seems long and involved, but once you have it figured out it's pretty quick.

Good luck, and I hope to see a bot by you competing online in the future. Smile
Back to top
View user's profile Send private message Send e-mail View GregM's ranking
blackj3sus
Lux Messiah


Joined: 05 May 2006
Posts: 3209
Location: sillysoft.net/roman-battles

PostPosted: Fri Aug 25, 2006 4:11 pm    Post subject: Reply with quote

easy for you to say... Confused
Back to top
View user's profile Send private message Visit poster's website View blackj3sus's ranking
GeekHammer
Lux Newbie


Joined: 02 Mar 2007
Posts: 1

PostPosted: Fri Mar 02, 2007 12:05 am    Post subject: Reply with quote

I'm new to both LuxSDK and Eclipse, but here is what I was able to figure out (Eclipse 3.2):

1. Install the LuxSDK. I put it in c:\program files\lux\luxsdk...
2. Run Eclipse. Open the Package Explorer (window -> show view -> package explorer).
3. Right-click and select New -> Project -> Java Project
4. In the new project wizard, under "Contents" select "create project from existing source"
5. Browse to and choose the LuxSDK folder; I used a project name of LuxBots and press "Finish"

6. Expand "LuxBots" in the package explorer
7. Expand src
8. expand com.sillysoft.lux.agent and you will see all the agents
9. Right-click on com.sillysoft.lux.agent and chose New -> Class
10. Pick SmartAgentBase as the superclass.
11. Cut&paste imports and edit as needed. You now have a bot.
12. Copy the class file from the LuxSDK bin folder and run Lux.

Hope this helps.
Back to top
View user's profile Send private message Send e-mail View GeekHammer's ranking
Display posts from previous:   
Post new topic   Reply to topic    Sillysoft Games Forum Index -> Robot House All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum

Meowzers Action Cats is our newest feline fun mobile game. Romp with cute cats on your phone and tablet.

Castle Vox is a simultaneous-turns team strategy boardgame. Diplomacy meets Axis & Allies game.

Lux Delux is an advanced Risk world domination game with over 800 maps, hard AI, and online multi-player.

American History Lux takes you through the wars of USA history. — Ancient Empires Lux spans Babylon to the Roman Empire.

Lux Touch, Lux USA and Lux DLX let you conquer the world on your iPhone, iPod, and iPad.

Sillysoft makes games for Mac OS X, Windows XP/Vista/7 and Linux. Also mobile games for iPhones, iPads, and iPod Touch.

Macintosh users may be interested to see our favorite Mac OS X games. For the full Sillysoft empire check out the sitemap.

Because taking over the world is fun.
                                 - Lux