top of page

Curve Tables in Unreal

In typical fashion, I figured this out through blind guessing mostly, before finding a tutorial by BEN.UI.

https://benui.ca/unreal/curve-tables/ I wanted to store a link basically. His tutorial is better, but just in case site goes down, here is the short form.

The node 'Evaluate Curve Table Row' is like the 'Get Datatable Row struct' node, but for the float curve type of data, instead of for the spreadsheet cell entries type of data. Float curves are often used for animation timing, but they also map well onto experience progression or stats.


An example curve table with rows stacked so you can compare them. They can also be overlapped.

This method of using curves can replace purely numerical lists like the Datatable case above, and the curve acts as its own visualizer too.


Apparently you can import CSV into the curve table but it probably has to be formatted just right (haven't tried). There's some info on limitations of doing so here: https://benui.ca/unreal/curve-tables/#imported-csv-curve-table-limitations 

My needs are sufficient to just make the curve data directly in unreal, and I only have to manage one curve table for all the data instead of lots of individual data table assets. A drawback is the entry order in the CurveTable is fixed once entered. It seems Epic hasn't added the usual drag to reorder functionality in this asset type's UI (yet).

All these Data Table assets can effectively live in one Curve Table.

To use curve data, create an asset in Content Browser of type Misc > Curve Table. Add some entries like ArcherShootDistancePerLevel or PotionHPRecoveryBonusPerLevel.

For the row's curve entry, add keyframes (you can add just two at either end of the X range) or you can add as many keys as you feel necessary to create the level progression balance you want. There's a few standard curve display icons to fit the results on screen and to snap, but nothing too tricky. It's standard unreal stuff.

Once you have a Curve Table with some Row entries, and they have some values, you use the 'Evaluate Curve Table Row' node in blueprint to get the value at a given level (or whatever you're using the curves for). The point is, you can look up any of the curves in the table and get their value at any time.


So, there's a point of confusion in how this node looks. Here's "jevincherries', whose video led me to this feature, getting confused: https://youtu.be/NkJU7BzJW_U?feature=shared&t=2185. This confusion struck me also, but I'd already made my curve table and really wanted to use it, so I dug in. I couldn't find any other node that looked relevant. Basically, the pins "In XY" and "Out XY" have bad naming. It should just be "Time" and "Value". All this node does is return the graph Value at the input Time.


Note, if you were using a Timeline to lerp the "In XY" value on Update, you could get a changing value "OutXY" to potentially animate from. I don't know what Context String is for -- let me know if it matters. It doesn't seem to. Maybe it has to do with the Curve Editor Filters?

In the use case below, we get ArcherCurrentLevel (as float Curve X) and that is matched to the 0-10 time dimension of the graph (I made it so there's 10 levels and 10 seconds on the graph, but you could map 0-1 and level 0-100 and do some range mapping math or whatever. Anyway, at level 1, the expected value is 133.0 and that's what the curve gives us at 1.0s for the "Out XY" value.

Despite the confusing float pin names, what's cool about this node is once the Curve Table pin is filled, the Row Name becomes a drop down that shows all the asset's row entries:

Why do it this way? As well being fast to set up, the balance from a curve is very easy to adjust for the entire range, unlike a range distributed over many spreadsheet cells. This matters where you want to permit regular adjustments to fine tune the stats and level progression, or you want a super clean shape to the values over time. Being able to compare several curves in the same place is convenient.


A caveat of using Evaluate Curve Table Row is that if that Curve Table asset's rows get renamed, any reference to the row get scrubbed in the blueprint node dropdown, leaving a glaring unassigned value for Row Name. It might be better if any renaming would be handed off to nodes using the renamed row, as is normal elsewhere in unreal.

Comments


Featured Posts
Recent Posts
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page