In a project I have some data in a Sqlite3 database. There are some tables with text plain data without relation between them.
The thing is that I don’t want to continue using a database. Is there something in Unreal to store this data as an asset? I’ve said asset because I don’t know so much about this kind of things in Unreal.
You can store data in whatever way you want to. You just need to make your own data reading system for it.
As far as pre-made options that allow you to read you only really have the unfinished DataTables (excel sheets or rather simple CSV) and if dealing with numbers you can write to and read images.
Obviously, if you are dealing with Plain Text your best bet is to store and use Plain Text directly.
Create a C++ class, add a System.IO using at the top. And read in whatever text file you want or build out Blueprint Callable functions to read out said file.
It’s probably hellish, but you can even do this in an Async fashion so as not to cause the main thread to hang while waiting for the file to load in ram…
Are these text files encrypted when I distribute the game? My problem is that they contain information that I’ve put a lot of effort into creating, and I don’t want anyone in the game’s installation directory to be able to read them.
You can make them encrypted and tell your game to decrypt them though.
Lets not discuss specific ways to do it in public because you do need to be able to decode and it would probably be trivial to goole for an answer and get to this thread.
In c++ you read bytes.
The bytes get put in ram and you can pass them through whatever decoding process you want, making it harder (but not impossible, modders do this all the time) to stop people from just reading it.
You can use some salt and pepper encryption so as to further make it harder to just get the decoded version out. But its still trivial for most hackers unfortunately.
If you are very concerned about it just make your own encoding system.
When you combine methods one after the other in a way that only makes sense to you, even using very basic things such as character transposition, you end up generally making it not worth the effort for anyone to figure out.
Whats worse for the run of the mill hacker is when you ran the first decoding, expect text, see gibberish you sort of think that the process didn’t work. And it really may not have. You just have no way to tell
Troll the hackers!