Giter Site home page Giter Site logo

jonathan-robertson / amnesia Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 18.18 MB

7 Days to Die mod: Reset player progress after dying under a configurable set of circumstances

Home Page: https://discord.gg/hYa2sNHXya

License: MIT License

C# 100.00%
7-days-to-die 7daystodie evergreen memory mod reset server-side

amnesia's People

Contributors

jonathan-robertson avatar

Stargazers

 avatar

Watchers

 avatar  avatar

amnesia's Issues

๐Ÿ’ฌ Add Opt-In Mode

On some servers, players might not all want to participate in Amnesia's features. For those situations, Opt-In mode provides players interested in engaging with this feature certain benefits at the cost of having a limited number of lives before being reset.

Upon reset, players will return to level 1 and whatever other options set by the admin, but will be removed from the limited lives mechanic.

The XP multiplier while enrolled in Opt-In mode can be set by the admin.

๐Ÿง  Reset to Skills Acquired at Start Level

Description

Instead of resetting and freeing up skill points (free forgetting elixir effect), record the 49th skill point set (or record at player level 50?) and apply that config upon reset.

Tasks

  • Record each skill invested by each player to files
  • Save skill progress to a file, load it from a file
  • Allow viewing of each skill via console
  • Track unspent skill points
    • wait... a final sync package sends when the player dies, right? So... we don't need to track this during gameplay, right?
    • except for... perhaps the forgetting elixir effect? If this is fired from the server, does this mess things up? Shouldn't. Only rewinding should care about currently unused skill points; full memory reset would calculate total skill points expected.
  • Update reset pattern to roll back to a given level, first consuming unspent points, then consuming spent points
  • Add integrity check on player data file sync
  • Reset with core tools, then replay skills chosen, spending as many skill points as able

Gold Plating?

  • Add console commands to add x, remove x levels
  • Add reconciliation logic for moments when the server failed to record updates?
  • Track skill points added via game events?
  • Track skill points added via quests?

Related

๐Ÿ†• Add Support for A21

7DTD A21 Experimental hasn't been released yet, but I plan to have support for A21 ready in time for the general release of the game.

โ™ป๏ธ Add minimum level value that can be upgraded only by reaching level 300

๐Ÿ”ฌ Instead, what if the player who reaches 300 automatically resets to something like level 50 and this is his new minimum level forevermore?
๐Ÿ”„ each time the player reaches 300, an extra x levels are added to his minimum count. That would extend the game to last far longer even for driven players.
๐ŸŽ–๏ธ This could perhaps be represented as some kind of Prestige value somewhere for other players to see.
๐Ÿ† This way, players "always" have something to work toward

๐Ÿ”ซ Prevent loss of lives from PVP kills

Might include this as an option, but discouraging PVP is usually a horrible idea.

Drop style would be based on server's rules. So if the server is set to drop the backpack, that's all that would drop on death.

๐Ÿ’€ Change death text to inform player of what to expect based on remainingLives

More Lives Remaining

Hours later you awake in a familiar place. Groggy and sore from you recent adventure, you wonder how you ever managed to make it back alive.

This server provides a set number of lives before total character deletion and this requires you to evaluate every risky situation more realistically. You have x/y Remaining Lives and are about to use one to return from the brink of death. You can Recover Lives by visiting Trader Jen and paying for her experimental rejuvenation treatments.

About to be Wiped

Darkness closes in around you as everything - even your own body - begins to feel more and more distant. You know you won't be coming back.. not this time.

IMPORTANT: If you were just killed due to game glitches, or suspect another player of defeating you with hacking or exploits, DO NOT RESPAWN. Instead, reach out to an admin. After investigating your admin may decide it's appropriate to provide you with another life to prevent your character from resetting.

Image

โ™ป๏ธ Lose Configurable Number of Levels on Reset

Description

๐ŸŽ‰ Thanks to Waymaran#4137 (Discord) for this idea!

... could you put another option that subtracts 10 lvl when you die? In other words, you can configure so many lvl that you lose when you die. Eg I would configure that 10 lvl is lost when dying successively unless you use the booster pill. Thanks, I'm just asking.


Depends on

Bonus

  • also add a console command to add levels to or remove levels from a given player

๐ŸŽ– Represent kill counts in message chat

Add ranking visuals as a prefix for player and zombie kill counts (for recognition/reputation).

Also determine titles to accompany player names in chat.

[Red]A[Green]S Battleborne the Zombie Slayer: ""

๐Ÿ“ Add buff explaining lives mechanic

General Buff (Informational)

When a player dies, this buff can show for some period of time.

It will provide guidance to seek out Trader Jen to receive intense treatment to restore lives (for money, a level, and the loss of a random assigned skill point or loose skill point - a feature to be added later).

๐Ÿ‘œ Add support for bag drop control based on remaining lives

For example...

Lives Remaining Drop On Defeat
2/2 Drop Nothing
1/2 Drop Backpack Only
0/2 Drop Everything

๐Ÿ’ญ Might have to actually simulate bag drop and inventory manipulation since trying to feed spoofed GameStat changes are tough to do on time (tricks player into thinking server configs are different from what they actually are).

Fix NRE in EntityKilled.Handle

2022-09-26T23:22:00 1189.580 EXC Object reference not set to an instance of an object
at Amnesia.Handlers.EntityKilled.Handle (Entity killedEntity, Entity killerEntity) [0x00000] in <77e44bbccb234bb7ac057ede33f51237>:0

UnityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
Amnesia.Utilities.ModLog:Error(String, Exception)
Amnesia.Handlers.EntityKilled:Handle(Entity, Entity)
ModEvent`2:Invoke(Entity, Entity)
EntityAlive:DMD<EntityAlive::OnEntityDeath>(EntityAlive)
EntityAnimal:OnEntityDeath()
EntityAlive:DMD<EntityAlive::ClientKill>(EntityAlive, DamageResponse)
EntityAlive:Kill(DamageResponse)
EntityAlive:ProcessDamageResponseLocal(DamageResponse)
EntityAlive:damageEntityLocal(DamageSource, Int32, Boolean, Single)
EntityAlive:DamageEntity(DamageSource, Int32, Boolean, Single)
EntityAnimal:DamageEntity(DamageSource, Int32, Boolean, Single)
BlockDamage:OnEntityCollidedWithBlock(WorldBase, Int32, Vector3i, BlockValue, Entity)
ChunkCluster:CheckCollisionWithBlocks(Entity)
World:CheckEntityCollisionWithBlocks(Entity)
Entity:ccEntityCollisionResults()
Entity:ccEntityCollision(Vector3)
Entity:entityCollision(Vector3)
EntityAlive:DefaultMoveEntity(Vector3, Boolean)
EntityAlive:MoveEntityHeaded(Vector3, Boolean)
EntityAlive:OnUpdateLive()
EntityAnimal:OnUpdateLive()
EntityAlive:OnUpdateEntity()
World:TickEntity(Entity, Single)
World:TickEntitiesSlice(Int32)
World:TickEntitiesFlush()
World:TickEntities(Single)
GameManager:UpdateTick()
GameManager:gmUpdate()
GameManager:Update()

โš™๏ธ Adjust Workflow for Memory Loss

Current

  1. Once player exceeds the long-term memory threshold, dying causes memory loss
  2. Player can use Trader Jen's Memory Booster to add Hardened Memory buffs which operates similar to a one-time shield against memory loss
flowchart LR
    natural[[Natural]]-->incap[[Incapacitated]]
    natural-->|use memory booster|hard[[Hardened Memory]]
    hard-->incap-->|hardened|natural
    incap-->|not hardened|amnesia[Lose Memory, Reset to Level 50]
    amnesia-->natural

Planned

  1. Players will receive a long-term ailment/debuff called "Fragile Memory" upon death once they have reached the long-term-memory threshold. Player who dies with Fragile Memory will experience Memory Loss (and keep Fragile Memory)
  2. Player can use Trader Jen's Memory Booster to cure Fragile Memory (and this explanation will be included in the Fragile Memory debuff description for reference any time).
flowchart LR
    natural[[Natural]]-->incap[[Incapacitated]]
    incap-->|not fragile|fragile[[Fragile Memory]]
    incap-->|fragile|amnesia[Lose Memory, Reset to Level 50]

    amnesia-->fragile
    fragile-->incap

    fragile-->|use memory booster|natural

Why the Change?

The current flow is confusing players and there isn't a natural way to warn players when Amnesia activates. This adjustment will serve both purposes: giving players a warning, and also fitting within the existing "injury/ailment needs a cure" workflow that players are already used to.

๐Ÿ’ฌ Add Dialog Option to Get Treatment From Trader

dialogs.xml

<config>
    <!-- <append xpath="/dialogs">
        <response id="recovery" text="dialog_trader_response_recover" nextstatementid="admin">
            <requirement type="Admin" requirementtype="Hide" />
        </response>
    </append> -->
    <insertBefore xpath="/dialogs/dialog[@id='trader' or @id='traderTest']/statement[@id='start']/response_entry[@id='admin']">
        <response_entry id="background" />
        <!-- <response_entry id="recover" /> -->
    </insertBefore>
</config>

buffs.xml

        <buff name="buffAmnesiaRecoverLife" hidden="true" remove_on_death="false">
            <duration value="0" />
            <effect_group>
                <passive_effect name="RunSpeed" operation="perc_set" value="0" />
                <passive_effect name="WalkSpeed" operation="perc_set" value="0" />
                <passive_effect name="CrouchSpeed" operation="perc_set" value="0" />
                <passive_effect name="JumpStrength" operation="perc_set" value="0" />

                <triggered_effect trigger="onSelfBuffStart" action="ModifyScreenEffect" intensity="1" fade="1" effect_name="infection" />
                <triggered_effect trigger="onSelfBuffRemove" action="ModifyScreenEffect" intensity="0" fade="1" effect_name="infection" />

                <triggered_effect trigger="onSelfBuffStart" action="ShowToolbeltMessage" message_key="buffAmnesiaRecoverLifeTooltip" />
            </effect_group>
        </buff>
        <buff name="buffAmnesiaRecoverLifeMaxed" hidden="true" remove_on_death="false">
            <duration value="2" />
            <effect_group>
                <triggered_effect trigger="onSelfBuffStart" action="RemoveBuff" buff="buffAmnesiaRecoverLife" />
                <triggered_effect trigger="onSelfBuffStart" action="ShowToolbeltMessage" message_key="buffAmnesiaRecoverLifeMaxedTooltip" />
            </effect_group>
        </buff>
        <buff name="buffAmnesiaRecoverLifeMissingPoint" hidden="true" remove_on_death="false">
            <duration value="2" />
            <effect_group>
                <triggered_effect trigger="onSelfBuffStart" action="RemoveBuff" buff="buffAmnesiaRecoverLife" />
                <triggered_effect trigger="onSelfBuffStart" action="ShowToolbeltMessage" message_key="buffAmnesiaRecoverLifeMissingPointTooltip" />
            </effect_group>
        </buff>
        <buff name="buffAmnesiaRecoverLifeSuccess" hidden="true" remove_on_death="false">
            <duration value="2" />
            <effect_group>
                <triggered_effect trigger="onSelfBuffStart" action="RemoveBuff" buff="buffAmnesiaRecoverLife" />
                <triggered_effect trigger="onSelfBuffStart" action="ShowToolbeltMessage" message_key="buffAmnesiaRecoverLifeSuccessTooltip" sound="spawnInStinger" />
            </effect_group>
        </buff>

๐Ÿฅ Add Memory Therapy to Trader

  • Remove forgetting elixir item
  • Add option to respec at trader
  • Set cost based on level, maybe 1/2 the cost of your memory recovery

Tasks

  • add console command to trigger respec
  • remove forgetting elixir from loot
  • remove forgetting elixir from traders
  • add Therapy option at trader
  • add Therapy price
  • add supporting dialog and purchase processes for Therapy

Tests

  • reset skill points via Therapy properly flushes purchased skills and returns skill points

๐Ÿฅ Replace Pills with Treatments

Idea

  • No more pills
  • Receive treatment at any trader for a cost
  • Cost of treatment goes up based on player's current level

Considering

  • Add option to heal other ailments at trader (flat rate, instant heal)

Tasks

  • add dialog options
  • add system for purchasing and getting change
  • remove fragile memory when purchase of treatment is successful
  • sync and display sale price of treatment
  • remove memory pills
  • include responses (toolbelt tips, sounds) for all conversation terminators (or use quests)
  • update cost colors to match quest highlight color
  • test with all other mods enabled

๐Ÿš‹ Buff/Debuff during final life (most risk)?

Final Life (Best Life?)

In the final stage (living your final life), this buff will show all the time and possibly flash.

This final stage will provide certain benefits (which can be disabled/enabled by admin) possibly coming from within this list:

  • steep bonus to xp gained (2x? 3x? - to be set by admin)
  • bonus critical/dismemberment chance? (zombies)
  • low boost to hp recovery?
  • maybe bonus discount for services purchased/sold?
  • greatly reduced chance of breaking leg?
  • boost chance of finding ammo?
  • boost chance of finding healing items?
  • boost change of finding coins?

โš”๏ธ Remove Quests the Right Way! ๐ŸŽ‰

Found out a very likely approach to removing quests!
Server will be reading player data already on death.
Instead of having to disconnect player so player can come back with manipulated player data file... the server can send the player a console command to have the player's client issue the command instead (which is supported).

ConnectionManager.Instance.Clients.ForEntityId(player.entityId)
?.SendPackage(NetPackageManager.GetPackage<NetPackageConsoleCmdClient>().Setup($"removequest {questId}", true));

โš™๏ธ Add support for enable/disable different levels of player wipe

For Example

  • One admin may want to support erasure of skill and levels, but not of books

  • Level (Default: Reset to 1)

  • XP to Next Level (Default: Reset to 0)

  • XP Deficit (Default: Reset to 0)

  • Unspent Skill Points (Default: Reset to 0)

  • Learned Skills (Default: Unlearn All)

  • Crafting Recipes (Default: Unlearn All)

  • Book Collection (Default: Forget All)

  • Current Quests (Default: Remove All)

  • Trader Progress (Default: Reset)

  • Map Explored (Default: ?)

  • Map Waypoints (Default: ?)

  • Sleeping Bag Position (Default: Retain)

  • LCB Ownership (Default: Retain)

  • Current Party (Default: Remain)

  • Allies/Friends (Default: Keep)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.