Author Topic: crown holder question  (Read 2264 times)

Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
crown holder question
« on: August 11, 2015, 09:53:25 AM »
I played a bit yesterday and i picked up the crown, then i faced some enemies and tried to kill them, but i lost the fight (luckily i was big, 800huc, so lost just 1 "life" and successfully banked the crown later)

I encountered some afk during the way, and tried to kill them, but my destruct was a failure, this is what rised a bell ring in my head and i went to check the source on github to find out that (correct me if i'm wrong) crownholder can't attack, his attack is completly skipped (i even thought about some bugs or some nasty thing happening before guessing the cause)

now: this may have been my fault not knowing it (i don't remember having read it anywhere, but maybe it's always been that way since the begin, but if it confuses me, then i can't imagine new players) but what i find wrong is that the game allowed me to spend (several times, doh!) the 20 huc fee to perform destruct and i consider this a bug or at least a big trap (along with not informing players about game rules)

To inform players about the fact that crownholders can't destruct, the game should prevent destructing at first place, informing the player and preserving his coins too


so to summarize:
- daemon should rise error if crownholder perform a move that have a destruct into it, preserving to accept the transaction (of course i can implement a check on my client but this is a "business rule" that should be handled by the daemon)
- players need to know about this rule (i didn't found it wrote anywhere, link me to the right place in case i missed it, anyway for a new player this isn't something he know. while not knowing about the fact that the crown has not a carry capacity cap (because it's not a constraint), not knowing that he can attack is very nasty


Probably with the next fork we would remove the fee problem, hopefully, implementing timers, but about the "crown holder can't attack" rule i'm wondering, why prevent crownholder to attack? what's the rationale behind? a crownholder can't then defend himself and has just to run away? Shouldn't we allow him to attack?



P.S.
this is the code part (at the end) where i see crown holder can't harm anyone:

Code: [Select]
CharactersOnTiles::ApplyAttacks (const GameState& state,
                                 const std::vector<Move>& moves)
{
  BOOST_FOREACH(const Move& m, moves)
    {
      if (m.destruct.empty ())
        continue;

      const PlayerStateMap::const_iterator miPl = state.players.find (m.player);
      assert (miPl != state.players.end ());
      const PlayerState& pl = miPl->second;
      BOOST_FOREACH(int i, m.destruct)
        {
          const std::map<int, CharacterState>::const_iterator miCh
            = pl.characters.find (i);
          if (miCh == pl.characters.end ())
            continue;
          const CharacterID chid(m.player, i);
          if (state.crownHolder == chid)
            continue;

that           if (state.crownHolder == chid)
            continue;
« Last Edit: August 11, 2015, 09:54:57 AM by Mithril Man »
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: crown holder question
« Reply #1 on: August 11, 2015, 10:01:05 AM »
update:
looking at the github repository history it seems it has been always this way, so i totally missed that detail (never fought with a crown on me) but what i wrote above is still valid:

- it's hard to know the rule (pls give a link if i'm wrong) for any kind of player
- with current "20 fee for destruct" this is something nasty that should be prevented
- does it still makes sense? I think actually crown holder should be able to attack, moreover with future armor/ammo (if we want to penalize somewhay the crown holder pvp power, we could limit his ammo/armor but anyway i think we shouldn't)
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

domob

  • Developer
  • Sr. Member
  • *****
  • Posts: 284
    • View Profile
Re: crown holder question
« Reply #2 on: August 11, 2015, 10:56:45 AM »
Hm, good catch.  The check was originally in there to prevent the crown-holder from self-destructing.  This was meant as a way to "avoid" handing over the crown to an alter-ego, which can be used to bank the coins without banking the crown.  It never really worked, though, because people would just hold the crown with a hearted player and destruct the general.

This explanation is now mostly moot with life-steal, so we may change it.
Use your Namecoin-ID as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | HBkxA5QmYSATFoPN1wFk8eBkgwPpY97Mfu

Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: crown holder question
« Reply #3 on: August 11, 2015, 11:22:16 AM »
Hm, good catch.  The check was originally in there to prevent the crown-holder from self-destructing.  This was meant as a way to "avoid" handing over the crown to an alter-ego, which can be used to bank the coins without banking the crown.  It never really worked, though, because people would just hold the crown with a hearted player and destruct the general.

This explanation is now mostly moot with life-steal, so we may change it.

ok thanks i understand the reason it was implemented. yes indeed the intention were good but exploitable and now self-defeating

another strange thing i forget to say:
when i killed the crownholder, i was on his same cell (see block 826540 on https://www.huntercoin.info/explorer in the south-west big area near the center, i was noo and the crown holder was api9)
on previous block (826539) you can see we better, one next to the other

on 826540 i was on the same cell, then on 826541 destruct happened (actually destruct first, then move, so the kill was on that cell)
ok the "strange" thing is that coins were left behind, while crown was on my head

I know that in those scenario you miss the coins, but i'm not sure this is right and i think it would be better to collect them (so maybe it involves again how operation are sorted), what do you think? because at least in this scenario it sounds odd that you kill the crown holder, grab the crown, but "forget" to take the coins too :)
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: crown holder question
« Reply #4 on: August 12, 2015, 08:55:47 PM »
update:
i taken again the crown, and i observed better the behaviour: when i killed the crown holder, both coins and crown were dropped on the ground (so i didn't had it on) and that's fine (i thought i had already the crown just for having killed him, anyway maybe now it would have made sense)

anyway the bug is: crownholder left 157 coins on the floor, when i went over the cell, i took the crown and 100huc, while 57 were left down

i think again this is an issue about gamestate operation order, probably you enforce the carry capacity limit before considering the change of crown holder, i consider that a bug because it enforce the hunter to wait 2 blocks (but if you set a path that's not possible) or move and waste 3 blocks to go back on that cell for the second time

now i don't have time to check the code but i'm pretty sure that was what happened

Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

domob

  • Developer
  • Sr. Member
  • *****
  • Posts: 284
    • View Profile
Re: crown holder question
« Reply #5 on: August 13, 2015, 06:12:39 AM »
anyway the bug is: crownholder left 157 coins on the floor, when i went over the cell, i took the crown and 100huc, while 57 were left down

i think again this is an issue about gamestate operation order, probably you enforce the carry capacity limit before considering the change of crown holder, i consider that a bug because it enforce the hunter to wait 2 blocks (but if you set a path that's not possible) or move and waste 3 blocks to go back on that cell for the second time
Yes, this is true.  I think changes of the crown state or processed last.  This is not a bug, but just the way the code was designed (already originally).  However, if you think it should be otherwise, you can, of course, suggest a change.
Use your Namecoin-ID as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | HBkxA5QmYSATFoPN1wFk8eBkgwPpY97Mfu