datacontractserializer

Hi every one I have an issue with my save files been awful to look at and bigger than they need to be.
Here is a sample of one of my save file.

<?xml version="1.0" encoding="utf-8"?><modal xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Animations xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><d2p1:KeyValueOfAnimationTypeAnimationDND_SLh8a><d2p1:Key>Walk</d2p1:Key><d2p1:Value xmlns:d4p1="http://schemas.datacontract.org/2004/07/BlockEmpire.Engine.Modals.Editor.Animation"><d4p1:_isLooped>true</d4p1:_isLooped><d4p1:_keyFrames><d4p1:KeyFrame><d4p1:_objectFrame><d4p1:ObjectFrame><d4p1:Id>0</d4p1:Id><d4p1:Position xmlns:d9p1="http://schemas.datacontract.org/2004/07/Microsoft.Xna.Framework"><d9p1:X>-0.0233333763</d9p1:X><d9p1:Y>1.42666948</d9p1:Y><d9p1:Z>0</d9p1:Z></d4p1:Position><d4p1:Rotation xmlns:d9p1="http://schemas.datacontract.org/2004/07/BlockEmpire.Engine"><d9p1:Pitch>0</d9p1:Pitch><d9p1:Roll>0</d9p1:Roll><d9p1:Yaw>0</d9p1:Yaw></d4p1:Rotation></d4p1:ObjectFrame><d4p1:ObjectFrame><d4p1:Id>1</d4p1:Id><d4p1:Position xmlns:d9p1="http://schemas.datacontract.org/2004/07/Microsoft.Xna.Framework"><d9p1:X>-0.0166666824</d9p1:X><d9p1:Y>0.8400011</d9p1:Y><d9p1:Z>0</d9p1:Z></d4p1:Position>

So my question is this, is there any way to remove the awfully long description names?

Iv tried doing this

 [DataContract (Name = "modalpart", Namespace = "")]
    public struct ModalPart
    {
        [DataMember (Name = "pos")]
        public Vector3 Pos; //the pos of the part relative to the parent modal
        
        [DataMember (Name = "rotation")]
        public Rotation3 Rotation; //the rotation of the modal

        [DataMember (Name = "origin")]
        public Vector3 Origin; //the point that the modal rotates around

but it still hasten solved the problem.

Any help would be appreciated.

DataContract serialization has some issues. This stackoverflow thread is the same issue you’re having.

All you can do is reduce the verbosity of your own types or write a custom serializer that works off of the datacontract attributes.

As @AcidFaucent says, you should avoid DataContractSerialization.

Try XmlSerializer

MonoGame has a class called IntermediateSerializer that you may want to use. Shawn Hargreaves has some great blog posts on how to use it: