Re: Additions to skill definiton

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Re: Additions to skill definiton

Re: Additions to skill definiton

by HotWax » Fri Jul 03, 2009 9:33 pm

Graf Zahl wrote:They are indeed - which is why I won't deal with

Code: Select all

'd patches.[/quote]
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.

Re: Additions to skill definiton

by Graf Zahl » Fri Jul 03, 2009 2: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: Select all

'd patches.

Re: Additions to skill definiton

by Rachael » Thu Jul 02, 2009 2:54 pm

Not a problem, thanks for helping with that. :)

Re: Additions to skill definiton

by HotWax » Thu Jul 02, 2009 2: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. :)

Re: Additions to skill definiton

by Rachael » Thu Jul 02, 2009 2: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: Select all

 block helps.

Re: Additions to skill definiton

by HotWax » Thu Jul 02, 2009 2: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)

Re: Additions to skill definiton

by Rachael » Thu Jul 02, 2009 3:08 am

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

Re: Additions to skill definiton

by HotWax » Wed Jul 01, 2009 5: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.

Re: Additions to skill definiton

by Ghastly » Wed Jul 01, 2009 8: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

Re: Additions to skill definiton

by Enjay » Wed Jul 01, 2009 7: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.

Additions to skill definiton

by .+:icytux:+. » Wed Jul 01, 2009 6:16 am

this is exactly how i thought it when i suggested it, if this gets added = :happyface:

Re: Additions to skill definiton

by HotWax » Wed Jul 01, 2009 1: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 all

// 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.

Top