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

Tried to alter Replay to run with 10 Bots - Did not work #220

Open
PlamAtom opened this issue Dec 21, 2021 · 12 comments
Open

Tried to alter Replay to run with 10 Bots - Did not work #220

PlamAtom opened this issue Dec 21, 2021 · 12 comments

Comments

@PlamAtom
Copy link

I want to rebuild demos using Practicemode because there is to my knowledge no free demo replay plugin.

Expected behavior

executes role 0-9 (10 Roles) (Yes and i renamed the recordings)

Actual behavior

executes role 0-4(5 Roles)

Steps to reproduce

  • Plugin version: 1.3.3
  • Sourcemod version: 1.1.1
  • Steps to reproduce (please be specific): Altered accessable code so might be impossible without editing the sourcepawn code.

"Replays"
{
"0"
{
"name" "unnamed - use .namereplay on me!"
"role1"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role0/a.rec"
"team" "CT"
}
"role2"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role1/b.rec"
"team" "CT"
}
"role3"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role2/c.rec"
"team" "CT"
}
"role4"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role3/d.rec"
"team" "CT"
}
"role5"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role4/e.rec"
"team" "CT"
}
"role6"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role5/a-2.rec"
"team" "T"
}
"role7"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role6/b-2.rec"
"team" "T"
}
"role8"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role7/c-2.rec"
"team" "T"
}
"role9"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role8/d-2.rec"
"team" "T"
}
"role10"
{
"file" "addons\sourcemod\data\botmimic\practicemode/de_inferno/role9/e-2.rec"
"team" "T"
}
}
}

@splewis
Copy link
Owner

splewis commented Dec 21, 2021

The code was written only to support 5 replay clients at once.

If you really want to try to make this work with 10 clients, you can recompile modifying the MAX_REPLAY_CLIENTS value:
https://github.com/splewis/csgo-practice-mode/blob/master/scripting/practicemode/botreplay.sp#L4

The bot replay behavior is, in general, somewhat buggy. So I'd be somewhat hesitant to make that change by default (and make the menus more difficult to navigate than they already are).

@PlamAtom
Copy link
Author

PlamAtom commented Dec 21, 2021

I just use SPEdit with the "Compile all" option i guess ^^

@PlamAtom
Copy link
Author

Hey you do mind telling me which encoding the ".rec" files have in which the replay is saved? because i might want to look at the data.

@splewis
Copy link
Owner

splewis commented Dec 21, 2021

I tweaked the code (375348c) then reverted it (1e5cb8f), so you can download an automatic build with MAX_REPLAY_CLIENTS set to 10 from https://ci.splewis.net/job/csgo-practice-mode/311/.

@splewis
Copy link
Owner

splewis commented Dec 21, 2021

Hey you do mind telling me which encoding the ".rec" files have in which the replay is saved? because i might want to look at the data.

All of that detail is from the botmimic plugin itself, not practicemode, but from a quick look, I see a binary format like this:

@PlamAtom
Copy link
Author

Is the Menu also from the botmimic plugin because i now want to change the the bot menu to allow me to record role 6-10. I don't want to bother you so much with this ^^

@splewis
Copy link
Owner

splewis commented Dec 21, 2021

No, all the menus are practicemode, botmimic is just providing the natives to start a recording to file x and replay a recording from file x.

@PlamAtom
Copy link
Author

PlamAtom commented Dec 21, 2021

I think i found it. csgo-practice-mode/scripting/practicemode/botreplay_editor.sp
....
/* Page 1 */
for (int i = 0; i < MAX_REPLAY_CLIENTS; i++) {
bool recordedLastRole = true;
if (i > 0) {
recordedLastRole = HasRoleRecorded(g_ReplayId[client], i - 1);
}
int style = EnabledIf(recordedLastRole);
if (HasRoleRecorded(g_ReplayId[client], i)) {
char roleName[REPLAY_NAME_LENGTH];
if (GetRoleName(g_ReplayId[client], i, roleName, sizeof(roleName))) {
AddMenuIntStyle(menu, i, style, "Change player %d role (%s)", i + 1, roleName);
} else {
AddMenuIntStyle(menu, i, style, "Change player %d role", i + 1);
}
} else {
AddMenuIntStyle(menu, i, style, "Add player %d role", i + 1);
}
}
...

But this would mean it should work because i is dependet on MAX_REPLAY_CLIENTS

@PlamAtom
Copy link
Author

PlamAtom commented Dec 21, 2021

Hey, I tried the whole thing again with my custom 10 player replay but it doesn't seem to work, only the first 5 bots (CTs) appear. (Plus only 5 spawn dead on replaymode start)

I first thought it worked because a bot died on the enemy side at the beginning of the replay. Because for some reason some roles were deleted I thought it was a minor glitch.

@PlamAtom
Copy link
Author

I think it's just a little more complicated... thanks for your help I'll look at the code and see if i find any hint. Very nice of you to help me. Maybe it's just not meant to be....

@PlamAtom
Copy link
Author

Solution:
The server must be reinstalled with the Practicemode 311
The start option "-maxplayers_override 12" must be set because default is 10 which means 9 bots plus the one player, who does even matter in .spec

Thank you very much for your help. I noticed that the bots fly away quite funny when you end the replay with "Noclip".

@mariuzkve
Copy link

Where can I find Practicemode 311 build? Link seems to be down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants