Dear FD: How To Code Realistic Spawns, Sincerely: Another Game Developer.

Hi Friends!

You know what grinds my gears? Terrible enemy spawn mechanics! You know the kind I mean - the sort where poor programming leads to a very obvious maintenance of the same number(s) of enemies no matter what you, the player, try to do. For example, Ngalia. Oooh Ngalia. You would think that a Compromised Nav Beacon wouldn't spawn police, but you would be wrong! They are called bounty hunters, and for the last two hours they have spawned consistently and relentlessly - always one wing, always close to my ship, always scanning me first. This mechanic is not exclusive to compromised nav beacons, it's pretty much a staple throughout encounters in Elite. In asteroid fields for example, you will always have at least one ship coming to harass you. Near certain bases marked as "impossible to beat solo", you will *always* have at least one fighter hanging around. It seems to me, that someone at Frontier forgot to code some decent spawn mechanics. So without further ado ladies and gentlemen, I, a fellow game developer, present to you and Frontier - a nicer way to spawn enemies!

spawnCountDown = minSpawnTime + rand() % (maxSpawnTime - minSpawnTime);

There you go! Easy isn't it? Obviously, timing is in milliseconds.

You are welcome.
 
Well THERE'S the problem - rand() isn't random unless you seed it.

:p

:D

One of the funniest things I saw related to rng was a random number generator that, I suppose at some point, had needed to be made more random. A clever fellow had done a bit of drive-by coding and called rand() on the seed every fourth time a number was generated. This had an interesting effect whenever you needed the rng to produce the same set of results for a particular seed...
 
lol, pick quite probably the hardest thing to do in a game; contextually relevant AI, that have to both be consistent, and yet not be too consistent; and then dumb it down to "why can't you just be more random, la?"; <insert rand(); here>.

Not sure if trolling, or serious (probably both). Well done. ;) [up]
 
Last edited:
lol, pick quite probably the hardest thing to do in a game; contextually relevant AI, that have to both be consistent, and yet not be too consistent; and then dumb it down to "why can't you just be more random, la?"; <insert rand(); here>.

Not sure if trolling, or serious (probably both). Well done. ;) [up]

Well apparently you are absolutely right, since this same behaviour can be observed at play in different zones and scenarios. Without fail, some gimboid is going to spawn to annoy you, and whence they die, another shall appear like magic to take its place. There shall always be just one gimboid, or a gimboid wing (by low chance). The gimboids shall always spawn near the player, and unlike other NPCs, these gimboids shall only ever be interested in the player. For ever and ever. Until you run out of chaff and patience.

I mean, for God's sake, at least Valve had the good grace to throw in some lightning particle effects whenever the player tripped over a trigger_once and it was time to plop a head crab on top them.
 
Last edited:
Well THERE'S the problem - rand() isn't random unless you seed it.

:p

Well, not to correct you but simply to clarify: Computers are incapable of generating random numbers using only mathematical formula (ie no quantum trickery etc) and will provide the same sequence of numbers when the same seed value is used. The sequence of numbers produced per seed value simply has the illusion of being random to human brains. So I guess you mean changing the seed value based on some other changing value like the computer timer etc to increase the complexity of the illusion.

To quote the great John von Neumann:

"Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin."

And some further pondering for the illusion.

A Dream Within a Dream by Edgar Allan Poe

Take this kiss upon the brow!
And, in parting from you now,
Thus much let me avow —
You are not wrong, who deem
That my days have been a dream;
Yet if hope has flown away
In a night, or in a day,
In a vision, or in none,
Is it therefore the less gone?
All that we see or seem
Is but a dream within a dream.

I stand amid the roar
Of a surf-tormented shore,
And I hold within my hand
Grains of the golden sand —
How few! yet how they creep
Through my fingers to the deep,
While I weep — while I weep!
O God! Can I not grasp
Them with a tighter clasp?
O God! can I not save
One from the pitiless wave?
Is all that we see or seem
But a dream within a dream?​
 
Well, not to correct you but simply to clarify: Computers are incapable of generating random numbers using only mathematical formula (ie no quantum trickery etc) and will provide the same sequence of numbers when the same seed value is used. The sequence of numbers produced per seed value simply has the illusion of being random to human brains. So I guess you mean changing the seed value based on some other changing value like the computer timer etc to increase the complexity of the illusion.

To quote the great John von Neumann:

"Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin."

And some further pondering for the illusion.

A Dream Within a Dream by Edgar Allan Poe

Take this kiss upon the brow!
And, in parting from you now,
Thus much let me avow —
You are not wrong, who deem
That my days have been a dream;
Yet if hope has flown away
In a night, or in a day,
In a vision, or in none,
Is it therefore the less gone?
All that we see or seem
Is but a dream within a dream.

I stand amid the roar
Of a surf-tormented shore,
And I hold within my hand
Grains of the golden sand —
How few! yet how they creep
Through my fingers to the deep,
While I weep — while I weep!
O God! Can I not grasp
Them with a tighter clasp?
O God! can I not save
One from the pitiless wave?
Is all that we see or seem
But a dream within a dream?​

I think the cmdr may have been cracking a joke, as standard pseudo number generation is woefully inadequate for any reasonable expectation of randomness.

That's a nice literary choice though, I've his unabridged collection of works and since I begun reading it, I've realised how poor my grasp of language truly is.
 
I agree that something needs to be done. The npc spawning in this game feels SO contrived it's like I am in a Hollywood movie! It feels so fake. I jump into an unpopulated system and immediately another ship jumps in, then they send me some message about how they have been tracking me for a while so they can claim the $400 bounty on my head and try to interdict me. Next system, same situation but they talk about how there have been rumors about me and all the tasty cargo I hold...

Like are there just armies and armies of loser npcs hanging around random no-name stars waiting or the off chance that I happen to drop by?

And don't even get me started on low waking when a npc is after you. Doesn't matter how far you run from the drop out point, it doesn't matter that the npc wasn't even on your contacts when you dropped (so therefor he shouldn't have been able to identify your low wake) or that you are low waking out of sc right after low waking into sc to escape the npc. No matter what, the npc will spawn right next to you. There's no logical way to avoid them.

NPC's are predictable, unconvincing, unengaging and don't feel like actual entities since they play by competently different rules than the player. Their dialog is also almost always inappropriate for the situation, or it feels so fake that it would make more sense for the npc's to be larping than to be seriously sending their target direct messages like "Target acquired, moving in" or "Starting attack run". NPCs in minecraft feel more immersive than the ones in E:D do.
 
Well apparently you are absolutely right, since this same behaviour can be observed at play in different zones and scenarios. Without fail, some gimboid is going to spawn to annoy you, and whence they die, another shall appear like magic to take its place. There shall always be just one gimboid, or a gimboid wing (by low chance). The gimboids shall always spawn near the player, and unlike other NPCs, these gimboids shall only ever be interested in the player. For ever and ever. Until you run out of chaff and patience.

I mean, for God's sake, at least Valve had the good grace to throw in some lightning particle effects whenever the player tripped over a trigger_once and it was time to plop a head crab on top them.

I like you. Have some rep. ;)
 
Waiting for the forum white knights storm in, question and demean the integrity of the OP's game design credentials. FD will then be praised as greatest thing since sliced bread. Followed by a token gesture that some features can be improved and encouraging the use of your "imagination" to spackle the gaping holes of common sense and realism.

See: Harmless "you scratched my paint" npc pirate siderwinder attacking combat fitted Anaconda with 1 cargo of fish.
 
Waiting for the forum white knights storm in, question and demean the integrity of the OP's game design credentials. FD will then be praised as greatest thing since sliced bread. Followed by a token gesture that some features can be improved and encouraging the use of your "imagination" to spackle the gaping holes of common sense and realism.

See: Harmless "you scratched my paint" npc pirate siderwinder attacking combat fitted Anaconda with 1 cargo of fish.

Good heavens man, don't you know you're not supposed to mention white knights on a forum? They can detect that scent for miles..... [where is it]
 
You claim to be a game dev, talk about spawn mechanics and random, yet mention in no word "encounter tables" where the actual problem is.

A greater variety of encounter tables that get rolled on, which are modified more by where you are and what you fly and why you're there would make encounters more engaging. The rest is AI programming and writing for the specific NPCs spawned in the encounters.
 
Hi Friends!

You know what grinds my gears? Terrible enemy spawn mechanics! You know the kind I mean - the sort where poor programming leads to a very obvious maintenance of the same number(s) of enemies no matter what you, the player, try to do. For example, Ngalia. Oooh Ngalia. You would think that a Compromised Nav Beacon wouldn't spawn police, but you would be wrong! They are called bounty hunters, and for the last two hours they have spawned consistently and relentlessly - always one wing, always close to my ship, always scanning me first. This mechanic is not exclusive to compromised nav beacons, it's pretty much a staple throughout encounters in Elite. In asteroid fields for example, you will always have at least one ship coming to harass you. Near certain bases marked as "impossible to beat solo", you will *always* have at least one fighter hanging around. It seems to me, that someone at Frontier forgot to code some decent spawn mechanics. So without further ado ladies and gentlemen, I, a fellow game developer, present to you and Frontier - a nicer way to spawn enemies!

spawnCountDown = minSpawnTime + rand() % (maxSpawnTime - minSpawnTime);

There you go! Easy isn't it? Obviously, timing is in milliseconds.

You are welcome.

Yeah, all SUPER easy CMDR GameDeveloper... Is that arrogance I smell? Hm...
 
You claim to be a game dev, talk about spawn mechanics and random, yet mention in no word "encounter tables" where the actual problem is.

A greater variety of encounter tables that get rolled on, which are modified more by where you are and what you fly and why you're there would make encounters more engaging. The rest is AI programming and writing for the specific NPCs spawned in the encounters.
Where are you?
What are you doing?
What is your rank?
What is your ship?
Are you in Open or in Solo?
How many people are in your instance?

And you also need some variety so the pattern doesn't become obvious.

PS
No offence OP, but you just described how to spawn or not spawn a harmless sidewinder pilot who doesn't know what he wants. It's not that easy, or if you want it to be that easy the game would be actually worse. ;)
 
Last edited:
Where are you?
What are you doing?
What is your rank?
What is your ship?
Are you in Open or in Solo?
How many people are in your instance?

And you also need some variety so the pattern doesn't become obvious.

PS
No offence OP, but you just described how to spawn or not spawn a harmless sidewinder pilot who doesn't know what he wants. It's not that easy, or if you want it to be that easy the game would be actually worse. ;)
Yes, it's complicated. You'd have to define what aspects amount as variables and how they affect the final encounter. Could be a modifier on a table or defining which tables are used (and modified from other variables) to create a composite of aspects that then define what kind of encounter is generated. What ships, what AI, what difficulty, etc. More variety could be achieved by using a composite model to assemble the aspects of an encounter from several rolls on aspect tables derived from situational variables.

It's complicated and not trivial. That's why game design is a profession. At least when you're not just re-skinning the same old game mechanics and call it a new game.
 
Yes, it's complicated. You'd have to define what aspects amount as variables and how they affect the final encounter. Could be a modifier on a table or defining which tables are used (and modified from other variables) to create a composite of aspects that then define what kind of encounter is generated. What ships, what AI, what difficulty, etc. More variety could be achieved by using a composite model to assemble the aspects of an encounter from several rolls on aspect tables derived from situational variables.

It's complicated and not trivial. That's why game design is a profession. At least when you're not just re-skinning the same old game mechanics and call it a new game.

And then you have people who think that scaling NPC spawns compromise a persitent game world and one should rather spawn NPCs based on system, security and location rather than the players.
 
And then you have people who think that scaling NPC spawns compromise a persitent game world and one should rather spawn NPCs based on system, security and location rather than the players.
All of that could actually define what will spawn: System, security and location define what is available and it's scaled by the player as any NPC force would approach with an appropriate force to who the player is or behave in a different way if they are outgunned/-skilled.

Pirates could come under-equipped and just try to bull the player into handing over goods (and being modest about their demands) only to run off as soon as they are getting shot at, knowing they couldn't fight the player down into submission.

NPCs reacting to circumstance is already in the game. I had a fight with a pirate once, fought with him for a while but as soon as system security spawned, he shouted in local "The law!" and high waked out. More dynamic behavior like that would be great for creating a more living and breathing game world.
 
Back
Top Bottom