
Build question "(Not a "help me" issue, just a curiosity)"
#1 Posted 06 October 2024 - 06:47 PM
It's in regards to spawning. Why does Build seem to be the only old-school engine that is capable of genuinely spawning things? What I mean by genuine is, well let's look at Doom by comparison. All enemies are stored on the map. Those that teleport in are kept in a box outside the playable space, that when they wake up they will cross a teleporter line and then appear within the level itself. Even advanced source ports that allow items to be spawned accomplish this with conveyor belts. Build doesn't work like that. The items and enemies that can be spawned actually spawn in in a literal sense. They don't exist on the map prior to the trigger that creates them (I know their spawn points are placed in the map, but). The total kills remaining number even increases when this happens.
And yeah, Doom's an older engine. Which is why I'm so confused that even more technically advanced engines don't work that way. The Quake engine works basically the same way as Doom's engine (in this regard I mean). And even Serious Sam, from 2001, still relies on template objects within the map itself to spawn things. Maybe GldSrc does literal spawning but I'm not sure; I'm less familiar with it. It's kind of moot anyway since it's still in the minority with Build even if it does.
So why is that? And as a followup question, why did "true" spawning seem to be an elusive technical accomplishment in that era?
This post has been edited by Ninety-Six: 06 October 2024 - 06:48 PM
#2 Posted 06 October 2024 - 07:48 PM
#3 Posted 06 October 2024 - 08:21 PM
Danukem, on 06 October 2024 - 07:48 PM, said:
I admit I forgot about those. That just reinforces the question all the more, though.
#4 Posted 07 October 2024 - 02:40 AM
To successfully work with RESPAWN sometimes additional code has to be run/added so that the sprite the RESPAWN turns into has the correct size otherwise by default it will be given repeats of 1x1 (0x0 being invalid and instantly deleting it, that's when a sprite is completely incompatible with the system), making it almost invisible, for instance some NEWBEAST actor frames do not have such checks. https://infosuite.du...ibility#Respawn
This post has been edited by ck3D: 07 October 2024 - 02:59 AM
#5 Posted 07 October 2024 - 12:13 PM
None of that matters though because we know for sure that in all of these games, sprites get spawned all the time. When your plasma gun or freezer goes PEW PEW PEW you can literally see the sprites coming into existence and then later deleting. And no there is not some "projectile closet" akin to a monster closet somewhere storing all the possible projectiles. So we know that there was nothing arcane or unusual about sprites spawning into these games. And since a monster is just a sprite, there's no reason in principle why monsters couldn't be spawned.
John Carmack is good at programming and would have had no trouble at all putting spawning monsters into Doom/Doom2 etc. It's possible that these were excluded from Doom 1 due to concerns about performance. If you have all the possible monsters that are gonna be in the map in the map at start, then that foregoes lag caused by spawning more. Or maybe it has something to do with maybe needing to resize some arrays. I don't know, but for sure it wasn't a limit on programming knowledge. If I had to guess I would say the original reason was a performance concern, and then later in Doom2 when we know they had spawning monsters (the lost souls) they just kept using monster closets because their level design techniques were well established and they felt no need to have monster spawners in the maps.
#6 Posted 07 October 2024 - 01:40 PM

#7 Posted 08 October 2024 - 03:56 AM
This post has been edited by ck3D: 08 October 2024 - 04:01 AM
#8 Posted 08 October 2024 - 12:26 PM
Danukem, on 07 October 2024 - 12:13 PM, said:
There is a counterargument to be made in that said projectiles aren't permanent. They will eventually hit a wall and dissipate (especially in the levels crafted by id themselves). Meanwhile the enemies are permanent. Even once they're dead the game is still processing them (except Lost Souls. They might actually be the exception; I'm not sure if the game processes an invisible corpse or just plain deletes them).
Danukem, on 07 October 2024 - 12:13 PM, said:
That still leaves the question of why they kept doing it that way in Quake (when that has demonstrably led to instances where the levels can break because of the rube-goldberg approach of monster spawning. Grisly Grotto has this bad for instance).
ck3D, on 08 October 2024 - 03:56 AM, said:
To be specific, I was referring to the monster boxes that exist outside the playable space. Proper "monster closets" are still part of the normal level; they're just closed off at the start. I'm talking about the boxes that have but a tiny connecting passage that only exists to transfer sound.
Had id taken the direct spawn method, those teleporter ambushes could have been much more meticulously designed, and again without the threat of monsters getting stuck (which happens even in Doom 1. The optional arena at the end of Unholy Cathedral often ends up with a few imps or pinkies lingering in limbo for a while before they cross the teleporter linedef again).
This post has been edited by Ninety-Six: 08 October 2024 - 12:28 PM
#9 Posted 10 October 2024 - 05:46 PM
I would guess the reason Doom uses the teleport trick instead of spawning in monsters directly is for performance reasons, like basically everything else in the engine's design. It is faster to load the monster in memory and have it exist on the map, than to spawn it at runtime, in a time where every frame mattered.
Quake may not have had "true" spawning for reasons related to the game's general development, and there was more important stuff to do. At very least, Half-Life on Goldsrc has monstermakers which function like a RESPAWN does and uses them all over the place.
Original Unreal had "creature factories" which kinda-sorta acted the way Build's RESPAWN works.
Doom 3 had monsters spawn in, again kinda-sorta like RESPAWN. In that game the monster literally already exists in the map and is just invisible, and when triggered, does the teleport in animation.
Unity allows you to Instantiate game objects (such as monsters), but it's heavily suggested NOT to do it because it is heavy on the engine. So it's better to recycle certain game objects - reset them to some kind of zero state and move them to a new monster's location - rather than spawn them over and over. We use this method in AWOL for similar reasons, it winds up being invisible to the player and there's no overhead for the various on-spawn Game Events.
Of all of these, Doom is the more interesting example because their system allows an essentially unlimited amount and variety of monsters all to spawn from a single point. All of the other examples are either one-time use (like RESPAWN) or are limited to a single enemy type (like Goldsrc's monstermaker). Doom's method also lets the rate the monsters teleport in be organic and essentially random. Their method also means all of the "programming" is done map-side, without having to make explicit cases for how certain spawners work. For example, I can immediately think of how to make a RESPAWN+ which can be triggered multiple times, or spawns in multiple enemies, or a varied enemy type, or a random spawn rate, or all of these things combined. Making it easy for the map maker to place this and "program" it with hitags, lotags, .extra values, and so on is where it gets hard and you'd need some kind of reference guide to understand how to use it... Or, you just place 10 enemies in a room, add a teleporter and a destination, and it's done.
#10 Posted 11 October 2024 - 08:51 AM
Reaper_Man, on 10 October 2024 - 05:46 PM, said:
Computers are strange. Intuitively you would think the opposite, that creating more monsters when there are less living ones to process idle/active code for would be easier than loading them all at the start. Yet it's almost always the opposite of what seems intuitive.
#11 Posted 12 October 2024 - 08:57 AM
At a very basic level, lets assume there are two different systems, one has a massive CPU but a crappy memory bus hanging off it. The other has a crappy CPU but uses lightning fast SRAM on a really wide bus with everything else being DMA capable.
On the first system, loading the monster in at map start would make sense, because the CPU isn't going to care and the monster is now already in RAM, so won't slow the level down later. However, if we have to load the monster in while the level is already playing, the CPU will have to wait for the monster's tiles and code to be loaded into RAM and can't really do anything in this time, despite how powerful it might be. For an example, on early Intel 386 systems the CPU might have to wait at least five cycles for every memory access, plus a few more for the operation to actually complete, which stacks up quickly if your program accesses it a lot - You have a powerful CPU that's no use when it's sat doing nothing, but a CPU-bound program would run well on this machine.
On the second system, the CPU is a pile of crap, so having a monster constantly pulling on it isn't going to help the game run all that nicely. On the other hand, loading the monster later on will barely have an impact because (assuming the storage we're loading it from isn't dog slow) RAM access is really fast, to where the CPU might hardly have to be involved at all if the machine was designed around this capability. As an example, late Intel 286 systems sometimes had almost no wait at all when accessing memory and so despite using a comparatively older and often slower CPU, they could outrun the flashy new 386 machines in programs that hammered the RAM constantly - The CPU might not technically be as quick and will slog if loaded down with processing, but it doesn't have to wait for the rest of the system anywhere near as often, meaning a memory heavy program would run well on this machine.
The correct way isn't always obvious and you could well have to break the apparent convention for certain applications. Still, curiously, the system architecture did change quite a lot on PCs between the time Doom went into development and when Duke 3D released, so this might well have influenced decisions somewhere along the way. Duke seems to suffer most with disk access and less than optimal texture caching. However, Duke runs a more complex engine where doing things like sight checks can be quite expensive computationally with certain types of level geometry.
This post has been edited by High Treason: 12 October 2024 - 08:58 AM
#12 Posted 13 October 2024 - 09:38 AM
Aspect of "Monsters teleporting in" happening quite literally and allowing some degree of natural pacing/throttling so that all don't get to the player in one go for gameplay and performance reasons (rendering & sounds)..
It's kind of a natural extension for monster closets through a hack without much code being required.
#13 Posted 14 October 2024 - 10:57 PM
However, I never understood that despite the gorillion updates, Mapster still can't show the R monster/item (at least with transparency) straight after the R sprite is getting the hi-tag. Also they should be part of the kill count, that can be implemented properly in future EDuke32 versions. And then, errors like not having set palette (in the case of assault captain respawns at least) and in some cases the sprites themselves (eggs, reconcars) are still there, and it has never truly been fixed, only in DaNukem's DukePlus. I would also implement default sizes for active items even at Mapster mapload (I reckon it was there at early Build versions as all item sprites except for the atomic health and pistol seem default at 32:32, but it's gone now).
#14 Posted 15 October 2024 - 07:04 AM
#15 Posted 15 October 2024 - 08:15 AM
NNC, on 14 October 2024 - 10:57 PM, said:
To be fair, a lot of that is because Duke 3D on the game side was coded with the feet (maybe a better way to put it would be it's the sum of so much situational improvised hackwork just to get one specific thing to do one thing at one moment in the game it's not that optimized to be modded as a whole). For instance in order to bleed acid and not blood, NEWBEAST will turn pal 6, spawn pal 6 blood, then immediately revert back to pal 0 before the visual change can be perceptible but it still happens in the running code, when (in theory) cleaner practice would have been to go back on the old blood pool code and give it pal 6 when it's detected to be a NEWBEAST that spawns it. Assault Troopers are weird too because when pal 0 are consistently assigned pal 11 inside of the maps by the game when not turned into Assault Captains with pal 21 (or placed with a non 0 pal in general); Nukebuttons will detect all blocked/hittable objects contained within their parent sector before they agree to activate (that means a blocked Nukebutton will negate its own self) just because the player wasn't supposed to be able to press the E1L1 one through the intact glass. It's a bunch of small one-time quirks due to the game having been written in a linear fashion that add up, and are especially noticeable when people try to get the game to do alternative things. In that sense it's not optimized, also because it only ever was meant to be so much as the base corpus would function and agree to do all the things it needed to in a specific context. EDuke makes it more practical than raw Build to go back and address those old quirks because it exposes access to a larger picture of what the game manipulates than just the old .cons. Danukem does seem to tend to clean all of that stuff up - Alien Armageddon is really well optimized in that sense with a lot of the original oddities still functional but properly rearranged - on the mapper's end that alleviates so much.
This post has been edited by ck3D: 15 October 2024 - 08:27 AM
#16 Posted 15 October 2024 - 11:16 PM
ck3D, on 15 October 2024 - 08:15 AM, said:
Yep, Duke was a mess of a game, which wasn't notable in the 1990s, when the game's great level design and edgy nature were huge, but it became obvious when it lost the modding race to other contemporary FPS games.
I think some of these things should be fixed for EDuke32, and not for special mods like Duke Plus or Alien Armageddon.
#17 Posted 23 October 2024 - 01:48 PM
oasiz, on 15 October 2024 - 07:04 AM, said:
A script I would find handy is to add a default value for RGB of an SE 49 or 50 polymer light instead of them being zero at time of placement and then having
to hit F8 to add them manually one at a time.
This post has been edited by Mark: 23 October 2024 - 01:49 PM