shawwn / noh

An open source implementation of Icefrog's DotA, with a pretty amazing engine. Builds in 3 minutes flat; cross-platform.
200 stars 32 forks source link

Newerth of Heroes

image

An open source implementation of dota.

Cross platform; multiplayer; lobby system; map editor; replay system; semicolon. Builds in 3 minutes flat on an M1 Air.

Table of Contents

About

Intended to be the game engine that my 13yo self wished he'd had. Think of it as a baseline "here's a fully working game engine, along with an actual game" reference that you can use for whatever you want. It's small enough that you can understand it, build it yourself, and customize.

My long term goal is to implement a custom game system reminiscent of the StarCraft 1 "Use Map Settings" era. There was something magical about it that modern "custom game" attempts don't really capture. If you remember it, you know what I mean -- point to any modern equivalent that makes you feel the same spark of joy of joining a random lobby and discovering that it's actually a weirdly-detailed esoteric RPG that some 14yo crafted in StarEdit, or an intense tower defense experience that you didn't expect.

image

It also makes my heart ache that your only realistic choices for becoming a professional gamedev circa 2023 is to build everything from scratch yourself (Celeste) or to spend years learning Unreal Engine or Unity. Good luck understanding the inner workings of those behemoths, much less getting UE to build.

So hopefully this will give you a leg up as a lone wolf gamedev.

image

Ultimately, I expect this to take somewhere between three months and three years, and for roughly seven people to care about it. But if you're one of those seven, know that you'll have all my heart and soul pushing you forward, for whatever it's worth. I fell in love with the K2 engine when I worked at S2 in 2010. Perhaps one or two others might too.

Media

Newerth dev stream #1

https://youtu.be/VBj0RcpxCIc?t=132

I wanted to give hackers a sense of how it feels to work with the engine, so I recorded about an hour of random work.

Be sure to read the chapter titles as you watch; it's a detailed blow-by-blow of my thought process as I went.

"I was a former HoN dev. AMA"

https://www.reddit.com/r/DotA2/comments/asc14j/i_was_a_former_hon_dev_ama/

This was an AMA I did when S2 officially shuttered Hon after Valve steamrolled them. The timestamp says four years ago, but it feels like a decade.

I originally joined S2 because I loved the game, and a certain bug was so frustrating that I simply had to annihilate it. Joining the company was the only way I could, so I did.

License

All code and assets are MIT licensed, to the extent that I'm authorized to do so. Which is to say, not at all. But nobody cares at this point.

Compiling NoH

Building NoH on macOS

Install macOS dependencies

Install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install the dependencies:

brew install cmake llvm ninja speex speexdsp giflib libpng libjpeg openssl@1.1 freetype fswatch fileicon
Clone the repository (--recursive is important!)
git clone --recursive https://github.com/shawwn/noh
Build on macOS with CMake
cd noh
mkdir build
cd build
cmake ..
cmake --build . -j12

Things you can do:

Building NoH on macOS with CLion

Open the repo in CLion:
cd noh
clion .
Once CLion is open
image

Ignore the scary-looking errors and just click the play button (Run -> Run 'NoH')

image

If things go well, NoH will launch. Congratulations!

image

If things go wrong

Open CMake tab, click "Reset Cache and Reload Project" (the icon in the upper left of the tab with two arrows)

image

Build -> Rebuild all in Release

image

Run -> Run NoH, or just click the play button

If things still aren't working, post an issue or DM me on Twitter: @theshawwn

Building NoH on Ubuntu

Clone the repo:

git clone --recursive https://github.com/shawwn/noh && cd noh

Install dependencies:

sudo apt update

# Compiler deps
sudo apt install -y build-essential libtool autoconf

# Build deps
sudo apt install -y cmake ninja-build

# K2 engine deps
sudo apt install -y libspeex-dev libspeexdsp-dev libssl-dev libgif-dev libpng-dev libcurl4-openssl-dev libjpeg-dev libxml2-dev libfreetype-dev libncurses-dev libxrandr-dev

Build without graphics

(Useful for servers)

cmake -DK2_NOVID=1 -S . -B build -G Ninja && cmake --build build

Now you can run ./NoH -dedicated to start a server

Build with graphics

Install graphics dependencies:

sudo apt install -y libgl-dev libglu1-mesa-dev libxrandr-dev xorg-dev
cmake -S . -B build -G Ninja && cmake --build build

Now you can run ./NoH or ./NoH\ Editor or ./K2\ Model\ Viewer

Building NoH on Windows

Install Git for Windows

Install Git for Windows

During setup, you can leave everything as default, except make sure you check "Enable symbolic links":

image
Install CMake for Windows

Download CMake (probably choose "Windows x64 Installer")

image

During setup, click "Add CMake to the system PATH for the current user":

image
Install Visual Studio

If you have Visual Studio 2019 or later instsalled, you can skip this step.

Install Visual Studio 2022 Community:

image

During setup, choose "Desktop development with C++":

image

(If you want to save around 6GB, you can you can uncheck ".NET desktop development")

Check "Install", then wait awhile.

Eventually you'll see this:

image
Install CLion

Install CLion: https://www.jetbrains.com/clion/download/

Build with CLion

Open CLion and clone the repo:

image

Click "Trust Project"

image

Configure Microsoft Defender:

image

Go to File -> Settings, then "Build, Execution, Deployment" and click "Toolchains". Verify that your settings look similar to this:

image

Open the Project tool window (Press Alt-1):

image

Open CMakeLists.txt, then click "Load CMake project" in the upper right:

image

You'll see some errors:

image

Click the Vcpkg tab:

image

Click the plus sign ("Add vcpkg")

image

Verify that "Add vcpkg integration to existing CMake profiles" is selected, then click ok:

image

Vcpkg will now start building the required dependencies:

image

You can click the "CMake" tab to watch its progress:

image image

Wait awhile (~40 minutes, sorry; luckily you only need to do this once, ever).

Eventually "Loading CMake project..." in the status bar will disappear.

image

Click the run button.

image

The engine will start building:

image

With any luck, it'll launch. You're done!

To get into a game, change the configuration to NoH, then click the run button again. Once NoH starts, click "Local Game" -> Create Game, join a lobby slot, start game, then choose a hero.