Skip to content

Commit de6a654

Browse files
committed
[DOCS] improved glossary, added saving process and fixes
1 parent 63f0fe2 commit de6a654

12 files changed

Lines changed: 130 additions & 57 deletions

File tree

Docs/_glossary.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
##### Record
22
Contains a block of serialized information.
33
Each actor, component or level have an assotiated record containing its saved information.
4+
5+
##### Serialize, Serialization
6+
Process of converting memory from an object or struct into binary data

Docs/assets/styles.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

2-
@font-face { font-family: 'Lovelo'; src: url('Fonts/Lovelo-Black.otf') format('opentype'); }
3-
@font-face { font-family: 'Lovelo Line'; src: url('Fonts/Lovelo-LineBold.otf') format('opentype'); font-weight: bold; }
4-
@font-face { font-family: 'Lovelo Line'; src: url('Fonts/Lovelo-LineLight.otf') format('opentype'); }
2+
@font-face { font-family: 'Lovelo'; src: url('fonts/Lovelo-Black.otf') format('opentype'); }
3+
@font-face { font-family: 'Lovelo Line'; src: url('fonts/Lovelo-LineBold.otf') format('opentype'); font-weight: bold; }
4+
@font-face { font-family: 'Lovelo Line'; src: url('fonts/Lovelo-LineLight.otf') format('opentype'); }
55

6-
@font-face { font-family: 'Century Gothic'; src: url('Fonts/Gothic.ttf') format('truetype'); }
7-
@font-face { font-family: 'Century Gothic'; src: url('Fonts/Gothic-Bold.ttf') format('truetype'); font-weight: bold; }
8-
@font-face { font-family: 'Century Gothic'; src: url('Fonts/Gothic-Italic.ttf') format('truetype'); font-style: italic; }
9-
@font-face { font-family: 'Century Gothic'; src: url('Fonts/Gothic-BoldItalic.ttf') format('truetype'); font-weight: bold; font-style: italic; }
6+
@font-face { font-family: 'Century Gothic'; src: url('fonts/Gothic.ttf') format('truetype'); }
7+
@font-face { font-family: 'Century Gothic'; src: url('fonts/Gothic-Bold.ttf') format('truetype'); font-weight: bold; }
8+
@font-face { font-family: 'Century Gothic'; src: url('fonts/Gothic-Italic.ttf') format('truetype'); font-style: italic; }
9+
@font-face { font-family: 'Century Gothic'; src: url('fonts/Gothic-BoldItalic.ttf') format('truetype'); font-weight: bold; font-style: italic; }
1010

1111

1212
:root {

Docs/index.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@
5151
pre: '',
5252
style: 'text-align: center;'
5353
},
54+
'flexible-alerts': {
55+
style: 'flat'
56+
},
5457
plugins: [
5558
EditOnGithubPlugin.create(
5659
"https://github.com/PipeRift/SaveExtension/blob/main/Docs/",
5760
"https://github.com/PipeRift/SaveExtension/edit/main/Docs/",
5861
"<img class='emoji' src='https://github.githubassets.com/images/icons/emoji/memo.png' alt='memo'> Edit"),
59-
Glossary.create({})
62+
Glossary.create()
6063
],
6164
mustache: {
6265
data: ['https://raw.githubusercontent.com/PipeRift/SaveExtension/main/SaveExtension.uplugin']
@@ -70,10 +73,10 @@
7073
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-csharp.min.js"></script>
7174
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-cpp.min.js"></script>
7275

73-
<link rel="stylesheet" href="unpkg.com/@fortawesome/fontawesome-free/css/fontawesome.css" />
74-
<link rel="stylesheet" href="unpkg.com/@fortawesome/fontawesome-free/css/brands.css" />
75-
<link rel="stylesheet" href="unpkg.com/@fortawesome/fontawesome-free/css/regular.css" />
76-
<link rel="stylesheet" href="unpkg.com/@fortawesome/fontawesome-free/css/solid.css" />
76+
<link rel="stylesheet" href="//unpkg.com/@fortawesome/fontawesome-free/css/fontawesome.css" />
77+
<link rel="stylesheet" href="//unpkg.com/@fortawesome/fontawesome-free/css/brands.css" />
78+
<link rel="stylesheet" href="//unpkg.com/@fortawesome/fontawesome-free/css/regular.css" />
79+
<link rel="stylesheet" href="//unpkg.com/@fortawesome/fontawesome-free/css/solid.css" />
7780

7881
<!-- Plugins -->
7982
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
@@ -84,6 +87,7 @@
8487
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/front-matter.min.js"></script>
8588
<script src="//cdn.jsdelivr.net/npm/docsify-mustache"></script>
8689
<script src="//unpkg.com/docsify-fontawesome/dist/docsify-fontawesome.min.js"></script>
90+
<script src="//unpkg.com/docsify-plugin-flexible-alerts"></script>
8791

8892
<script src="//unpkg.com/mermaid/dist/mermaid.js"></script>
8993
<script src="//unpkg.com/docsify-mermaid@latest/dist/docsify-mermaid.js"></script>
@@ -96,8 +100,8 @@
96100
darkMode: true
97101
},
98102
flowchart:{
99-
htmlLabels:true,
100-
curve:'linear',
103+
htmlLabels: true,
104+
curve: 'linear',
101105
},
102106
});
103107
</script>

Docs/quick-start/first-steps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ To be able to save, we will need to:
4242
3. Assign the preset inside Project Settings
4343
![Assign Preset](img/default-preset.png)
4444

45-
{% hint style='hint' %} For detailed info see [**Save Presets**](presets.md) and [**Filters**](filters.md) {% endhint %}
45+
?> For detailed info see [**Save Presets**](presets.md) and [**Filters**](filters.md)
4646

4747
## Marking variables to be saved
4848

Docs/quick-start/presets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The preset can also be changed from blueprints in runtime calling:
3131

3232
![INSERT DETAILS SCREENSHOT HERE]()
3333

34-
{% hint style='hint' %} All settings have defined tooltips describing what they are used for. Check them moving your mouse over the property. {% endhint %}
34+
?> All settings have defined tooltips describing what they are used for. Check them moving your mouse over the property.
3535

3636
* **Gameplay**: Configures the runtime behavior of the plugin. Debug settings are also inside Gameplay. [Check Saving & Loading](saving&loading.md)
3737
* **Serialization**: Toggle what to save from the world.

Docs/resources/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Under *Project Settings* -> *Game* -> *Save Extension: Default Preset* you will
1616

1717
This default settings page is useful in case you have many presets, or in case you have none (because without any preset, default is used).
1818

19-
{% hint style='hint' %} All settings have defined tooltips describing what they are used for. Check them moving your mouse over the property. {% endhint %}
19+
?> All settings have defined tooltips describing what they are used for. Check them moving your mouse over the property.
2020

2121
* **Gameplay**: Configures the runtime behavior of the plugin. Debug settings are also inside Gameplay. [Check Saving & Loading](saving&loading.md)
2222
* **Serialization**: Toggle what to save from the world.

Docs/resources/loading-process.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
# Loading
2-
Loading is divided in the following stages:
2+
Loading is divided in many stages.
33

4+
*Note: Dot lines(- - - -) mean concurrency*
45
```mermaid
56
flowchart LR
67
classDef CEntry stroke:#ea9999;
78
8-
A[Start]:::CEntry --> B[<b>Notify</b><br>OnLoadBegin]
9+
A[Start]:::CEntry --> B[<b>Notify</b><br>OnLoadBegan]
910
B --> Load
10-
Load --> C[<b>Notify</b><br>OnLoadFinish]
11+
Load --> C[<b>Notify</b><br>OnLoadFinished]
1112
C --> D[Done]
1213
1314
subgraph Load [ ]
14-
LoadB{Is at map?}:::CEntry;
15+
LoadA[Load Info]:::CEntry -.-> LoadB{Is at map?};
16+
LoadA -.-> LoadG[Load Data]
1517
LoadB -->|No| LoadC[Load Map];
16-
LoadB -->|Yes| LoadD[Bake Filters];
17-
LoadC --> LoadD;
18+
LoadC --> LoadMapLoaded
19+
LoadB -->|Yes| LoadMapLoaded;
20+
LoadMapLoaded[ ] -.-> LoadWait(( ))
21+
LoadG -.-> LoadWait
22+
LoadWait --> LoadD[Bake Filters];
1823
LoadD --> LoadE[Prepare Levels];
1924
LoadE --> LoadF[Deserialize World];
20-
21-
click LoadE "./?id=deserialize-world" "Deserialize World" _blank
2225
end
2326
```
2427

28+
2529
## Bake filters
2630
In this step, all level filters and the general one are baked.
2731
We need this to check which actors to prepare in each level, and how to deserialize.
@@ -47,5 +51,16 @@ flowchart LR
4751
This is where the magic happens. The system goes through each actor to be loaded and deserializes its data from its record.
4852
```mermaid
4953
flowchart LR
50-
A[Deserialize Game Instance] --> B[Deserialize Actors];
54+
classDef CEntry stroke:#ea9999;
55+
56+
A[Deserialize Game Instance]:::CEntry --> Loop;
57+
Loop{Levels left?} -->|No| Done
58+
Loop -->|Yes| DeserializeLevel
59+
60+
subgraph DeserializeLevel [Deserialize Level]
61+
LevelB -->|Loop all saved actors| LevelA;
62+
LevelA[Deserialize Actor]:::CEntry --> LevelB[Deserialize Actor Components];
63+
end
64+
65+
DeserializeLevel --> Loop;
5166
```

Docs/resources/multithreading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This means platforms with many cores like modern CPUs will obtain very noticeabl
2626

2727
This method is only available if [Multithreaded Serialization](#multithreaded-serialization) is disabled.
2828

29-
{% hint style='danger' %} Frame Splitting is not recommended if level streaming saving is enabled. It could be interrupted while loading or saving creating unexpected issues {% endhint %}
29+
!> Frame Splitting is not recommended if level streaming saving is enabled. It could be interrupted while loading or saving creating unexpected issues
3030

3131
![Frame-splitted Serialization](./img/frame-splitted_serialization.png)
3232

Docs/resources/saving-process.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,43 @@
11
# Saving
2+
Saving is divided in many stages:
23

3-
Saving is divided in multiple stages:
4+
*Note: Dot lines(- - - -) mean concurrency*
5+
```mermaid
6+
flowchart LR
7+
classDef CEntry stroke:#ea9999;
8+
9+
A[Start]:::CEntry --> B[Delete old save];
10+
B --> C[<b>Notify</b><br>OnSaveBegan];
11+
C -.-> D[Capture Thumbnail];
12+
C -.-> E[Capture stats];
13+
E --> SerializeWorld[Serialize World];
14+
SerializeWorld --> H[<b>Notify</b><br>OnSaveFinished];
15+
H --> End;
16+
```
17+
18+
## Capture thumbnail
19+
Runs independently from the rest of the save process. An screenshot of the desired characteristics will be queued in ue4's system and then saved with its correct name after x frames.
20+
21+
## Capture stats
22+
Store game time, current map, filters and more inside a new SlotData object.
23+
24+
## Serialize World
25+
We iterate all actors to be saved and serialize each of them.
426

527
```mermaid
6-
graph LR
7-
A[Start] --> B{Valid Map?};
8-
B -->|Yes| D[Prepare Levels];
9-
B -->|No| C[Load Map];
10-
C --> D;
11-
D --> E[Deserialize];
28+
flowchart TB
29+
classDef CEntry stroke:#ea9999;
30+
31+
A[Bake Filters]:::CEntry --> Levels;
32+
subgraph Levels [Serialize Levels]
33+
subgraph Level [Serialize Level]
34+
LevelB -->|Loop all saved actors| LevelA;
35+
LevelA[Serialize Actor]:::CEntry --> LevelB[Serialize Actor Components];
36+
end
37+
38+
Level -->|Loop all levels| Level;
39+
end
40+
Levels --> Done
1241
```
42+
43+
If **MultithreadedSerialization** is *SaveAsync* or *SaveAndLoadAsync*, actors to be deserialized will be distributed between all available threads.

Docs/src/glossary.js

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,62 @@ let Glossary = {
1212

1313
let termTexts = text.split('#####');
1414
termTexts.forEach((termText) => {
15-
if (termText.length <= 5) { // If it can't possibly contain a term, skip
15+
if (termText.length <= 1) { // If it can't possibly contain a term, skip
1616
return;
1717
}
1818

1919
// Parse the term and its content
20-
let title = termText.split('\n', 1)[0].trim();
21-
let id = title.toLowerCase().replace(' ','-');
20+
let titles = termText.split('\n', 1)[0].split(',');
21+
if(titles.length <= 0) {
22+
return;
23+
}
24+
let id = titles[0].trim().toLowerCase().replace(' ','-');
2225
let content = termText.substr(termText.indexOf('\n') + 1).trim();
2326
content = content.replace("\r\n\r\n", "\n");
2427
if (content.length > 200) {
2528
content = content.substring(0, 200) + "...";
2629
}
27-
window.$docsify.terms[title] = {
28-
id: id,
29-
content: content
30-
};
30+
31+
titles.forEach((title)=> {
32+
window.$docsify.terms[title.trim()] = {
33+
id: id,
34+
content: content
35+
};
36+
});
3137
});
3238
});
3339
};
3440

3541
let addLinks = (content,next,terms) => {
42+
let lines = content.split('\n');
43+
3644
for (let term in terms) {
3745
console.log(term);
3846

3947
let regex = new RegExp(`\\b${term}\\b`,'ig');
40-
content = content.replace(regex, (match) => {
41-
let termData = terms[term];
42-
return `[${match}*](/_glossary?id=${termData.id} "${termData.content}")`;
48+
49+
let isBlock = false;
50+
lines.forEach((line, index) => {
51+
// Ignore titles
52+
if(line.startsWith('#')) {
53+
return;
54+
}
55+
56+
// Ignore blocks of code or graphs
57+
if(line.startsWith('```')) {
58+
isBlock = !isBlock;
59+
return;
60+
} else if(isBlock) {
61+
return;
62+
}
63+
64+
lines[index] = line.replace(regex, (match) => {
65+
let termData = terms[term];
66+
return `[${match}*](/_glossary?id=${termData.id} "${termData.content}")`;
67+
});
4368
});
4469
}
70+
content = lines.join('\n');
4571
next(content);
4672
};
4773

0 commit comments

Comments
 (0)