How do I save game data in a .txt/.csv file?

Hello everyone,

sorry if my question might be a little stupid. I am absolutely new to UE or every kind of programming/ game creation etc. and couldn’t find a solution on the internet.

I am currently working on a driving simulator for research purposes. For this purpose I need some data from each session: Important would be vehicle speed, position, and distance to other game objects (The data I see in the console when typing showdebug VEHICLE would also be ok). I would like to store the data in some csv or txt file and it needs to be sampled with a pretty high frequency (at least 10Hz).

Is there an easy way to do it?
I appreciate any kind of help, thanks in advance =)

Not sure about the 10Hz thing, But in UE4, there is a SaveGame Blueprint class. It can save variables within it. It saves a .sav file into the computer file system. Can be found within the Saved/SaveGames folder inside the UE4 project folder once you run the game and create a savegame and save it.

Here’s an example tutorial on how to use it Blueprint Game Framework Basics | Live Training | Unreal Engine - YouTube. Skip to about 46.22 min

You can also serialize ustructs as JSON if you need the data to be easily readable outside Unreal.

https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1561415-solved-json-serializing-and-deserializing-c

Just checking … did you find a way to “save data to CSV”? I am struggling with the same thing. the “.sav” file is of no use to me since it is not human readable.