Posts RSS Comments RSS Digg Technorati Blinklist Furl reddit 65 Posts and Comments till now
This wordpress theme is downloaded from wordpress themes website.

Archive for November, 2016 (2016/11)

Treasure Rules

The American rulebook states a room may be searched by all 4 Heroes:


The European rulebook does not state this, but it’s reasonable to infer that you can only search a room for treasure once.  The idea that each hero would find different treasure searching the same room is wonky.  I suspect that the European version intended this, then when it was ported to the American version they saw the rule was unclear, they saw the rule was unclear, they may have thought it meant infinite treasure searches, then they changed it without realizing the consequences.

Allowing all four heroes to search every room has some bad consequences:

1) If the players want to optimize their results, they’ll wait until the end of the quest and then do a painful treasure card grind that takes longer than the actual quest.  Searching each room for treasure four times can be slow due to wandering monsters.

2) More treasure cards means you get gold faster, which means characters max out their armory purchases too fast.  This makes the game less fun because part of the fun is “leveling up” the heroes.

3) More treasure cards means you end up with too many treasure potions.  It’s tedious writing these on the character sheet.  It makes the heroes invincible because you always have a bunch of healing potions in case of death.

Despite the flaws of the original HeroQuest, my HeroQuest simulator is all about nostalgia.  For that reason, I stick to the original rules as much as possible.  However, interpretation is required because there’s two versions of the official rules (American and European) (plus expansions clarify rules) (plus non-English versions may have slight rule variations and/or rules wording), and because some rules are not clear.  There’s also cases where I think of a rule as a “bug” (which is why I added the anti door camping rule).  When in doubt, I strive to stay faithful to the source material but lean towards interpreting the rules to improve the overall game experience.  For that reason, I’m going with (one treasure search per room).

Beyond this, I may add some conservative tweaks for the purpose of improving the overall experience.  Some ideas:

1) Start of Zargon’s turn any room with no monsters that hasn’t been searched for treasure spawns a treasure goblin.  This avoids the end of quest treasure grind and adds a little difficulty.

2) Basic expansion artifacts can be reused once per quest.  This gives heroes more opportunity to permanently “level up” instead of hording one-time-use potions and items.

3) When entering the Elf expansion, the Elf gets all 8 spell cards and the Wizard gets all 12 elemental spell cards.  The advanced expansions are hard (especially with less potions).  Plus this avoids the Elf spells not getting used – it’s no fun making the player pick 3 out of 8 elf spells and have to give up the elemental (typically Earth) spells.  Access to new stuff is a big part of what makes the expansions fun.

But I’ll come back to these ideas later after the implementation is further along and I’ve done more play testing.

Treasure Cards

In HeroQuest, the Hero’s turn is (Move then Action) or (Action then Move).  The six actions are – attack, spell, search traps, search doors, search treasure, disarm trap.  The latest I’m working on is search for treasure.  You can only search rooms for treasure (no corridors).  When you search a room for treasure, you either get special treasure or a random treasure card.  I implemented support for drawing a card from a treasure card deck.

OpenGL vs. UE4

My first thought with the deck was that if this were OpenGL then I might draw the entire deck in a single draw call.  Each card is only 24 verts (6 sides * 4 per verts side), so 24 cards is 24*24 = 576 verts.  I could use a single texture atlas for the draw call, and each card’s vert’s texture coordinates define which card it is.  I used SpriteSheetPacker to generate the texture atlas png (and uv txt) (my treasure card scans can be crammed in one or two 2048×2048 textures).

Each card needs independent transformations (just simple translation and rotation), so I could do that similar to skeletal animation see ( ).  My GLSL VS would just have (uniform mat4 Bone[24];) – one mat4 for each of 24 cards.  Each vert would have a boneIdx param that specifies which mat4 to use.

So to do this in UE4, I implemented a material that did rotation and translation.  However, I ran into a problem – it broke up the lighting.  I thought the issue might be that the normals so I tried doing VertexNormalWS > RotateAboutWorldAxis_cheap > output Normal to match what I output for Absolute World Position > RotateAboutWorldAxis_cheap > World Position Offset.  I read that inverse transpose of the model view matrix is not required for basic rotation, but I tried that anyway by implementing my own matrix math for rotations in material nodes (blueprints).

I did rotation experiments with a white sphere and it didn’t seem to work as I expected.  I may come back to this idea later, but I realized that for a reasonable authentic implementation of the HeroQuest, I don’t really need to render 24 cards with independent transformations.  So I moved on to a simpler implementation (at least for the short-term).

UE4 Implementation

Instead of 24 actors I have three actors – deck, card, and discard pile. I created a Blueprint actor "deckBp" which can resize (ie shrink when the player draws a card). In the level editor, I placed a deckBp for treasure deck main and for discard. The level Blueprint’s BeginPlay resizes these to 24 cards and 0 cards. My C++ code can reference treasure main deck and discard deck (pile) via the level Blueprint.

When the player draws a card, it shrinks the deck by one card then does a simple transformation lerp’ed over time in Tick(). Placing the treasure card draw destination relative to the camera doesn’t make sense because the player can move the camera, so the destination is to rotate the card 180 degrees and place it above the current turn player. The card sits there (so the player can read it) until the player clicks the card (or types space / enter / gamepad-A), then it lerp-translates to the discard pile (and the discard pile grows).  Here’s a video of it in action: