Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

285 Neutral

About Murdocki

  • Rank
  1. Murdocki

    Obtaining low ping

    Alright so their pings shown on screen are just network travel times. Are there any uses for this ping other than showing the user whether or not he needs to get a shorter wire?   If we're considering a system that uses entity interpolation and client side prediction (eg valve's approach). Wouldn't the ping that incorporates any queues, tick interval and handling times be more useful for the simulation? For example, to know how far in the past you need to render remote actors you use the sum of the update ping and the server tickrate?
  2. I'm wondering how many games can get their ping so low (30ms or lower). I have made a basic localhost setup. The server updates at 10Hz and the client updates at 60Hz. When i measure the ping i get something like 60mS. I gues this is expected because on average pings would need to wait 50mS on the server (1000mS / 10Hz / 2) and 8mS on the client (1000mS / 60Hz / 2) before they are handled.   Do most games have much much higher update rates or do they have a special case for handling pings? Should pings bypass message queues for example?   The most extreme case i've seen is a game (WoW) reporting 5mS ping. I gues this can only be done with a server that doesn't use a discrete timestep but wakes up as soon as a ping is received? Even then, transport would have to be near instant and the client's update rate would be about 100Hz am i right?
  3. Murdocki

    OpenGL terrain

    You could have a look at texture splatting. If you use all four channels of a splat/detail texture you can have four types in a single base texture, resulting in four possible textures. I'm using two splat textures so i can have up to eight different textures applied to the terrain. This is more than enough for a single terrain patch.
  4. Murdocki

    Sun Shadows

    Usually you dont see the entire world, so you can limit the area you have to include in your shadow map, thus increasing it's resolution. As with other rendering optimizations it's always good to not render what you dont see, meaning you only need to have shadows inside your player's frustum. Using the sun's direction you can build an oriented bounding box around your frustum. You'll then have to extend that box in the direction of the sun so that it reaches all the way up to your scene/world's roof. This ensures that objects (a tree or tall building for example) that are outside of the player's view but are casting shadows into the player's view are still rendered into your shadow map. If you extend the obb's size to the roof of your scene and the sun is at an angle(which is pretty much always) then you'll be extending a part of the obb outside of the scene's bounding box. This will lose you a little bit of precision, which you can solve by using a sheared matrix for the sun's projection.
  5. Murdocki

    Downcast application registered interface.

    I've been trying  to use the sharing but this doesn't work as good as i hoped. Sure enough i can access other classes, but with sharing i cant seem to reload scripts anymore. If i reload the dependant class first (scene main script) i get a message that it uses a type with a different layout than in it's original module. That's the 'order of compilation' thing i gues, so then i've tried recompiling the dependency first (test anim player), but that doesn't work either. My reloading code works like this: Build a new module from the new source file with a new module name. Rename the new module to the old object type's name. Destroy instances of the old object type. Release old object type Start using the new object type from the new module. There's a few missing steps like old module cleanup and recreating / synchronizing new object instances, but this is how i was supporting rapid prototyping on isolated entity behaviours. My question now is: Is it actually possible to replace a shared object type?   I've stayed with 'sharing everything' instead of a single module because i dont see a way to add/remove/replace types on the fly when i'm using a single module. Making all the inter-module communication happen through an abstract class (EntityBehaviour) is suboptimal as i would then have to add annother abstract class for the scene's main script (so that behaviours may talk back as well). I then also would have to create an elaborate messaging system. Since the EntityBehaviour is defined by the engine while all it's concrete implementations are defined by the game. I cant possibly put all the functions/properties of all the derivatives into the main abstract class. I'd like to keep this messaging system as a last resort because i'd rather make direct function calls to other classes than send it some abstract message.
  6. Murdocki

    Downcast application registered interface.

    The script object returned by GetScriptBehaviour has it's reference increased prior to returning it, so i've been looking into the cast bytecode for the first cast (Script->EntityBehaviour). It looks like i've got multiple versions of the EntityBehaviour type. the 'to' variable is 0x090d5c58 while the 'objType' derives from 0x04321fe8. The DerivesFrom function checks on pointer so the types indeed dont match.   My gues is that it has something to do with the contexts/modules. Every derivative of an EntityBehaviour uses a different context, and so does the scene main script (the one that's doing the cast). They also all are placed inside their own module. I probably need to do something with the shared script entities. I dont think i can place all the scripts inside a single module, as the user should be able to add a new script even after the module has been compiled. If i make all the behaviours/derivatives 'shared' this should work right? The 'Shared script entities' page talks about order of module compilation, i gues this is no problem if i just include the files that contain the classes and not use forward declarations?(if they exist in as).   I've tried making the EntityBehaviour and TestAnimPlayer shared, this makes the casts work and i can call a function on the object. Is this a stable solution or am i misusing something? I dont fully understand modules/contexts yet, do i need to solve anything there or is this okay?
  7. Hello Angelscript users,   I'm trying to downcast an object handle from an application registered interface to a script defined class. I'm wanting to do this as described in the 'Returning script classes' section on this page. But that page doesn't describe what you can/cannot do with the returned handle, and that's where it's going wrong for me. My final goal is to be able to attach script instances to entities (as behaviours), but then i also want to get those script instances from inside other scripts. So for example i want the scene's main script be able to get a behaviour script that's attached to an entity in that scene. I've added relevant code below, i've provided quite alot to provide the entire context.     The application registers te interface i'm using to pass around the script instance like so: engine->RegisterInterface( "Script" ); Then the behaviours that are attached to an entity are included by the script builder like so: int IncludeCallback( const char* include, const char* from, CScriptBuilder* builder, void* userParam ) { ...(other predefined includes) else if( std::string( include ).compare( "EntityBehaviour" ) == 0 ) { static std::string entityBehaviourClass = "class EntityBehaviour : Script\n\ {\n\ Entity@ entity;\n\ ComponentLight@ light;\n\ ComponentModel@ model;\n\ ...(other components) }"; return builder->AddSectionFromMemory( "EntityBehaviour", entityBehaviourClass.c_str() ); } ...(includes from files) } The final scripted behaviour includes and implements the EntityBehaviour. #include "EntityBehaviour" class TestAnimPlayer : EntityBehaviour ...(class implementation) All of this is working fine by itself. But then when i try to add the functionality of getting the behaviours from an entity something is going wrong. I have added the function that should return the script class. This is registered outside the angelscript package so it's wrapped. The returned void* is actually an asIScriptObject*. void* GetScriptBehaviour( Entity& entity, const std::string& typeName ) { ...(looks up the behaviour by it's name and returns an asIScriptObject*) } scriptManager.RegisterObjectMethod( "Entity", "Script@ GetScriptBehaviour( const string& in )", asFUNCTION( GetScriptBehaviour ), EECore::ScriptManager::CALL_CDECL_OBJFIRST ) And here's the final script where it's going wrong: Entity@ lb = scene.GetEntity( "LB animated" ); //This handle is valid. Script@ playerScript = lb.GetScriptBehaviour( "TestAnimPlayer" ); //This handle is valid. //DebugScriptType( playerScript ); if( playerScript is null ) Print( "no player script found" ); else Print( "Player script was found" ); //This is printed (since the andle is valid) EntityBehaviour@ behaviour = cast< EntityBehaviour >( playerScript ); //Will be null if( behaviour is null ) Print( "cast failed" ); //Prints this else Print( "cast succeeded" ); TestAnimPlayer@ animPlayer = cast< TestAnimPlayer >( playerScript ); //Will be null if( animPlayer is null ) Print( "cast failed" ); //Prints this else Print( "cast succeeded" ); //animPlayer.animationClip = "dance"; The page on inheritance describes the '@handle_to_B = cast<B>(handle_to_A);' behaviour, which is what i'm wanting to do. Though i'm not sure, shouldn't it cast to B@? For debugging purposes i've hadded the DebugScriptType function, if i enable this it calls this method: void DebugScriptType( asIScriptObject* obj ) { obj->Release(); } engine->RegisterGlobalFunction( "void DebugScriptType( Script@ obj )", asFUNCTION( DebugScriptType ), asCALL_CDECL ); When inspecting the obj using the debugger it's filled in like this: obj   -objType     -name       -dynamic: TestAnimPlayer     -interfaces       -[0].name         -local: Script     -derived from       -name         -dynamic: EntityBehaviour       -interfaces         -[0].name           -local: Script This type hierarchy looks correct to me.   I hope somebody can help me out a bit with this, or would it be better to use the script handle add-on?   Thanks in advance.
  8. I am wondering about this as well. If you are just passing through the uniform how can it even be interpolating. The same value for every vertex in a triangle should effectively disable interpolation right?
  9. Murdocki

    C++/OpenGL Chess Game Project

    You really were on the right path. Make your design up-front to avoid a lot of problems later. Writing the code should be really just that, writing code, not thinking about how/where/what to write. Think of building software as-if you're building a house. Houses need a design up front to prevent making mistakes early in the construction process (eg building walls that dont support a heavy roof), the same holds true for software. And while you're at the design process you should really have a look at UML, it's pretty standard and alot more clear than fancy text colors. For tool you can have a look at violet uml editor, it's good for very basic designs. As for your last question, are WhitePiece and BlackPiece really fundamentally different from eachother? Or is it just some of the behaviour that needs to change? Also, dont worry about object count, as long as you're not making any mistakes resulting in constant copy-ing of objects, you can use many thousands of objects.
  10. Murdocki

    understanding return by value.

    If you want to avoid the intermediate constructor/destructor you could explicitly use the copy constructor like so: Test B( A.Make(11) ); To avoid the copy during method return you either have to return a reference or a pointer, but for this you'll need to guarantee that the object will survive beyond the method's scope. You could also use reference out parameters like so: bool Make(int ID, Test& outParam ) { outParam = Test(ID); return true; //Return something for the user to know if creation succeeded. } int main(int argc, char **argv) { Test A = Test(10); Test B; A.Make(11, B); }
  11. Murdocki

    Initializing DevIL

    Are you sure you have to init ilu and ilut yourself? I'm not and i can use them just fine: ..context creation.. ilInit(); ilutRenderer( ILUT_OPENGL ); ..texture loading.. GLuint textureID = ilutGLLoadImage( charArr ); ilutGLBuildMipmaps(); provided charArr is a proper file, textureID then contains the id of the opengl texture you can use.
  12. Hey guys, Recently i've reinstalled my pc which also included a new visual studio 2010 installation. With this new installation i'm experiencing alot (about once per minute) of visual studio crashes. Here's some things i was doing when vs crashed: Linking Typing a . (opening autocomplete) Pressing F5 to start a debug session Any time the debugger hits a breakpoint Any time a breakpoint is placed while a debug session is in progress Also the output generated (an executable) seems to be corrupt or something similar. I am able to run the application but the scripting environment (angelscript) goes completely whack. As in where a perfectly fine Vec3 is interpreted as all float max values. This all happens with a codebase that was working perfectly fine before which suggests the issue is tool related rather than source or solution. I have installed all available windows updates and visual studio updates (eg vs SP1). I am missing a hotfix i had before the reinstall though, but this hotfix i needed because builds were hanging up on '.exe in use' so i dont think this hotfix will fix all of these issues. I'm just wondering if anyone has any tips on where to go from here (i have allready tried another reinstall and that didnt help) I appreciate any help, Murdocki
  13. Since you want to make your viewport width match your window width you just need to use the window's height and the desired viewport height to calculate what you should provide in the y parameter for your glViewport call: x, y specify the lower left corner of the viewport. Your game coordinates should be viewport relative unless you make them so that they aren't.
  14. i had issues with linking static libraries in eclipse as well. For me the issue was that the libraries i tried to link were not in a subfolder of the project's root (even output libraries from other projects also in the workspace could not be linked). To fix this i just made a libs folder, pasted all the libraries in there and then linked them. You may also have to take a look at the order in which you're linking the libraries. Not sure why but this was an issue for me as well, it may have something to do with something else though so try the other thing first.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!