Changelog
Unreleased
Pieces by definition id
- Pieces are known by their definition id (
FPulseDefinitionIdof PulseFoundation,PulseBuildPiece:<asset name>) wherever they leave the machine.FPulseBuildPiecereplicates and savesDefinitionId;Definitionis local (Transient,NotReplicated) and found by each machine. NewFPulseBuildPiece::IsResolved;IsValidneeds the id, not the pointer. Code that makes a piece sets both withPulse::Build::Pieces::SetDefinition;UPulseBuildSubsystem::AddPiecerefuses a piece whose id is not the one of its definition. - New
Pulse::Build::Pieces(PulseBuildPieces.h) andUPulseBuildPieceLibrary: make, read and parse ids, find (never loads), load at once or in the background, list, register and unregister runtime pieces. NewUPulseBuildSubsystem::AddPieceById(Blueprint Add Piece By Id). - The kinds
PulseBuildPiece(always cooked),PulseBuildCatalogandPulseBuildBlueprintare registered with the asset manager in code (PrimaryAssetTypeon each class); no project config needed. - Clients show and register a received piece once its definition is there (
SubmitReceivedPiece, anFPulseDefinitionResolver); pieces whose definition does not come wait, are warned about once per id, counted in the debug snapshot and inPulseBuildInfo, and are tried again when the definitions of pieces change. - Requests:
FPulseBuildRequest::Pieceis replaced byDefinitionId. The server takes pieces it has ready and never loads a path for a request (Pulse::Build::Request::ResolvePiece); unknown ids, ids of another kind and blueprints with an unknown piece answer Invalid Piece. Only a builder that may build every piece (bRequireCatalogoff, free build) loads a piece asset the asset manager knows by the id, once, and keeps it (UPulseBuildComponent::FindOrLoadBuildablePiece), so creative building works on a dedicated server. Catalogs compare pieces by id. Hosts of bridges outside this repository that fillRequest.PiecesetRequest.DefinitionIdinstead. - Blueprint text version 2:
FPulseBuildBlueprintEntry::DefinitionIdreplaces the soft pointerDefinition; text of another version or with more entries thanBlueprint::MaxEntriesis refused.Blueprint::MakePiecestakes a world context and only ready definitions and lists the missing ids;Blueprint::LoadDefinitionsloads them first,ImportBlueprintandSelectBlueprintselect a blueprint once they are there and name unknown pieces in the result. - Save data version 5:
FPulseBuildSavedPiece::DefinitionIdreplaces the soft pointer; loading finds pieces by id (LoadPieceSynchronous) and lists unknown ids (MissingPiece); data of another version is refused. The builder saves favorites, hotbar and recent pieces as ids (FPulseBuildUserData,FPulseBuildBuilderSaveDataversion 2);ImportUserDataloads pieces that are not ready, fills only places the player left empty meanwhile and closes the gaps of unknown ids once every load answered (hotbar slots keep their places). - Cheats take a name or an id of a piece (
ParsePieceId, any case);PulseBuildInfolists the piece names and the pieces waiting for their definition. The creative menu (no catalogs,bRequireCatalogoff) lists every piece id; the builder keeps the pieces it loaded for it, and a selected blueprint keeps the definitions of its pieces, so the garbage collector does not take them while they are named. - Editor: data validation reports two pieces with one name (one id); new and renamed pieces, catalogs and blueprint assets whose name is taken get a warning, and renaming a piece tells that saves need a Primary Asset Id Redirect. Id fields carry
PulseDefinitionType = "PulseBuildPiece"for the definition picker.
Extension points
- New
Pulse::Build::Registry(PulseBuildRegistry.h): bridges register piece sources, default rules, cluster components and the cluster class at runtime (RegisterPieceSource,RegisterRule,RegisterClusterComponent,RegisterClusterClass) and take them back (Unregister(Owner)and one call per kind) instead of writingUPulseBuildSettingsat module startup. The settings stay the base list: a registered source or rule of a type the settings hold is left out, a cluster class in the settings wins. Placement rules, the piece sources of the build component, cluster components, the cluster class and the spline check of piece validation read through it. Nothing changes for projects and bridges that keep using the settings.
Range
- The build range checks of placing (and every spline point), removing, editing spline points and placing blueprints go through
Pulse::Requests::CheckReachof PulseFoundation, on the preview and the server. The tolerance stays 400 cm unless the Reach Tolerance of the request guard is larger; the refusal stays Out Of Range. Upgrades, repairs and the other changes of a placed piece measure to its bounds with the same tolerance, so a piece placed at the edge of the reach can be changed from there.
Save
- The building world saves what the actors of actor pieces and their components save of themselves (
IPulseByteSaveable) in the newFPulseBuildSavedPiece::Components(FPulseBuildSavedComponent: name and bytes) and loads it beforeOnLoadPieceActor.OnSavePieceActorandOnLoadPieceActorstay for other data;OnLoadPieceActoris called only for pieces with such data. - New
Pulse::Build::Save::IsSavedWithPiece(Object): filter for save systems that collect everyIPulseByteSaveableof the world (Pulse::Save::AddObjectFilterof PulseSave), so those objects are not saved twice.
Splines
Pulse::Build::Spline::SetSplinePointsnow runs the placement rules by default (EPulseBuildRuleCheck::Check): the new points must pass what placing the piece there would check. Code that restores points it checked before passesEPulseBuildRuleCheck::Skip;bCheckRulesOnEditoff on the Spline trait turns the rules off for a piece.SplitSplineandJoinSplinesdo not run the placement rules: they reuse segments that were checked already (joining checks the limits only).FindConnectionbreaks ties in a fixed order (a socket before a spline end, then the lower piece id, then the socket name), so the result no longer depends on the order of the query.- A piece with a socket of a fitting type within 1 cm of a spline end counts as connected (a support two belts meet at), in the placement, on the server and in
GetConnectedPieces. - The server empties
AddedPointsofFPulseBuildPlacementExtra_Splinein placements it receives, so no rule reads corner points a client sent.
Builder
UPulseBuildComponent::CheckPlacementwith anIgnorePieceId(moving or editing a placed piece) no longer checks the catalog, as it did not check the lock: placed pieces from world seeds, saves or catalogs that have shrunk can be moved and edited withbRequireCatalogon.
Security
MovePiece(request Move) no longer takes spline points from the client: the server carries the stored shape with the sent transform (turned around the first point), so a move cannot make a spline longer than what was paid. Shape edits stay withRequestSetSplinePoints, which pays the difference.PlaceBlueprintruns every piece through the checks ofPlacePiecebefore anything is placed or paid: the placement mode (pieces may sit on sockets of other pieces of the blueprint that stand; grid pieces keep the grid offset of the blueprint; a group that stands nowhere is refused), catalog, lock, the range of every piece and spline point, the rules, zones, claims and permissions. Piece limits count the whole blueprint, now also per zone. The preview of the PlaceBlueprint tool runs the same checks. Blueprints wider than the build range must be placed in parts.Pulse::Build::Blueprint::MakePiecesdrops the scale of entries: pieces never get a scale from blueprint text.- Undo and redo run the checks of the direct actions: a piece a step takes away needs the right to remove it (
CanRemovePiece), a piece set back needs the right to change it (fixed pieces stay), and a piece that comes back is checked like a new piece for zones, claims and piece limits (counted for the whole step). Payment keeps its refund and charge rules. - New
Pulse::Build::Request::Validate, run first byExecuteRequest: requests with more copies thanMaxDragCount(no longer cut to it), more spline points than the new settingMaxRequestPoints(256), more extras or blueprint entry states thanMaxRequestExtras(8), more connected ids thanMaxRequestConnections(32) or more blueprint entries thanBlueprint::MaxEntriesare refused (Invalid), and so are vectors and transforms that are not finite (Invalid Transform). NewPulse::Build::Math::IsFinitefor vectors and transforms.