March '21: Blog Birthday! 2 years old

Published April 10, 2021
Advertisement

Another year and it's definitely been a weird one. Since the last blog birthday post here it's been Covid lockdown basically the entire time. It's eased up some in the past few months but not like the before times. At least I have an appointment for a vaccine shot tomorrow. The last couple months especially have seemed harder to work on this project than before. Maybe ‘cause I’m not hitting targets or some low level burn out. Or maybe it's the other way around, not hitting targets cause I haven't been motivated. I really try to do something every couple of days at least, write some code or fiddle with blueprints even if there's no check in to source control. There's at least some sort of progress towards one.

I've talked before about what I've found to be the upsides to this project compared to my team-based professional work, primarily ability to just execute on things and less stress since no one else is expecting anything from me. In the last couple of months I've also hit more on one of the downsides of missing the collaboration sometimes required to even have a reasonable plan to execute on. The upside is I have some fantastic colleagues that are willing to indulge me a bit and chat about my project and let me bounce stuff off them. It helps that this project is sort of designed to act as a testbed in some ways to a lot of the core custom tech (not UE4 specifically) is similar enough that I can translate the problem pretty directly. But there's always stuff that takes more time to explain that a team member that was working on the project with me would already know. I don't believe there's really anything to be done about it, just an observation really.

Birthday Stats!

I would have liked to build a table here, but that didn't seem to be a formatting option. I've included the prior year stats at the bottom of this post for easy reference (as well as in the same format for easier comparison)

Year 2

  • Last Source Control Changelist: #1421
  • Total Check-ins: 605
    • 578 SRPG changes
    • 12 check-ins merging my custom plugins to a common depot and back out to other projects
    • 15 Race for the Galaxy side-side project changes
  • Project Size
    • SRPG
      • 396 source files (+191)
      • 307 content files (+166)
    • StrategyTech Plugin
      • 128 source files (-7)
      • 2 content files
    • HistoryTech Plugin (split off from StrategyTech)
      • 118 source files
      • 0 content files
    • CoreTech Plugin
      • 92 source files (+54)
      • 2 content files
  • Big Ticket Items
    • More Strategy Systems (Repairs, Ship Configuration, Research, Squadrons)
    • Status Effects
    • New Task Tracking tool: Codecks.io viewable here
    • Published a K2 Node Tutorial (available here on Gamedev.net)
    • Text Injection support (to support dynamic game values being inserted into display strings)
    • Dialog Boxes
    • Content Validation Utilities (Redscreens, AssetChecks, etc)
    • Engine Upgrade

Recap

  • Custom method for blueprint delegate binding
  • Continue work on Squadrons gameplay
  • Revisit Tactical HUD UI organization

Results

Things went pretty well. I didn't get quite as far with the squadron gameplay as I might have liked but all the progress that was made was really good.

Tactical HUD

I did make a pass on the layout for my tactical HUD, it doesn't really look any different but it's going to be much easier to use and extend in the future.

Custom Delegate Binding

Recently with the amount of UI work I was doing (primarily with the Squadron Management screen) I was getting a bit irritated when working with delegates in blueprint. So I decided to try my hand at a custom node (no big deal for me at this point) that used a custom display node (what!?) with a bit of custom Slate (aaahhhh!).

What my node looks like (top) vs the stock UE4 Engine solution

On the bottom you can see the two nodes UE4 provides to bind to a delegate and to specify the delegate. On the top is my custom node that turns both options into dropdowns on the same node and then takes both the owner of the delegate and the object to call as inputs. I think it does a really great job of making those things easier to use as well as making it faster because you can copy/paste my ‘Bind Delegate’ node and change the thing your binding to instead of having to use the right click menu every time.

Now that I've got that working, I sort of want to revisit the nodes for my custom event manager so that those registrations don't need delegate pins either. But it's something for the backlog.

Squadrons

Like I said, I didn't get as far as I wanted to get on this as I would have liked. The main reason was that a number of systems required refactors to make adding squadrons a reasonable proposition. In a couple cases I had sort of planned for this and left myself extension points, but it turned out that by the time I got here I understood the problem better then I did at that time and decided I needed a different solution. But ultimately the step that I was able to accomplish was being able to launch a squadron on to the map from one of my ships.

Here's the flow that I settled on for how this works

Here's the regular tactical view, with the various abilities of the currently selected ship.
When you hover a squadron launching ability, buttons appear to select which squadron you wish to launch. Tiles also become highlighted to show you where this launcher is allowed to deploy the squadron.
As you hove the squadron button, the tooltip provides information with the squadron name and type. The potential destination tiles remain highlighted.
Clicking on one of the squadron buttons starts the actual targeting sequence to select the tile you want to deploy the squadron to.
Finally the action visualizes and the squadron is in the tile selected.

You'll probably notice the information banner above the squadron in the last image doesn't make any sense. Work in progress, whatcha going to do. Originally I was hoping to have a system so that if a ship had multiple options for launching squadrons (think Battlestar Galactica launching fighters from both sides at the same time) you'd only need one button. But I ran into a number of technical issues with that and so settled on this as a solution. The more I thought about it, the more I've reconsidered and think this will be closer to the long term solution. Since each launcher could have it's own set of cooldowns and other limitations, it would likely be hard to show all that data for all the launchers coherently with one button.

A surprising thing that working on the Squadrons feature brought up was that I really wish I had a savegame system available. Getting to the point where I could test this was a little onerous. Alternately I could have spent time getting my configuration setup so that I could actually launch PIE and have valid squadrons to deploy, but that seemed like a real distraction. Way more effort than what I was expending to test what I wanted to be building. Eventually I will need that so that randomly spawned (enemy) ships can have strikecraft, but not now. The good news is that with my model-view-controller setup it should be very easy to save out the 2 or 3 objects that contain all the game data worth saving. Also, once I have saves working Tactical MP is theoretically trivial although I think I have made some expediency decisions that I'd have to rectify to really make it work.

Source Code Organization

One really great discovery while hanging out in the Unreal Slackers discord was the CPP macro that UE4 defines. You can use it like:

#if CPP
...
#endif

to write code that is hidden from the Unreal Build Tool (UBT) pre-process pass.

I've always found it annoying that Unreal was so strict about things like “the generated.h include must be the last one” because it meant that I couldn't include any header files later on. Why might one do that? Well I like to include a .hpp at the end of headers that has all the implementations of template functions. This way I get the organization benefits of a cpp file while meeting the compilation requirements of templates. But with that macro, I can wrap the include in the #if block and UBT doesn't complain at all. This contributed a number of new files to the project source file counts which is why they went up so much. And why the StrategyTech plugin only went down 7 files when the HistoryTech plugin, which was split off from it, started out with 118 files.

K2 Node Tutorial

Shortly after posting my last update where I lamented a bit on the lack of any real feedback to my tutorial, I was browsing through one of the game dev reddits and was elated to see that someone responded to a question with a link to my tutorial! It's not quite the same thing, but it definitely made me feel better about the time I spent writing it.

Goals

  • Continue Squadron work to get them playable in tactical
    • Mostly UI work
    • Still need to do something about names
    • Still need a real construction UI, and not the console command

Changelog

  • 1378 Initial branch/edit of the CreateDelegate node and SlateWidget
  • 1379 Get the dupes of CreateDelegate compiling.
  • 1380 Make a formatting pass on the branched versions of CreateDelegate kismet and slate nodes code.
  • 1381 Working implementations for the combined Add & Create Delegate node.
  • 1382 Rename the new delegate files as BindDelegate to match in Editor display name.
  • 1383 Oops, a reverse loop should use -- not ++.
  • 1384 Tweaks to the Definition Library to a) prevent definitions from being GC'd unexpectantly and b) to properly update it's cache of definitions when one is deleted in the Content Browser.
  • 1385 Make a pass on UI blueprints and swap in the new CreateWidget and BindDelegate nodes.
  • 1386 Do some renaming on the tactical side from Weapon->Module & Hardpoint -> SlotIndex
  • 1387 Tweak the weapon state creation at the start of tactical to be delegated to the module instead of the starship knowing how to transform a module into game states.
  • 1388 Create a new module type for squadron related modules (at least ones that should cause state objects to be created for the squadrons).
  • 1389 Create a new pawn type for squadrons. Create a temporary pawn blueprint for squadrons. Hook up the temp blueprint to each of current strikecraft types.
  • 1390 First pass on constructing tactical gamestates for tracking squadron data.
  • 1391 First pass pawn construction for squadrons.
  • 1392 Make some adjustments to how the tactical hud organizes the weapon buttons. Now they're discarded and recreated when the selection changes. Control bars have also been updated to be horizontal box inside of a vertical box instead of nested canvas panels. Also added a sized spacer so that odd numbered weapon counts offset the weapon controls to properly tile with the general control bar.
  • 1393 Tweak the targeting events and the responsibilities of each layer of the weapon activation controls.
  • 1394 Tweak the weapon activation to allow UI to prepopulate the targets a bit.
    • Create some new buttons for alternate action and weapon buttons.
  • 1395 Correct the filetype settings for asset and maps so that they're exclusive checkout.
  • 1396 Update the filetypes for the plugins and other projects
  • 1397 Do a bit more refactoring of responsibilities from the old weapon button to the derived versions
  • 1398 Shift some bits of the weapon widget into native so that native has a hook for type specifications.
  • 1399 Don't use work patterns for member declarations. Definition references should be hard references.
  • 1400 Create a cost that can check against launch capacity.
    • Create a new effect that can deploy a squadron into space.
    • Create a "weapon" that can deploy a squadron into space.
    • Create a unique game state for managing squadron launching actions.
  • 1401 Take advantage of the CPP define to move template implementations out of direct headers.
  • 1402 missed a new template implementation header.
  • 1403 This implementation header should include state frames since anyone using the template should be able to just call it when including the header.
  • 1404 Properly init the maximum launch capacity of the weapon.
  • 1405 Move the weapon button click handler up to the supported weapon widget.
  • 1406 Move a private helper function into the implementation header instead of the public one.
  • 1407 Add the display interface to squadrons.
    • Shift tooltip assignment up from the action button to the support and squadron buttons.
    • Initialize squadron buttons for each of the squadrons that are embarked on the starship.
  • 1408 Get the tooltip and hover display working properly for the squadron launcher button.
  • 1409 Create a new primary object targeting style that can be used when the target is system controlled instead of user controlled.
  • 1410 Improvements to the manual primary tile target so that it functions better as the controlling style of weapon targeting.
  • 1411 New hex utility that can determine the hex direction between two tiles (at least when they're one tile apart).
  • 1412 New utility for performing the comparisons supported by the EStatCompare enumeration.
  • 1413 Create a new condition that can be used to check the number of squadrons held by a starship.
  • 1414 Update the effect that can launch a squadron. Update the orientation of the squadron based on direction between the source and destination.
  • 1415 Minor updates to how starship and squadron orientation is handled.
  • 1416 Updates to the squadron launching "weapon" to use updated targeting styles and conditions.
  • 1417 Updates to the squadron launcher UI button so that it can force the primary target to a specific squadron.
  • 1418 Make unregistering by handle invalidate the event listener handle. Update for compilation errors. Update to remove manual handle invalidations.
  • 1419 Fix conditional that should have been reversed when removing an ensure. Remove another manual handle invalidation.
  • 1420 Remove a LoadSynchronous call and instead apply an asset bundle in the right place.
  • 1421 Add new stats for strikecraft. Update definitions with unbalanced data. Add various stats tracking.

Prior Year Project Stats

Year 1

  • Last Source Control Changelist: #816
  • Total Check-ins: 364
    • 360 SRPG changes
    • 4 Armada tool changes
  • Project Size
    • SRPG
      • 205 source files (+61)
      • 141 content files (+61)
    • StrategyTech Plugin
      • 135 source files (-27)
      • 2 content files (+2)
    • CoreTech Plugin
      • 38 source files (+20)
      • 2 content files (+2)
  • Big Ticket Items
    • Transaction System
    • Strategy Game Mode
    • Custom K2 knowledge building
    • Tactical Mission Generation & Scripting Frameworks

Year 0

  • First Control Changelist: #452
  • Project Size
    • SRPG
      • 141 source files
      • 80 content files
    • StrategyTech Plugin
      • 162 source files
      • 0 content files
    • CoreTech Plugin
      • 18 source files
      • 0 content files
Previous Entry February '21 Update
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement