Summary
[TLDR: moving code to another module makes the moved component disappear on every entity or entity prefab that was using it. This makes moving code an absolute nigthmare that breaks everything. How can i prevent this. I am constantly needing to move code. Coding everything in one giant module seems to prevent the problem but is no viable option. What is the solution to relocating code breaking everything without a trace?]
The way verse is structured in modules and how modules are either created in verse or are folders from the content browser in the editor and designing a proper access structure with those modules is quite challanging. I often find myself needing to move scenegraph component code to a different module, which breaks all existing prefabs using that code. This causes great pain as i have to remember and manually check which entity prefab is now broken because moving component code makes the component just disappear in the prefab. This constantly breaks my game and needs pushed changes and takes a lot of time. Constantly.
So i tried to come up with a way to automate an error prevention with the tools im given. So i created a “requires” component that should contain every component type the owning prefab uses and look for it. If that component is not there because it is missing, it should trigger an error. This does not do the trick though. See steps to reproduce.
The relocation of code also impacts the array referencing the component type. Meaning the checking for the relocated component is broken itself after the relocation. It actually would have worked, if there were any form of validation check for the array in the requires component checking for broken references, because the VERSE_DEAD_… does name the component that was at that array entry. That would easily allow me to just go through all the errors and reapply the components named in the broken reference. But it does not raise any error, it just disconnects the session on a time out error.
SO: with my requires component, i gained the ability to backtrace what components disappeared after moving them, because the type array still names the missing reference types, but since no error is raised, i still need to remember manually find every single entity that has a requires component and check their entries for validity. So i am gaining nearly nothing.
I think that relocating code is a constant need. But if all scene graph, entity prefabs and component references are completely broken after relocating code, it is extremely frustrating for me to develop in UEFN.
Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
Stability
Steps to Reproduce
- Create a component like the example below (requires)
- Create a new test component test_component:=class<final_super>(component){}
- Put that requires on an entity prefab and assign test_component in the array and save the prefab
- Move the code of test_component to a different module and compile
- This causes a “VERSE_DEAD_{missing_component}…” reference set in the array instead of the test_component.
- This is not raised as an error in any validation check. When you compile, push and launch session, while the broken prefab is in the scene trying to execute its OnBeginSimulation(), the session will not leave the “connecting…” screen and end up with a time out error sending you back in the lobby
requires:=class<final_super>(component){
@editable
ObjectName:string
@editable
RequiredComponents:subtype(component)
OnBeginSimulation<override>():void={
(super:)OnBeginSimulation()
for(Index->Comp:RequiredComponents):
if(not Entity.FindDescendantEntitiesWithComponent(Comp).First[]):#returns first found component of the generator
Err("Entity: {ObjectName} has a required component missing at index {Index}")
}
}
Expected Result
- Some error message during validation that there is a dead verse reference that needs to be corrected because you moved code
Observed Result
See steps to reproduce
Platform(s)
PC