Skip to content

Conversation

ifeldshteyn
Copy link
Contributor

@ifeldshteyn ifeldshteyn commented Feb 26, 2025

This is a POC replay code that is compatible with 1.15

Things to try
The replay section is in **Settings --> Replays **

  1. Try playing the built-in secbase demo. See if it works for you
  2. Try recording any demo and playing it back. Can be either built-in missions or the mods (you can either check Record box or Record All box)
  3. Ensure you have Playback speed up/slowdown buttons set under** Settings-->Inputs**
  4. Try playing back any demo and using the speedup/slowdown (Default: Numpad +/- )
  5. Test whether you can totally pause the demo by going below 30 FPS with Numpad - or make it Fast Forward (go above 240 FPS - ie: use VSYNC off).
  6. Try turning on and off the update visualization (Ex: how many main loop cycles you've played back).

Copy link
Owner

@luciusDXL luciusDXL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, will push once tested locally.

@jerethk
Copy link
Contributor

jerethk commented Mar 10, 2025

Wow this is epic
Well done

static MouseBot* s_curMouseBot;
static s32 s_mouseNum = 0;

void mousebot_resetNum()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed that Lucius adds a // TFE comment above new functions and variables that have been added, it helps us see what did not come from vanilla
I've been trying to do the same
I think it would be good if you could do this as well, where possible

s_playerInfo.health = pickup_addToValue(0, 100, s_healthMax);
s_playerInfo.healthFract = 0;
s_batteryPower = s_batteryPowerMax;
// Always reset player ticks on init for replay consistency
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "TFE" following Lucius' convention


void mission_exitLevel()
{
// Force the game to exit the replay modes in case you try to exit through the menu / console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "TFE" following Lucius' convention (you get the picture) :-)

extern void weapon_animateOnOrOffscreen(MessageType msg);
JBool computeAutoaim(fixed16_16 xPos, fixed16_16 yPos, fixed16_16 zPos, angle14_32 pitch, angle14_32 yaw, s32 variation);

// Ensure that the weapon is reset to the default states for replays
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "TFE"

@@ -0,0 +1,1143 @@
#include <TFE_Input/replay.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just asking the question - is TFE_Input the appropriate place for this, or should you create a new directory and namespace called TFE_Replay ?

What do you think @luciusDXL

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we decided to let it exist here for now and potentially refactor it later.


// This is not really needed but for replay comparison reset the turret/mouse task IDs
TFE_DarkForces::mousebot_resetNum();
TFE_DarkForces::turret_resetNum();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that you don't need to do the same for the other enemies?
It looks like welders, dragons, dark troopers also are numbered

local(moveMod)->target.yaw = local(odd) ? (local(obj)->yaw + deltaYaw) : (local(obj)->yaw - deltaYaw);

local(moveMod)->target.yaw = local(odd) ? (local(obj)->yaw + deltaYaw) : (local(obj)->yaw - deltaYaw);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it is my turn to nit pick :-)
There seem to be a lot of this in your diffs -- meaningless whitespaces added to lines
I think it would be good to revert as many of them as possible, so your PR commit does not have a whole lot of unnecessary diffs
(Would help in the future if anybody, including yourself, needs to search through the diff while bug hunting etc.)

s_framebuffer = ldraw_getBitmap();
lcanvas_getBounds(&s_viewBounds);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another one

// Draw the overlay *behind* the main view - which means we must blit it to the view.
pda_drawOverlay();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple more

}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

etcetra

@luciusDXL luciusDXL merged commit f328121 into luciusDXL:master Mar 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants