First, 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-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:
- In the code editor, hit
CTRL-P
(Command-P
on Mac) and typeStartAgentServlet.java
, and selectStartAgentServlet.java
.
CTRL-P/Command-P
is a great way to quickly find Java classes in the Microclimate code editor.- Note: You might need to click inside the code editor for this shortcut key to work.
- Edit the following fields 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!)";
- The username and password you specify are automatically registered when your code first begins controlling a character on the game map.
-
In the code editor, hit
CTRL-S
(Command-S
on Mac) in order to save your changes -
Hit
CTRL-P
(on Mac, useCommand-P
) 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, switch to the Open app
tab. You see a URL at the top of the page:
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.