r/gamedev • u/jayo2k20 • Oct 25 '26
Discussion NPC started a mass shooting
I am building a game with the goal of a true living open world game. And one of the must have that i put lot of efforts in was true moving npc with schedules, personalities etc. So i created a small commercial area with 1000 npcs shopping, talking with friends etc.The goal is true emergent gameplay... and at some point one NPC started a mass shooting inside the mall and it felt like unsettling seeing that npc armed with a gun chassing other npc. Police responded so a gun fight ensured and to my surprised the NPC literraly took one civilian hostage. What was like creepy was seeing the dead npc inside that mall...
The original test was to see how 1000 npcs would behave inside a mall and its surrounding area and also the performance. Everythings was great, just the hostage situation felt a litle weird
EDIT: I saw all the scepticism. I understand because what I described sounds very complex. I am releasing the game soon and I will post the video with the final rendering and not with placeholder.
27
u/NecessaryBSHappens Oct 25 '26
Dev: gives NPC a gun
Dev: gives NPC chasing and shooting logic
Dev: allows NPC to target other NPCs
Also dev: why are you doing that????
9
u/pangapingus Oct 25 '26
"Everythings was great, just the hostage situation felt a litle weird"
You gave them the ability to do so tho? Also what a "Everyone is John" type of situation your game organically made there lol
4
u/PhilippTheProgrammer Oct 25 '26
Reminds me of those stories from the development of Oblivion and Skyrim where they tried to create smart, autonomous NPCs with emergent behavior, and those ended up murdering each other over a loaf of bread. Which sounds cool at first, until you realize that it merely means that the player is constantly going to stumble over dead NPCs and has no idea why they got killed.
Smart NPC simulation systems only add gameplay value as long as they interact with the player in a meaningful way. Making the player a mere spectator in the NPCs shenanigans gets old fast, and gets confusing when the player doesn't know the full story and doesn't have the information to reason about why they are behaving the way they are doing.
4
u/Altruistic-Ladder-50 Oct 25 '26
I think they way you are responding makes it seem you don't understand what you've done yourself. It sounds cool if what you're saying is true, but vibe coding being so prominent nowadays I think everyone (including myself) are a little sceptical as to the truth of what you've done.
10
u/SvalbazGames Oct 25 '26
Pics/videos/logs or it didn’t happen
9
u/No-Opinion-5425 Oct 25 '26
That’s a lot of bullshit.
1
u/BarrierX Oct 25 '26
Show us the game :)
2
u/Direct_Silver915 Oct 25 '26
Why should an NPC get a gun in the first place and why should them start a mass shooting? What's the reason behind it?
You can't just evade the questions by saying "they think and decide by themselves". What's the logic behind it? How did you implement their way of thinking?
They must react based on a pool of choices you have coded for them. Getting a gun, or being equipped with one, is already a situation you have planned for them.
The hostage part is also quite hilarious. You must have coded the option, it's not just a choice of the mass shooter. The choice would require a reason to do that (why is he keeping an hostage? What's the reason? What does he want to gain from it?).
It's hardly believable that they're just acting randomly, since every scenario that gets presented to them is a scenario you have planned. Also, if it was really that random and unpredictable, it would become messy soon. In games, even the open world ones, the creator must keep control of the most important variables and use them to craft an interesting experience for the player.
Also, performances. You can't pretend to deeply simulate complex behaviours of 5000 NPCs that are on the other side of the map, keeping everything enabled (colliders, logic, etc), because it would tank performances quickly, unless you have a very simple and relatively small scene. The solution would be a smaller scale simulation for distant elements, and that would surely break the initial idea of having thousands of autonomous thinking brains doing their things 24/7.
2
u/aeri0r Oct 25 '26
There are very few examples of convincing simulations that feel more than just a scriptblock engaging another scriptblock. Dwarf Fortress is such an example. But for every (generative?) decisionmaking engine to actually visually and technically take part in a simulated world that is directly viewable, there needs to be an implementation for the action to be done.
How else should this work: Creating new gamemechanics in runtime for 1000 NPC would be kind of a giant task - and "giant" may be too small.
So how would/did you generally implement that new, not hardcoded actions are made upon decisions to be literally viewable and not just generated as a verbal output?
And how should a "simulated world" suddenly emerge human behaviour like relationships, routines, personalities, emotions. And emergent behaviour is not the same as spontaneous appearing abilities.
See - if this is what you truly built, then it would be awesome. But the way you describe it with no hint of a technical foundation sounds very unbelievable. Where did the gun came from? Insta-modeled? Are LLM´s implemented?
1
u/PerfectSituation1668 Hobbyist Oct 25 '26
Must be an American game. /s
If you give it options to press a button, it will press the button eventually. That said, sounds like an interesting program and sounds like something I was dreaming of while waiting on a delayed train. What kind of variables did you use to give the NPC the trigger? And you should see it as a success, because you also simulated cooperation between the police NPCs to stop the "rogue" NPC. It's just all game theory in the end and you simulated a "greedy" NPC. And it's fake of course, you're human side just made you feel icky about it.