Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Obsolete > v4

 
 
Thread Tools Display Modes
Old November 17, 2011, 10:26   #1
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,079
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
A new way of managing effects

Several months ago, takkaria and I had a debate about how to improve the handling of effects. In case anyone is interested, the original exchange is here. The basic issues are:

1. We don't currently distinguish between simple effects which do one thing (e.g. remove fear) and compound effects which do lots of things (e.g. cure 60 hp and remove poison, blindness, confusion and stunning).

2. We don't have consistently parameterised effects, by which I mean that the code knows whether an effect requires aiming, but not whether it requires a target object, and that variable values are hard-coded - CLW, CSW and CCW are all *different* effects. This, incidentally, is why it's so hard to display the adjusted damage that an attack wand or rod would do.

Thirdly, there's no way to edit effects without hacking the source and recompiling.

So, we concluded that we need to split effects into two. Simple effects *have* to be in the code - because if you want to add or change one, you have to code that change. But compound effects are just multiple simple effects put together, and there's no reason these couldn't be in an edit file:

N:Cure Light Wounds
E: HEAL_HP:20:0
E: DEC_POIS:0:2d6
E: DEC_BLIND:0:-1 (where -1 means "all")

N:Cure Serious Wounds
E: HEAL_HP:40:0
E: DEC_POIS:0:-1
E: DEC_BLIND:0:-1
E: DEC_CONF:0:-1

etc. So, my plan is to define a full set of simple effects that can be called with a parameter "amount" (i.e. the hp to heal, temp boost to-hit, etc.) and a parameter "duration", and then create an edit file and a parser to deal with the compound effects. (There will be other aspects to encode as well, like whether the effect needs a target object or monster, and of course the flavour text.)

I'll post the list of simple effects here before I commit anything, to check that it covers what people think might be needed. In the meantime, does anyone have any comments on this approach? Are there other things to take into account?
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline  
Old November 17, 2011, 11:10   #2
Djabanete
Knight
 
Join Date: Apr 2007
Posts: 576
Djabanete is on a distinguished road
Seems like a good idea to me, although to be honest I don't know anything.

Edit: off the top of my head:

Heal
Feed
Restore Mana
Decrease Poison
Heal Cutting
Heal Stunning
Remove Fear
Remove Blindness
Remove Confusion
Remove Hallucination
Heroism Buff
Blessing Buff
Res Pois/Fire/Cold/Acid/Elec Buff
Speed Buff
Djabanete is offline  
Old November 17, 2011, 11:27   #3
Timo Pietilä
Prophet
 
Join Date: Apr 2007
Location: Climbing up from hole I just dug.
Posts: 4,096
Timo Pietilä is on a distinguished road
Quote:
Originally Posted by Djabanete View Post
Seems like a good idea to me, although to be honest I don't know anything.

Edit: off the top of my head:

Heal
Feed
Restore Mana
Decrease Poison
Heal Cutting
Heal Stunning
Remove Fear
Remove Blindness
Remove Confusion
Remove Hallucination
Heroism Buff
Blessing Buff
Res Pois/Fire/Cold/Acid/Elec Buff
Speed Buff
Berserker buff
Protection from confusion (mushroom effect)
Protection from evil.
What about sprinting? I think that is something that can be stacked with haste?

Also bad effects, cause cuts/stunning/confusion/blindness/hallucination/fear/hunger (vomit)/paralyzation/slowness/terror (fear that can't be removed, currently joined with sprinting I think).

...I think that is close to full list.
Timo Pietilä is offline  
Old November 17, 2011, 12:26   #4
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 58
Posts: 9,526
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
This is (probably) a complete list of effects on the player - I think Magnate was after all effects, so including fire bolt, earthquake, aggravate, summon, restore life, etc etc

So for example *Destruction* is earthquake + mass banishment + remove items + blind.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline  
Old November 17, 2011, 12:33   #5
Djabanete
Knight
 
Join Date: Apr 2007
Posts: 576
Djabanete is on a distinguished road
It's more complicated than that, because Mass Banishment doesn't remove uniques while *Destruction* does, and Mass Banishment costs life while *Destruction* doesn't.
Djabanete is offline  
Old November 17, 2011, 12:39   #6
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 58
Posts: 9,526
Donated: $60
Nick will become famous soon enoughNick will become famous soon enough
Quote:
Originally Posted by Djabanete View Post
It's more complicated than that, because Mass Banishment doesn't remove uniques while *Destruction* does, and Mass Banishment costs life while *Destruction* doesn't.
Yes, that's what's known as a deliberate error to make a point.

*cough*
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline  
Old November 17, 2011, 13:11   #7
Djabanete
Knight
 
Join Date: Apr 2007
Posts: 576
Djabanete is on a distinguished road
Heh, well, the point was well-made in any case. I could imagine the "effects" library being quite extensive, allowing for some interesting possibilities. Traps, consumables, activations, and spells could become very easily modifiable, allowing both users and developers to make changes using only the edit files. New combinations could be tested by those who felt adventurous.

And in Variant Land, having a comprehensive library of effects could allow characters to create spells and items from within the game.
Djabanete is offline  
Old November 17, 2011, 16:02   #8
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,079
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Djabanete View Post
Heh, well, the point was well-made in any case. I could imagine the "effects" library being quite extensive, allowing for some interesting possibilities. Traps, consumables, activations, and spells could become very easily modifiable, allowing both users and developers to make changes using only the edit files. New combinations could be tested by those who felt adventurous.
That's the idea. I've been through the code and done a spreadsheet, and I think I can create every single current effect of items, monsters and spells from a set of 21 base effects:

Effects on grids (a grid is a square on the map):
- detect a grid
- modify the contents of a grid (create, destroy, or replace a feature e.g. wall with rubble)
- change the light level of a grid
- change the status of a door (locked, stuck, etc.)

Effects on objects:
- learn about an object (detection and ID)
- create an object
- destroy an object
- modify an object (i.e. change its to-hit, to-dam, base ac, to-ac, dice, sides, weight, extent)
- add, change or remove an object flag
- imbue an object with the ability to inflict a status change on the next monster it hits (i.e. Monster Confusion)

Effects on monsters:
- learn about a monster (detection and probing)
- create a monster (summon, clone, polymorph)
- change a monster status (stun, fear, confuse)
- change a monster quantity (hp, sleep depth, speed)
- change a monster location (which includes banishment)

Effects on @:
- change a flag-based status or quantity (i.e. speed, resists, fear, etc.)
- change a non-flag status (blind, paralyse, confuse, hallucination, amnesia, vomiting, poison)
- change a non-flag quantity (hp, mana, cuts, stun, food, to-hit, to-dam, ac)
- change a stat (including exp)
- protect from a monster flag (i.e. Protection from Evil)
- change location

This list actually condenses down further, if we consider that several of them are duplicates with different targets: learning about something, or changing a flag, a non-flag status, a quantity or a location. It condenses further still if we ignore the arbitrary distinction of which statuses and quantities happen to be associated with flags and which don't. We then end up with five basic effects:

- learn (or forget) about something
- create, destroy or replace something
- modify an attribute of something
- move something
- protect @ from something

Now, each of these effects needs to know an amount, a range, and a duration, as well as things like what the flag is and whether there's an applicable resistance or saving throw. But what this tells me is that the whole business of flags needs rationalising before trying to rewrite the effects framework ...

By the way, you're probably all wondering how all the bolts, balls, beams and breaths fit into this. Well they don't - they're projections, not effects. We must distinguish between the effects of a thing, and the mechanism that thing uses to deliver its effects. Above are the effects, which could be the result of projections, but need not be. For example, projecting an acid ball (whether from a wand or ring or spell) can modify the hp of monsters or the player if it hits them, as well as modifying the to-hit, to-dam or to-ac of objects it hits. Conversely, lots of effects don't require projections at all (e.g. earthquake, banishment).
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline  
Old November 18, 2011, 00:47   #9
Antoine
Ironband/Quickband Maintainer
 
Join Date: Nov 2007
Posts: 1,010
Antoine is on a distinguished road
I guess you'd want to make sure that (a) effects could still depend on stuff like Device skill, and (b) similar-sounding effects (like !CSW/_CSW/spell of CSW) could still have different consequences?

A.
__________________
Ironband - http://angband.oook.cz/ironband/
Antoine is offline  
Old November 18, 2011, 10:04   #10
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,079
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Antoine View Post
I guess you'd want to make sure that (a) effects could still depend on stuff like Device skill, and (b) similar-sounding effects (like !CSW/_CSW/spell of CSW) could still have different consequences?

A.
Funny you should say that. Takkaria has always been very keen on CLW being CLW, i.e. having exactly the same consequences whether it's from a spell, potion, staff or whatever. But yes, any modular/parseable effects system will let you define as many variations of CLW as you like.

Your other point is a good reminder - yes, we do want the variables in effects to be able to be adjusted by device skill (or whatever else) - I do need to bear in mind how to keep that simple.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Str effects Merlin Vanilla 2 May 5, 2011 06:18
Stat Effects Merlin Vanilla 5 April 26, 2011 21:31
Adding Effects to Angband PaulBlay Development 0 March 28, 2009 12:08
Question on Amnesia Effects APWhite Vanilla 3 October 30, 2008 01:36
bizzare effects (*spoilery*) will_asher Vanilla 6 May 23, 2008 10:56


All times are GMT +1. The time now is 22:02.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.