Ludii Forum
Hnefatafl - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Suggestions (https://ludii.games/forums/forumdisplay.php?fid=10)
+--- Forum: Games to Include (https://ludii.games/forums/forumdisplay.php?fid=12)
+--- Thread: Hnefatafl (/showthread.php?tid=7)



Hnefatafl - unhandyandy - 11-30-2019

Hnefatafl is the subject of ongoing exploration at

http://aagenielsen.dk/hnefatafl_online.php

Where is a good place to discuss errors in the rules (.lud) files?  I've found a few in Brandubh.

Am I right that the optional rules system has not yet been implemented in the player?


RE: Hnefatafl - DennisSoemers - 11-30-2019

Ah hmm I see we do not yet have a forum section dedicated to reporting issues for existing games. I suppose you might as well post any issues you've found for Hnefatafl games in this thread right here, and for now create new threads under "General Discussion" for any issues found in other games. Until we have a dedicated forum section for issues in existing games, that is.

If a .lud file includes several Options, they should also be accessible from the menubar, as described in our User Guide (accessible from: https://ludii.games/). The user guide was written for version 0.2.0 and not yet updated, but the mechanism for options in games has not really changed since then as far as I'm aware.


RE: Hnefatafl - Eric Piette - 11-30-2019

Yes could you describe what are the problems with Brandubh?


RE: Hnefatafl - unhandyandy - 11-30-2019

1. In all variations of Brandub, the thralls cannot move to the corners.
2. In most variations of Brandub, the king can return to the center.

Here's a modified lud, see if I did it right.


Code:
(game "Brandub" 
  (players 2) 
  (equipment {
    (taflBoard 7)
  (define "custodial" (custodial (lastToMove) Orthogonal limit:1 of:(isPiece (to) #1) by:(or {(isFriend (who (step))) (in (step) (corners)) (and (in (step) (centre)) (isZero (what (step))))}) effect:(remove (to))))
    (piece "Thrall" P1 (slide Orthogonal along:(in (step) (empty))
    toRule:(not (in (to) (union (centre) (corners))))
    (then
      (or {
      ("custodial" "Thrall2")
      (surrounded (lastToMove) Orthogonal
    of:(and (isPiece (to) "Jarl2") (in (to) (expand origin:(middle) 1 Orthogonal)))
    by:(or (isFriend (who (step))) (in (step) (centre)))
    effect:(checkmate P2)
      )
      (custodial (lastToMove) Orthogonal limit:1
    of:(and (isPiece (to) "Jarl2") (not (in (to) (expand origin:(middle) 1 Orthogonal))))
    by:(or (isFriend (who (step))) (in (step) (corners)))
    effect:(checkmate P2)
      )
    }
    )
    )
    )
  )
    (piece "Thrall" P2 (slide Orthogonal along:(in (step) (empty))
    toRule:(not (in (to) (union (centre) (corners))))
    (then ("custodial" "Thrall1") ) ) )
    (piece "Jarl" P2 (slide Orthogonal along:(in (step) (empty))  (then ("custodial" "Thrall1") ) ))
  }
  ) 
  (rules
    (start
    {
      (fill "Thrall1" {"D1" "D2" "A4" "B4" "F4" "G4" "D6" "D7"})
      (fill "Thrall2" {"D3" "C4" "E4" "D5"})
      (place "Jarl2" (middle))
    }
    )
   
    (play (byPiece))
   
    (end
    {
    (if (reachedRegion (indexOf "Jarl2") (corners) ) (result P2 Win))
    (if (isCheckmate P2)  (result P1 Win))
    }
    )
  )
  )

(option <1> "Rules/ReturnToThrone" <>)
(option <1> "Rules/NoReturnToThrone" <toRule:(not (= (to) (middle)))>)

(metadata
  { "rules" "The rules of Brandub are described in http://tafl.cyningstan.com/page/171/brandub."}
  { "source" "http://tafl.cyningstan.com/page/171/brandub"}
  { "P1Colour" "Black" }
  { "P2Colour" "White" }
  )



RE: Hnefatafl - Eric Piette - 12-01-2019

1. In all variations of Brandub, the thralls cannot move to the corners.

True, I fixed that in our official lud file, you will be able to see that in the next version.

2. In most variations of Brandub, the king can return to the center.

Maybe but not in our source: http://tafl.cyningstan.com/page/171/brandub
Do you have another source for that? In that case I can add an option to allow this possible modification of this rule.


And yes your file is correct and works Smile


RE: Hnefatafl - unhandyandy - 12-01-2019

There are lots of rule sets linked here:

http://aagenielsen.dk/tafl_rules.php

The tournaments at that site are partially intended to test rule variations, which are constantly being tweaked.