Results 1 to 10 of 22

Thread: Periphery Online / MMORTS

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Thanks, i will try to make sense of that, it looks like a simple exporter with clearly separated structures, t-pose is also exported so each model has its own t-pose (does this cause you issues if you want to share animations between multiple modems? )
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  2. #2
    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;
    }

  3. #3
    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

  4. #4
    Awesome. Well done!

  5. #5
    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.

  6. #6
    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"?

  7. #7
    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.

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
  •