AoiKagase / Amxx-ReviveKit

Cheap_Suit Revive Kit(Disappearing Corpses)
2 stars 0 forks source link

Revive tag based rework #24

Open arkprocession opened 1 year ago

arkprocession commented 1 year ago

I have been thinking that this could be lot easier and fluid if instead of a fake corpse, a sprite appeared in place. it would not require to trace a corpse, with for it to fall and stuff. The sprite would mark the last place the player was alive , kind of how the revive plugin for sourcemod works.

too much of a headache?

AoiKagase commented 1 year ago

A new logic is required to display the sprite. (You will also need a sprite to display.)

It is possible with time, but please be aware that it is not an immediate fix.

arkprocession commented 1 year ago

A new logic is required to display the sprite. (You will also need a sprite to display.)

It is possible with time, but please be aware that it is not an immediate fix.

I definitely understand, trust me.

I only wish we realized this earlier, would have saved you LOT of time reworking this plugin.

But it sounds more stable and lightweight, is that right?

any skull sprite would work, i guess, in the sourcemod version of revive, a blue skull for ct and a red skull for tt, for high visibility.

Also, if you choose to take the challenge, maybe make a separate plugin? this one as it is works really great as a finished product.

So maybe a side version in order not to lose all this progress.

arkprocession commented 1 year ago

Let me know if this has any future :)

AoiKagase commented 1 year ago

I have been too busy to do anything about it.

arkprocession commented 11 months ago

If you believe this is in the past, you may close the ticket :) just wanted you to know we still use this plugin and having tons of fun thanks to you

AoiKagase commented 9 months ago

I've been giving it some thought. It would be easy to just display a sprite over a corpse. But trying to display it only for your own team makes it difficult. How about displaying a sprite for each team for every corpse (e.g., different colors, etc.)? And you have to have a sprite.

arkprocession commented 9 months ago

A year later and the plugin is still going strong! Thank you for the foundation it provides for my family's server fun.

Let's say I borrow the image for the revival from Sourcemod, specifically the skulls with different colors for each team.

Here's my vision:

Remove everything related to corpses, except for gathering the location of death/last known place where the player was alive. I'm aware of a few plugins that handle this well and could be useful to you if needed.

Displaying sprites only for the team might not be possible, but how about having the option to turn it on and off for bots, similar to how we currently handle corpses? This way, bots won't leave numerous sprites lying around, and only human images can be seen with a specific command. Cant we add transparency to the sprite of the enemy to fake its disappearance?

With no more fake corpses, the plugin is expected to be simpler, more optimized, and faster. There won't be any waiting times for corpses to "blink" or detect the last corpse position to replace it with a fake corpse. Reviving would be quicker and more straightforward.

Without corpses clipping through walls, maybe we can add a bit of detection to the sprite to prevent it from clipping inside a wall?

Drop the revive kit itself and make it a native functionality, just like the current approach with a cvar (no need for a revkit to revive). This will result in lighter code.

Allow players to choose their image color so there is a way to differentiate players.

Thank you!!

AoiKagase commented 9 months ago

Remove everything related to corpses, except for gathering the location of death/last known place where the player was alive. I'm aware of a few plugins that handle this well and could be useful to you if needed.

After the falling down gesture, the corpse disappears, is that ok with you?

Displaying sprites only for the team might not be possible, but how about having the option to turn it on and off for bots, similar to how we currently handle corpses? This way, bots won't leave numerous sprites lying around, and only human images can be seen with a specific command. Cant we add transparency to the sprite of the enemy to fake its disappearance?

Are you saying that the bot is ignored by the cvar setting? It is not an easy task to implement because the judgment of whether a player is an enemy or not depends on the player.

With no more fake corpses, the plugin is expected to be simpler, more optimized, and faster. There won't be any waiting times for corpses to "blink" or detect the last corpse position to replace it with a fake corpse. Reviving would be quicker and more straightforward.

-> first answer.

Without corpses clipping through walls, maybe we can add a bit of detection to the sprite to prevent it from clipping inside a wall?

After all, it's just like a fake corpse. A new sprite must be generated.

Drop the revive kit itself and make it a native functionality, just like the current approach with a cvar (no need for a revkit to revive). This will result in lighter code.

This should be able to be set by Cvar. (already implemented as an add-on to BF4Mod)

Allow players to choose their image color so there is a way to differentiate players.

This looks easy, but it's actually a pain in the ass. Players need to make a choice in the menu or chat when they log in, and if they want to be remembered when they leave the server, they need to figure out how to save it.

arkprocession commented 9 months ago

1) As usual it disappears, that is okay with me! As long as the sprite is visible and appears at a fixed position above the vanishing corpse so it doesnt clip into the ground, and its easy to see. (Will it be faster to revive since we are not waiting for corpse blinking anymore?) 2) Currently we have a cvar to revive bots or not, so disabling the bot revive leaves room for performance i think. correct me if i am wrong. Now, with a sprite, the cvar could make it so bots are ignored for sprites just as they were for fake corpses and revive process. Basically be able to disable bot revive and thus the sprite by cvar. 3) Understood 4) Perfect! 5) Can't the sprite color be referenced in a ini file with a steamid or something like that? I play with family and friends. The usuals. Another way : I use OciXCrom simple menu builder and if a command sets players sprite color then i can add my own menu there for players to choose and the option could be remembered per steamid

Thanks!

AoiKagase commented 9 months ago

(Will it be faster to revive since we are not waiting for corpse blinking anymore?)

I've forgotten a lot of it, so I need to actually work it.

5.Can't the sprite color be referenced in a ini file with a steamid or something like that? I play with family and friends. The usuals. Another way : I use OciXCrom simple menu builder and if a command sets players sprite color then i can add my own menu there for players to choose and the option could be remembered per steamid

If you have a small group, that's fine, But you have to think about a large group of people, because the plugin is not just for you. Ini files will probably not have the performance. Also, if the OciXCrom menu is to be used, there must be a process to link them together.

arkprocession commented 9 months ago

(Will it be faster to revive since we are not waiting for corpse blinking anymore?)

I've forgotten a lot of it, so I need to actually work it.

5.Can't the sprite color be referenced in a ini file with a steamid or something like that? I play with family and friends. The usuals. Another way : I use OciXCrom simple menu builder and if a command sets players sprite color then i can add my own menu there for players to choose and the option could be remembered per steamid

If you have a small group, that's fine, But you have to think about a large group of people, because the plugin is not just for you. Ini files will probably not have the performance. Also, if the OciXCrom menu is to be used, there must be a process to link them together.

What do you propose for making them different? or lets just leave them a single sprite.

Remember the main idea for using a sprite instead of corpse is for Quality of Life. If it will be the same as the corpse there is no point for it. I guess corpse gave it realism somehow, but the idea of the sprite is for making it even faster and less prone to bugs. Otherwise you will be working for little differences

Linking them together? i meant for example "use /revivemenu to select your color" and then if you die, you have that color. You create the menu, that sets the sprite, i hook it to the simple menu builder for users in my particular case. Other people could just /revivemenu and select their sprite color, or is that not possible?

Another idea, make it a random color for each human player in SV and people will get accustomed to their color per game

AoiKagase commented 9 months ago

If you have any good sprite files, please give them to me.

arkprocession commented 9 months ago

If you have any good sprite files, please give them to me.

https://we.tl/t-avhTTggSxf

AoiKagase commented 9 months ago

Drop the revive kit itself and make it a native functionality, just like the current approach with a cvar (no need for a revkit to revive). This will result in lighter code.

I had to reread the source code, Wouldn't rkit_buy_mode = 0 make the kit obsolete?

arkprocession commented 9 months ago

Drop the revive kit itself and make it a native functionality, just like the current approach with a cvar (no need for a revkit to revive). This will result in lighter code.

I had to reread the source code, Wouldn't rkit_buy_mode = 0 make the kit obsolete?

You are right here,

AoiKagase commented 9 months ago

I'm thinking of adding rkit_corpse_mode (1 is corpse, 0 is sprites) but, I'm not satisfied with this CVAR name. Any suggestions for a better name?

arkprocession commented 9 months ago

I'm thinking of adding rkit_corpse_mode (1 is corpse, 0 is sprites) but, I'm not satisfied with this CVAR name. Any suggestions for a better name?

rkit_revive_type rkit_entity_style rkit_revive_form rkit_sprite_on (to toggle it on or off)

arkprocession commented 9 months ago

Question, since my expectations are around being able to revive without blinking the corpse first. Death can be detected when the player gets killed, not when the animation of death stop right? it must be! what i mean is: is it possible to make the sprite instantly appear at death and not after the animation of death?

This would propose two things:

1) even faster revive 2) not waiting for the corpse to fly away with c4, or a headshot to place the sprite there, it could appear on the actual place of death instead.

AoiKagase commented 9 months ago

Death can be detected when the player gets killed, not when the animation of death stop right?

I'll have to look into it, but I'm thinking that the detection of pev(id, pev_deadflag) == DEAD_DEAD is probably after the death animation is over.

what i mean is: is it possible to make the sprite instantly appear at death and not after the animation of death?

I think it is possible, but it would require detailed testing. I can't come up with the necessary logic right away.

not waiting for the corpse to fly away with c4, or a headshot to place the sprite there, it could appear on the actual place of death instead.

Perhaps tied to the first answer, though, If it is possible to adjust the timing of death detection, that is possible.

This is where they create the fake corpse. Could you please make this a message using client_print, etc., and check when it is actually output? https://github.com/AoiKagase/Amxx-ReviveKit/blob/0bfa2b3735fa2de102b303b9d02b133c766009fe/cstrike/addons/amxmodx/scripting/revivalkit_remake.sma#L499 => client_print_color(0, print_chat, "^4[Revive Kit]:^1 Timing of corpse creation.");

arkprocession commented 9 months ago

Death can be detected when the player gets killed, not when the animation of death stop right?

I'll have to look into it, but I'm thinking that the detection of pev(id, pev_deadflag) == DEAD_DEAD is probably after the death animation is over.

what i mean is: is it possible to make the sprite instantly appear at death and not after the animation of death?

I think it is possible, but it would require detailed testing. I can't come up with the necessary logic right away.

not waiting for the corpse to fly away with c4, or a headshot to place the sprite there, it could appear on the actual place of death instead.

Perhaps tied to the first answer, though, If it is possible to adjust the timing of death detection, that is possible.

This is where they create the fake corpse. Could you please make this a message using client_print, etc., and check when it is actually output?

https://github.com/AoiKagase/Amxx-ReviveKit/blob/0bfa2b3735fa2de102b303b9d02b133c766009fe/cstrike/addons/amxmodx/scripting/revivalkit_remake.sma#L499

=> client_print_color(0, print_chat, "^4[Revive Kit]:^1 Timing of corpse creation.");

I can't get it to work properly, it spams that message briefly after, but infinitely.

AoiKagase commented 9 months ago

Unfortunately, it appears that the animation is treated as a death after the animation is completed. https://github.com/AoiKagase/Amxx-ReviveKit/assets/26139931/d01babcd-1930-4ad2-894d-255a77d70c8f

arkprocession commented 9 months ago

Unfortunately, it appears that the animation is treated as a death after the animation is completed. https://github.com/AoiKagase/Amxx-ReviveKit/assets/26139931/d01babcd-1930-4ad2-894d-255a77d70c8f

Thanks for testing.

then it appears that this Would be a waste of time my friend. there would be no difference in having the sprite or the corpse.

But if you are still feeling like working on a plugin for 1.6 i have a few ideas, nothing fancy or too complicated.

arkprocession commented 9 months ago

Sorry for reopening! what exactly changed? i see no more blinking and can instantly revive which is BRILLIANT! THANKS!

how this was achieved?

Also if this is possible since i can revive without the dead animation ending, then why the sprite isn't possible or viable? we are clearly being able to revive someone before the body even falling so detection of death can be achieved! right?

Also, can you make it so if i am already pressing E away from the body if i come near the body i shall revive it without having to release E key and then press it again?

arkprocession commented 9 months ago

CRITICAL: If i get killed i cannot spectate free.

AoiKagase commented 9 months ago

The moment when Health becomes zero instead of pev_deadflag is now detected. But the death is not processed correctly, so it would have been impossible to watch the game.

If this is successful, a sprite implementation would be possible.

arkprocession commented 9 months ago

The moment when Health becomes zero instead of pev_deadflag is now detected. But the death is not processed correctly, so it would have been impossible to watch the game.

If this is successful, a sprite implementation would be possible.

Can we rollback? spectating is quite important

Also a few implementations:

1) Be able to revive to the nearest walkable path, sometimes i revive on the floor below where i was. 2) Be able to revive with a fixed number of heatlh. 3) Be able to Spectate.

AoiKagase commented 9 months ago

https://raw.githubusercontent.com/AoiKagase/Amxx-ReviveKit/0bfa2b3735fa2de102b303b9d02b133c766009fe/cstrike/addons/amxmodx/scripting/revivalkit_remake.sma

AoiKagase commented 9 months ago

Please create an Issue for a new problem.

1.Be able to revive to the nearest walkable path, sometimes i revive on the floor below where i was.

Do you know the thickness of the floor? This may happen if it is thin.

2.Be able to revive with a fixed number of heatlh.

rkit_health ?

3.Be able to Spectate.

Rollbacked. That's a bug that was implemented here.

AoiKagase commented 9 months ago

Also, can you make it so if i am already pressing E away from the body if i come near the body i shall revive it without having to release E key and then press it again?

It is possible, but the load is expected to be high because the find_dead_body process runs all the time while E is pressed. The current process only handles the moment it is pressed, and it is released the moment it is released.

AoiKagase commented 9 months ago

Now testing. de_dust0003 de_dust0000

arkprocession commented 9 months ago

Now testing. de_dust0003 de_dust0000

Looking good.

Will you try to fix the spectator not working and still try to manage to revive with that speed?

AoiKagase commented 9 months ago

Will you try to fix the spectator not working and still try to manage to revive with that speed?

Try https://raw.githubusercontent.com/AoiKagase/Amxx-ReviveKit/6f6c57e17a31efb6b8f67a9eae35421316ccdcb6/cstrike/addons/amxmodx/scripting/revivalkit_remake.sma

=> delete this line. https://github.com/AoiKagase/Amxx-ReviveKit/blob/6f6c57e17a31efb6b8f67a9eae35421316ccdcb6/cstrike/addons/amxmodx/scripting/revivalkit_remake.sma#L1009

AoiKagase commented 9 months ago

https://github.com/AoiKagase/Amxx-ReviveKit/assets/26139931/f31f2063-ec97-4d8f-bd6d-78a67ac4f0e0

arkprocession commented 9 months ago

revival.mp4

Recommended cvars. rkit_sprite_rotation_speed (0 disabled and means static, 1 normal speed as seen in video, 2 faster speed so you don't have to stop to look around and probably miss in the invisible frame)

1) Will i see sprites for bots if i have set rkit_bot_can_revive 0? i wish to NOT see them. 2) Will i see the sprites for the opposite team even though i can't revive them? i also wish NOT to see them if possible. 3) Is spectator working with that version? is revive instant as with the corpse version you achieved recently?

Thank you for the hard work! looks awesome, can't wait to try it.

AoiKagase commented 9 months ago

rkit_sprite_rotation_speed (0 disabled and means static, 1 normal speed as seen in video, 2 faster speed so you don't have to stop to look around and probably miss in the invisible frame)

If set to 0, it will always face a certain direction. It is possible to change the sprite's nature so that it always faces in its own direction, but in this case, two types of sprites must be prepared. (Because it will not be able to rotate.)

  1. Will i see sprites for bots if i have set rkit_bot_can_revive 0? i wish to NOT see them.

Considerations.

  1. Will i see the sprites for the opposite team even though i can't revive them? i also wish NOT to see them if possible.

This is very difficult. need to find out if it is possible. (So now can distinguish between red and blue.)

  1. Is spectator working with that version? is revive instant as with the corpse version you achieved recently?

Yes.

arkprocession commented 9 months ago

rkit_sprite_rotation_speed (0 disabled and means static, 1 normal speed as seen in video, 2 faster speed so you don't have to stop to look around and probably miss in the invisible frame)

If set to 0, it will always face a certain direction. It is possible to change the sprite's nature so that it always faces in its own direction, but in this case, two types of sprites must be prepared. (Because it will not be able to rotate.)

  1. Will i see sprites for bots if i have set rkit_bot_can_revive 0? i wish to NOT see them.

Considerations.

  1. Will i see the sprites for the opposite team even though i can't revive them? i also wish NOT to see them if possible.

This is very difficult. need to find out if it is possible. (So now can distinguish between red and blue.)

  1. Is spectator working with that version? is revive instant as with the corpse version you achieved recently?

Yes.

In source, the engine allows for a sprite always looking at clients That way there is no need to have a right "angle" to see the skull and that would make rotation not needed.

How possible is that in goldsource?

AoiKagase commented 9 months ago

In source, the engine allows for a sprite always looking at clients That way there is no need to have a right "angle" to see the skull and that would make rotation not needed. How possible is that in goldsource?

It can do this by changing the type of sprite. (I just thought it was tasteless and made it rotate. I'll change it back if you don't need it.)

arkprocession commented 9 months ago

In source, the engine allows for a sprite always looking at clients That way there is no need to have a right "angle" to see the skull and that would make rotation not needed. How possible is that in goldsource?

It can do this by changing the type of sprite. (I just thought it was tasteless and made it rotate. I'll change it back if you don't need it.)

I find it absolutely more useful and foolproof if it's static and you can see it from every angle at all times.

and again , i Can't wait to try it! looks amazing!!

AoiKagase commented 9 months ago

Sprites are troublesome to replace once downloaded to the client, so they must be tested repeatedly. Now i'm investigating if i can fulfill request 2.

Will i see the sprites for the opposite team even though i can't revive them? i also wish NOT to see them if possible.

arkprocession commented 9 months ago

Sprites are troublesome to replace once downloaded to the client, so they must be tested repeatedly. Now i'm investigating if i can fulfill request 2.

Will i see the sprites for the opposite team even though i can't revive them? i also wish NOT to see them if possible.

Thank you, don't know whats harder to do , but if i just want to see my team sprites. and also disable via CVAR bot revive and thus the sprite for them.

AoiKagase commented 9 months ago

Thank you, don't know whats harder to do , but if i just want to see my team sprites.

Entities are always visible to everyone. It is difficult to change what is visible or invisible to different people. I could tell that it would probably use AddFullpack, but this seems to take a lot of CPU time.

arkprocession commented 9 months ago

Thank you, don't know whats harder to do , but if i just want to see my team sprites.

Entities are always visible to everyone. It is difficult to change what is visible or invisible to different people. I could tell that it would probably use AddFullpack, but this seems to take a lot of CPU time.

I rather it be lightweight then, no worries.

At least try to make it not appear for bots at all, i mean if i disable bot_can_revive then no sprite should display, it isn¿t about who sees it or not, rather not displaying on them at all.

AoiKagase commented 9 months ago

if bot_can_revive is set to 0, all processing for the bot will stop because no fake corpses (sprites too) will be created. (create_fake_corpse process is not executed.)

arkprocession commented 9 months ago

if bot_can_revive is set to 0, all processing for the bot will stop because no fake corpses (sprites too) will be created. (create_fake_corpse process is not executed.)

Then awesome! let me know when there is a version for testing!

AoiKagase commented 9 months ago

Updated. Add 2 Sprites. Add rkit_corpse_style, 0 = default, 1 = skull sprite. Add rkit_sprite_rotation_speed, 0 = always look. 1 or 2 = rolling. Add Display of sprites within a team. (Lag may occur. need report.)

arkprocession commented 9 months ago

Updated. Add 2 Sprites. Add rkit_corpse_style, 0 = default, 1 = skull sprite. Add rkit_sprite_rotation_speed, 0 = always look. 1 or 2 = rolling. Add Display of sprites within a team. (Lag may occur. need report.)

Can you elaborate on the lag part? have any of the new implementations been heavy for the cpu compared to the one i have been using?

i really prioritise stability

AoiKagase commented 9 months ago

Regarding the implementation of not displaying the opposing team's sprites. Initially, there was lag that made it difficult to even play. This has now been resolved, but I can't be sure because I am the only one testing it against a BOT.

arkprocession commented 9 months ago

Regarding the implementation of not displaying the opposing team's sprites. Initially, there was lag that made it difficult to even play. This has now been resolved, but I can't be sure because I am the only one testing it against a BOT.

It has been running quite well as far as i tested it but:


L 01/23/2024 - 12:48:08: Start of error session.
L 01/23/2024 - 12:48:08: Info (map "fy_pool_day") (file "addons/amxmodx/logs/error_20240123.log")
L 01/23/2024 - 12:48:08: [FAKEMETA] Invalid entity
L 01/23/2024 - 12:48:08: [AMXX] Run time error 10 (plugin "custom_revival_kit_beta.amxx") (native "set_pev") - debug not enabled!
L 01/23/2024 - 12:48:08: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

I am going to activate the debug to see if i can recreate it.

EDIT: L 01/23/2024 - 12:57:28: Start of error session. L 01/23/2024 - 12:57:28: Info (map "fy_pool_day") (file "addons/amxmodx/logs/error_20240123.log") L 01/23/2024 - 12:57:28: [FAKEMETA] Invalid entity L 01/23/2024 - 12:57:28: [AMXX] Displaying debug trace (plugin "custom_revival_kit_beta.amxx", version "1.000") L 01/23/2024 - 12:57:28: [AMXX] Run time error 10: native error (native "set_pev") L 01/23/2024 - 12:57:28: [AMXX] [0] custom_revival_kit_beta.sma::HideBody (line 1068)

arkprocession commented 9 months ago

Errors:

1) Sometimes i see enemies skulls sometimes not, don't know what it depends on. 2) Revive is no longer possible after round end event. (CRITICAL)

revive used to be possible when round end and since i have 10 seconds before round starts you could use that time to revive friends before new round begins. can that be brought back?

If seeing enemies skulls makes the plugin more stable, then don't overcomplicate it

AoiKagase commented 9 months ago
  1. It is displayed when you are in spectator mode.
  2. Such a process is not touched. It needs to be investigated. Can I have you try it with rkit_corpse_style 0 for a while?