Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example level improvements #311

Merged
merged 17 commits into from
Nov 13, 2024
Merged

Conversation

Th3Fanbus
Copy link
Contributor

Please see individual commit messages.

@budak7273
Copy link
Member

Requires #310 to be merged first otherwise the buildings are inside the block

Th3Fanbus and others added 16 commits November 11, 2024 08:27
Enable OFPA (One File Per Actor) for ExampleLevel as it is intended to
be used with version control systems, such as Git. This should make it
possible for multiple contributors to work on ExampleLevel at the same
time, and should also allow reordering commits in a patch train.

Signed-off-by: Angel Pons <[email protected]>
The mesh for the Bacon Agaric consumable was changed in Update 1.0 but
the Bacon Agaric spawner in ExampleLevel still referenced the old mesh
(which no longer exists). Switch to the new mesh to be able to see the
Bacon Agaric again.

Signed-off-by: Angel Pons <[email protected]>
Flower Petals got removed in the 1.0 update. Since there is no spawner
bush for Mycelia, turn the Flower Petals bush into a Mycelia bush.

Signed-off-by: Angel Pons <[email protected]>
There are two pickups for berries in the level, and neither of them is
visible or usable. Set up meshes for one plant so that it can be used.

There is a second berry pickup used to group all the plant pickups. As
this makes adjusting its position extremely annoying, simply remove it
and put the plant pickups in a subfolder.

Signed-off-by: Angel Pons <[email protected]>
The manually placed Geyser's mesh was an eighth of its size for some
reason. Reset the scale to 1 and tweak the vertical position so that
the Geothermal Generator can still be placed on it.

Signed-off-by: Angel Pons <[email protected]>
Add FGWorldScannableData.cpp provided by Archengius in [1], and update
FGDropPod.cpp and FGItemPickup.cpp to save the actor GUID during cook,
borrowing the PreSave checks from the CSS implementation.

With these changes, custom pickups and drop pods should work properly,
and collecting them should not result in errors like this:

> Found ItemPickup with invalid GUID: "BP_WAT1_C_UAID_309C23A421C2842302_1988312689". WorldScannableData may need to be regenerated.

In order for custom levels to make use of this system, there has to be
a subclass of `AFGWorldScannableDataGenerator` inside the level during
cook time. The following commit will update ExampleLevel accordingly.

[1]: https://discord.com/channels/555424930502541343/1036634533077979146/1293718867553554472

Signed-off-by: Angel Pons <[email protected]>
Since Somersloops and Mercer Spheres are used in 1.0 for some things,
add some pickups in ExampleLevel. Add them as magic plant pickups and
as shrines (as found in base game). Some things are still a bit rough
around the edges, though: the shrines don't properly respond when the
pickup is collected. But the maddening voices can be heard. Don't let
them *CONSUME* your sanity, though...

Signed-off-by: Angel Pons <[email protected]>
Looks like the Nitrogen resource wells now use their own meshes, since
the emanating gas visuals is now implemented using a material. Because
of this, the Nitrogen resource wells in ExampleLevel looked incorrect.

Adjust ExampleLevel's fracking nodes to account for this new mesh, and
make sure the materials are right. Furthermore, as ExampleLevel spawns
two resource wells for each resource descriptor, turn one of them into
the desert variant. This requires creating some material instances for
desert Crude Oil nodes as the game doesn't have them.

Signed-off-by: Angel Pons <[email protected]>
The Blueprint spaghetti that handled dynamic resource nodes did not
account for mesh scale and offset, and Crude Oil nodes had problems
with the decal being too small and too tall. To make matters worse,
SAM nodes used the Limestone mesh with a pre-1.0 material.

Instead of making the spaghetti even worse, rip it all out and make
use of a map to associate resource descriptors with mesh parameters
within an ad-hoc struct type. Crude Oil is still handled separately
as it uses a decal. Also, ensure all nodes are about the same size,
and that the mesh is centered on the resource node's origin.

ExampleLevel also tried spawning resource nodes for resources added
by other mods, but had to use a fallback mesh as there is no way to
know which mesh or materials the modded resource's nodes would use.
Deal with this by using the resource descriptor's item mesh, scaled
up to about the size of a resource node.

Thanks to AngryBeaver for the suggestion of using a map for this.

Signed-off-by: Angel Pons <[email protected]>
Set the correct rotation (capture actor must be facing downwards) and
ensure the Ortho Width encompasses the entire landscape, which is not
centered for some cursed reason.

With this change, minimap capture actors appear in the right position
even if the minimap texture is not accurate.

Signed-off-by: Angel Pons <[email protected]>
For some reason, the landscape was not centered. Use some math to
correct the location offset so that the landscape is centered. As
this also changes the foliage's position, put the foliage back to
about where it originally was.

Signed-off-by: Angel Pons <[email protected]>
Provide an implementation for this class' three editor-only functions:

 - GatherNearbyPillarLocations
 - NotifyGasPillarRemovedFromInfluence
 - DebugDrawCurrentPillarLocations

Important: `mProximityPillarWorldLocations` stores the location of the
gas pillar plus its `mEffectHeightOffset` (Z axis). Using the pillar's
location alone will not work for big pillars (with a big effect height
offset), but the tiny pillars will work fine because the offset is not
too big. As of writing, the game tests if the distance squared is less
than 40000 (i.e. less than 200 cm) to see if a pillar matched.

Note that these were created from scratch, without seeing the original
implementation by CSS. There may be bugs and/or problems, but at least
the implementations are good enough to make gas pillar clouds function
in ExampleLevel (adapted in the next commit).

Signed-off-by: Angel Pons <[email protected]>
As of at least U8, gas pillar cloud actors now spawn clouds on each
gas pillar they know about. But this knowledge is set up inside the
editor when clicking the `Gather Nearby Pillar Locations` button in
the gas pillar cloud's details panel.

Now that `Gather Nearby Pillar Locations` has been implemented, use
it to make the gas cloud in ExampleLevel behave correctly. While at
it, also reorganise the poison gas actors to make the gas cloud the
parent. This should allow moving the pillars around individually.

Signed-off-by: Angel Pons <[email protected]>
@budak7273
Copy link
Member

Mircea brought the custom implementations over into the header implementer https://discord.com/channels/555424930502541343/562722670974599227/1304892216392552581

@budak7273 budak7273 merged commit d42fe5f into satisfactorymodding:dev Nov 13, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants