Difficulty Functions, Flags, and other misc. settings

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: Difficulty Functions, Flags, and other misc. settings

Re: Difficulty Functions, Flags, and other misc. settings

by David Ferstat » Tue Apr 27, 2010 6:15 am

Brilliant! They look great alternatives.

Many thanks.

Re: Difficulty Functions, Flags, and other misc. settings

by Ghastly » Mon Apr 26, 2010 4:52 pm

The_Funktasm wrote:A_JumpIfDifficulty(name, state/frames)
If you really need this, you could try A_JumpIf(ACS_ExecuteWithResult) pointing to a script that returns game skill.

Re: Difficulty Functions, Flags, and other misc. settings

by Zippy » Mon Apr 26, 2010 8:52 am

For those that need an example, it involves using the [wiki=MAPINFO/Skill_definition]Skill definition[/wiki] in MAPINFO and would look something like this...

Code: Select all

//
// DECORATE
//

// This is a ShotgunGuy that fires more bullets, more accurately, with more damage per bullet.  For Hard mode.
ACTOR ShotgunGuyHard : ShotgunGuy
{
  States
  {
    Missile:
      SPOS E 10 A_FaceTarget
      SPOS F 10 BRIGHT A_CustomBulletAttack(14, 0, 4, 6, "BulletPuff")
      SPOS E 10
      Goto See
  }
}

Code: Select all

//
// MAPINFO
//

skill MyCustomSkill
{
  name = "Shotgunners are Evil"
  replaceactor = "ShotgunGuy", "ShotgunGuyHard"
}
This creates the custom skill (shows up as "Shotgunners are Evil" in the menu) that if selected by the player, replaces all the ShotgunGuys with the new, more difficult shotgunner. This lets you do the different behaviors per difficulty as suggested, with the added benefit of doing it without encapsulating all the difficulty behaviors in a single actor, reducing that actor's complexity.

Re: Difficulty Functions, Flags, and other misc. settings

by Graf Zahl » Mon Apr 26, 2010 2:37 am

You define different actor classes and set a class remapping in MAPINFO. That way you don't have to mess around in the actor with A_JumpIf's.

Re: Difficulty Functions, Flags, and other misc. settings

by David Ferstat » Mon Apr 26, 2010 2:26 am

Sorry for the bump, but I really would like an answer to this:

What is involved in exposing GameSkill to DECORATE, please?

Re: Difficulty Functions, Flags, and other misc. settings

by David Ferstat » Fri Apr 23, 2010 8:37 pm

Gez wrote:Sure, but that could be done by having gameskill (and other useful global variables) available to [wiki]DECORATE expressions[/wiki], rather than yet-another-A_Jump function.
So what's involved in exposing GameSkill to DECORATE?

Re: Difficulty Functions, Flags, and other misc. settings

by The_Funktasm » Fri Apr 23, 2010 8:09 am

Gez wrote:Sure, but that could be done by having gameskill (and other useful global variables) available to [wiki]DECORATE expressions[/wiki], rather than yet-another-A_Jump function.
http://zdoom.org/wiki/Projectile_Trap

After reading that, another A_Jump sounds wonderful.
Alternatively, you could add it to another jump function, dunno which one.

Re: Difficulty Functions, Flags, and other misc. settings

by Gez » Fri Apr 23, 2010 7:50 am

Sure, but that could be done by having gameskill (and other useful global variables) available to [wiki]DECORATE expressions[/wiki], rather than yet-another-A_Jump function.

Re: Difficulty Functions, Flags, and other misc. settings

by David Ferstat » Fri Apr 23, 2010 7:41 am

I confess I can't see why the first one would be difficult. GameSkill is an integer value available to ACS. It simply needs to be exposed to DECORATE, as so many other ACS variables are. ("Simply", says the person who doesn't, really, know what goes on inside the code. :) )

Traditionally, the main technique available to change the difficulty of a level is to vary the number of monsters according to skill level. Exposing the GameSkill to DECORATE allows much more flexibility to mod-makers. For example, the level design may make it undesirable, or impossible, to add another monster at a particular place in a level. The ability to change the monster itself would still allow the mod-maker to adjust the difficulty.

As The_Funktasm points out, A_JumpIfDifficulty would allow the creation of actors that could adjust their behaviour and characteristics as the skill level changed. At lower skills monsters might throw a punch for a melee attack, while kicking at higher skills. At lower skills a monster might fire its gun once per attack sequence, with a lower accuracy; while at higher skills it might fire two or three times, with a higher accuracy. It might change its dropped item, or might run a script that checks a different loot table. It might have more or less health, or armour.

Ok, you could probably use dummy inventory items to pass the skill level to the actor, but this will require an ACS script to give the item to every monster you want to be able to vary. You'd probably have to add this to the spawn state of every monster's DECORATE. Having the GameSkill directly available to DECORATE would surely be neater.

Re: Difficulty Functions, Flags, and other misc. settings

by Gez » Fri Apr 23, 2010 6:23 am

My predictions:

1. [WFDS]
2. [wiki=Actor flags#INVENTORY.IGNORESKILL][Already in][/wiki]
3. [WFDS]

Note that if you want to have monster loot depend on skill setting, you can do that already with the skill property ReplaceActor. E.g., DropItem "ImpLoot" in your actor, then in your skill "ReplaceActor = "ImpLoot", "SomeStuff"".

Difficulty Functions, Flags, and other misc. settings

by The_Funktasm » Fri Apr 23, 2010 6:12 am

I was thinking earlier about difficulty settings, and how little coders appear to be able to use them. Here are some ideas that may help that problem.

A_JumpIfDifficulty(name, state/frames)

A_JumpIfDifficulty could be used on monsters to give them more accuracy or other attacks custom tailored to difficulty. They also could be used in monster spawners to adapt to the difficulty and spawn more, or tougher monsters. Weapons, effects, powerups, and even scenery could have different behavior depending on difficulty.

+IGNOREDIFFICULTY
Essentially, this flag would cause an ammunition type or powerup (anything applicable) to ignore any difficulty based changes, such as less or double ammo.

DropItemX (X = difficulty)
Not a biggie, but it'd possibly help in mods where people want easier modes to have extra items dropped by monsters. This would probably use the spawning filter difficulty.

Just throwing out some ideas.

Top