Skip to content

Project Setup (Windows)

twostars edited this page Mar 25, 2026 · 14 revisions

Contents


  1. Prerequisites
  2. Fork the Repository
  3. IDE Setup (Visual Studio)
  4. Database Setup
  5. ODBC Setup
  6. Server Configuration
  7. Running the Server
  8. Connect with Client

Prerequisites


This is the guide for the Windows-based project setup. If you're looking for Linux, see Project Setup (Linux).

You'll need the following to work with the project:


Fork the Repository


Fork the Knight Online repository then clone your fork to your machine. If you're unfamiliar with Git, see our Using Git page for help.


IDE Setup (Visual Studio)


Visual Studio 2026

Download the Visual Studio 2026 installer from Microsoft and run it. After the installer finishes downloading updates you should see the following screen:
image

For this project, you'll need to select the following from this screen:

  1. Scroll down to the "Desktop & Mobile" section and check Desktop development with C++": image

  2. Go to the "Individual components" tab

  3. Search for and following components and make sure they're all checked (most likely you will only need to add MFC):

  • C++ ATL for x64/x86 (Latest MSVC)
  • C++ MFC for x64/x86 (Latest MSVC)
  • MSVC Build Tools for x64/x86 (Latest)
  1. Verify that all required components are selected, then click Install:
    image

Visual Studio should now download and install.

Building All.slnx

Now that Visual Studio is installed with all the required components we can build the project.

  1. Open Visual Studio
  2. On the Open screen, select "Open a project or solution" from the list on the right.
image
  1. In the file picker, navigate to the KnightOnline folder you cloned from git. Select and open "All.slnx".
image
  1. Visual Studio will open to a "What's New?" screen. You can safely close this.
    image

  2. You should be able to see the Solution Explorer view on the right side of the IDE. Right click the "Solution 'All'" line, and select "Build Solution".
    image

  3. This will kick off the build process for everything in the repo. It will be slowest on the first build as it fetches all the required dependencies and builds them; these dependencies will only be rebuilt when there is a change to them, so subsequent builds should be much faster. (Note: while this shouldn't happen, if you do happen to get an error on your first build, try running it again. It may have been a one-time setup error).
    image

This should have built all of the application managed under the KnightOnline repository.

You can find the built applications under bin/Debug-x64/:

image

Visual Studio 2022

Download the Visual Studio 2022 installer from Microsoft and run it. After the installer finishes downloading updates you should see the following screen:
image

For this project, you'll need to select the following from this screen:

  1. Scroll down to the "Desktop & Mobile" section and check Desktop development with C++": image
  2. Go to the "Individual components" tab
  3. Search for and check the boxes for the following components:
  • C++ ATL for latest v143 build tools (x86 & x64)
  • C++ MFC for latest v143 build tools (x86 & x64)
  • MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)
  1. Verify that all required components are selected, then click Install:
    image

Visual Studio should now download and install.

Building All.slnx

Now that Visual Studio is installed with all the required components we can build the project.

  1. Open Visual Studio
  2. On the Open screen, select "Open a project or solution" from the Get Started list on the right.
image
  1. In the file picker, navigate to the KnightOnline folder you cloned from git. Select and open "All.slnx".
image
  1. Visual Studio will open to a screen full of advertisements for their AI products. You can safely close all of these.
    image
  2. With the advertisements closed you should now be able to see the Solution Explorer view on the right side of the IDE. Right click the "Solution 'All'" line, and select "Build Solution".
    image
  3. This will kick off the build process for everything in the repo. It will be slowest on the first build as it fetches all the required dependencies and builds them; These dependencies will only be rebuilt when there is a change to them, so subsequent builds should be much faster. (Note: while this shouldn't happen, if you do happen to get an error on your first build, try running it again. It may have been a one-time setup error).
    image
    image

This should have built all of the application managed under the KnightOnline repository.

You can find the built applications under bin/Debug-x64/:

image

Database Setup


It is recommended to do a manual setup when using Windows. See SQL Server Manual Setup.

Docker Desktop can be difficult to work with, and optimal configuration can vary machine-to-machine. If you're comfortable setting Docker up, however, our local development database containers and helper scripts will keep your development database in sync with the data in our OpenKO-db repository. See the Docker README.MD if interested.


ODBC Setup


Note that this assumes you've either:

  • Manually restored the database as "KN_online". If you restored it as something else, use its new name instead. OR
  • Successfully started the Docker database container
  1. Press "Start" and type in "ODBC":
    image
    You should see "ODBC Data Sources (32-bit)" and "ODBC Data Sources (64-bit)" in the search list.

    The projects all currently default to building for 64-bit, so for that, you should use the 64-bit version ("ODBC Data Sources (64-bit)").

  2. Under "User DSN", press "Add...":
    image

  3. Scroll down to find the newest SQL Server driver (if you scroll to the right, there's a date column). So long as it's for SQL server, any SQL server specific driver should be fine:
    image
    Select it and press "Finish".

  4. Now we configure the datasource name and SQL server instance:
    image
    Name: KN_online
    This is the datasource name, not the database name. The servers will connect to this. If you change this, you must change each of the servers' config files.
    This is the default, so it's easiest to leave it as-is.

    Description: (you can leave this blank)

    Server: If you installed SQL Server Express from this guide, then by default, use ".\SQLEXPRESS".
    If you installed another version like SQL Server Developer, then use the default ".".

    Press "Next >".

  5. ODBC will need to connect to your database server for setup. It will ask for login details; these don't matter for anything besides setup here:
    image
    If you followed the SQL server setup guide, then you will have mixed mode installed, so you can just leave "With Windows NT authentication" checked" so it just uses your Windows login details.

    DOCKER ONLY: you must follow these additional steps to support a connection to the Docker container:

  • Click the "Client Configuration..." button.
    Odbc Client Configuration button

  • Uncheck "Dynamically assign port", and type in the port your SQL server runs on (default: 1433). Click OK.
    Odbc Dynamically assign port

  • You must use SQL Server authentication using a login ID and password for Docker. The default username is knight and the default password is knight.

    Hit "Next >".

  1. If everything is correct, it should take you to the next screen immediately.

    If an error occurred, it will let you know that either it's connecting to the wrong place or your login details don't work, so you should go back (via the "< Back" button) and fix those appropriately.

    Tick "Change the default database to:" and select your database from the dropdown (which should be "KN_online" by default):
    image
    Press "Next >".

  2. On the final setup page, be sure to untick "Perform translation for character data":
    image
    KO uses character data when it means to use binary data for items, quests etc, so untick this or they will break.

    Hit "Finish".

  3. It will show you all of the config you chose.

    Press "Test Data Source..." verify that everything connects and behaves correctly:

    image
    Finish up by pressing "OK" on the test UI.
    image
    NOTE:
    Verification may fail due to "Perform translation with character data" being unchecked.
    So long as it connects to the server successfully, you can ignore this.
    This setting MUST be off (i.e. unchecked) to ensure things behave correctly.

    Press "OK" again on the confirmation UI:
    image
    And finally press "OK" again on the main UI to close it:
    image

ODBC is now setup.


Server Configuration


The server applications will generate their default configuration the first time they are run. If new configuration is added, the server will add the default value to the file on the next run.

If you feel compelled to change the default configuration, you can edit the .ini file for the application.

Under bin/Debug-x64/:

Application Configuration File
AIServer server.ini
Ebenezer gameserver.ini
Aujard Aujard.ini
VersionManager Version.ini
ItemManager ItemManager.ini

If you're using CMake instead of VS's build, these files would be located in cmake-build-debug/bin/Debug/.


Running the Server


TBD (Open Server.slnx, run projects in the order: "AIServer", "Ebenezer", "Aujard", and then "VersionManager")


Connect with Client


TBD (Open Client.slnx, run the WarFare project. It should work as-is. If you're not running the client on the same machine as the server, configure the client's Server.ini under assets/Client - if you've run the project once, Server.ini will exist. Otherwise, copy & rename Server.ini.default to Server.ini and modify that)

If using our development database, you can log in to a fresh account using one of the following accounts.

Username Password
testing testing
testing1 testing1
testing2 testing2
testing3 testing3
testing4 testing4
testing5 testing5
testing6 testing6
testing7 testing7
testing8 testing8
testing9 testing9
testing10 testing10

Clone this wiki locally