• Stars
    star
    196
  • Rank 197,350 (Top 4 %)
  • Language
    C++
  • Created over 1 year ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 [email protected] 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:

  • Run ./K2\ Model\ Viewer and play with some effects
  • Run ./NoH and click "Local Game" to start a game
  • Run ./NoH\ Editor

Building NoH on macOS with CLion

Open the repo in CLion:
cd noh
clion .
Once CLion is open
  • Open Project view (press Cmd-1)

  • Open CMakeLists.txt

  • Click "Load CMake project" in the upper right

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.

More Repositories

1

llama-dl

High-speed download of LLaMA, Facebook's 65B parameter GPT model
Shell
4,166
star
2

colab-tricks

Tricks for Colab power users
Jupyter Notebook
169
star
3

openai-server

OpenAI API webserver
Python
164
star
4

scrap

Nearly a thousand bash and python scripts I've written over the years.
Python
85
star
5

tpunicorn

Babysit your preemptible TPUs
Python
78
star
6

wiki

Research wiki
Haskell
51
star
7

sparkvis

Visualize tensors in a plain Python REPL using Sparklines
Python
43
star
8

ml-notes

Python
36
star
9

jaxnotes

Jupyter Notebook
20
star
10

shmem

Lightweight C++ cross-platform named shared memory interface.
17
star
11

hon

A complete copy of the Heroes of Newerth development environment from January 2011
C++
17
star
12

mount

Shell
16
star
13

humble-sliders

Provides "split payment" sliders as seen in Humble Bundle.
JavaScript
13
star
14

pymen

JavaScript
12
star
15

gaping

Python
12
star
16

website

The code that runs my blog: https://blog.gpt4.org/
CSS
10
star
17

disruption

Ultra-fast crossplatform IPC, inspired by the LMAX "Disruptor" pattern.
C
10
star
18

arc

Arc
9
star
19

stylegan-server

Jupyter Notebook
8
star
20

chalkie

Chalk for the browser. Useful with xterm.js.
JavaScript
6
star
21

Celeste

Celeste game engine, generated with JetBrains Rider
C#
6
star
22

mtftorch

Python
4
star
23

arcmacs

Arc and Scheme for Emacs Lisp
Emacs Lisp
4
star
24

mel

Python
4
star
25

sparc

Arc Lisp
Arc
4
star
26

arxiv-vanity-bookmarklet

A bookmarklet for arxiv-vanity.com
HTML
3
star
27

arachnid-old

Arachnid is a cross-platform 3D graphics engine.
C++
3
star
28

docs.gpt4.org

Python
3
star
29

ansi-escapes-python

ANSI escape codes for manipulating the terminal
Python
3
star
30

tftorch

3
star
31

pytreez

An implementation of Jax pytrees in pure python
Python
3
star
32

jaxtpu

A helper package to install the latest JAX on TPUs, along with all necessary dependencies (e.g. libtpu-nightly)
Python
3
star
33

beatsaber-python

Beatsaber for Python
Python
3
star
34

npnd

Numpy n-dimensional ops (scatter, gather, one-hot, etc)
Python
2
star
35

danbooru-tools

Python
2
star
36

dnnlib-util

StyleGAN2's dnnlib/util.py functionality as a standalone library
Python
2
star
37

bel-old

A mirror of Paul Graham's Bel source code and documentation, formatted
Common Lisp
2
star
38

paulg

Various utility functions by Paul Graham, implemented in Python
Python
2
star
39

apple-m1-for-ml

2
star
40

auto_assign_role

A discord bot to automatically assign roles to users whenever they rejoin the server.
Python
2
star
41

pyjax

Google's JAX library, in pure Python (no dependency on jaxlib)
2
star
42

unixpath

unix-style path processing functions
Python
2
star
43

racket-unix-sockets

Provides unix domain sockets for Racket.
Racket
2
star
44

imle

Python
2
star
45

ansi-styles-python

ANSI escape codes for styling strings in the terminal
Python
2
star
46

arachnid

High-performance 3D cross-platform game engine.
C
2
star
47

hask

Haskell in Python
Python
2
star
48

tensorflow-checkpoint-reader

Pure Python implementation of Tensorflow -- at least, enough of it to load checkpoints. :) Perfect for M1 laptops, since apparently installing Tensorflow on M1's is beyond mortal ability. But reimplementing Tensorflow in Python wasn't beyond my ability.
Python
2
star
49

coronator

Python
2
star
50

armadillo

C++
1
star
51

specnorm

Spectral norms of tensors
Python
1
star
52

tcell

Scheme thread cells in Python
Python
1
star
53

books

1
star
54

d4tree

Visualize your trees using D3. 🌲
JavaScript
1
star
55

paulg-python

Various utility functions by Paul Graham, implemented in Python
Python
1
star
56

beatsaber-lib

Various library functions related to beatsaber (replays, etc)
Python
1
star
57

xlaz

Python
1
star
58

rasterizer

1
star
59

PyTorrent

Python
1
star
60

get-annotations

A backport of Python 3.10's `inspect.get_annotations()` function
Python
1
star
61

arc3.2

Arc
1
star
62

noizy

Log function calls: from noizy import noizy
Python
1
star
63

netflix-skip

HTML
1
star
64

lumen-string-replace

string-replace for Lumen
Common Lisp
1
star
65

RecreatingNSApplication

Objective-C
1
star
66

eli

Emacs Lisp runtime interface for Python
Python
1
star
67

tfimg

Python
1
star
68

pendulum

HTML
1
star
69

rtmidi

Python
1
star
70

gallery

HTML
1
star
71

daxx-lightning

Python
1
star
72

arclang

Python
1
star
73

plexer

A simple lexer written in Python.
Python
1
star
74

snippets

John Ratcliff's code snippets
C++
1
star
75

ski

JavaScript
1
star
76

noh-game

GLSL
1
star