Re: [hlcoders] Multiplayer NPCs
Childe Roland wrote: Does anybody know where I can get more information about transfering existing code to be client side?? Probably just by looking at the sdk source code to see what stuff is handled in cl_dll (client side) verses dlls (server side) and, of course, game_shared (for things that run on both the client and the server). Looking at the source code is the best way to understand how things should be done. "Use the source Luke." - Obi-wan -- Jeffrey "botman" Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] Client-Side entities questions
1) Creating solid client-side entities I'm working on a mod that involves building structures on the ground from a "RTS" view (topdown), using the mouse cursor. To help the player position its structure, I'm creating a temporary client-side entity reprensiting the selected structure. This temporary entity follows the mouse cursor to help him visualize where the structure will be placed. I've managed to create the client side only entity using C_BaseEntity::InitializeAsClientEntity(, RENDER_GROUP_OPAQUE_ENTITY). I've also added the following code in the temp model entity's SpawnClientEntity method: MyTempModelClass::SpawnClientEntity( void ) { SetMoveType(MOVETYPE_NONE); SetSolid( SOLID_BBOX ); } The real problem arise when I try to access the temp model entity's collision bounds. Basically, I want to get the current model's mins & maxs and use them in a UTIL_TraceHull to check if the location where the player wants to build is free or not (ie: there is a player or another structure there already). Ive tryed several different ways of accessing these mins & maxs (WorldAlignedMins/Maxs(), PropCollision()->OBBMins/Maxs(), GetRenderBounds, etc) but each time the returned vectors are (0,0,0) for some reasons. Also, the client-side structure doesn't appear to be solid (I can walk through it) but this may be because collision detections are done server side in this case. I have no idea what Im doing wrong here and could really use some help on this matter. Is there a better way of checking if a given space around an entity is empty of solid entities / world geometry? 2) Entity Visibility on the client-side I would like to determine if a given set of C_BaseEntities are currently visible to the local player on the client side, without using expensive trace lines. I'm going to be displaying text on the hud near each of these entities, and I would like to cull out the ones that are not currently visible. I've tryed using g_pClientLeafSystem->IsRenderableInPVS( ) but it doesn't seem to have any effect as I can still see the name of entities behind walls appearing through. Thanks in advance for your help! Spk ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] RE: View vectors in a hud?
You can just use the local player's EyeAngles and figure out if pitch > 90, yaw < 180, etc etc... And get some sleep man , you sound tired ;) -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.2 - Release Date: 21/04/2005 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] [OT] Fun
hi. this its a littel offtopic (you already know that, batman) Ok, this guys win: http://fragfiles.org/downloads/HL2JKSTrailer.wmv ..everybody can return home. This mod its the absolutelly brilliant finest fun EVER mod on Earth and Outside USA. Nothing to se here. Half-life 1 win. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] VGUI and Schemes... (Again.)
Well I'd left this hanging for a while because i had a ton of other things to do for my mod, but i'm back at square "VGUI" trying to figure out how to make my panels be scheme'd based on the localplayer's team. I already have a function that returns the correct names of schemes based on his team... BUT, for some reason, there just isn't a way for it to use anything else but ClientScheme. Here's some example code i tried to use in a CONSTRUCTOR for my panel, and it wasn't able to fetch the right scheme (the colors were still the default HL2 ones.) vgui::HScheme myscheme; myscheme = vgui::scheme()->LoadSchemeFromFile("resource/VaminScheme.res","VaminScheme"); SetScheme(myscheme); InvalidateLayout(false,true); It doesn't work. I tried FORCING my own scheme down the throat of ApplySchemeSettings and same result: default scheme... You can't tell me nothing is wrong here, i don't think i've overlooked anything to get this dumb custom scheme to work, something is borked and i doubt it's on my end :( -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.2 - Release Date: 21/04/2005 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Netcode and Vehicles
Childe Roland wrote: Ok, so I decided to create my own vehicle class, CPropCGjeep. It derives from CPropVehicleDriveable on the server side, and C_PropVehicleDriveable on the client side. I did this using an #ifdef CLIENT_DLL like is shown many times in the code. However, when I declare this: IMPLEMENT_NETWORKCLASS_ALIASED( CPropCGjeep, DT_PropCGjeep ) The compiler gives me the error: error C2653: 'C_CPropCGjeep' : is not a class or namespace name IMPLEMENT_NETWORKCLASS_ALIASED is defines as follows... #define IMPLEMENT_NETWORKCLASS_ALIASED(className, dataTable) \ IMPLEMENT_CLIENTCLASS( C_##className, dataTable, C##className ) ...so it makes the assumption that the class CWhatever on the server will be mirrored by the class C_CWhatever on the client (the macro prepends an additional "C_" to the class name. If your class on the server is "CPropCGjeep", then your class on the client had better be "C_CPropCGjeep". -- Jeffrey "botman" Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Netcode and Vehicles
Ok, so I decided to create my own vehicle class, CPropCGjeep. It derives from CPropVehicleDriveable on the server side, and C_PropVehicleDriveable on the client side. I did this using an #ifdef CLIENT_DLL like is shown many times in the code. #include "cbase.h" #ifdef CLIENT_DLL #include "c_prop_vehicle.h" #include "c_baseplayer.h" #define CPropCGjeep C_PropCGjeep #define CPropVehicleDriveable C_PropVehicleDriveable #else #include "vehicle_base.h" #include "baseplayer.h" #endif #include "movevars_shared.h" #include "view.h" #include "flashlighteffect.h" #include "c_te_effect_dispatch.h" #include "CBaseVehicles.h" However, when I declare this: IMPLEMENT_NETWORKCLASS_ALIASED( CPropCGjeep, DT_PropCGjeep ) The compiler gives me the error: error C2653: 'C_CPropCGjeep' : is not a class or namespace name Why would the preprocessor be inserting that extra C when I clarly have CPropCGJeep being changed to C_PropCGjeep? Also, am I going about this the right way? Will I be able to derive that shared class from 2 completely different classes (CPropVehicleDriveable, C_PropVehicleDriveable) and still have it 'sync' up? On 4/21/05, Childe Roland <[EMAIL PROTECTED]> wrote: > I was wondering if you can give me a clue on how to start. Perhaps > you could move one of the functions client side as a demo? I really > have no idea how your guys' netcode works or how to begin moving > things to the client side. Any hints or links you can give me that > may give me a start on how to do this would be greatly appreciated. > > Thanks. > > On 12/15/04, Yahn Bernier <[EMAIL PROTECTED]> wrote: > > You should be able to make your vehicles as lightweight from a > > networking point of view in Source as in any other current or next > > generation engine. You have complete control over how much data is sent > > for each vehicle and it's generally not too tricky to move lots of logic > > over to the client to avoid having to network it. In fact, you could > > make vehicles nearly 100% client side if you so desired. > > > > Jay or I are happy to provide specific suggestions on how to reduce > > bandwidth usage by vehicles/phyics/players/weapons or whatever you run > > into, but you'll need to formulate a plan so you can ask questions we > > can give real answers to. > > > > I'd love to see someone try to do a 32 vehicle game and we'd be happy to > > help with any technical issues along the way. > > > > Yahn > > > > -- > = > Childe Roland > "I will show you fear in a handful of jellybeans." > -- = Childe Roland "I will show you fear in a handful of jellybeans." ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Netcode and Vehicles
> Why would the preprocessor be inserting that extra C when I clarly > have CPropCGJeep being changed to C_PropCGjeep? I'm not going to bother looking into it particularly deeply (:P) but keep in mind that IMPLEMENT_NETWORKCLASS_ALIASED is a macro. Look up its definition; you're probably using it incorrectly or missing some associated requirement. mail2web - Check your email from the web at http://mail2web.com/ . ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Shared-Jeep-Code Thread
Childe Roland wrote: I basically tried to create one class that contains all the functions of both the PropVehicleJeep and C_PropVehicleJeep. When I compile it, I still get one error. All of this is just from grepping the the source code. I haven't actually worked with any of this so I might be talking out of my ass (a neat trick), but here goes... Probably the best thing to do is take one entity and look at what it has defined, for example basegrenade_shared.cpp has this... #if !defined( CLIENT_DLL ) // Global Savedata for friction modifier BEGIN_DATADESC( CBaseGrenade ) // nextGrenade DEFINE_FIELD( m_hThrower, FIELD_EHANDLE ), // m_fRegisteredSound ??? DEFINE_FIELD( m_bIsLive, FIELD_BOOLEAN ), DEFINE_FIELD( m_DmgRadius, FIELD_FLOAT ), DEFINE_FIELD( m_flDetonateTime, FIELD_TIME ), DEFINE_FIELD( m_flWarnAITime, FIELD_TIME ), DEFINE_FIELD( m_flDamage, FIELD_FLOAT ), DEFINE_FIELD( m_iszBounceSound, FIELD_STRING ), DEFINE_FIELD( m_bHasWarnedAI, FIELD_BOOLEAN ), // Function Pointers DEFINE_THINKFUNC( Smoke ), DEFINE_ENTITYFUNC( BounceTouch ), DEFINE_ENTITYFUNC( SlideTouch ), DEFINE_ENTITYFUNC( ExplodeTouch ), DEFINE_USEFUNC( DetonateUse ), DEFINE_THINKFUNC( DangerSoundThink ), DEFINE_THINKFUNC( PreDetonate ), DEFINE_THINKFUNC( Detonate ), DEFINE_THINKFUNC( TumbleThink ), END_DATADESC() void SendProxy_CropFlagsToPlayerFlagBitsLength( const SendProp *pProp, const void *pStruct, const void *pVarData, DVariant *pOut, int iElement, int objectID); #endif ...BEGIN_DATADESC (found in datamap.h) defines the GetDataDescMap() function for you. The DATADESC stuff, to me, just looks like stuff you would need to save/restore for a single player game. I would assume for a multiplayer game, you could just have something like this... BEGIN_DATADESC( CBaseGrenade ) // empty END_DATADESC() ...then back to basegrenade_shared.cpp we have this... IMPLEMENT_NETWORKCLASS_ALIASED( BaseGrenade, DT_BaseGrenade ) BEGIN_NETWORK_TABLE( CBaseGrenade, DT_BaseGrenade ) #if !defined( CLIENT_DLL ) SendPropFloat( SENDINFO( m_flDamage ), 10, SPROP_ROUNDDOWN, 0.0, 256.0f ), SendPropFloat( SENDINFO( m_DmgRadius ), 10, SPROP_ROUNDDOWN, 0.0, 1024.0f ), SendPropInt( SENDINFO( m_bIsLive ), 1, SPROP_UNSIGNED ), // SendPropTime( SENDINFO( m_flDetonateTime ) ), SendPropEHandle( SENDINFO( m_hThrower ) ), SendPropVector( SENDINFO( m_vecVelocity ), 0, SPROP_NOSCALE ), // HACK: Use same flag bits as player for now SendPropInt ( SENDINFO(m_fFlags), PLAYER_FLAG_BITS, SPROP_UNSIGNED, SendProxy_CropFlagsToPlayerFlagBitsLength ), SendPropTime( SENDINFO( m_flNextAttack ) ), #else RecvPropFloat( RECVINFO( m_flDamage ) ), RecvPropFloat( RECVINFO( m_DmgRadius ) ), RecvPropInt( RECVINFO( m_bIsLive ) ), // RecvPropTime( RECVINFO( m_flDetonateTime ) ), RecvPropEHandle( RECVINFO( m_hThrower ) ), // Need velocity from grenades to make animation system work correctly when running RecvPropVector( RECVINFO(m_vecVelocity), 0, RecvProxy_LocalVelocity ), RecvPropInt( RECVINFO( m_fFlags ) ), RecvPropTime( RECVINFO( m_flNextAttack ) ), #endif END_NETWORK_TABLE() ...this defines the networked properties that get sent from server to client. Notice the code compiled on the server would include the SendPropXXX() stuff and the code compiled on the client would include the RecvPropXXX() stuff (and you BETTER have a RecvProp() for each SendProp() or things will get weird). This NETWORK_TABLE lets the engine know what data needs to be replicated between the server and the client. Then we have this... BEGIN_PREDICTION_DATA( CBaseGrenade ) DEFINE_PRED_FIELD( m_hThrower, FIELD_EHANDLE, FTYPEDESC_INSENDTABLE ), DEFINE_PRED_FIELD( m_bIsLive, FIELD_BOOLEAN, FTYPEDESC_INSENDTABLE ), DEFINE_PRED_FIELD( m_DmgRadius, FIELD_BOOLEAN, FTYPEDESC_INSENDTABLE ), // DEFINE_PRED_FIELD_TOL( m_flDetonateTime, FIELD_FLOAT, FTYPEDESC_INSENDTABLE, TD_MSECTOLERANCE ), DEFINE_PRED_FIELD( m_flDamage, FIELD_FLOAT, FTYPEDESC_INSENDTABLE ), DEFINE_PRED_FIELD_TOL( m_vecVelocity, FIELD_VECTOR, FTYPEDESC_INSENDTABLE, 0.5f ), DEFINE_PRED_FIELD_TOL( m_flNextAttack, FIELD_FLOAT, FTYPEDESC_INSENDTABLE, TD_MSECTOLERANCE ), // DEFINE_FIELD( m_fRegisteredSound, FIELD_BOOLEAN ), // DEFINE_FIELD( m_iszBounceSound, FIELD_STRING ), END_PREDICTION_DATA() ...to define prediction data so that things that are moving/changing on the clients and servers can be predicted properly. If you look at the BEGIN_PREDICTION_DATA() macro, you'll notice this part... &BaseClass::m_PredMap ...oh, cool. The Prediction data also includes the prediction data of the base class that this class inh
RE: [hlcoders] VGUI and Schemes... (Again.)
Override Panel::SetScheme() in your panel class (both Hscheme and string versions), write a simple pass thru and drop a breakpoint on it. I bet that the view port or something similar is resetting your panels scheme after construction. Scheme application is recursive, it applied to all children panels under the parent. The base viewport is the parent of all the hud panels, so when it gets it scheme set it will reset all the hud elements to that scheme. - Alfred -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Imperio59 Sent: Friday, April 22, 2005 7:43 AM To: hlcoders@list.valvesoftware.com Subject: [hlcoders] VGUI and Schemes... (Again.) Well I'd left this hanging for a while because i had a ton of other things to do for my mod, but i'm back at square "VGUI" trying to figure out how to make my panels be scheme'd based on the localplayer's team. I already have a function that returns the correct names of schemes based on his team... BUT, for some reason, there just isn't a way for it to use anything else but ClientScheme. Here's some example code i tried to use in a CONSTRUCTOR for my panel, and it wasn't able to fetch the right scheme (the colors were still the default HL2 ones.) vgui::HScheme myscheme; myscheme = vgui::scheme()->LoadSchemeFromFile("resource/VaminScheme.res","VaminSche me"); SetScheme(myscheme); InvalidateLayout(false,true); It doesn't work. I tried FORCING my own scheme down the throat of ApplySchemeSettings and same result: default scheme... You can't tell me nothing is wrong here, i don't think i've overlooked anything to get this dumb custom scheme to work, something is borked and i doubt it's on my end :( -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.2 - Release Date: 21/04/2005 ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] Shared-Jeep-Code Thread
I basically tried to create one class that contains all the functions of both the PropVehicleJeep and C_PropVehicleJeep. When I compile it, I still get one error. - CBaseVehicle.obj : error LNK2001: unresolved external symbol "private: virtual struct datamap_t * __thiscall C_CPropCGjeep::GetDataDescMap(void)" ([EMAIL PROTECTED]@@EAEPAUdatamap_t@@XZ) - I can't find any examples of GetDataDescMap, so I assume it is in one of the Macros. This is how I used the Macros: -- IMPLEMENT_NETWORKCLASS_ALIASED( CPropCGjeep, DT_PropCGjeep ) BEGIN_NETWORK_TABLE( CPropCGjeep, DT_PropCGjeep ) END_NETWORK_TABLE() BEGIN_PREDICTION_DATA( CPropCGjeep ) END_PREDICTION_DATA() - Is this correct? Do I need to put my variables inside these macros, or will that be done automatically? I'm still not sure about the useage of the Network macros, perhaps when I get those right, the linker error will be fixed. -- = Childe Roland "I will show you fear in a handful of jellybeans." ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders