splewis / csgo-practice-mode

CS:GO Sourcemod plugin for private team/individual practice servers
GNU General Public License v3.0
457 stars 71 forks source link

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

Open PlamAtom opened 2 years ago

PlamAtom commented 2 years ago

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

"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 commented 2 years ago

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 commented 2 years ago

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

PlamAtom commented 2 years ago

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 commented 2 years ago

I tweaked the code (https://github.com/splewis/csgo-practice-mode/commit/375348ce2924c529356fe1b7eca88b2d9e0630bd) then reverted it (https://github.com/splewis/csgo-practice-mode/commit/1e5cb8ff4d1f4c286dfbff09a4959a98729e7d7f), 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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 11 months ago

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