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

UI redesign and more

With lockdown (and some recent vacation), we’ve continued progress on HeroQuest UE4 in the month of June.

some highlights
* specify map in map.txt; instead of having to recompile C++ to change maps for debug
* implement disarm traps: the last missing action
* support individual hero spawns in HeroScribe XML
* falling rock fixes (falling block) for corner cases
* migrate from vs2017 to vs2019, update to latest LuaMachine and UE 4.25.1
* start revamping the UI
* spiffy continues working on LUA transcribing for expansion quests (pending commit)
* banana (friend of spiffy) (college student) joined Discord chat; he’s setup and discussed some ideas for what he can work on

Here’s a preview of the new UI:

image

The big change is that instead of having an oversized horizontal menu that covers the center of the screen (that blocks WASD QE input), it’s a horizontal bar on the bottom middle of the screen. For controller input (tested with xbox 360 controller), you can use dpad to navigate.  Keyboard supports arrow keys or 1234567890 hotkeys.  We plan to replace the "1M" etc with icons for move, character sheet, end turn, attack, etc.

Lua Progress and More

In the past few weeks, Spiffy has done a lot of work implementing and testing a first pass of the per-quest Lua for 00-HQBase_US (the base 14 quests), and he’s started on 01-KellarsKeep_US and 02-ReturnOfTheWitchLord_US.  Spiffy has more of an art background, and he’s motivated to learn more code, so I’ve been working with him in Discord chat.  It’s also motivated me to do some review; for example I’ve started reading foundationsofgameenginedev.com volume 1.  Actually, I’ve sometimes missed having study partners like I did in college and as a new grad to talk about material I’m learning or reviewing.

Spiffy has also reported and helped motivate me to fix a few small bugs and missing features.  Letters can be in hallway; Letter is associated with a square (in addition to a room).  Fix nullptr crashes.  Implemented DoorIn and DoorOut for Kellar’s Keep and Witchlord.  And others.

We’re using git on bitbucket, and he’s working in a separate branch, so I’ve been doing sync/merge in bitbucket.

image image

HeroScribe Pem’s Fork update

When I was chatting (in our Discord channel) to Spiffy about working on the Lua code, I noticed that in Quest 3, to find Ulag’s position (left top), is kind of kludge.  HeroScribe GUi doesn’t show it, so you have to count the squares in the GUI and/or search the XML to figure it out.  So I added it in the GUI.  It’s a small update, but it’s a great example where updating HeroScribe GUI is useful for writing the Lua code.  This will be used in HQBase-03-LairoftheOrcWarlord_US.xml’s function monster_dies(left, top) to determine whether the spawned monster is Ulag, and also for monster_dies(left, top).

image

Contributions from Spiffy coming; Lua related

Spiffy has joined (he emailed me from this blog).  I created a Discord channel that we’ve been using, and also wrote some new user wiki doc in the project’s bitbucket on how to setup the project (build/run), and how to use the git/bicketbucket flow (ie he will work in a separate git branch, then create a bitbucket pull request).

It’s been a while since I did any updates on HeroQuest UE4 (distractions from day job and personal life), but Spiffy has inspired me to do some more work this past week (amidst COVID-19 WFH), and also to help him to ramp up on implementing Lua code for quest-specific game rules/logic.  My recent changes include.  Fix crash when UMD is not plugged in.  Improve Lua support for _on_exit().  And Spiffy will implement more Quest-specific game logic using Lua.

Spiffy’s background is mostly in art for game development, and he is helping with HeroQuest UE4 to get more code exposure.

For example, HQBase-01-TheTrial_US.xml (HeroScribe XML) now has a corresponding HQBase-01-TheTrial_US.lua.  One of the functions in HQBase-01-TheTrial_US.lua is:

function on_exit()
    if (not g_bCanExit) then
        quest_print("can’t leave until you defeat Verag (a foul Gargoyle)")
    end
    return g_bCanExit
end

image

There’s also some related code that gets triggered whenever a monster dies:

function monster_dies(left, top)
    if (left == 13 and top == 9) then
        quest_print("Verag, a foul gargoyle, was slain.")
        g_bCanExit = true
    end
end

And here is the first Lua function which Spiffy has added:

function intro()
    quest_print_intro("Quest 1", "The Trial", "You have learned well, my friends.  Now has come the time of your first trial. You must first enter the catacombs which contain Fellmarg’s Tomb. You must seek out and destroy Verag, a foul Gargoyle who hides in the catacombs. This quest is not easy and you must work together in order to survive. This is your first step on the road to becoming true Heroes. Tread carefully my friends.")
end

If you are interested in contributing to HeroQuest UE4, please contact me – http://mepem.com/pemcode/?page_id=995

Quest-specific game logic using Lua

One of the big missing pieces to make the game truly playable (instead of just a prototype) is quest specific game logic.  Quests are defined by HeroScribe XML, which lacks quest text (including specific game rules).  Here’s an example of quest text from Quest 1 (from a PDF):

image

To allow custom maps, and to make the design cleaner, quest specific logic should be an extension to HeroScribe XML.  Luckily someone added a simple LuaMachine plugin for UE4 that makes it really easy to do this.  So I started integrating that.

For example, I have HQBase-01-TheTrial_US.xml which has a corresponding HQBase-01-TheTrial_US.lua.  At this point, there are no modifications to the XML file.  When the game opens quest foo.xml, it looks for an optional corresponding foo.lua.  Here is a simplified example:

local HeroScribeQuest = {}

function HeroScribeQuest.special_treasure(id)
    if (id == "LetterF") then
        quest_print("The weapons on this weapons rack are chipped, rusted, and broken.  There is nothing here that the Heroes would want.")
        return true
    end
    print(id)
    return false
end

return HeroScribeQuest

special_treasure() is a callback from UE4, while print() is a call into UE4.  So this demonstrates two-way communication between UE4 and Lua.  If there’s no Lua file, no special_treasure() in the Lua file, or special_treasure() returns false, then the game draws a treasure card.

Typically when special_treasure() returns true, that means it also did something.  Typically that something is to display quest text using quest_print() which displays text using UMG.  And to give the hero an item (or gold).  For our first example, there is no item, so we just call quest_print():

image

special_treasure() takes argument id.  “LetterF” comes from standard HeroScribe XML test.xml.  When the game loads the XML, if it finds a letter in a room, it associates the room with that letter.  Then when a hero searches that room for treasure, the game passes that letter (eg “LetterF”) to special_treasure().  For testing, I used HeroScribe (Pem’s Fork) to add the letter F to the starting room:

image

This was all made possible (and easy) using the LuaMachine UE4 plugin.

https://www.unrealengine.com/marketplace/en-US/slug/luamachine
> Contrary to the other Unreal Engine 4 Lua plugins, this one does not try to expose the Unreal Engine 4 api, but completely hides it exposing to the user/scripter only the features the developer decided to include (via Blueprints or C++).
> Currently Windows 64bit, Mac, Linux 64bit (both Runtime and Editor) , Android, iOS (Runtime only) are supported.
> Scripts can be cooked in the build or loaded at runtime from the filesystem

As described in the above quote, LuaMachine is exactly what I was looking for!

Preview of HeroQuest UE4 (Windows package)

Most of the basic functionality is there, but it’s missing:
1) Ability to complete a quest, carry on to the next quest, maintain state cross-quest, save/load progress, related menu system.
2) Quest-specific logic.  I plan to implement a scripting interface as an extension to HeroScribe XML.
3) Quest-specific monsters, monster spells
4) AI has much room for improvement.
5) Sound effects.

So it’s more of a prototype than a complete game, but enough of it’s working that you can at least get a feel for it.

HeroQuest UE4 package 2019-04-18

The download (Win64.exe) is a self-extracting executable package built for Windows (64-bit).  I can post other platforms if someone requests it.  I’ve also included my modified HeroScribe package (HeroScribePem.exe) (HeroScribePem.jar requires Java) with XML map files (xml sub-folder).

If you have basic programming skills (or know someone) and are motivated to contribute, please contact me.  You don’t necessarily need to know UE4 or C++ (or Blueprints), but you’d need sufficient skill in OO programming (eg Java, C#, Python) (and are motivated to learn).

VR drag camera, misc

I made some time (during the holiday weekend) to work on VR mode.

I added dragging drag camera based on this tutorial: https://www.youtube.com/watch?v=XgGGBQc6fVM&feature=youtu.be -> https://imgur.com/a/L2Ild

I also added prototype motion controller input support.  It’s just a low-effort implementation that re-uses the existing UMG menus.  Later I’ll add something more VR friendly (spatial interactions).  Eg user can point-trigger a 3d icon to select an action.  Eg user can do things like spatially drag-and-drop Hero pieces for move, physically point-trigger on monsters/heroes to select targets, etc.

I’m posting this update because the video shows tangible progress on better VR support.

I also did some non-VR changes including:
* upgrade to 4.21
* multi-move is faster (less delays)
* when nothing is selected, space/enter does Back (faster menu navigation)
* update treasure card mesh to use tex v that’s better for pot of speed (UK png)
* back from atk was broken no UMG focus; fix in HqTurnMenuBp > Turn Menu Camera Enable
* fix action atk enter; HqTurnMenuBp > Key Down Helper > Action Attack Menu needed Return Node is Handled

When recording the VR preview (with OBS Studio), I kept getting Oculus Rift Sensor errors (which didn’t happen when I wasn’t recording).  So the videos are a bit choppy, but it’s enough to get the idea.  The drag-camera (and the more accurate scale) makes the VR experience a lot better, so I’ll be excited to add more VR mode interactions in the future.

VR scale to real world objects (HeroQuest)

I noticed the board/pieces in VR were too big, so I shrunk everything by 10x.  Under map > Settings > World Settings > VR > World to Meters: changed from 100 to 1000.  This looks/feels a lot more practical.  To go a step further, I compared the Elf to the motion controller at 10x (real vs. virtual):

IMG_20181123_1448324 image IMG_20181123_1452047

While my 10x wild guess was surprisingly close (to real world object physical size), I found that 9x is even closer:

IMG_20181123_1507131 image image image

In terms of the 80/20 rule (Pareto principle), 9x looks very accurate.

Fast Forward (Time Warp)

There are many times when…  If Zargon doesn’t have an upcoming turn, then rolling move dice for movement to position Heroes can get tedious (to the point of absurdity).  To solve the problem, we sort of fast forward through Hero moves (when Zargon doesn’t have an upcoming turn or potential event/trap trigger).

For ex, when a room is empty, the player may reposition the heroes before we search for treasure.  Or reposition the heroes before opening a door.  Or before opening a door, we could (roll move, skip turns, repeat) until we roll a 12 (two sixes), so we just say “auto 12”.  Or walking down an empty hallway (no monsters, we already searched for traps).  In these scenarios, fast forwarding (compared to going through the motions) doesn’t change the decisions/outcome made by the player; it just makes these parts of the game less tedious.

When play-testing the video game port, I ran into the same concern.  So I’ve added fast forwarding logic to make the experience smoother (less tedious).  So far what I’ve implemented includes:
) FastForwardIsAllowed() – checks whether fast forward is allowed.  Currently it just checks (are there any spawned monsters) and (is fast forward blocked by a special event, because certain quests have events that prevent fast forward).
) FastForwardIsAllowed() => Roll auto 6’s for move.  Skips dice roll sequence (physics/animation).  This simulates (move roll, end turn x4) until all 6’s is achieved.
) FastForwardIsAllowed() => Don’t gray out Move/Action.  This simulates (end turn x4) to get back to the current Hero’s turn.

Implementing these two fast forward scenarios dramatically improves the experience.

An additional fast forward idea (I didn’t implement it yet) is:
) FastForwardIsAllowed() and there’s no traps (or unsearched squares) in the way => allow Move warp

image

map bounds (wooden exit door)

Expansion maps starting with Kellar’s Keep and Witchlord have an alternate exit.  Instead of the staircase, you can exit on the edge of the map through a wooden exit door.  You can also enter the map via a metal entrance door.

I refactored the array bounds from (0-25,0-18) to (0-27,0-20) so that we can have a map border to let heroes enter/exit from map edge.  This allows us to use the existing move (and path finding) logic.  Later I will extend this with a special case such that walking through a wooden exit door exits the map (ends the quests).

image

Next Page »

Check out best marijuana drug testing website.