Idea for a Von Neumann Imp
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Idea for a Von Neumann Imp
Hi,
I've been working at a type of Imp that replicates itself. With A_SpawnItemEx the Imps can summon more of themselves, giving them an exponential growth rate. The problem is, there's no limit to the amount of Imps created. Given enough time and room, the Von Neumann Imps can flood the map.
What I'd like to accomplish is that the SpawnItem ceases to function when a certain limit is reached (sort of like what happens to Pain Elementals in vanilla). I've racked my brain about ways to do this, but I couldn't find a solution.
Do you guys have any ideas how this might be done with current decorate tools?
I've been working at a type of Imp that replicates itself. With A_SpawnItemEx the Imps can summon more of themselves, giving them an exponential growth rate. The problem is, there's no limit to the amount of Imps created. Given enough time and room, the Von Neumann Imps can flood the map.
What I'd like to accomplish is that the SpawnItem ceases to function when a certain limit is reached (sort of like what happens to Pain Elementals in vanilla). I've racked my brain about ways to do this, but I couldn't find a solution.
Do you guys have any ideas how this might be done with current decorate tools?
Re: Idea for a Von Neumann Imp
Maybe you could make copies of the imp and name them imp1, imp2, imp3, imp4, imp5 until whatever number you want them to stop spawning.
- InsanityBringer
- Posts: 3392
- Joined: Thu Jul 05, 2007 4:53 pm
- Location: opening the forbidden box
Re: Idea for a Von Neumann Imp
Use ACS. Make the spawn state look like this
Script 500 would look like:
On death, insert a call of ACS_Execute(500,0,-1,0,0). Like this:
To do the spawning, implement a script like this:
Then, do this in death:
The ACS bits go into a script library file referenced in LOADACS. There may be some bugs, I can't check here.
Code: Select all
Spawn:
TROO AA 0 ACS_Execute(500,0,1,0,0)
TROO AB 10
goto spawn+2
Idle: //this is to stop it from miscounting if they lose their target
TROO AB 10
loop
Code: Select all
int impcount;
Script 500 (int way)
{
impcount += way;
}
Code: Select all
Death:
TROO I 8 ACS_Execute(500,0,-1,0,0)
TROO J 8 A_Scream
TROO K 6
TROO L 6 A_NoBlocking
TROO M -1
stop
Code: Select all
script 501 (void)
{
SetResultValue(impcount);
}
Code: Select all
Death:
TROO A 0 A_JumpIf(ACS_ExecuteWithResult(501,0,0,0) <= 20,"spawnimp") //spawnimp contains logic for spawning
TROO I 8 ACS_Execute(500,0,-1,0,0)
TROO J 8 A_Scream
TROO K 6
TROO L 6 A_NoBlocking
TROO M -1
stop
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: Idea for a Von Neumann Imp
It'd be interesting if we could recreate the "xerox effect" and have each successive "generation" of Imp come out slightly more flawed/defective than the last, until you end up with something almost unrecognizable at the fifth incarnation.
Re: Idea for a Von Neumann Imp
@Mikk:
Hmmmm I've tried that
but it turned out that the original Imp (Imp Zero
) can still indefinitely spawn second version Imps this way. The way I see it, I want the Imps to always reach a certain number. Let's say 500... if you chip away at the horde, their numbers will dwindle but soon enough they'll catch up to 500 again - but not more than that.
@InsanityBringer:
I must admit I'm not familiar with ACS, but I'll give it a try!
I'll let you know if I get it working.
@wildweasel:
That does sound interesting, it makes the horde flawed (in a good way). Such a thing might be done with what Mikk suggested. It makes a new horde harder to weed out than a big one. The core of the horde should still consist of "fresh" Imps so it'll just be the outer rims of the horde that are weaker/different.
Hmmmm I've tried that


@InsanityBringer:
I must admit I'm not familiar with ACS, but I'll give it a try!
I'll let you know if I get it working.
@wildweasel:
That does sound interesting, it makes the horde flawed (in a good way). Such a thing might be done with what Mikk suggested. It makes a new horde harder to weed out than a big one. The core of the horde should still consist of "fresh" Imps so it'll just be the outer rims of the horde that are weaker/different.
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: Idea for a Von Neumann Imp
I actually did something similar with Pain Elementals for my brother's mod. My trick for limiting their spawning ability was to create a dummy inventory item (max out at 20, I'd say) that is incremented by one every time he'd spawn a new monster. Once the counter reaches 20, it can't spawn any more.
Re: Idea for a Von Neumann Imp
It's too bad there aren't any inventory functions for master/children, or this'd be simple enough.
Re: Idea for a Von Neumann Imp
I made a feature suggestion for something like that a while back. Here it is.Ethril wrote:It's too bad there aren't any inventory functions for master/children, or this'd be simple enough.
In fact this type of enemy behavior is exactly why I suggested it.
Re: Idea for a Von Neumann Imp
Yeah, I have no idea why that didn't (couldn't?) get added. I was under the impression that it would just be like A_GiveToTarget, etc., but I guess that's not the case?
Re: Idea for a Von Neumann Imp
My thread was closed with no explanation. So I have no idea.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Idea for a Von Neumann Imp
A bit of a bizarre idea, but:
Have the imps do a special damage type that calls a special pain state in the player. This pain state increases a dummy inventory item that otherwise very slowly depletes over time.
Imps do not reproduce unless they are chasing a player. Each time an imp is about to reproduce, it checks its target's inventory for a certain amount of the dummy item. Enough, and it aborts.
Have the imps do a special damage type that calls a special pain state in the player. This pain state increases a dummy inventory item that otherwise very slowly depletes over time.
Imps do not reproduce unless they are chasing a player. Each time an imp is about to reproduce, it checks its target's inventory for a certain amount of the dummy item. Enough, and it aborts.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Idea for a Von Neumann Imp
Is that wierd and hacky method [wiki=A_GiveToTarget]really needed[/wiki]?Vaecrius wrote:Have the imps do a special damage type that calls a special pain state in the player. This pain state increases a dummy inventory item that otherwise very slowly depletes over time.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Idea for a Von Neumann Imp
......y'know that's actually a good point, I just assumed that it was necessary to actually hit the player for some reason. :V
(though there would be a difference... with the hacky method good players will face more monsters independently of tactics, while with an A_GivetoTarget which I assume would be called in an attack state there would be more imps spawned against players who hide behind cover compared to players who dodge stuff out in the open.)
(though there would be a difference... with the hacky method good players will face more monsters independently of tactics, while with an A_GivetoTarget which I assume would be called in an attack state there would be more imps spawned against players who hide behind cover compared to players who dodge stuff out in the open.)
Re: Idea for a Von Neumann Imp
"OH MY GOD ETHRIL WHAT IS WRONG WITH YOU THIS TOPIC IS LIKE 5 MONTHS OLD"
Fuck you I've had a breakthrough.
I've done it. All in DECORATE because I'm too lazy to learn ACS presently... and it's easier to adjust this way (no compiling and stuff. eww.)
It's a bit hacky, but it works (as far as I can tell).
VNImp.wad is more like what you're looking for. Summon VNImp1 to get it started. For testing purposes it only makes up to 10 clones (barring glitches, but the few times i've had it happen it only meant 1-3 extras) but it should be simple enough to change.
BuddingImp.wad is different but related, just for the hell of it. It's more like those egg-shaped nesting dolls... Not quite what you're after but it's a lot less prone to breaking. Summon BudImp1 and stand back.
...Is this guy still even around? Bah, whatever. I'm sharing this whether you like it or not.
Fuck you I've had a breakthrough.
I've done it. All in DECORATE because I'm too lazy to learn ACS presently... and it's easier to adjust this way (no compiling and stuff. eww.)
It's a bit hacky, but it works (as far as I can tell).
VNImp.wad is more like what you're looking for. Summon VNImp1 to get it started. For testing purposes it only makes up to 10 clones (barring glitches, but the few times i've had it happen it only meant 1-3 extras) but it should be simple enough to change.
BuddingImp.wad is different but related, just for the hell of it. It's more like those egg-shaped nesting dolls... Not quite what you're after but it's a lot less prone to breaking. Summon BudImp1 and stand back.
...Is this guy still even around? Bah, whatever. I'm sharing this whether you like it or not.