Skip to content

Commit

Permalink
update site
Browse files Browse the repository at this point in the history
  • Loading branch information
jagt committed Feb 15, 2023
1 parent fa26a00 commit 1ff454e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
9 changes: 5 additions & 4 deletions dataconfig/Advanced/NoMetaData.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,29 +147,30 @@ <h1 class="menu-title">DataConfig Book</h1>
<div id="content" class="content">
<main>
<h1 id="no-metadata"><a class="header" href="#no-metadata">No MetaData</a></h1>
<p>Some DataConfig behaviors take advantage of <a href="https://docs.unrealengine.com/en-US/metadata-specifiers-in-unreal-engine/">property metadata</a>, notable the default <code>DcSkip</code> metadata to let DataConfig ignore a property:</p>
<p>Some DataConfig behaviors take advantage of <a href="https://docs.unrealengine.com/en-US/metadata-specifiers-in-unreal-engine/">property metadata</a>. For example the default <code>DcSkip</code> metadata let DataConfig ignore marked property:</p>
<pre><code class="language-c++">// DataConfigTests/Private/DcTestProperty3.h
UPROPERTY(meta = (DcSkip)) int SkipField1;
</code></pre>
<p>However the metadata would be stripped in packaged builds, meanwhile the <code>FProperty::GetMetaData/HasMetaData()</code> methods would be gone. The state is roughly like this:</p>
<p>However the metadata would be stripped in packaged builds and <code>FProperty::GetMetaData/HasMetaData()</code> set of methods would be gone. The state is roughly like this:</p>
<ol>
<li>In <a href="https://docs.unrealengine.com/en-US/packaging-unreal-engine-projects/">packaged builds</a> there's no metadata C++ methods nor any data.</li>
<li>Program targets can choose whether to keep metadata methods by setting <code>bBuildWithEditorOnlyData</code> in <code>Target.cs</code>. This toggles macro <code>WITH_EDITORONLY_DATA</code>.
However the actual metadata would <em>not</em> be auto loaded.</li>
<li>In editor metadata works as intended.</li>
</ol>
<p>In release 1.4.1 we fixed compilation on <code>!WITH_EDITORONLY_DATA</code>. This would allow you to include <code>DataConfigCore</code> as a runtime module and ship it with your project. This is an intended and supported use case.</p>
<p>However some builtin DataConfig features are affected in builds with no metadata.</p>
<p>However with no metadata some default DataConfig behaviors would be different:</p>
<ul>
<li>All builtin metas (<code>DcSkip/DcMsgPackBlob</code>) are ignored.</li>
<li>Bitflag enums (<code>UENUM(meta = (Bitflags))</code>) are ignored. All enums are now treated as scalar.</li>
</ul>
<p>The good news is that DataConfig allows you to workaround this <a href="../Programming/SerializerDeserializer.html">by writing custom serialization handlers</a>. For example for bitflag enums:</p>
<p>The good news is that you can workaround this <a href="../Programming/SerializerDeserializer.html">by writing custom serialization handlers</a>. For example for bitflag enums:</p>
<ul>
<li>Name your bitflag enums with a prefix like <code>EFlagBar</code> and check for it in predicates.</li>
<li>Collect a list of bitflag enum names and test for it in predicates.</li>
<li>On serializing <code>PeekRead</code> for next data entry. If it's a <code>ArrayRoot</code> then treat it as a bitflag enum.</li>
</ul>
<p>Note that you should be able to implement these without modifying <code>DataConfigCore</code> code.</p>

</main>

Expand Down
9 changes: 5 additions & 4 deletions dataconfig/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -2856,29 +2856,30 @@ <h2 id="coercion"><a class="header" href="#coercion">Coercion</a></h2>
</code></pre>
<p>Note that <code>FDcPropertyBuilder</code> would create a heap allocated <code>FProperty</code> and <code>LinkOnScope()</code> returns a <code>TUniquePtr</code>. You might want to cache the properties if used repeatedly.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="no-metadata"><a class="header" href="#no-metadata">No MetaData</a></h1>
<p>Some DataConfig behaviors take advantage of <a href="https://docs.unrealengine.com/en-US/metadata-specifiers-in-unreal-engine/">property metadata</a>, notable the default <code>DcSkip</code> metadata to let DataConfig ignore a property:</p>
<p>Some DataConfig behaviors take advantage of <a href="https://docs.unrealengine.com/en-US/metadata-specifiers-in-unreal-engine/">property metadata</a>. For example the default <code>DcSkip</code> metadata let DataConfig ignore marked property:</p>
<pre><code class="language-c++">// DataConfigTests/Private/DcTestProperty3.h
UPROPERTY(meta = (DcSkip)) int SkipField1;
</code></pre>
<p>However the metadata would be stripped in packaged builds, meanwhile the <code>FProperty::GetMetaData/HasMetaData()</code> methods would be gone. The state is roughly like this:</p>
<p>However the metadata would be stripped in packaged builds and <code>FProperty::GetMetaData/HasMetaData()</code> set of methods would be gone. The state is roughly like this:</p>
<ol>
<li>In <a href="https://docs.unrealengine.com/en-US/packaging-unreal-engine-projects/">packaged builds</a> there's no metadata C++ methods nor any data.</li>
<li>Program targets can choose whether to keep metadata methods by setting <code>bBuildWithEditorOnlyData</code> in <code>Target.cs</code>. This toggles macro <code>WITH_EDITORONLY_DATA</code>.
However the actual metadata would <em>not</em> be auto loaded.</li>
<li>In editor metadata works as intended.</li>
</ol>
<p>In release 1.4.1 we fixed compilation on <code>!WITH_EDITORONLY_DATA</code>. This would allow you to include <code>DataConfigCore</code> as a runtime module and ship it with your project. This is an intended and supported use case.</p>
<p>However some builtin DataConfig features are affected in builds with no metadata.</p>
<p>However with no metadata some default DataConfig behaviors would be different:</p>
<ul>
<li>All builtin metas (<code>DcSkip/DcMsgPackBlob</code>) are ignored.</li>
<li>Bitflag enums (<code>UENUM(meta = (Bitflags))</code>) are ignored. All enums are now treated as scalar.</li>
</ul>
<p>The good news is that DataConfig allows you to workaround this <a href="Advanced/../Programming/SerializerDeserializer.html">by writing custom serialization handlers</a>. For example for bitflag enums:</p>
<p>The good news is that you can workaround this <a href="Advanced/../Programming/SerializerDeserializer.html">by writing custom serialization handlers</a>. For example for bitflag enums:</p>
<ul>
<li>Name your bitflag enums with a prefix like <code>EFlagBar</code> and check for it in predicates.</li>
<li>Collect a list of bitflag enum names and test for it in predicates.</li>
<li>On serializing <code>PeekRead</code> for next data entry. If it's a <code>ArrayRoot</code> then treat it as a bitflag enum.</li>
</ul>
<p>Note that you should be able to implement these without modifying <code>DataConfigCore</code> code.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="automation"><a class="header" href="#automation">Automation</a></h1>
<p>One thing we find that's really important when maintaining DataConfig across multiple UE versions, is that proper automation is a must. On this page we document how to run the bundled automation tests.</p>
<p>Note that all instructions shown here are using Windows with a Cmd shell. You'll need to adapt to your system setup.</p>
Expand Down
2 changes: 1 addition & 1 deletion dataconfig/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dataconfig/searchindex.json

Large diffs are not rendered by default.

0 comments on commit 1ff454e

Please sign in to comment.