This is a multi-part message in MIME format. -- [ Picked text/plain from multipart/alternative ] Note: Eric Smith posted a solution to this problem on 1/24/02, but I can't figure out part of his code (read on for details)
With the 2.2 SDK, client-side model blending was added (gamestudiomodelrenderer.cpp, etc) Unbeknownst to us, this introduced a problem - the client was blending model animations, and with them hitboxes, but the server wasn't. This creates a discrepancy, where hits that register on the client miss on the server. Depend on the nature of your mod, this could be a big, or not so big problem. Turns out that in Front Line Force it's a pretty big deal, as some blatant hits from some guns completely miss server-side. The solution to this was posted by Eric Smith on 1/24/02 - it involved setting up a server-side blending that matched the client. My problems arose when I tried to implement that code. The blending on the server side uses some engine functions stored in a variable named IEngineStudio. Problem is, when the engine copies over the addresses of the various blending functions in Server_GetBlendingInterface, Mod_Extradata() is invalid. Consequently, when Mod_Extradata() is called in our blending code, HL crashes. http://www.flfmod.com/david/getblendinginterface.jpg is just a screenshot of my debugger The discrepancy comes up because in Eric Smith's code, IEngineStudio is "server_studio_api_t", but there is no mention of this structure anywhere in the HL SDK 2.2, or in FLF. The closest thing is engine_studio_api_t, which does contain Mod_Extradata() and a bunch of other blending functions (it's used on the client-side) It's thoroughly possible that server_studio_api_t is the correct struct, and engine_studio_api_t has the functions in the wrong order, which is why Mod_Extradata() is invalid. Just judging from the nature of the variable names, it **seems** like server_studio_api_t might be a modified version of the engine_studio_api_t (which is used client-side) and consequently contains a different set of functions? Has anyone else been experiencing this problem? Could someone from Valve shed light on any difference between those 2 structs, and if so could they be causing my Mod_Extradata() func to be invalid? If so, could Valve post the server_studio_api_t struct? Below is an exerpt of FLF's code. Thanks, David [EMAIL PROTECTED] ------- animation_cpp.txt #include "com_model.h" #include "r_studioint.h" #ifndef M_PI #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif void SV_StudioSetupBones( struct model_s *pModel, float frame, int sequence, const vec3_t angles, const vec3_t origin, const byte *pcontroller, const byte *pblending, int iBone, const edict_t *pEdict ); // The simple blending interface we'll pass back to the engine sv_blending_interface_t svBlending = { SV_BLENDING_INTERFACE_VERSION, SV_StudioSetupBones }; // Global engine <-> studio model code interface engine_studio_api_t IEngineStudio; //note difference from Eric Smith's code, server_studio_api_t is nowhere to be found studiohdr_t *g_pstudiohdr; float (*g_pRotationMatrix)[3][4]; float (*g_pBoneTransform)[MAXSTUDIOBONES][3][4]; /* ==================== Server_GetBlendingInterface Export this function for the engine to use the blending code to blend models ==================== */ #ifdef _WIN32 extern "C" int __declspec( dllexport ) Server_GetBlendingInterface( int version, struct sv_blending_interface_s **ppinterface, struct engine_studio_api_s *pstudio, float (*rotationmatrix)[3][4], float (*bonetransform)[MAXSTUDIOBONES][3][4] ) #else extern "C" int Server_GetBlendingInterface( int version, struct sv_blending_interface_s **ppinterface, struct engine_studio_api_s *pstudio, float (*rotationmatrix)[3][4], float (*bonetransform)[MAXSTUDIOBONES][3][4] ) #endif { if ( version != SV_BLENDING_INTERFACE_VERSION ) return 0; // Point the engine to our callback *ppinterface = &svBlending; // Copy in engine helper functions memcpy( &IEngineStudio, pstudio, sizeof( IEngineStudio ) ); g_pRotationMatrix = rotationmatrix; g_pBoneTransform = bonetransform; // Success return 1; } ...... void SV_StudioSetupBones( struct model_s *pModel, float frame, int sequence, const vec3_t angles, const vec3_t origin, const byte *pcontroller, const byte *pblending, int iBone, const edict_t *pEdict ) { int i, j; float f, subframe; float adj[MAXSTUDIOCONTROLLERS]; mstudiobone_t *pbones; mstudioseqdesc_t *pseqdesc; mstudioanim_t *panim; static vec3_t pos[MAXSTUDIOBONES]; float bonematrix[3][4]; static vec4_t q[MAXSTUDIOBONES]; static float pos2[MAXSTUDIOBONES][3]; static vec4_t q2[MAXSTUDIOBONES]; int chain[MAXSTUDIOBONES]; int chainlength = 0; // make sure our studio head is setup correctly ALERT(at_console, "SV_StudioSetupBones is called\n"); g_pstudiohdr = (studiohdr_t *)IEngineStudio.Mod_Extradata( pModel ); //<--- this is the line that crashes ..... _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders