Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix certain fields not getting saved in SourceTV demos #290

Merged
merged 3 commits into from Sep 10, 2016

Conversation

Projects
None yet
2 participants
@squeek502
Copy link
Member

commented Jul 7, 2016

This will fix all the following fields not getting saved in SourceTV demos (+ pyro jetpack fuel once that's added):

BEGIN_SEND_TABLE_NOBASE( CFFPlayer, DT_FFPlayerObserver )
    SendPropFloat(SENDINFO(m_flNextClassSpecificSkill)),
    SendPropFloat(SENDINFO(m_flTrueAimTime)),
    SendPropFloat(SENDINFO(m_flHitTime)),
    SendPropInt(SENDINFO(m_nButtons)),
END_SEND_TABLE()

The one potential caveat here is that m_nButtons changes a lot, so saving it in the SourceTV demo for each player might inflate the size of demos considerably. The m_nButtons field is only needed for hud_keystate, so if we think it's too risky we could intentionally remove it from getting sent to SourceTV.

@AfterShockFF

This comment has been minimized.

Copy link
Member

commented Jul 7, 2016

Whats m_flNextClassSpecificSkill needed for, is that to display the overpressure hud bar? I wonder if we could round that to 8 bits rather than 32, since 256 segments on screen is probably fine. Similarly can we squeeze flHitTime down at all?

I know it seems like potentially over optimising but if it saves everyone disk space, download time and provides a good standard for future I think its worth it.

@squeek502

This comment has been minimized.

Copy link
Member Author

commented Jul 7, 2016

Yes, m_flNextClassSpecificSkill is for overpressure (the cooldown also shows on the AC viewmodel).

You're right that those floats seem like they can be optimized. Here's some potentially similar fields; I couldn't actually find many examples of curtime fields:

// playerlocaldata.cpp
    SendPropFloat   (SENDINFO(m_flDucktime), 12, SPROP_ROUNDDOWN|SPROP_CHANGES_OFTEN, 0.0f, 2048.0f ),
    SendPropFloat   (SENDINFO(m_flDuckJumpTime), 12, SPROP_ROUNDDOWN, 0.0f, 2048.0f ),
    SendPropFloat   (SENDINFO(m_flJumpTime), 12, SPROP_ROUNDDOWN, 0.0f, 2048.0f ),
// player.cpp
        SendPropFloat       ( SENDINFO( m_flDeathTime ), 0, SPROP_NOSCALE ),

I'm not really sure what the limits of curtime are.

@squeek502

This comment has been minimized.

Copy link
Member Author

commented Jul 7, 2016

Just realized that there's also a SendPropTime function:

// basecombatweapon_shared.cpp
    SendPropTime( SENDINFO( m_flNextPrimaryAttack ) ),
    SendPropTime( SENDINFO( m_flNextSecondaryAttack ) ),

What it looks like (I'm not really sure what -1 bits does or SPROP_NOSCALE):

SendProp SendPropTime(
    char *pVarName,
    int offset,
    int sizeofVar )
{
//  return SendPropInt( pVarName, offset, sizeofVar, TIME_BITS, 0, SendProxy_Time );
    // FIXME:  Re-enable above when it doesn't cause lots of deltas
    return SendPropFloat( pVarName, offset, sizeofVar, -1, SPROP_NOSCALE );
}

squeek502 added some commits Jul 7, 2016

Fix SendProxy_OnlyToObservers not sending data to SourceTV
 - This was stopping fields in a SendProxy_OnlyToObservers datatable from getting saved to the SourceTV demo (and presumably also getting propagated to clients connected to SourceTV)

@squeek502 squeek502 force-pushed the fixes/sourcetv-sendproxy branch from 060c937 to 159af56 Sep 5, 2016

@AfterShockFF

This comment has been minimized.

Copy link
Member

commented Sep 10, 2016

Is this ready to merge?

@squeek502

This comment has been minimized.

Copy link
Member Author

commented Sep 10, 2016

Yes

@AfterShockFF AfterShockFF merged commit e2629fc into beta Sep 10, 2016

@squeek502 squeek502 deleted the fixes/sourcetv-sendproxy branch Sep 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.