Live data from Hacker News

AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

github.com

31–40 of 57 posts

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#31

That is a very clean GOAP implementation. FYI, GOAP was what made F.E.A.R such a cool game: https://www.youtube.com/watch?v=PaOLBOuyswI https://archive.org/details/GDC2006Orkin

GOAP has worked very well for us for an open-world game with tons of NPCs taking part in non-linear interweaving quest lines. Planning performance is an ever growing issue however…

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#32
post #7

Author here, feel free to ask any question :)

I would like to say thank you for posting this, I am currently building a similar toolkit in Lua and will most likely restart and just port your code instead :)

It is extremely clean and concise.

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#33

Earlier quoted context omitted.

What do you mean by non-conventional game AI?

Conventional game AI is usually search algorithms for movement (like A*) + finite state machines for behavior. No network calls to LLMs, no machine learning, etc. At the fringes, throw in the odd markov chain for procedural text generation. Basically AI post 2019 usually means LLM, and they're making the distinction that this is not that.

Any book recommendations for conventional game AI? (Particularly with the "game" part, as games always have interesting constraints.) Thanks in advance.

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#34
post #7

Author here, feel free to ask any question :)

I would like to say thank you for posting this, I am currently building a similar toolkit in Lua and will most likely restart and just port your code instead :) It is extremely clean and concise.

Thank you for the feedback :)

Feel free to open issues or discussions on the repository if you have any difficulty.

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#35
post #7

Author here, feel free to ask any question :)

I'm not a C or C++ programmer. Well, I know my way around, but I don't write real programs with it. Here's my potentially dumb question: what's the benefit of header-only libraries versus regular C/C++ code?

The header-only part is actually accidental, I'm using C++ templates which requires to be fully defined at their declaration site (the header).

On top of that, the "Installation" instructions are just "copy the file in your project", no CMake, no Meson, not any kind of build system.

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#36
I've been working on a multiplayer (MMO-ish) game. Currently at the point where most of the core stuff is in place and now I'm implementing the A.I. Recently there have been some great links posted on HN regarding Game A.I, and I'm very grateful for it! Implementing A.I has been a ton of fun and not as overwhelming as I thought it'd be. I think my game will be dependent on "smart" A.I behavior so I'm really trying to get this part down.

The language i'm using - Elixir - also has some very interesting features that make it easy to integrate async a.i planning + a.i to a.i group communication. Ahh, I find it so exciting. The main simulation loop is never blocked. Meanwhile the A.I planner just chugs along as a separate process, spawning and despawning new agents in the world, creating and merging control groups, and setting new goals.

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#37
post #25

Earlier quoted context omitted.

Conventional game AI is usually search algorithms for movement (like A*) + finite state machines for behavior. No network calls to LLMs, no machine learning, etc. At the fringes, throw in the odd markov chain for procedural text generation. Basically AI post 2019 usually means LLM, and they're making the distinction that this is not that.

All AI systems (including A* and LLMs) can be thought of as a system that explores a search space to obtain a certain goal. At least this is what I understood from reading artificial intelligence -a modern approach by Peter norvig. Both A* and deep learning explores a search space based on a goal. The difference is DL explores when it's training and learns to use the right moves for a given input.

It still seems worthwhile to make the distinction; it might be possible to think of them as the same thing at a high enough level, but the actual libraries and algorithms used are different.

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#38
post #36

I've been working on a multiplayer (MMO-ish) game. Currently at the point where most of the core stuff is in place and now I'm implementing the A.I. Recently there have been some great links posted on HN regarding Game A.I, and I'm very grateful for it! Implementing A.I has been a ton of fun and not as overwhelming as I thought it'd be. I think my game will be dependent on "smart" A.I behavior so I'm really trying to…

Nice use case about Elixir! You should definitely write about it, I'm getting sick of the "We used Elixir/Phoenix/LiveView" articles out there. MMOs are one field where Erlang/Elixir can shine a lot due to their concurrency model, their fault tolerance, and especially no-downtime upgrades thanks to hot code reloading (very attractive to upgrade the server without disconnecting people).

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#39
post #33

Earlier quoted context omitted.

Conventional game AI is usually search algorithms for movement (like A*) + finite state machines for behavior. No network calls to LLMs, no machine learning, etc. At the fringes, throw in the odd markov chain for procedural text generation. Basically AI post 2019 usually means LLM, and they're making the distinction that this is not that.

Any book recommendations for conventional game AI? (Particularly with the "game" part, as games always have interesting constraints.) Thanks in advance.

basically the entire GameDevCon youtube channel has tons of examples

Re: AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library

#40
post #7

Author here, feel free to ask any question :)

related question to @Jemaclus above - why is C++ the popular language for gamedev? not C# or some other higher level language. is it only for when you're working on console games or does it also matter on desktop games?
Post reply on HN