Idea for a Von Neumann Imp

Archive of the old editing forum
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.
Locked
Terra-jin
Posts: 65
Joined: Mon Oct 27, 2003 7:15 am
Location: Bilthoven, Holland

Idea for a Von Neumann Imp

Post by Terra-jin »

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?
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

Re: Idea for a Von Neumann Imp

Post by Mikk- »

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.
User avatar
InsanityBringer
Posts: 3392
Joined: Thu Jul 05, 2007 4:53 pm
Location: opening the forbidden box

Re: Idea for a Von Neumann Imp

Post by InsanityBringer »

Use ACS. Make the spawn state look like this

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
Script 500 would look like:

Code: Select all

int impcount;
Script 500 (int way)
{
    impcount += way;
}
On death, insert a call of ACS_Execute(500,0,-1,0,0). Like this:

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
To do the spawning, implement a script like this:

Code: Select all

script 501 (void)
{
    SetResultValue(impcount);
}
Then, do this in death:

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
The ACS bits go into a script library file referenced in LOADACS. There may be some bugs, I can't check here.
User avatar
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

Post by wildweasel »

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.
Terra-jin
Posts: 65
Joined: Mon Oct 27, 2003 7:15 am
Location: Bilthoven, Holland

Re: Idea for a Von Neumann Imp

Post by Terra-jin »

@Mikk:

Hmmmm I've tried that :) but it turned out that the original Imp (Imp Zero :P) 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.
User avatar
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

Post by wildweasel »

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.
User avatar
Ethril
Posts: 2677
Joined: Sun Nov 16, 2008 2:59 am
Location: with you in the dark

Re: Idea for a Von Neumann Imp

Post by Ethril »

It's too bad there aren't any inventory functions for master/children, or this'd be simple enough.
User avatar
Slasher
Posts: 1160
Joined: Sun Mar 16, 2008 11:17 pm
Location: California

Re: Idea for a Von Neumann Imp

Post by Slasher »

Ethril wrote:It's too bad there aren't any inventory functions for master/children, or this'd be simple enough.
I made a feature suggestion for something like that a while back. Here it is.
In fact this type of enemy behavior is exactly why I suggested it.
User avatar
Ethril
Posts: 2677
Joined: Sun Nov 16, 2008 2:59 am
Location: with you in the dark

Re: Idea for a Von Neumann Imp

Post by Ethril »

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?
User avatar
Slasher
Posts: 1160
Joined: Sun Mar 16, 2008 11:17 pm
Location: California

Re: Idea for a Von Neumann Imp

Post by Slasher »

My thread was closed with no explanation. So I have no idea.
User avatar
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

Post by Matt »

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.
User avatar
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

Post by NeuralStunner »

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.
Is that wierd and hacky method [wiki=A_GiveToTarget]really needed[/wiki]?
User avatar
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

Post by Matt »

......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.)
User avatar
Ethril
Posts: 2677
Joined: Sun Nov 16, 2008 2:59 am
Location: with you in the dark

Re: Idea for a Von Neumann Imp

Post by Ethril »

"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).
MOREIMPS.zip
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.
Locked

Return to “Editing (Archive)”