Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > 9Dragons
You last visited: Today at 12:07

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Reading .xes files

Discussion on [Release] Reading .xes files within the 9Dragons forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2006
Posts: 102
Received Thanks: 119
[Release] Reading .xes files

This is the file structure for reading the .xes files. The ENVEFFECT.XES file refers to world particles/textures, while the VISUALEFFECT.XES refers to character based particles/textures. Creating this and making sure it worked took a fair bit of time. Hopefully someone will actually create something they release publicly for the community with this.

Code:
typedef struct
{
    float x,y,z;
} D3DVECTOR3;

typedef struct
{
    float x;
    float y;
    float z;
} D3DVECTOR;

typedef struct
{
    float r, g, b, a;
} D3DCOLORVALUE;

typedef struct
{
    FLOAT r;
    FLOAT g;
    FLOAT b;
    FLOAT a;
} D3DXCOLOR;

typedef struct 
{
    float m[4];
} 
D3DXMATRIX[4];

typedef struct
{
    D3DCOLORVALUE Diffuse;        /* Diffuse color RGBA */
    D3DCOLORVALUE Ambient;        /* Ambient color RGB */
    D3DCOLORVALUE Specular;       /* Specular 'shininess' */
    D3DCOLORVALUE Emissive;       /* Emissive color RGB */
    float Power;          /* Sharpness if specular highlight */
} D3DMATERIAL9;

typedef enum
{
    D3DLIGHT_POINT          = 1,
    D3DLIGHT_SPOT           = 2,
    D3DLIGHT_DIRECTIONAL    = 3,
    D3DLIGHT_FORCE_DWORD    = 0x7fffffff, /* force 32-bit size enum */
} D3DLIGHTTYPE;

typedef struct
{
    D3DLIGHTTYPE Type;            /* Type of light source */
    D3DCOLORVALUE Diffuse;         /* Diffuse color of light */
    D3DCOLORVALUE Specular;        /* Specular color of light */
    D3DCOLORVALUE Ambient;         /* Ambient color of light */
    D3DVECTOR Position;         /* Position in world space */
    D3DVECTOR Direction;        /* Direction in world space */
    float Range;            /* Cutoff range */
    float Falloff;          /* Falloff */
    float Attenuation0;     /* Constant attenuation */
    float Attenuation1;     /* Linear attenuation */
    float Attenuation2;     /* Quadratic attenuation */
    float Theta;            /* Inner angle of spotlight cone */
    float Phi;              /* Outer angle of spotlight cone */
} D3DLIGHT9;

typedef struct
{
    char animationKeyFileName[ 64 ]; // loads this file from MR_VISUALEFFECT.XP
} XANIMATION_KEY;

typedef struct
{
    int keyframeFileNameLength;
    char keyframeFileName[ keyframeFileNameLength ]; // loads this file from MR_VISUALEFFECT.XP
} XKEYFRAME_CONTROLLER;

typedef struct
{
    int particleFileNameLength;
    char particleFileName[ particleFileNameLength ];
    int bipedFileNameLength;
    if( bipedFileNameLength > 0 )
    {
        char bipedFileName[ bipedFileNameLength ];
        int bipedAnimationCount;
        if( bipedAnimationCount > 0 )
        {
            XANIMATION_KEY animationKey[ bipedAnimationCount ];
        }
    }

    int keyframeCount;
    if( keyframeCount > 0 )
    {
        int nodeCount;
        XKEYFRAME_CONTROLLER keyframeController[ keyframeCount ];
    }
} XPARTICLE_MESH_DATA;

typedef struct
{
    int splineFileNameLength;
    if( splineFileNameLength > 0 )
    {
        char splineFileName[ splineFileNameLength ];
    }

    int curveType;
    int controlCount;
    int curveDivisionCount;
    if( controlCount > 0 )
    {
        D3DVECTOR3 controlData[ controlCount ];
    }
} XSPLINE_CONTAINER;

typedef struct
{
    int useExtExdUVEffect;
    int useOscilloScopeUVEffect;
    int useRotationEffect;
    float uPanning;
    float vPanning;
    float uPanningVelocity;
    float vPanningVelocity;
    float yawRotation;
    float pitchRotation;
    float rollRotation;
    float yawRotationVelocity;
    float pitchRotationVelocity;
    float rollRotationVelocity;
} XRENDERSTYLE_UVEFFECT;

typedef struct
{
    struct
    {
        char texName[ 32 ];
    } textureName[ 4 ]; // char texturename[ 4 ][ 32 ];		
	D3DXMATRIX uvMatrix1;
    D3DXMATRIX uvMatrix2;
    D3DXMATRIX uvMatrix3;
    D3DXMATRIX uvMatrix4;
	D3DMATERIAL9 material;
	
	DWORD useLight : 1;	
	DWORD useSpecular : 1;	
	DWORD zBufferOperationMode : 2;	
	DWORD alphaTest : 1;
	DWORD alphaTestCompareMode : 4;
	DWORD cullingMode : 2;	
	DWORD useuvMatrix1 : 1;
	DWORD useuvMatrix2 : 1;
	DWORD useuvMatrix3 : 1;
	DWORD useuvMatrix4 : 1;
	DWORD useTransformBumpEnvMapping : 1;
	DWORD bumpEnvMappingStage : 2;
	
	DWORD ts1_textureCoordCount : 3;
	DWORD ts2_textureCoordCount : 3;
	DWORD ts3_textureCoordCount : 3;
	DWORD ts4_textureCoordCount : 3;
	
	DWORD reserved1 : 32-30;
		
	DWORD textureFactor;
	DWORD alphaReference;
	FLOAT bumpMapScale;
	FLOAT bumpMapOffset;

	DWORD ts1_colorOperation : 5;
	DWORD ts2_colorOperation : 5;
	DWORD ts3_colorOperation : 5;
	DWORD ts4_colorOperation : 5;
	
	DWORD ts1_colorArg1 : 3;
	DWORD ts2_colorArg1 : 3;
	DWORD ts3_colorArg1 : 3;
	DWORD ts4_colorArg1 : 3;

	DWORD ts1_alphaOperation : 5;
	DWORD ts2_alphaOperation : 5;
	DWORD ts3_alphaOperation : 5;
	DWORD ts4_alphaOperation : 5;
	
	DWORD ts1_alphaArg1 : 3;
	DWORD ts2_alphaArg1 : 3;
	DWORD ts3_alphaArg1 : 3;
	DWORD ts4_alphaArg1 : 3;

	DWORD ts1_colorArg2 : 3;
	DWORD ts2_colorArg2 : 3;
	DWORD ts3_colorArg2 : 3;
	DWORD ts4_colorArg2 : 3;

	DWORD ts1_alphaArg2 : 3;
	DWORD ts2_alphaArg2 : 3;
	DWORD ts3_alphaArg2 : 3;
	DWORD ts4_alphaArg2 : 3;

	DWORD ts1_projected : 1;
	DWORD ts2_projected : 1;
	DWORD ts3_projected : 1;
	DWORD ts4_projected : 1;

	DWORD blendMode : 4;

	DWORD ts1_sourceType : 3;
	DWORD ts2_sourceType : 3;
	DWORD ts3_sourceType : 3;
	DWORD ts4_sourceType : 3;

	DWORD ts1_uvCoordIndex : 3;
	DWORD ts2_uvCoordIndex : 3;
	DWORD ts3_uvCoordIndex : 3;
	DWORD ts4_uvCoordIndex : 3;

	DWORD zBufferCompareMode : 4;	

	DWORD reserved3 : 32-28;

	DWORD ts1_uCoordAdress : 3;
	DWORD ts2_uCoordAdress : 3;	
	DWORD ts3_uCoordAdress : 3;
	DWORD ts4_uCoordAdress : 3;
	
	DWORD ts3_vCoordAdress : 3;
	DWORD ts4_vCoordAdress : 3;
	DWORD ts1_vCoordAdress : 3;
	DWORD ts2_vCoordAdress : 3;

	DWORD reserved4 : 32-24;
} XRENDERSTYLE_STRUCTURE;

typedef struct
{
    char renderStyleName[ 32 ];
    XRENDERSTYLE_UVEFFECT uvEffect[ 4 ];
    XRENDERSTYLE_STRUCTURE renderStyleStructure;
} XRENDERSTYLE_ITEM;

typedef struct
{
    WORD styleVersion <format=hex>; // 0xFE90
    int renderStyleCount;
    if( renderStyleCount > 0 )
    {
        XRENDERSTYLE_ITEM styleItem[ renderStyleCount ];
    }
} XRENDERSTYLE_MANAGER;

typedef enum
{
	LTT_Infinity = 0,
	LTT_LimitTime,
	LTT_OneTime
} XPARTICLE_LIFETIMETYPE;

typedef enum
{
    BLT_World = 0,
    BLT_Character,
    BLT_CharacterRightHand,
    BLT_CharacterLeftHand,
    BLT_CharacterRightLeg,
    BLT_CharacterLeftLeg,
    BLT_CharacterShortWeapon,
    BLT_CharacterLongWeapon,
    BLT_CharacterPelvis,
    BLT_CharacterHead,
    BLT_CharacterRightCalf,
    BLT_CharacterLeftCalf,
    BLT_CharacterRightForearm,
    BLT_CharacterLeftForearm,
    BLT_CharacterLeftWeapon,
    BLT_MaxCount
} XPARTICLE_BIPEDLINKTYPE;

typedef enum
{
    VTT_None = 0,
    VTT_Camera,
    VTT_LockX,
    VTT_LockY,
    VTT_LockZ,	
    VTT_Direction,
    VTT_ArbitrarilyPoint,	
    VTT_CameraAndRollAnimation,
    VTT_FixedAndXRollAnimation,
    VTT_FixedAndYRollAnimation,
    VTT_FixedAndZRollAnimation,
    VTT_MaxCount
} XPARTICLE_VIEWTARGETTYPE;

typedef enum
{
    RTT_Triangle = 0,
    RTT_NumericBillboard,
    RTT_Billboard,
    RTT_XZCrossBillboard,
    RTT_XYZCrossBillboard,
    RTT_Model,
    RTT_AnimationModel,
    RTT_OrgTextureModel,
    RTT_OrgTextureAnimationModel,
    RTT_TerrainDecal,
    RTT_LineEffect,
    RTT_MaxCount
} XPARTICLE_RENDERINGTYPE;

typedef enum
{
    EMT_Point = 0,
    EMT_Line,
    EMT_Triangle,
    EMT_Plane,
    EMT_Box,
    EMT_Sphere,
    EMT_Cylinder,
    EMT_Cone,
    EMT_Blob,
    EMT_Disc,
    EMT_Rectangle
} XPARTICLE_EMITTERTYPE;

typedef struct
{
    XPARTICLE_EMITTERTYPE type;
    float data[ 9 ];
    float snapSize;
} XPARTICLE_EMITTER;

typedef enum
{
    AT_Unknown = -1,
    AT_HeaderID = 0,			
    AT_AvoidID,			
    AT_BounceID,			
    AT_CallActionListID,	
    AT_CopyVertexBID,	
    AT_DampingID,		
    AT_ExplosionID,		
    AT_FollowID,			
    AT_GravitateID,		
    AT_GravityID,		
    AT_JetID,			
    AT_KillOldID,		
    AT_MatchVelocityID,	
    AT_MoveID,			
    AT_OrbitLineID,		
    AT_OrbitPointID,		
    AT_RandomAccelID,	
    AT_RandomDisplaceID,	
    AT_RandomVelocityID,	
    AT_RestoreID,		
    AT_SinkID,			
    AT_SinkVelocityID,	
    AT_SourceID,
    AT_SpeedLimitID,		
    AT_TargetColorID,	
    AT_TargetSizeID,		
    AT_TargetVelocityID,	
    AT_VortexID,
    AT_VertexID,
    AT_StopVolumeID,
    AT_EffectSoundID,
    AT_EffectLightID,
    AT_EffectScreenID,
    AT_CameraShakeID,
    AT_MaxCount
} XPARTICLE_ACTIONTYPE;

typedef struct
{
    float startTime;
    float endTime;
} XPARTICLE_TIMESLICE;

typedef struct
{
    int enable;
    int timeSliceCount;
    if( timeSliceCount > 0 )
    {
        XPARTICLE_TIMESLICE timeSlice[ timeSliceCount ];
    }
} XPARTICLE_ACTIONITEM;

typedef struct
{
    XPARTICLE_ACTIONTYPE actionType;
    XPARTICLE_ACTIONITEM actionItem;
    switch( actionType )
    {
        case AT_HeaderID:
            break;
        case AT_AvoidID:
            XPARTICLE_EMITTER position;
            float lookAhead;
            float magnitude;
            float epsilon;
            break;
        case AT_BounceID:
            XPARTICLE_EMITTER position;
            float oneMinusFriction;
            float resilience;
            float cutOffSqr;
            break;
        case AT_CallActionListID:
            int effectTemplateID;
            DWORD useTargetPosition;
            DWORD insideParticles;
            int useStopVolumeEffect;
            int enableSink;
            XPARTICLE_EMITTER position;
            break;
        case AT_CopyVertexBID:
            unsigned char copyPos;
            unsigned char copyVel;
            break;
        case AT_DampingID:
            D3DVECTOR3 damping;
            float vLowSqr;
            float vHighSqr;
            break;
        case AT_ExplosionID:
            D3DVECTOR3 center;
            float velocity;
            float magnitude;
            float stdev;
            float age;
            float epsilon;
            break;
        case AT_FollowID:
            float magnitude;
            float epsilon;
            float max_radius;
            break;
        case AT_GravitateID:
            float magnitude;
            float epsilon;
            float maxRadius;
            break;
        case AT_GravityID:
            D3DVECTOR3 direction;
            break;
        case AT_JetID:
            D3DVECTOR3 center;
            XPARTICLE_EMITTER acceleration;
            float magnitude;
            float epsilon;
            float maxRadius;
            break;
        case AT_KillOldID:
            float ageLimit;
            unsigned char killLessThan;
            break;
        case AT_MatchVelocityID:
            float magnitude;
            float epsilon;
            float maxRadius;
            break;
        case AT_MoveID:
            break;
        case AT_OrbitLineID:
            D3DVECTOR3 p;
            D3DVECTOR3 axis;
            float magnitude;
            float epsilon;
            float maxRadius;
            int useTargetPosition;
            break;
        case AT_OrbitPointID:
            D3DVECTOR3 center;
            float magnitude;
            float epsilon;
            float maxRadius;
            DWORD useTargetPosition;
            unsigned char directTurning;
            break;
        case AT_RandomAccelID:
            XPARTICLE_EMITTER genAcc;
            break;
        case AT_RandomDisplaceID:
            XPARTICLE_EMITTER genDisp;
            break;
        case AT_RandomVelocityID:
            XPARTICLE_EMITTER genVel;
            break;
        case AT_RestoreID:
            float timeLeft;
            break;
        case AT_SinkID:
            unsigned char killInside;
            XPARTICLE_EMITTER position;
            break;
        case AT_SinkVelocityID:
            unsigned char killInside;
            XPARTICLE_EMITTER velocity;
            break;
        case AT_SourceID:
            XPARTICLE_EMITTER position;
            XPARTICLE_EMITTER positionB;
            XPARTICLE_EMITTER size;
            XPARTICLE_EMITTER velocity;
            XPARTICLE_EMITTER color;
            float alpha; // if > 1.0f   alpha = 1.0f
            float particleRate;
            float age;
            float age_sigma;
            unsigned char vertexB_tracks;
            int useRotation;
            int emitterSplineContainerIndex;
            float emitterPathMoveSpeed;
            int rewind;
            int timeBaseParticleRate;
            break;
        case AT_SpeedLimitID:
            float minSpeed;
            float maxSpeed;
            break;
        case AT_TargetColorID:
            D3DXCOLOR color;
            float scale;
            break;
        case AT_TargetSizeID:
            D3DVECTOR3 size;
            D3DVECTOR3 scale;
            break;
        case AT_TargetVelocityID:
            D3DVECTOR3 velocity;
            float scale;
            break;
        case AT_VortexID:
            D3DVECTOR3 center;
            D3DVECTOR3 axis;
            float magnitude;
            float epsilon;
            float maxRadius;
            break;
        case AT_VertexID:
            break;
        case AT_StopVolumeID:
            XPARTICLE_EMITTER position;
            break;
        case AT_EffectSoundID:
            int soundIndex;
            if( soundIndex > 0 )
            {
                int soundNameLength;
                char soundName[ soundNameLength ];
            }
            break;
        case AT_EffectLightID:
            D3DLIGHT9 light;
            break;
        case AT_EffectScreenID:
            DWORD color; // D3DCOLOR
            float fadeTime;
            break;
        case AT_CameraShakeID:
            float shakeTime;
            break;
        default:
            break;
    }
} XPARTICLE_ACTIONBASE;

typedef struct
{
    int particleNameLength;
    if( particleNameLength > 0 )
    {
        char particleName[ particleNameLength ]; // fseek past
    }

    int enableFlag; // fseek past
    float maxTrackTime;
    XPARTICLE_LIFETIMETYPE lifeTimeType;
    float limitTime;
    int maxParticles;
    unsigned char vertexB_tracks;
    float alpha;
    float age;
    float ageSigma;
    float renderStyleChangeTime;
    int renderStyleIndexCount;
    int renderStyleArray[ renderStyleIndexCount ];
    char renderStyleNames[ 32 * renderStyleIndexCount ]; // fseek past
    XPARTICLE_BIPEDLINKTYPE bipedLinkType;
    int limitBipedRotation;
    XPARTICLE_BIPEDLINKTYPE emitterBipedLinkType;
    DWORD linkSubTarget;
    int meshModelIndex;
    char meshModelName[ 32 ];
    XPARTICLE_VIEWTARGETTYPE viewTargetType;
    XPARTICLE_RENDERINGTYPE renderingType;
    D3DVECTOR3 baseRotateAngle;
    D3DVECTOR3 rotationFactor;
    D3DVECTOR3 arbitrarilyPoint;
    XPARTICLE_EMITTER size;
    XPARTICLE_EMITTER velocity;
    XPARTICLE_EMITTER vertexB;
    XPARTICLE_EMITTER color;
    int actionCount;
    if( actionCount > 0 )
    {
        XPARTICLE_ACTIONBASE actionBase[ actionCount ];
    }
} XPARTICLE_LIST;

typedef struct
{
    int groupNameLength;
    if( groupNameLength > 0 )
    {
        char groupName[ groupNameLength ]; // fseek past
    }

    int groupID;
    int enableFlag; // fseek past
    int maxInstanceCount;
    int particleCount;
    if( particleCount > 0 )
    {
        XPARTICLE_LIST particleList[ particleCount ];
    }
} XPARTICLEGROUP_ITEM;

struct
{
    WORD headerIndicator <format=hex>; // 0xFEEB
    WORD version <format=hex>; // 0x5A5

    // data referencing MR_VISUALEFFECT.XP
    int particleMeshCount;
    if( particleMeshCount > 0 )
    {
        XPARTICLE_MESH_DATA particleMeshData[ particleMeshCount ];
    }

    int emitterPathCount;
    if( emitterPathCount > 0 )
    {
        XSPLINE_CONTAINER splineContainer[ emitterPathCount ];
    }

    XRENDERSTYLE_MANAGER renderStyle;

    // data referencing TR_VISUALEFFECT.XP
    int particleGroupCount;
    if( particleGroupCount > 0 )
    {
        XPARTICLEGROUP_ITEM particleItem[ particleGroupCount ];
    }
} theFile;
010 Editor template attached below.
Attached Files
File Type: zip xes_files.zip (3.7 KB, 235 views)
Plastic is offline  
Thanks
4 Users
Old 02/07/2017, 08:30   #2
 
elite*gold: 0
Join Date: Dec 2013
Posts: 23
Received Thanks: 18
Amazing, thank for share !!!
leluuvietson is offline  
Reply


Similar Threads Similar Threads
problem reading files
06/08/2013 - Grand Chase - 0 Replies
i'm sorry if my english is not good and i'm new here. please help me with this file. i cant read or understand this file from script.kom. :confused: this is before my grand chase entering zero 3rd job (probably before grand chase rising) http://www.elitepvpers.com/forum/attachment.php?a ttachmentid=179006&stc=1&d=1370686015 and this is after update http://www.elitepvpers.com/forum/attachment.php?a ttachmentid=179007&stc=1&d=1370686015
Dump files reading?
02/09/2013 - SRO Private Server - 12 Replies
So uhm yeah, I know that some people can open and successfully read it, but for me it's still a mistery. Do you need some kind of tool which decrypts that .dmp files or it's soomething else?
C# Help, Reading Files
02/27/2010 - CO2 Private Server - 19 Replies
Hey, i cant seem to get my head around this, What im trying to do is, Read a line from a file but, i want to single out each word and save it into a String array, using the "Trim()" command? but i just cant do it, if you can point me in the right direction it would be nice ;D
[HELP]Writing and reading from *.ini files
02/18/2009 - CO2 Programming - 2 Replies
i was trying to do that by myself but after 3days i must say that i cant do it :mad: sooo i will be very happy if somebody could help me with it :) thanks :)
Reading and Writing .INI Files
11/16/2008 - General Coding - 2 Replies
CodeGuru: CIniFile - Class for Reading and Writing .INI Files I found this information useful for starting out on understanding more about the code for read/write ini files. Maybe this will help some others (That are willing to read) :D enjoy



All times are GMT +2. The time now is 12:07.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.