Game
Lumencraft
3 years ago

Long time no see, my Scouts! Forgive us for this disappearance, but we were super busy with Playtests and preparations for the big day. Yep, you heard that right! Early Access is coming. Keep reading for more juicy info! Now, without further ado…


Swarm and how it finds you

Today we want to discuss enemies - you know, the friendly little bugs that totally aren’t annoying and totally aren’t destroying all your hard work. Currently, we have 3 different AI systems for enemies.
Number one is your very favorite Basic Swarm - small, fast, aggressive.

1.gif

Basic Swarm was introduced in the first publicly available build. It was the core of wave attacks and we quickly learned that the absolute top number that the game can support is 500 on the high end PC. When the tiny swarm was attacking your base every 10 minutes - this is it, that’s our AI. As you may have noticed, the behavior is pretty simple as those bugs have only one target, one purpose. Don’t expect them to suddenly do something super smart. If they do, it’s game over - for everyone, the AI is self-conscious and these sci-fi movies you like so much aren’t only movies anymore.

Jokes aside, the Basic Swarm has only 3 objectives:

  • go to the player core,

  • attack the player on sight,

  • attack anything the player constructed on the way to the core.

The Basic Swarm executes the plan by following these three simple rules: ( and Scouts hate them ;))

The Basic Swarm enemy is using simple Finite State Machine (FSM), meaning it can do the following:

IDLE - looks for target, finds a path, becomes leader, chill if nothing to do

2.gif

LEADER - has no other swarm member directly in front, picks one of two attacks on the visible target, follows the target

3.gif

FOLLOWING_LEADER - follow other swarm members that are close ahead, copies attack target from the leader

4.gif

ATTACK_WALL - happens when swarm bumps into a wall or a gate

5.gif

FOLLOWING_PATH - follows a path to the target (usually the player or reactor)

6.gif

If you would like to imagine how much perception the swarm monster has, just close your eyes, plug your ears and imagine being pushed in a specific direction, you have your arm straight in front of you, and can only sense things that your hand is touching.
Now imagine you are being pushed back to chase the player that is behind a wall you don't know the wall is there. Now you have to decide: how to avoid collisions, when to turn, how fast to go, and you have no idea the player has surrounded you with walls or napalm. Poor bugs…

The Basic Swarm is, or maybe we should say “was”, the main AI system that we created from scratch. Although the result has a certain aggressive swarm-like character to it, we weren’t 100% satisfied with the supported swarm size so we wrote another swarm.

The Bigger Swarm

If hundreds of angry enemies are not enough for you, we also have another swarm AI.

7.gif

This one is done following a well-established algorithm for flocking/boids introduced by Craig W. Reynolds: https://www.red3d.com/cwr/steer/gdc99/
If you are interested we recommend checking the article as it explains everything far better than we could do it here.

Swarm in Lumencraft is written as a C++ custom module for Godot. It allows spawning thousands of monsters that behave like ants. The biggest difference in the implementation was in integrating it with our world and letting monsters react to the terrain.

Lonely bugs

We talked about the swarm, but what about the rest of the gross enemies? Well, they have their own system. Next AI is intended to be used for “Smarter” enemies that can support multiple different behaviors that are not swarm-related.

The AI for most standalone monsters is a combination of Finite State Machine (FSM) and Context-based navigation. We know, it sounds as scary as being surrounded by lava! However, it works miraculously on monsters' behavior. FSM has a set of states that the monster can be in, like: wandering around, following players, attacking in a specific pattern, flanking, jumping, running away, etc. Context behavior on the other hand is responsible for navigation collisions, finding the best target, and avoiding other monsters.

FSM is a well-established algorithm and we do not deviate much in the implementation. So each monster has a set of states and transitions between them. E.g. A monster can only enter an Attack state from a Follow Target state, or an Idle state can be changed to a Follow Target state only if the target is seen. You get the idea.

Context navigation is more interesting and is based on a paper “Context Steering Behavior-Driven Steering at the Macro Scale” by Andrew Fray. You can read a bit more in chapter 18 of Game AI Pro 2 http://www.gameaipro.com/

Anyway, let's talk about how it is done in Lumencraft. We have this test dude over here:

8.gif

Context navigation

So you can see vectors attached from his center. Those are interest vectors. The length of the vector is an information of how much the AI wants to go in a specific direction. E.g. Longer when the vector is directed to the player or destination. On top of that there is a copy of vectors that display danger. Usually the danger vector informs the AI that the direction will cause wall collisions, but can also inform environmental hazards.

9.gif

Targeting and Decision making

Any decision the monster makes is defined by a state within the Finite State Machine based on information from other systems. Targeting systems pick targets and direct the AI on a world scale. E.g Go to the reactor core, chase players, return to spawn, etc. Context navigation informs the AI about its environment, targets around etc..
The FSM gathers the information and picks action according to the current state and options it has. Nothing much here to explain the biggest job is to make a functioning FSM and not drown in states and transition. Maybe one example:

Current state is follow_target

  • No collision ahead

  • Target in range of attack

  • Available attacks: Punch, Smash_AOE

Next state should be one of the available attacks.
So the AI randomly chooses AOE_Smash, changing the state to attack_smash_AOE

And the result can look something like this:

10.gif

Game Endeavor made an excellent video about combining various methods to create the most satisfying movement for enemies. We strongly recommend checking that one out!

Bonus clip where after months of polishing just a day before playtest started, everything decided to stop working:

11.gif

The Big Day

We are super excited to inform you that Lumencraft will be entering Early Access around the end of March. The precise date will be revealed later this month.

Playtests

But! As we said many times before, we would love you to take an active part in every step. That’s why we would love to invite you to take part in playtests that we are organizing on Steam. Be sure to check out Lumencraft hands-on! Playtests are waiting for you and we are waiting for your comments. Your feedback will be super valuable. More precious than lumen!

That’s all we got for you today!

If you have any questions, find us in our Discord and we’ll be happy to answer all of them.
https://discord.gg/PCeTvgy4nZ

Remember to wishlist Lumencraft on Steam/GOG.com.

https://store.steampowered.com/app/1713810/Lumencraft/
https://www.gog.com/game/lumencraft

We will be back with more Lumencraft fun facts!

Keep drilling,
2Dynamic & Star Drifters



0 comments

Loading...

Next up

Scouts! 👾

If you still haven’t grabbed Lumencraft, we’ve got some cool offers for you!

Buy Lumencraft with a 60% discount NOW!

And check our BUNDLES! 👇

https://store.steampowered.com/app/1713810/Lumencraft/

Well, look at that!👾

We’re back with a whole new Post Release Update for Lumencraft! Check out the news about new languages and short Q&A!

Say “hello” in your language in the comments!👋

Link to the update 👇👇

https://steamcommunity.com/ogg/1713810/announcements/detail/3957…

Scouts!  👾

Can you believe that a YEAR has passed since the full release of Lumencraft? Are you surviving the monster waves? What is your strategy for that? 👾

https://store.steampowered.com/app/1713810/Lumencraft/

#IndieGame #WishlistWednesday #IndieDev #GameDev #TrailerTuesday

Looking for a new game to play? 👾

Lumencraft is now 70% OFF on Steam!

Become a scout, fight monsters and find precious Lumen, now just for $5.99!

Hurry before the offer ends! 👾

https://store.steampowered.com/app/1713810/Lumencraft/

Hey Gamers! 🎮🚀

Big SALES just dropped! 🔥 Check our Steam pages and snag a game for tonight! 🕹️✨

https://store.steampowered.com/app/1714900

Scouts! 👾 It’s Earth Day! 🌍

The Earth Appreciation Festival on Steam has a list of games that focus on a post-apocalyptic grim atmosphere, as well as those which show us the beauty of our planet! 

https://store.steampowered.com/sale/AppreciateEarth2024

Hi Scouts! 👾

We've got news today! 🫡

New Endless Mode Update! Lose yourself in the neverending maps!

And that's not even all that we have been preparing for you...

Check our new announcement!

https://steamcommunity.com/games/1713810/announcements/detail/41…

📸 A sneak peek of our upcoming islands at the very early stage of development #WIP

What do you think? We can't wait to show you more!

https://store.steampowered.com/app/1714900/First_Dwarf/

What time is it? ⏰ Time for a new update! 🚀

What do you think of our changes, especially to Ragna’s flight? 🐉 She has completely new animations and visual effects, so we’re very eager to hear your thoughts~! ✨💬

https://steamcommunity.com/games/1714900/announcements/detail/45…

Don’t you just LOVE games that you can play over and over again? ⌛

Lumencraft is just like that! That’s why it's taking part in Steam Endless Replayability Fest!

https://store.steampowered.com/category/endlessly_replayable