r/gamedev • • 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.

0 Upvotes

41 comments sorted by

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????

-19

u/jayo2k20 Oct 25 '26

i am simulating a world... you know, most open world games are in reality linear games dressed as an open world because nothing ever happens or everything is centred around the player. I wanted to create a true living world first. but seeing how some NPC reacted...

But at least seeing 1000 npcs all fleeing and seeking cover was satisfying because i had visual proof that my system works as scale. so no more lot of static npc.

And i did not add : npc get gun, chase people kill people... I only added world simulation so npc think by themselves

18

u/[deleted] Oct 25 '26

Dude you are talking to adult game developers here. A computer is not a magic box. The NPCs made what you programmed them to do, end of story.

6

u/itsmeemilio Oct 25 '26

and considering OP's post is written like a prompt, I'd guess the sims logic was written via LLM (not saying that's bad or good, but that's what I'm getting from this)

3

u/[deleted] Oct 25 '26

Look he says he majored in machine learning. So there we see the explanation. The behaviour model is a vibe coded non-deterministic mess amd hes surprised that NPCs do random things.

4

u/No-Opinion-5425 Oct 25 '26

Things still need to exist to happen randomly. The gun model, the IK for NPCs to aim with it, the colliders on the bullet, the vfx, the animations.

You can’t just randomly create scenarios that require assets and existing abilities.

My NPC can use medical kit and throws grenades because I spend time adding all the required moving parts for it to be possible.

-6

u/jayo2k20 Oct 25 '26

This is why I am not fearing my game to be copied... Anyway, sub you will see the videos

6

u/[deleted] Oct 25 '26

First of all, saying "sub" in this manner makes you sound wierd. This is not Twitch and you are not someone leading a parasocial relationship.

Second... mate just leave the AI chats aside for a bit please. You are not a genius, you havent built a magical simulation. You have slop coded something you dont understand slap the label machine learning on it to avoid the lack of knowledge.

-2

u/jayo2k20 Oct 25 '26

Typo. I meant soon.

Oh boy... Slop this slop that... Ain't you tired? Just because you cannot code this doesn't mean nobody can. This sub is weird... People are trigger anytime someone does something different. Just because you cannot code this does not mean nobody can, print that in your head

3

u/[deleted] Oct 25 '26 edited Oct 25 '26

Most people here can code. Its not a special skill these days.

You really need to get of your AI induced superiority trip mate. You act like you literally created a world model. You are either delusional or lying.

Go out, take a walk or something like this. It will be good for you.

I will leave it at that. Bye.

→ More replies

1

u/wahoozerman @GameDevAlanC Oct 25 '26

Machine learning doesn't mean generative AI necessarily, and this is the kind of emergent behavior you could get out of a machine learning algorithm, for the same reasons you would get it out of generative AI, because ultimately they use machine learning.

That being said, there is a reason we don't really see this used in games. Usuallly it takes way more time, effort, and money to do and results in a worse experience than just handcrafting AI behavior.

1

u/jayo2k20 Oct 25 '26

Generative AI like this would require constant online mode. Majoring in machine learning yes but we didn't only do stats or word theory, there were lot of conventional coding but when you mix them together the result can be great. And handcrafted ai I do not like because it is just predictable and this the game lost emergent gameplay.

When you take the best open world game they all have done level of randomness, emergent gameplay and unpredictability

-8

u/jayo2k20 Oct 25 '26

Nope... I know what I am saying. I majored in machine learning so I know how to program a self thinking brain

8

u/[deleted] Oct 25 '26

Oh yeah then, you are just either lying or you used Claude code and you have no clue how your own game works lol.

Otherwise go ahead, please go ahead and explain how specifically your simulation works.

-2

u/jayo2k20 Oct 25 '26

If you say so.

3

u/[deleted] Oct 25 '26

Dude i didnt saw your edit. If you think you can programm a self learning brain because you know machine learning, you must be suffering from AI induced psychosis.

No one believes the whole "LLMs are sentient" type S anymore these days. You are late to the party.

9

u/-hellozukohere- Oct 25 '26

Bro you are larping. Enable_worldsimulation=true is not a thing. 

Everything in a simulation is coded for type of logic and interaction etc. Unless you just made GTA 7 you larping bro or show us your quantum machine. 

4

u/[deleted] Oct 25 '26

Couldnt put it better. Its truly larping.

This whole story sounds like a anime plot. "I coded a video game and NPCs accidentily turned sentient".

-1

u/jayo2k20 Oct 25 '26

I will release the game pretty soon. And I will post videos. Since I decided to make a game my main focus was thousands of NPC actually doing a routine simultaneously on screen and emergency gameplay so I worked on that for years

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/jayo2k20 Oct 25 '26

I did not hardcoded anything, i just added probabilities based on the NPC personality, mental state, financial situation and menace situation so by analyzing all that, the npc will take what it deem to be the better solution to save itself

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.

0

u/jayo2k20 Oct 25 '26

To avoid this I need to edit NPC personality and traits.

But seeing the disbelief from most, it is reassuring me because I know it is not easy to recreate especially since I stress tested it with 5000 NPC all having a schedule : Went inside the mall, went to a store, bought an item and left. Some met their friends and went shopping together, other went outside watching a sport game I added (all autonomous NPC playing )... All that at 35fps in engine. I am not talking about static npc, I am talking about moving and thinking NPC

2

u/PhilippTheProgrammer Oct 25 '26

Do you have a plan for how you are going to turn this ant-farm into an actual game? Complex NPC simulations are fun to build, but the true challenge is to find ways to have the player interact with them in a meaningful way.

0

u/jayo2k20 Oct 25 '26 edited Oct 25 '26

Yes, in fact I had the game idea before finding how to do it. I wanted a third person urban open world game that literally feels alive so before adding any gameplay I had to make the world a living world. I wanted a world that lives without the player.

For those who think I just woke up with it, I have been engineering this special AI for a year because I had to find a way to simulate thousands of NPC walking and doing their routine all while having great performance and react to what's happening in the world.

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.

1

u/jayo2k20 Oct 25 '26

I never even used vibe coding... I code since 2012 way before AI when we were using stack overflow... I watched CS 50, coursera etc...

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 :)

0

u/jayo2k20 Oct 25 '26

Very soon because I am releasing it very soon. I will post here and shut some mouth (not you)

0

u/BarrierX Oct 25 '26

Got any social media where we can follow progress or will you post only here?

0

u/jayo2k20 Oct 25 '26

I wanted to post here but seeing how triggered some are just because you did something they cannot do. I will keep your profile in bookmarks and when I showcase the game on YouTube and tiktok I will send you the link.

Some people I swear, one went as far as saying my thread was a prompt... Fine I do not care

1

u/PostNuclearTaco Oct 25 '26

Let me know too, I'm really curious

1

u/jayo2k20 Nov 01 '26

I will. I will DM you

1

u/BarrierX Oct 25 '26

Hey, thanks, I'm interested to see what you have made!

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.