Question: Mist Transformation

Information and updates for all other projects by Black Omen Productions (besides Shadow Empires): Namely Codename: MetalStorm, Anti-Balance, Ultimate Fixer and all versions of XyRAX

Moderators: Nefarius, Joel, Doombreed-x, Vendanna

Post Reply
User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Question: Mist Transformation

Post by kidpaddle94 » Sun Jun 24, 2012 2:47 pm

Hey Nefarius. I remember seeing a screenshot from you, somewhere in your screenshot archive topic, showing the mist transformation for monsters like vampires. I wanted to know, how is this done? I mean, the actual mist form, what is it? A missile? A Monster? Something else?

Also, is it 100% hardcoded. And is there any way to reproduce something like that by softcode, or at least not too much code.

Thanks.

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: Question: Mist Transformation

Post by Nefarius » Sun Jun 24, 2012 4:10 pm

The mist transform involves a lot of code (dedicated AI block to handle it), 2 pairs of skill functions (srv and clt) and an active state function, it also has a special server side state removal callback func.

Principally:
The skill removes the monster's collision and applies a state (the state makes the unit invisible, and the active state frame func generates the mist), the monster's AI works normally at this point, it can do whatever it could do while visible, this is why a dedicated block is needed, to stop it from attacking the player and actually change its behavior (they flee from the player while the state is present). In my case it also marks the unit as ethereal so that it won't take damage from physical AoE (you can still kill it with elemental AoE).

When the skill is invoked again (if the state is present) it tries to restore the units collision and removes the state.

We also have special code for the case the AI deactivates over unwalkable terrain, to make sure it reactivates in the mist shape when the player loads that room again.

---

I doubt that even if this was somehow hackable in a softcoded way (it may be via the emerge/submerge funcs "somehow") that it would work properly, it sounds like a can of worms without dedicated code, you're very likely to end up with invalidly marked collision bits on the map that'll never get cleared up.

You also need to take into account vanilla is notoriously broken when it gets to sync AI related collision changes (vultures, frogs and tentacle beasts), none of those actually worked properly.

As far as calling that hardcoded, there are no missile, skill, monster (etc) indices coded into the DLL for skills, ais and mostly anything else (except for some legacy vanilla code that we don't intend to keep, it is just intermediate to not break things), however in general almost everything I added has dedicated code, unless it is something basic like a single target missile, trying to create effects with the existing things while often possible doesn't give the desired degree of control, it is easier and faster to just write code that does exactly what we want, with all the parameters open for tweaking.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Question: Mist Transformation

Post by kidpaddle94 » Sun Jun 24, 2012 4:26 pm

Hmm, that seems like lot of code... and a little too advanced for me yet :P
I was kinda hoping to reproduce something like that with shapeshift skills and some tweaking methods, maybe with some bits of code. I still might try to do something. That won't be perfect as yours for sure, but heh ^^
(you can still kill it with elemental AoE).
Is this intended??
however in general almost everything I added has dedicated code, unless it is something basic like a single target missile, trying to create effects with the existing things while often possible doesn't give the desired degree of control, it is easier and faster to just write code that does exactly what we want, with all the parameters open for tweaking.
I clearly understand what you mean there. I'm myself starting to do this as I get better. ^^

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: Question: Mist Transformation

Post by Nefarius » Sun Jun 24, 2012 4:49 pm

Yes that is intended, I didn't want to make them fully unkillable while in that shape, it merely serves as an extra layer of defense.

In general gaseous forms are considered ethereal in Metal Storm making them invulnerable to physical hits, anything elemental or magical can still damage ethereal units (see the dedicated post about them). This isn't some stat tweakery, it basically changes how the damage routines operate on the unit.

Might explain it better:

Code: Select all

	if ( pUnit->tMetal.dwMetalFlags & METALFLAG_ETHEREAL )
	{
		DWORD dwDamage = pDamage->dPhysical + pDamage->dMagic;

		if ( dwDamage > MAX_256_LONG )
		{
			dwDamage = MAX_256_LONG;
		}

		pDamage->dPhysical = 0;
		pDamage->dMagic = dwDamage;
	}

	if ( pTarget->tMetal.dwMetalFlags & METALFLAG_ETHEREAL )
	{
		pDamage->dPoison = 0;
		pDamage->dPhysical = 0;
		pDamage->dAcid = 0;
	}
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Question: Mist Transformation

Post by kidpaddle94 » Sun Jun 24, 2012 5:28 pm

Perhaps, using some tweaked spiderlay state + invis state shapeshift could work.

Though the only thing I can't reproduce, obviously, is the AI changes, to prevent the unit from engaging attack while in mist form.

I will see what I manage to create ^^

Post Reply

Return to “Mods by Nefarius”