- If you already have Eclipse installed, skip to the next section. Codewind requires Eclipse 2019-03, 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.
Installation prerequisites:
- On Mac: Install 'Docker Desktop for Mac' and Git (on this platform Docker Compose is bundled with Docker Desktop)
- On Windows: Install 'Docker Desktop for Windows' and Git (on this platform Docker Compose is bundled with Docker Desktop)
- On Linux: Install Docker, Docker Compose, and Git (on this platform, Docker Compose must be downloaded separately)
Additional configuration steps for these platforms may be required. See the Eclipse Codewind documentation for details.
- Requires: Eclipse 2019-03, or newer.
- From within Eclipse, select
Help
(menu item) >Eclipse Marketplace
. - Type
Codewind
in the search bar, then clickGo
. - You should now see
Codewind
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 Eclipse Codewind documentation for more information on Installing Codewind into Eclipse.
- Open the Codewind view. Navigate to
Window
(menu item) >Show View
>Other...
, thenCodewind
>Codewind Explorer
- Codewind requires the installation of additional Docker images to run. Double-click on the Codewind item in the Codewind Explorer view to complete the installation. The installation may take a few minutes to complete.
You are now ready to use the tools. You can use the Codewind Explorer view to create new projects or add existing ones. Right-click an element in the Codewind Explorer to look at the features available.
Codewind creates a folder called codewind-workspace
within your home directory to contain your projects. In this step we will locate that folder, and then git clone
the Rogue Cloud client into that folder.
- From the terminal, determine the location of the Codewind workspace folder:
- Mac/Linux:
docker inspect codewind-pfe | grep "HOST_WORKSPACE_DIRECTORY="
- Example:
"HOST_WORKSPACE_DIRECTORY=/home/user/codewind/codewind-workspace"
means your workspace can be found in/home/user/codewind/codewind-workspace
- Example:
- Windows:
docker inspect codewind-pfe | find "HOST_WORKSPACE_DIRECTORY="
- Example:
"HOST_WORKSPACE_DIRECTORY=C:\\codewind-workspace"
means the Codewind workspace isc:\codewind-workspace
- Example:
- From within the
codewind-workspace
directory, clone the Rogue Cloud client repo
cd (path to your codewind workspace from the previous step)
git clone https://github.com/microclimate-dev2ops/rogue-cloud-client-codewind
- Now, import the project into Eclipse: Select
File
(menubar item) >Import...
, then in the dialog selectGeneral
(tree item) >Existing Projects into Workspace
and clickNext >
. - Select
Select root directory
and clickBrowse...
, select(codewind workspace path from above)/rogue-cloud-client-codewind
, then clickSelect Folder
. ClickFinish
. Wait for the project to build. - Right-click on
Codewind
(inCodewind Explorer
view) >Local Projects
>Add Existing Project...
. gameclient
should appear in the checkbox list, select it (if not already selected), then clickNext >
.- Select
MicroProfile / Java EE
(if not already selected), then clickFinish
. - 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 between 5 to 10 minutes depending on CPU and network connection (this initialization is only required the first time you use MicroProfile with the Codewind tools).
Additional information about creating and importing projects into Codewind is available our website.
- 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 in the MicroProfile Liberty container.
To watch your agent as it interacts with the game world, right-click on the gameclient
project in the Codewind Explorer
view and select Open Application
.
This will open a browser to the root of your application. Note: If you are on Windows, you will need to copy-paste the URL into an external browser (Chrome, Firefox, Edge) because Eclipse's internal browser uses IE11 (an unsupported browser).
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.