[Added] Re: Additions to skill definiton

Moderator: GZDoom Developers

Re: Additions to skill definiton

Postby HotWax » Wed Jul 01, 2009 2:39 am

Alright, here is a patch to add NoPain, MonsterHealth and FriendlyHealth to the skill definition.

I made some educated guesses as to how this should work. If I need to tweak it, I can.

First off, there's no range checking on Monster/FriendlyHealth, but I've made it so you can't make an actor's starting health go below 1 (which would make them invincible) -- they'll always have a default of 1 health to start. I've made the change directly in AActor:StaticSpawn so enemies placed in the map, spawned by scripts, or summoned from the console should all be affected. I've also done some hackery so that enemies spawned using summonfoe or summonfriend will adapt to their new role -- If you summon a friendly monster, he'll use FriendlyHealth to determine his start health, not MonsterHealth, and vice versa. Same if you override a friendly monster to an enemy using summonfoe.

I also made it so for all intents and purposes an enemy's max health is based on the adjusted value. So GetActorProperty(APROP_MaxHealth) will return the adjusted value, not the original. I figured the only negative side-effect are scripts not behaving properly because their values are hard-coded, and the fact is there's nothing I can do about that in any case -- mods going forward will have to be aware that the skill levels could adjust max enemy health, and using these settings on old mods is not guaranteed to work.

Also, certain Raven boss enemies base their actions off their percentage of health, and they will be... funky... when the max health is adjusted really low. Mostly they will just refuse to use some of their abilities or might use them at the wrong times. This shouldn't be a problem if you're using reasonble values. (But what fun is that?! ;))

Without further ado, the patch:

[edit] Look down. [/edit]

Here are a couple (ridiculous) sample skill definitions to test with:

Code: Select allExpand view
// Enemies are one-shot kill, friendlies are godly
skill "Paper thin"
{
   name="Paper Thin"
   monsterhealth=0.001
   friendlyhealth=10
   spawnfilter=4   
}

// Enemies are godly, friendlies are one-shot kill, nobody feels pain
skill "Strong Enemies"
{
   name="Strong Enemies"
   monsterhealth=10
   friendlyhealth=0.001
   spawnfilter=4
   nopain
}

[edit] Corrected code snippet's description of the nopain flag.
Last edited by HotWax on Thu Jul 02, 2009 4:02 pm, edited 4 times in total.
User avatar
HotWax
Do what you must, and pay the price later.
 
Joined: 18 Jul 2003
Location: Idaho Falls, ID

Additions to skill definiton

Postby .+:icytux:+. » Wed Jul 01, 2009 7:16 am

this is exactly how i thought it when i suggested it, if this gets added = :happyface:
User avatar
.+:icytux:+.
Mr. Happy of the Day!
 
Joined: 17 May 2007
Location: Finland

Re: Additions to skill definiton

Postby Enjay » Wed Jul 01, 2009 8:27 am

And, funnily enough, until I found out how the Doom skill definitions worked, I always assumed that the easy difficulties had slightly lower HP enemies and the harder settings had higher HP enemies.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Additions to skill definiton

Postby Ghastly » Wed Jul 01, 2009 9:17 am

Enjay wrote:And, funnily enough, until I found out how the Doom skill definitions worked, I always assumed that the easy difficulties had slightly lower HP enemies and the harder settings had higher HP enemies.

Ironic how that wasn't even possible for another 15 years (assuming this gets in soon). :P
User avatar
Ghastly
Rather ghastly
 
Joined: 06 Jul 2007

Re: Additions to skill definiton

Postby HotWax » Wed Jul 01, 2009 6:28 pm

Another note I forgot to mention. The NoPain flag is currently implemented to prevent everything that can go into a pain state when taking damage from doing so, which includes friendly and unfriendly monsters and for all I know the player himself. (That might be handled elsewhere though, not sure) It'd be fairly trivial to create a separate version for friendly monsters, but that seems kind of overkill to me... Anyway if it's an issue it's nothing that can't be tweaked a bit.
User avatar
HotWax
Do what you must, and pay the price later.
 
Joined: 18 Jul 2003
Location: Idaho Falls, ID

Re: Additions to skill definiton

Postby Rachael » Thu Jul 02, 2009 4:08 am

HotWax, that was the most pain in the ass code I've ever merged. Nevertheless, it's in the community build now.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Additions to skill definiton

Postby HotWax » Thu Jul 02, 2009 3:43 pm

SoulPriestess wrote:HotWax, that was the most pain in the ass code I've ever merged. Nevertheless, it's in the community build now.

LOL. How so? Anything I could have done to make it easier?

I'm just using TortoiseSVN's built in patch maker to generate these patches. If I need to use a different utility, I can.

(That said, there were quite a few changes in this one, just because of the number of places that were grabbing the actor's default health directly :P)
User avatar
HotWax
Do what you must, and pay the price later.
 
Joined: 18 Jul 2003
Location: Idaho Falls, ID

Re: Additions to skill definiton

Postby Rachael » Thu Jul 02, 2009 3:46 pm

Your tabs were turned into spaces. I had to merge it in manually to maintain any sort of consistency with the actual source files. It is probably a fault of the editor you used, though.

Also, posting the patch as an attachment, instead of a [code] block helps.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Additions to skill definiton

Postby HotWax » Thu Jul 02, 2009 3:52 pm

Ah, OK. It looks like the tabs are lost when I post the code here. I'll use the patch files directly from now on. Thanks for pointing that out. :)
User avatar
HotWax
Do what you must, and pay the price later.
 
Joined: 18 Jul 2003
Location: Idaho Falls, ID

Re: Additions to skill definiton

Postby Rachael » Thu Jul 02, 2009 3:54 pm

Not a problem, thanks for helping with that. :)
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Additions to skill definiton

Postby Graf Zahl » Fri Jul 03, 2009 3:51 pm

HotWax wrote:Ah, OK. It looks like the tabs are lost when I post the code here.



They are indeed - which is why I won't deal with [code]'d patches.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Additions to skill definiton

Postby HotWax » Fri Jul 03, 2009 10:33 pm

Graf Zahl wrote:They are indeed - which is why I won't deal with [code]'d patches.

So noted. For some reason I was thinking you actually preferred them that way. My bad.

Also, please let me know if there's anything I need to fix with these submissions. I'm quite new to editing the ZDoom source so I'm sure there're cases and exceptions I'm forgetting about.
User avatar
HotWax
Do what you must, and pay the price later.
 
Joined: 18 Jul 2003
Location: Idaho Falls, ID


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Google [Bot] and 0 guests