Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: Periphery Online / MMORTS

  1. #11
    Yes, I am using several models with the same armature, and only one animation collection for all models.

    In fact, t-pose is not used in any way when imported into the game engine. This function in the script only serves to initialize the matrices. The values did not need to be written to the file.

    In the engine, I get matrices directly from positions and rotations:
    Code:
    procedure mat4.AssignEulerTranslation( e,t :vec3 );
    var
     cy,sy,cp,sp,cr,sr :float;
     q                 :vec4;
    begin
    
     LoadIdentity;
    
     cy := cos(e.z * 0.5);
     sy := sin(e.z * 0.5);
     cp := cos(e.y * 0.5);
     sp := sin(e.y * 0.5);
     cr := cos(e.x * 0.5);
     sr := sin(e.x * 0.5);
    
     q.w := cy * cp * cr + sy * sp * sr;
     q.x := cy * cp * sr - sy * sp * cr;
     q.y := sy * cp * sr + cy * sp * cr;
     q.z := sy * cp * cr - cy * sp * sr;
    
     with q do  // m3 AssignQuaternion
     begin
      e00 := 1.0 - ( y * y + z * z ) * 2.0;
      e01 :=       ( x * y + w * z ) * 2.0;
      e02 :=       ( x * z - w * y ) * 2.0;
    
      e10 :=       ( x * y - w * z ) * 2.0;
      e11 := 1.0 - ( x * x + z * z ) * 2.0;
      e12 :=       ( y * z + w * x ) * 2.0;
    
      e20 :=       ( x * z + w * y ) * 2.0;
      e21 :=       ( y * z - w * x ) * 2.0;
      e22 := 1.0 - ( x * x + y * y ) * 2.0;
     end;
    
     e30 := t.x;
     e31 := t.y;
     e32 := t.z;
    
    end;
    For animation, I send these matrices to a simple shader like this:
    Code:
    uniform mat4 mm[32];
    attribute vec3  vv;
    attribute vec3  nn;
    attribute vec2  tt;
    attribute ivec2 bb;
    attribute vec2  ww;
    varying vec2 tex_coord;
    varying vec3 normal;
    void main( void )
    {
     ivec2 ibb = ivec2( bb );
     vec4 v1 = vec4( vv , 1.0 );
     vec4 v2 = ( mm[ibb[0]] * v1 ) * ww[0] + ( mm[ibb[1]] * v1 ) * ww[1];
     vec4 n1 = vec4( nn , 0.0 );
     vec4 n2 = ( mm[ibb[0]] * n1 ) * ww[0] + ( mm[ibb[1]] * n1 ) * ww[1];
     normal      = normalize( gl_NormalMatrix * n2.xyz );
     tex_coord   = tt;
     gl_Position = gl_ModelViewProjectionMatrix * v2;
    }

  2. #12
    I tried the game. It is really awsome! Excellent work, from an design- but also from a programming stand point. The Age of Empires controls and sounds are great, too! - I wonder, as it is MMORTS, what happens if I log off and someone attacks. I will be an easy target in this case, right?

    The source code is not available, right?

    Best regards
    Matthias

  3. #13
    Awesome. Well done!

  4. #14
    Matthias, Jonax - thanks.

    I wonder, as it is MMORTS, what happens if I log off and someone attacks. I will be an easy target in this case, right?
    Yes, at any moment any other player will be able to attack you. For protection, you can build defensive structures such as towers and walls. The wall has a lot of HP, absorbs and reflects most of the damage, and can be upgraded as long as there are enough resources.

    The source code is not available, right?
    Sorry, in order to prevent desync, the code will not be available. It's a multiplayer game, after all.

  5. #15
    Quote Originally Posted by rts111 View Post
    Matthias, Jonax - thanks.


    Yes, at any moment any other player will be able to attack you. For protection, you can build defensive structures such as towers and walls. The wall has a lot of HP, absorbs and reflects most of the damage, and can be upgraded as long as there are enough resources.
    I see, that is what I expected and I like this.

    Quote Originally Posted by rts111 View Post
    Sorry, in order to prevent desync, the code will not be available. It's a multiplayer game, after all.

    Never mind, but what do you mean by "prevent desync"?

  6. #16
    I meant that if some player has access to the code, and if he changes the code of his game client, for example, increases the HP of a unit, then his client will work out of sync with other players' game clients. Something like that.

  7. #17
    Quote Originally Posted by rts111 View Post
    I meant that if some player has access to the code, and if he changes the code of his game client, for example, increases the HP of a unit, then his client will work out of sync with other players' game clients. Something like that.
    So this would mean you are using distributed processing of game state where each client is processing state of its own ingame units. Right?

  8. #18
    To make the server work as easy as possible, a significant part of the calculations has been transferred to the client side. Yes, something like distributed processing.

  9. #19
    I bet many of PGD members would like to peek into your code to see how you managed to do this. And not for intention of cheating your game but instead to get idea of how to tackle something like this in our current or future projects

  10. #20
    Judging by myself, I would definitely try to hack.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •