The Hydra Emitter

Started by Xindaris, April 14, 2015, 08:37:50 PM

Previous topic - Next topic

Xindaris

I've finally fixed what was wrong with the idea I had long ago.

The hydra emitter is a special emitter that spawns more of itself upon death, for however many iterations the map designer wants. It chooses random locations within a specified range to place the new emitters, which may be set to become weaker or stronger by whatever factor the designer wants. The amount of emitters it places each time, with the change per iteration, and the number of emitters are also settable. All of this is pretty self-explanatory.

To use this script, put HydraHead on the core you want to be the emitter, set it to "nullifier damages" and "counts for victory", and set its values however you like. Then make another, invisible and intagible core that nothing damages but which counts for victory, and give it "HydraBody". Make sure to calculate exactly how many heads there will be and put that number into HydraBody's "numberOfHeads" variable.

The body (if its variable is set correctly) ensures that the map doesn't end prematurely due to the player having killed the last hydra emitter for the moment when more are spawning; when all of the heads are dead it destroys itself.

Demonstration map here.

This idea could be spread out to things like hydra spore towers or the like, but I haven't the expertise to remake spore tower behavior in CRPL. If you want to add more scripts to the hydra emitter so it does more things, and its children do the same things, you'll need to add those things to the part of the script dedicated to setting up each new unit.

J

Quote from: Xindaris on April 14, 2015, 08:37:50 PM
This idea could be spread out to things like hydra spore towers or the like, but I haven't the expertise to remake spore tower behavior in CRPL. If you want to add more scripts to the hydra emitter so it does more things, and its children do the same things, you'll need to add those things to the part of the script dedicated to setting up each new unit.
You can place a regular spore tower on top of a core that when destroyed, spawns more invisible hydraheads with a spore tower on top. Should work for any regular enemy unit. You can copy the spore tower placement from Arca or from the wiki (CRPL reference - setscriptvar).

TheDutcher

Quote from: J on April 15, 2015, 01:13:57 AMYou can place a regular spore tower on top of a core that when destroyed, spawns more invisible hydraheads with a spore tower on top. Should work for any regular enemy unit. You can copy the spore tower placement from Arca or from the wiki (CRPL reference - setscriptvar).
What I personally don't like about this method is that there is no way for the player to know that that sporetower is actually an 'edited' unit (in this case a hydra sporetower thing).

Tyler21

From a gameplay perspective I think that all nullifiers within the range should be immediately destroyed when the hydra 'splits'.
The best way to do this is to include the getunitsinrange + getunittype + destroy loop in the awake function of new emitters.

Otherwise experienced players will simply build several nullifiers around the first emitter, disarm them, and arm one of them whenever a split is carried over which would make the hydra unit completely useless.
"Enjoyment appears at the boundary between boredom and anxiety, when the challenges are just balanced with the person's capacity to act."
― Mihaly Csikszentmihalyi

Check my collection of the 30 most difficult and challenging maps in Colonial Space!

Xindaris

#4
As long as the player isn't able to place nullifiers wherever they want and the range is big enough, at least some of the split-off heads are going to appear outside the range of any nullifiers the player might have thought to place ahead of time. It's random, so there's no guarantee, but if you make the range the whole map and the map is big enough it's pretty likely most of them won't be in range.

Also, wouldn't putting that into the awake function make them kill any nullifiers in place when the player saves and then reloads the game? Or do I misunderstand what the awake function does?

At any rate, I'm pretty open to the idea of a "puzzle map" where the correct strategy is to build a bunch of nullifiers at once because there are too many heads with too much growth in amount/decrease in delay to handle it reasonably any other way, but they all appear in a short range.

J

Quote from: Xindaris on April 15, 2015, 01:22:59 PM
Also, wouldn't putting that into the awake function make them kill any nullifiers in place when the player saves and then reloads the game? Or do I misunderstand what the awake function does?
That's correct, but that's what the once-blocks are for.

Xindaris

Yeah, I would use a once-block for that if I wanted to do that thing.

In other news, I've now uploaded the map I originally made for this idea, and added a link to the relevant forum post up in the first thing.

Also, I think I forgot to mention a small bit of behavior the hydra has: It won't place new emitters on void. I believe this was originally a quick and dirty way to be sure that it doesn't place heads outside of the map space, but I suspect it's useful on maps that have void for, y'know, not making them unwinnable too.