Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old February 27, 2015, 10:37   #21
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,605
PowerWyrm is on a distinguished road
Just a little gameplay change I've noted, which is probably due to changing "do_poly" from integer to boolean. This change even occured before 3.5, so it's unrelated to the restructure.

Prior to 3.5, "do_poly" was an integer, the polymorphing effect was using "p_ptr->lev" to compute the chance of a monster resisting it:
- dam = p_ptr->lev
- do_poly = dam
- savelvl = randint1(MAX(1, do_poly - 10)) + 10

In 3.5, "do_poly" was changed into a boolean without anything else changed. This made the formula bugged (the second affectation probably turns do_poly to 1 on most systems), making savelvl always equal to 11.

In the latest code, the formula was simply changed to "savelvl = 11".

This change wasn't probably intended?
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old February 27, 2015, 11:15   #22
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,647
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
Just a little gameplay change I've noted, which is probably due to changing "do_poly" from integer to boolean. This change even occured before 3.5, so it's unrelated to the restructure.

Prior to 3.5, "do_poly" was an integer, the polymorphing effect was using "p_ptr->lev" to compute the chance of a monster resisting it:
- dam = p_ptr->lev
- do_poly = dam
- savelvl = randint1(MAX(1, do_poly - 10)) + 10

In 3.5, "do_poly" was changed into a boolean without anything else changed. This made the formula bugged (the second affectation probably turns do_poly to 1 on most systems), making savelvl always equal to 11.

In the latest code, the formula was simply changed to "savelvl = 11".

This change wasn't probably intended?
Yes, indeed. This particular effect has a long and complicated history, and it's not clear which bits are intentional. It does need sorting out.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old February 27, 2015, 14:41   #23
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,605
PowerWyrm is on a distinguished road
Another glitch due to the restructure in project_m():

Code:
if (monster_handler != NULL)
  monster_handler(&context);

/* Force obviousness for certain types if seen. */
if (gf_force_obvious(typ) && context.seen)
  context.obvious = TRUE;
Before the restructure, the "obviousness when seen" line was the first line processed for each type. Therefore these two bits of code should be reversed. Check for example project_monster_handler_OLD_DRAIN():

Code:
static void project_monster_handler_OLD_DRAIN(project_monster_handler_context_t *context)
{
	if (context->seen) {
		rf_on(context->l_ptr->flags, RF_UNDEAD);
		rf_on(context->l_ptr->flags, RF_DEMON);
	}
	if (monster_is_nonliving(context->m_ptr->race)) {
		context->hurt_msg = MON_MSG_UNAFFECTED;
		context->obvious = FALSE;
		context->dam = 0;
	}
}
With this code, nonliving monsters will erroneously identify a wand of drain life when before they didn't.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old February 27, 2015, 22:08   #24
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,647
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
Before the restructure, the "obviousness when seen" line was the first line processed for each type. Therefore these two bits of code should be reversed.

With this code, nonliving monsters will erroneously identify a wand of drain life when before they didn't.
Ah yes, thanks - I thought there was still something not quite right there.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old March 2, 2015, 13:10   #25
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,605
PowerWyrm is on a distinguished road
In project_m(), GF_ flags with no associated handlers are not processed anymore. Before the restructure, there was a big switch with a default section at the end:

Code:
switch (typ)
{
    case GF_MISSILE (and all obvious effects): ...
    case GF_FIRE (and all handled effects): ...
    default: context.skipped = TRUE; context.dam = 0;
}
This default section is now missing. To fix that, maybe add something like:

Code:
if (!gf_force_obvious(typ) && (monster_handler == NULL))
{
    context.skipped = TRUE;
    context.dam = 0;
}
after calling monster_handler().
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 2, 2015, 20:02   #26
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,647
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
This default section is now missing. To fix that, maybe add something like:

Code:
if (!gf_force_obvious(typ) && (monster_handler == NULL))
{
    context.skipped = TRUE;
    context.dam = 0;
}
after calling monster_handler().
Actually there are no null monster handlers now, just some empty ones, so I guess the thing is just to set
Code:
    context.skipped = TRUE;
in all those.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old March 4, 2015, 15:15   #27
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,605
PowerWyrm is on a distinguished road
In dice_parse_state_transition(), there's no way to add a "bonus" part when the spell has a random component. For example, PWMAngband has an elemental bolt spell which fires four bolts, one of each element. I've tried "dice:$Dd8+m4" to be able to display "dam 5d8x4", but the state_table doesn't allow that (only "base" + "bonus" is allowed, like for Meteor Swarm).

Here's an updated, more complete state_table:

Code:
static unsigned char state_table[DICE_STATE_MAX][DICE_INPUT_MAX] =
    {
        /* Input:                                -+dm$DU0 */
        /*[DICE_STATE_START] = */       /* A */ "B.EHKB..",
        /*[DICE_STATE_BASE_DIGIT] = */  /* B */ ".CE..B.C",
        /*[DICE_STATE_FLUSH_BASE] = */  /* C */ "..EHKD..",
        /*[DICE_STATE_DICE_DIGIT] = */  /* D */ "..E..D..",
        /*[DICE_STATE_FLUSH_DICE] = */  /* E */ "....KF..",
        /*[DICE_STATE_SIDE_DIGIT] = */  /* F */ ".G.H.F.G",
        /*[DICE_STATE_FLUSH_SIDE] = */  /* G */ "...H....",
        /*[DICE_STATE_BONUS] = */       /* H */ "....KI..",
        /*[DICE_STATE_BONUS_DIGIT] = */ /* I */ ".....I.J",
        /*[DICE_STATE_FLUSH_BONUS] = */ /* J */ "........",
        /*[DICE_STATE_VAR] = */         /* K */ "......L.",
        /*[DICE_STATE_VAR_CHAR] = */    /* L */ ".CEH..LM",
        /*[DICE_STATE_FLUSH_ALL] = */   /* M */ "........"
    };
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 4, 2015, 16:44   #28
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,605
PowerWyrm is on a distinguished road
Bah, there's also a Thunderstorm spell that uses the format "dice:$B+$Dd$S+m8" to display something like "dam 100+5d6x8" and that still doesn't work because the dice parser doesn't expect a "+" after anything else than the "base" value. For PWMAngband, I've simple hacked the parser to be able to use "-" as separator between dice and bonus so that the "dice" component is properly flushed.

The state table becomes:

Code:
static unsigned char state_table[DICE_STATE_MAX][DICE_INPUT_MAX] =
    {
        /* Input:                                -+dm$DU0 */
        /*[DICE_STATE_START] = */       /* A */ "B.EHKB..",
        /*[DICE_STATE_BASE_DIGIT] = */  /* B */ ".CE..B.C",
        /*[DICE_STATE_FLUSH_BASE] = */  /* C */ "..EHKD..",
        /*[DICE_STATE_DICE_DIGIT] = */  /* D */ "..E..D..",
        /*[DICE_STATE_FLUSH_DICE] = */  /* E */ "....KF..",
        /*[DICE_STATE_SIDE_DIGIT] = */  /* F */ "G..H.F.G",
        /*[DICE_STATE_FLUSH_SIDE] = */  /* G */ "...H....",
        /*[DICE_STATE_BONUS] = */       /* H */ "....KI..",
        /*[DICE_STATE_BONUS_DIGIT] = */ /* I */ ".....I.J",
        /*[DICE_STATE_FLUSH_BONUS] = */ /* J */ "........",
        /*[DICE_STATE_VAR] = */         /* K */ "......L.",
        /*[DICE_STATE_VAR_CHAR] = */    /* L */ "GCEH..LM",
        /*[DICE_STATE_FLUSH_ALL] = */   /* M */ "........"
    };
And I can use "dice:$Dd8-m4" for Elemental Bolt and "dice:$B+$Dd$S-m8" for Thunderstorm.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 4, 2015, 17:12   #29
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,605
PowerWyrm is on a distinguished road
And it doesn't work...

I also need to declare the expression as "S-" instead of "S" because the parser considers the minus sign as a digit and not an operator.
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old March 4, 2015, 19:55   #30
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,647
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by PowerWyrm View Post
And it doesn't work...
Once you have it working, I'm happy to just slot it right in - part of the point of all this as the z-* files at least should not need to be changed for variants.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Reply


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
Restructure update Nick Development 80 February 25, 2015 20:56
Ladder restructure request OOD Town drunk Vanilla 7 April 4, 2013 16:11
Implementing different difficulty levels Greebley Vanilla 14 January 11, 2012 14:39


All times are GMT +1. The time now is 11:37.


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