- If you already have Eclipse installed, skip to the next section. Microclimate Developer Tools for Eclipse requires either Eclipse Photon, Eclipse 2018-09, or newer.
- Visit the Eclipse download page.
- Locate the
Eclipse IDE for Enterprise Java Developers
section, select your operating system, then clickDownload
. - Wait for the file to download, then extract it to the directory of your choice.
- Start Eclipse, specify a workspace directory (the default is fine), and wait for Eclipse to load.
- Requires: Eclipse Photon.0, Eclipse 2018-09, 2018-12, 2019-03, or newer.
- From within Eclipse, select
Help
(menu item) >Eclipse Marketplace
. - Type
Microclimate
in the search bar, then clickGo
. - You should now see
Microclimate Developer Tools
in the search listings. Click theInstall
button next to these tools. - Read and accept the licenses, then click
Finish
. - After the install completes, you will be prompted to restart Eclipse, click Restart.
See the Microclimate documentation for more information on Installing Microclimate Developer Tools.
Visit the Installing Microclimate page to install and start Microclimate. Return to this page when done.
- In the Microclimate browser UI, accept the Microclimate license and select an option on the telemetry page. You should now see the Microclimate introductory splash screen.
- Select the
Import Project
button. On the following page, selectGit
, then copy and paste the following repository location:
https://github.com/microclimate-dev2ops/rogue-cloud-client
- Click
Next
, then click theImport
button. - Once the code is imported, click the
Edit Code
button. You are now redirected to the code editor. - Before the code starts building, the container needs to initialize and download the Java and Maven dependencies for the underlying build system. This can take up to 7 to 10 minutes depending on CPU and network connection (this initialization is only required the first time you using Microclimate). You can use
docker logs -f microclimate-file-watcher
to watch its progress. - Once the build has initialized and downloaded the required dependencies, the build icon displays a green circle notification, like so:
Once the build completes, you can return to the Eclipse window.
You should now have both Eclipse and Microclimate installed. Next we need to configure the Eclipse Microclimate Developer Tools to connect to the Microclimate service.
Ensure that Microclimate is up and running before proceeding with these steps.
- In Eclipse, select
File
(menu item) >New
>Other
. This will bring up theNew
wizard dialog. - Under the
Microclimate
category, selectNew Microclimate Connection
, then clickNext
. - Click
Test connection
to confirm that Eclipse can connect to your local Microclimate instance, thenFinish
. - The
Microclimate Explorer
view should appear at the bottom of the screen, and should show theroguecloudclient
application running inside Microclimate. - Right-click on
roguecloudclient
and selectImport project
.- The Git repository on which the project is based will be imported into Eclipse.
- The
roguecloudclient
source will be imported into Eclipse as a Maven project.
See the Microclimate documentation for more information on connecting to Microclimate instance from Eclipse.
- In the code editor, press
CTRL-SHIFT-R
(Command-Shift-R
on Mac) and typeStartAgentServlet.java
, and selectStartAgentServlet.java
.
CTRL-SHIFT-R/Command-Shift-R
is a great way to quickly find Java classes in Eclipse.
- Edit the following fields in
StartAgentServlet.java
to create a new user and password.
public static final String USERNAME = "(specify a username here!)";
public static final String PASSWORD = "(specify a password here!)";
- These values are to ensure that only you can access and control your character.
- The username and password you specify are automatically registered when your code first begins controlling a character on the game map, and they do not have to correspond to an existing email address or account.
-
Press
CTRL-S
(Command-S
on Mac) in order to save your changes. -
Press
CTRL-SHIFT-R
(Command-Shift-R
on Mac) and typeSimpleAI.java
and selectSimpleAI.java
. -
This class is the main AI class. Changes made to this class are reflected in your AI running on the Liberty Server.
To watch your agent as it interacts with the game world, right-click on the roguecloudclient
project in the Microclimate Explorer
view and select Open Application
.
This will open a browser to the root of your application.
Add gameclient/StartAgent
to the end of the URL, such that it looks like:
http://localhost:(port)/gameclient/StartAgent
, where (port) is the randomly generated local port for the server.
Congratulations, your character is now exploring and interacting with the game world, and earning you points on the leaderboard!
Next, visit the next steps page to learn more about coding an agent for Rogue Cloud.