That’s a good idea, especially easy with the static data saving and loading. Hard in the case of normal loading of actors because clients can’t spawn replicating actors.
But letting clients load static data would be easy
Rama
That’s a good idea, especially easy with the static data saving and loading. Hard in the case of normal loading of actors because clients can’t spawn replicating actors.
But letting clients load static data would be easy
Rama
In our case the client can not load, though should be able to save.
Cenario: Server opens a game, fresh or a save. Server opens game for public. Clients join. Server and clients create stuff (minecraft, art tool, …), all connected can make a save of the current state.
Now the client can disconnect and use that save to create a new server. That again gets changed by connected players, which again can save and open that game on their own.
Hi there Rama
I’ve encountered a small issue and I just don’t know why it’s happening. I’m migrating some of my code from blueprints to C++ and found that when I include RamaSaveComponent.h I get a bunch of errors. This is on UE4 4.17.2
RamaSaveUtility.h(53): error C2653: 'FPlatformFileManager': is not a class or namespace name
RamaSaveUtility.h(53): error C2653: 'FPlatformFileManager': is not a class or namespace name
RamaSaveUtility.h(53): error C2228: left of '.GetPlatformFile' must have class/struct/union
RamaSaveUtility.h(53): note: type is 'unknown-type'
RamaSaveUtility.h(53): error C2228: left of '.FileExists' must have class/struct/union
this repeats for a few lines but always involves FPlatformFileManager. I’ve added the dependency to the build .cs, and removing the include fixes the problem. I can go in and add the dependencies to the RamaSaveUtilities file but I don’t know why that would be necessary if it works without it in blueprints.
Thanks for any assistance you can provide and have a fantastic day!
I don’t have the code currently. When I use his component from C++ I just include the RamaSaveComponent.h and it works. Maybe it includes the Utility stuff as well. Might give it a shot.
Oh I have. Literally just adding the include in the Rama utilities fixes the problem though. Just figured I might be doing something weird.
This include stuff gets a bit weird when using the modules. Never used Cpp like this before using unreal. Might be the include you are missing gets included through the module in the background for the plugin itself. Thus it compiles.
Possibly. In either case, It seems to work with 1 added line to the Cpp. Now, my understanding of the Rama Save plugin is that it loads a binary and re-spawns all the assets in the world. Even dynamically created assets. This is causing a bit of an issue with our multiplayer game.
Our world are completely dynamically generated. Since the assets are recreated at runtime, the level fully loads really fast. and the players postLogin gets called before the elements of the level are fully loaded. So, they end up falling through the world on the client as it takes a minute for everything to replicate into place. Usually there would be a loading screen or something that I could cover this up with but since post login has already been called I’d need to create a Post-Post login function. That’s just getting kind of nuts
Hey Rama,
I have another little feature request that should not be much of a deal as the functions are already in place.
Currently I have tools (actors) that have settings. These settings are UObjects so the interface can share the settings with the tool.
The settings should not be actors (otherwise I could add another RamaSaveComponent) cause when loading the references would break.
I could save the settings as individual rama save static files, but a single file would be the way to go.
Using structs would mean I need to adjust the static save object every time a new tool is created.
So the idea is: The SettingsObjects inherit from RamaSaveObject. Thus it can be serialized with your system. The issue is that I would get a file for each settings. To solve that a function would be nice that returns the binary of the file instead of saving it out directly. This way I would be able to transfer every tool setting into binary, and add that binary to the actual static save object where it will be referenced with the class of the settings object.
Cheers.
Edit:
Btw: Thanks for taking care for the other requests.
Hello @Rama, I am wondering if this plugin is able to save presets?
If I spawn an object and modify settings, can I save it as a preset?
And then place down the original object and set it to that preset, OR dynamically create an edited version of the object that can be placed?
Thanks!
Hey Rama, I’m sorry to come back with this issue. I found some time to look into this again and spend some more hours trying to narrow down the issue, but had no luck at all.
It’s all about a BP child of RamaSaveEngine class. We are currently at UE4.19.
Sometimes it is working, then it seems to be related to a CreateWidget node depending on what widget it creates. Seemed to narrow it down to a point, but then the issue went just more viral and it breaks randomly. Tried a SpawnActor node but that also broke the loading of the edtor, just at another point.
Still I’m not able to reproduce the issue in a fresh project
Hi Rama,
I’m using your plugin and have run into an issue when working with level streaming. When actors are being spawned into the world, there is no way to control the Level that they are being spawned into. When I load a streamed level and then load its persisted state using your plugin, I sometimes want those spawned actors to spawn into the streamed level, not into persistent level.
One way to achieve this would be to change this:
static bool RamaSave_LoadFromFile(UWorld* World, int32 RamaSaveSystemVersion, const TArray<FString>& LoadActorsWithSaveTags, FArchive &Ar
, URamaSaveComponent*& LoadedComp, bool DontLoadPlayerPawns, FString LoadOnlyStreamingLevel="");
to this:
static bool RamaSave_LoadFromFile(UWorld* World, int32 RamaSaveSystemVersion, const TArray<FString>& LoadActorsWithSaveTags, FArchive &Ar
, URamaSaveComponent*& LoadedComp, bool DontLoadPlayerPawns, FString LoadOnlyStreamingLevel="", bool bSpawnIntoStreamingLevel=false);
And then change this:
template <typename VictoryObjType>
static FORCEINLINE VictoryObjType* SpawnBP(
UWorld* TheWorld,
UClass* TheBP,
const FVector& Loc,
const FRotator& Rot = FRotator::ZeroRotator,
const bool bNoCollisionFail = true,
AActor* Owner = NULL,
APawn* Instigator = NULL
)
to this:
template <typename VictoryObjType>
static FORCEINLINE VictoryObjType* SpawnBP(
UWorld* TheWorld,
UClass* TheBP,
const FVector& Loc,
const FRotator& Rot = FRotator::ZeroRotator,
const bool bNoCollisionFail = true,
AActor* Owner = NULL,
APawn* Instigator = NULL,
ULevel* OverrideLevel = NULL
)
And then down where you are setting up the spawn info, add this:
if(OverrideLevel)
{
SpawnInfo.OverrideLevel = OverrideLevel;
}
Then we could add in RamaSave_LoadFromFile an if statement on bSpawnIntoStreamingLevel to determine if we find and pass in the level specified with LoadOnlyStreamingLevel as an argurment to SpawnBP.
Regards,
Modeus Mark
We are running into a similar issue. Though we have ruled out all the widgets in our project. It also happened to us in a BP child class or RamaSaveEngine. I’m looking into it now and will let you know if we find anything more. I believe it may be a circular dependency but we will see.
Hi @Rama, your plugin is loading objects twice in 4.20.2 when saving/loading streamed level only. How can I get support?
Is it possible to load a save file in thread?, or is there any way to create a loading screen with a throbber for big data?
@Rama Still no support for Android? I really need to use this on Oculus Go (and Oculus Quest when it’s out)
The basic blue print “Rama Save Copy File” Delete File" Rename File"Paths saved dir"game root dir" all do not work in android as is I just wasted money well, not really as it works great on windows! Been looking for an excuse to pick it up. I miss understood this line from the marketplace. “Mac, Mobile platforms, VR, AR, XBox One,and PS4 should all work for anyone who can recompile for these platforms because of my use of the UFS.”
edit:
Solution was to basically follow Rama’s suggestion of recompiling for other platforms.
I tried a few different methods with assorted issues, such as runuat BuildPlugin -plugin="<path/to/yourplugin.uplugin>" -targetplatforms=Android -package="<output path>" -rocket but always ended up with one error or another.
Finally I found something that worked,
Cut and paste plugin folder from engine to a new c++ projects plugin folder. Add Android, to the whitelist of the uplugin, delete binaries and intermediate folders from the plugin directory. Then open the new C++ project, go to plugins window, and find the plugin, at the bottom there is an edit and package text/hyperlink/button, click package. This will make all the whitelisted builds. Now copy this plugin to your blueprint projects Plugin folder and you are good to go for Android builds. I was Told Epic will do these for you when submitting to the market place if you ask them.
I have not tested everything, but the rename features work and the path tools tools work, accept Document Folder, which puts you at …/…/…/ on android, so one Directory above the root. I just had that in there as part of my debug process.
I am pretty happy to have this working on Android with Arcore and GameDNA’s Firebase plugin. No package issues on 4.20.3.
My next challenge will be creating the plugin binaries for ios on a Mac, and then bringing them back to the pc, so I can package them both from one project on my PC(remote networking to the mac). I have not done this yet. That will have to wait for another day.
Thanks Rama!
Got it working on Android, but have not tested every feature. see previous post and feel free to PM, and I will reply with better instructions. I know you have been wanting this for some time.
Apparently, when Rama submits an update, he can ask Epic to build the IOS, Android Binaries for him. So, maybe this will get easier going forward?
Does it save game on a separate thread? I am concerned with potential hitches when saving on checkpoint (can’t have any hitches when saving in my Android project)
I will test later. know of an easy test to suggest? You could combine with Vega Thread, if it didnt work. But would be great if the async feature is working out of the box, for sure. I’m still guessing it will. Easy test? Make large level and wait for the annoying hitch, lag on a save, like we would get on doom etc? I wonder if there is an easier way to detect? I know I have async firebase saves working on ios and android so it can be done at least.
@Rama There is a huge bug in your system, it seems to be loading actors outside of the sim, there are none of these actors placed on the level and all i’m doing is compiling and you can see it destroying them then recreating? this creates a issue for things that are created in the constrictor as the actors location is zero so it creates any added components in the incorrect locations.