PDA

View Full Version : Serialization and Reflection Framework



danielmd
11-22-2009, 09:12 PM
Hi,

I have been browsing the documentation looking for ways to do serialization of game state to save data, load data structures for AI functionality, but found no way to do this. Is there a Serialization and Reflection framework? (accessible using scripting or is this only available with a low-level source access.)

Say i want to create an avatar/character creation tool like on Sims3, or a racing game with custom cars. Is this possible without using external configuration files. I would typically do this using serialized XML files. But i don't know how i would do it, with the UDK.

What are the main limitation, in terms of extendability and possible workarounds to add external functionality. TCPlink appears to be a way around certain limitations but not the most elegant way.

Is it possible to have a workable fantasy style RPG game, made with hundreds of states for inventory object in UnrealScript? Or is this sort of scenario unfeasible using the UDK without access to source? I have read that UnrealScript is quite slow, and unable to manage very high amounts of data. I hope this is something of an old story.

Thank you.

immortius
11-22-2009, 09:27 PM
There is only a little bit of reflection, and no built-in serialization. Perhaps the bigger hurdle to get over is the lack of file loading functionality though. At the moment if you want save/load data the only built-in method is the config system.

TCPLink is the only way to graunch(*) in external stuff at the moment.

I don't think UnrealScript is unreasonably slow when used well. It is not like the state of all those objects are going to be accessed or changing every frame.

(*) - Graunch is the technical term for forcing things regardless of whether they really fit.

neai
11-22-2009, 09:38 PM
As far as configuration goes, don't bother with XML, serialize to INI's using the features provided. If you have lots and lots of data you may want a proper database.

Wormbo
11-23-2009, 06:17 AM
There's no reflection in UE3. UE1 and 2 provided access to variable values via variable names as strings, but that feature was removed in UE3, probably because it was exploitable in a bad way. Storing persistent data is usually done via config variables, possibly in PerObjectConfig classes if you need an undefined number of these data sets.

danielmd
11-23-2009, 05:07 PM
Thanks for the replies guys. I see now that there are a few options. Sill...

This is really frustrating. It's one of those features that can be done over the weekend, it would really be of use by everyone and eliminate allot of frustration. Well i guess we can always email Tim Sweeney, and nag him to add this feature in the next UDK release lol

joeGraf
11-23-2009, 05:37 PM
Is there a Serialization and Reflection framework? (accessible using scripting or is this only available with a low-level source access.)


Yes, there is a framework, but it is only accessible from C++

elmuerte
11-23-2009, 05:38 PM
I don't see why you would need reflection. Also the idea you propose in the second segment of your first post can be done using the config system currently available in the engine. (See PerObjectConfig).

horstdraper
11-24-2009, 08:26 PM
No serialization, are you sure? What about SerializeItem and CopyCompleteValue? Found those in some docs...

neai
11-24-2009, 11:38 PM
See above, C++. Also, I believe you can still get and set values of properties in chosen objects, via console. I haven't verified this tho.

marcusmattingly
11-25-2009, 12:16 AM
The 'no external file access' issue is the big thing for me. Seems like basic read/write file functionality wouldn't be too big of a deal for Epic to add to UnrealScript. Without it, making something like an RPG will be more difficult than it should be.

neai
11-25-2009, 01:19 AM
Marcus, that functionality is already included. Use the config system. If you want some custom file format, you can implement support for it.

elmuerte
11-25-2009, 02:07 AM
No serialization, are you sure? What about SerializeItem and CopyCompleteValue? Found those in some docs...

UE does contain serialization and reflection, but as Joe Graf already pointed out, it's not exposed to the UnrealScript.

Reflection isn't really an issue, because you would only need to resort to reflection if you don't have control over the code you are using.
As for missing serialization, most of its functionality can be substituted by using the configuration file system and PerObjectConfig (and optionally in combination with UIResourceDataProvider subclasses).