Welcome to the 42 Amsterdam multiserver.
Results 1 to 6 of 6

Thread: Serious Sam SDK

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Location
    Kyiv, Ukraine
    Posts
    27

    Question Serious Sam SDK

    Hi.
    Does anyone know, how to optimise code for multiplayer to avoid getting Syncbads?
    I already know, that you should use RelativeToAbsoluteSmooth() instead of RelativeToAbsolute() (same thing for AbsoluteToRelative() ), but my code still causes bad syncs.

    The code itself doesn't contain any rand() functions, so it should work theoretically, but for some reason it doesn't.

  2. #2
    Vinyl Scratch
    Join Date
    Oct 2012
    Location
    Zagreb, Croatia
    Posts
    54
    Pause the game on bad syncs, set cli_bDumpSync to 1 both on server and client. This will output Temp/SyncDump.txt on both server and client. Compare those files, and you know what's getting out of sync.
    - Angelo (aka Scratch aka YS)

  3. #3
    Junior Member
    Join Date
    Dec 2012
    Location
    Kyiv, Ukraine
    Posts
    27
    Thanks for replying!

    The reason of bad syncs is that client and server return different values for GetPlacement()... I think I should get predicted placement for client. There are 2 functions in EnemyBase class called "ShootPredictedProjectile" and "CalculatePredictedPosition". Perhaps they contain the solution to all my problems...

  4. #4
    Banned
    Join Date
    Jul 2012
    Location
    nothin are changes with our commander.... it seems, that we're need to find a new commander for SS )
    Posts
    271
    hello,I need your help, I have a code that corresponds to a group of enemies with a "0" became friendly, and I have a parameter that is responsible for the fact that they follow the player permanently, as bots in a mod that's actually Parse error (by Dwk) code:
    Friendship()
    {
    m_bRunningToFriend = TRUE;
    GetWatcher()->SendEvent(EStart());

    // while there is a valid marker, take values from it
    if (m_penFriend != NULL) {
    if(!(m_penFriend->GetFlags()&ENF_ALIVE)) {
    StopMoving();
    StandingAnim();
    m_penFriend = NULL;
    m_bRunningToFriend = FALSE;
    return EReturn();
    }
    CEntity *pem = &*m_penFriend;
    // the marker position is our new start position for attack range
    CPlacement3D plFriend = m_penFriend->GetPlacement();
    /*plFriend.AbsoluteToRelative(GetPlacement());
    plFriend=CPlacement3D(plFriend.pl_PositionVector/2.0f,plFriend.pl_OrientationAngle);
    plFriend.RelativeToAbsolute(GetPlacement());*/
    m_vStartPosition = plFriend.pl_PositionVector;
    m_vDesiredPosition = m_vStartPosition;
    // use attack speeds
    m_fMoveSpeed = GetProp(m_fAttackRunSpeed)*m_fSpeedMultiplier;
    m_aRotateSpeed = GetProp(m_aAttackRotateSpeed);
    // start running anim
    RunningAnim();

    autocall MoveToDestination() EReturn;

    // wait a bit always (to prevent eventual busy-looping)
    autowait(0.05f);
    } // when no more markers

    // stop where you are
    StopMoving();
    StandingAnim();
    m_bRunningToFriend = FALSE;

    // return to called
    return EReturn();
    };
    but, I had a problem (
    1) as even after the big fight, they stand as driven ((
    2) if for him (that is, a group of enemies 0) shoots a player, they also stand (which I already corrected))
    Watcher.es already in the mood (I was helping a friend set it up)
    help if we have not seen anything that will recommend something.
    Last edited by Devon; 15-04-2013 at 11:01.

  5. #5
    Junior Member
    Join Date
    Dec 2012
    Location
    Kyiv, Ukraine
    Posts
    27
    m_vStartPosition = plFriend.pl_PositionVector;
    m_vDesiredPosition = m_vStartPosition;
    I think, the problem is here. The destination and start positions are the same. Try this:
    Code:
    m_vStartPosition = GetPlacement().pl_PositionVector;
    m_vDesiredPosition = plFriend.pl_PositionVector;
    But I'm not sure whether this is the source of the problem or not.

    BTW,
    plFriend.RelativeToAbsolute(GetPlacement());
    I know that this line is commented, but it is better to use RelativeToAbsoluteSmooth() instead of RelativeToAbsolute().

  6. #6
    Banned
    Join Date
    Jul 2012
    Location
    nothin are changes with our commander.... it seems, that we're need to find a new commander for SS )
    Posts
    271
    hmm, did not help ((I want to heir class "CEnemyBase" follow the player, at any distance, and when you touch to it.

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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