Mods / Grief Logger

Tags: #Utility
Author: codeAtorium
Side: Server
Created: Mar 27th 2024 at 4:22 PM
Last modified: Apr 30th 2024 at 5:05 PM
Downloads: 2622
Follow Unfollow 11

Latest release (for outdated Vintage Story v1.19.0 - v1.19.7):
grief_logger_0.0.23.zip  1-click install


This mod works by storing information about placed and broken/used blocks in the savegame file.  When a user first places a block in a chunk, it marks the chunk with a unique id, and used that id to key the placed block information in the file. Then, when a user breaks a block, it checks for the presence of that id, and if it finds it, compares the block being broken to the blocks in that chunk's placed block information.  If it finds a matching block that was placed by a different player, it marks that in a single table. The mod creates a grief-log.csv file that is openable in Google Sheets or Microsoft Excel.

It outputs a grief_log.json file to the modconfig folder where you can set a few settings. This will allow you to trim the length of the grief log, whitelist low value items like soil, set the chat group that receives the grief announcement (acceptable vakyes are: AllChatGroups, ConsoleGroup, DamageLogChatGroup, GeneralChatGroup, InfoLogChatGroup, ServerInfoChatGroup), and limit the announcements by the player's role (remove any roles from the list you don't want).  

The mod also detects when a player places a bomb within radius of a griefable block and announces it once (not for all blocks in threat, since there are many).  

The mod also detects animal griefing.  In order to be recognized, the animal must be non-wild (generation 1), and must be on claimed land that is not the killing player's.  Thanks to funnybunnyofdoom whose code on github helped me to accomplish this.

Remember that this mod tracks ownership of all placed blocks.  That means it can be used to determine who placed a block next to claimed land, or on top of public paths. (Breaking the block will reveal who placed it in the grieflog.) 

Please let me know if you're experiencing any errors or slowdowns on your server.

UPDATE: I will not be continuing development of this or any of my mods.  Please feel free to fork them and continue development.

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v0.0.23 259 Apr 30th 2024 at 5:05 PM Show grief_logger_0.0.23.zip 1-click install
v0.0.22 99 Apr 29th 2024 at 4:40 AM Show grief_logger_0.0.22.zip 1-click install
v0.0.21 151 Apr 26th 2024 at 3:45 AM Show grief_logger_0.0.21.zip 1-click install
v0.0.20 128 Apr 24th 2024 at 9:28 PM Show grief_logger_0.0.20.zip 1-click install
v0.0.19 111 Apr 21st 2024 at 8:03 AM Show grief_logger_0.0.19.zip 1-click install
v0.0.18 108 Apr 17th 2024 at 12:25 AM Show grief_logger_0.0.18.zip 1-click install
v0.0.17 112 Apr 16th 2024 at 11:58 PM Show grief_logger_0.0.17.zip 1-click install
v0.0.16 116 Apr 16th 2024 at 9:39 PM Show grief_logger_0.0.16.zip 1-click install
v0.0.14 108 Apr 16th 2024 at 8:55 PM Show grief_logger_0.0.14.zip 1-click install
v0.0.13 111 Apr 16th 2024 at 5:05 PM Show grief_logger_0.0.13.zip 1-click install
v0.0.12 108 Apr 16th 2024 at 3:13 AM Show grief_logger_0.0.12.zip 1-click install
v0.0.11 116 Apr 16th 2024 at 1:19 AM Show grief_logger_0.0.11.zip 1-click install
v0.0.10 118 Apr 15th 2024 at 4:30 AM Show grief_logger_0.0.10.zip 1-click install
v0.0.9 124 Apr 15th 2024 at 3:18 AM Show grief_logger_0.0.9.zip 1-click install
v0.0.8 106 Apr 13th 2024 at 4:19 AM Show grief_logger_0.0.8.zip 1-click install
v0.0.7 110 Apr 12th 2024 at 4:49 PM Show grief_logger_0.0.7.zip 1-click install
v0.0.6 131 Mar 29th 2024 at 5:56 AM Show grief_logger_0.0.6.zip 1-click install
v0.0.2 128 Mar 28th 2024 at 7:24 AM Show grief_logger_0.0.2.zip 1-click install
v0.0.1 133 Mar 27th 2024 at 4:46 PM Show griefloggerwithharmony_0.0.1.zip 1-click install
v 114 Mar 28th 2024 at 2:17 PM Show grief_logger_0.0.4.zip
v 124 Mar 28th 2024 at 6:18 PM Show grief_logger_0.0.4.zip

17 Comments (oldest first | newest first)

💬 GlooMeGlo, Mar 16th at 11:00 PM

works on 1.20, but every time a stone block or dirt block is mined, it says "object refrence is not set to an instance of an object" in the server console. Doesn't cause any issues other than console bloat

💬 GlooMeGlo, Feb 13th at 6:04 PM

Does anyone know if this works on 1.20?

💬 WickedSchnitzel, May 28th 2024 at 5:43 PM

And where is that csv file located?

💬 WickedSchnitzel, May 28th 2024 at 5:40 PM

28.5.2024 16:29:35 [Error] Object reference not set to an instance of an object.
28.5.2024 16:29:43 [Error] Exception: Index and count must refer to a location within the string. (Parameter 'count')
at System.String.Remove(Int32 startIndex, Int32 count)
at grieflogger.griefloggerModSystem.OnEntityDeath(Entity entity, DamageSource damageSource) in C:\Users\jgord\source\repos\grief_logger\grief_logger\grief_loggerModSystem.cs:line 532
at Vintagestory.API.Common.Entities.Entity.Die(EnumDespawnReason reason, DamageSource damageSourceForDeath) in VintagestoryApi\Common\Entity\Entity.cs:line 1706
at Vintagestory.API.Common.EntityPlayer.Die(EnumDespawnReason reason, DamageSource damageSourceForDeath) in VintagestoryApi\Common\Entity\EntityPlayer.cs:line 1177
at Vintagestory.GameContent.EntityBehaviorHealth.OnEntityReceiveDamage(DamageSource damageSource, Single& damage) in VSEssentials\Entity\Behavior\BehaviorHealth.cs:line 169
at Vintagestory.API.Common.Entities.Entity.ReceiveDamage(DamageSource damageSource, Single damage) in VintagestoryApi\Common\Entity\Entity.cs:line 813
at Vintagestory.GameContent.AiTaskMeleeAttack.attackTarget() in VSEssentials\Entity\AI\Task\TasksImpl\AiTaskMeleeAttack.cs:line 173
at Vintagestory.GameContent.AiTaskMeleeAttack.ContinueExecute(Single dt) in VSEssentials\Entity\AI\Task\TasksImpl\AiTaskMeleeAttack.cs:line 146
at Vintagestory.GameContent.AiTaskManager.OnGameTick(Single dt) in VSEssentials\Entity\AI\Task\AiTaskManager.cs:line 174
at Vintagestory.GameContent.EntityBehaviorTaskAI.OnGameTick(Single deltaTime) in VSEssentials\Entity\AI\Task\BehaviorTaskAI.cs:line 114
at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 874
at Vintagestory.API.Common.EntityAgent.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\EntityAgent.cs:line 540
at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 330
at Vintagestory.Server.ServerSystemEntitySimulation.OnServerTick(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 169
at Vintagestory.Server.ServerMain.Process() in VintagestoryLib\Server\ServerMain.cs:line 886

💬 WickedSchnitzel, May 27th 2024 at 9:21 AM

GRIEFLOG (claim error): Object reference not set to an instance of an object.
shown in console without further infos

Also the grief logger makes players jump to the info chat tab every time someone is griefing, which is kind of annoying.
It should log without forcing people to another chat tab.

💬 codeAtorium , Apr 10th 2024 at 11:49 PM

@MadGnome

  1. I think I fixed a null bug in DidUseBlock, but I wasn't able to reproduce it.  Time will tell.
  2. You can now filter messages by role.  This can be set in the config file.  Currently all roles are included, so you can just eliminate the ones you don't want.
  3. If the block is in a claimed area, it doesn't log or report the grief.  If there's some special logic that's needed in these cases, fine, but I assume if you're allowed to work in the claimed area, you're not griefing.
  4. You can now set the chat channel in the config.  Acceptable values are: AllChatGroups, ConsoleGroup, DamageLogChatGroup, GeneralChatGroup, InfoLogChatGroup, ServerInfoChatGroup

You might need to delete your old modconfig file to get this new version working.

💬 MadGnome, Apr 9th 2024 at 2:10 PM

Getting quite a few error messages in my logs:
server-main, server-event
9.4.2024 07:59:26 [Error] Mod exception during DidUseBlock
9.4.2024 07:59:26 [Error] Exception: Object reference not set to an instance of an object.
at grieflogger.griefloggerModSystem.getLogString(String locString, IServerPlayer byPlayer, BlockSelection blockSel, List`1 oldData) in C:\Users\jgord\source\repos\grief_logger\grief_logger\grief_loggerModSystem.cs:line 172
at grieflogger.griefloggerModSystem.possibleGriefEvent(IServerPlayer byPlayer, BlockSelection blockSel) in C:\Users\jgord\source\repos\grief_logger\grief_logger\grief_loggerModSystem.cs:line 214
at Vintagestory.Server.ServerEventManager.TriggerDidUseBlock(IServerPlayer player, BlockSelection blockSel) in VintagestoryLib\Server\ServerEventManager.cs:line 553

💬 MadGnome, Apr 8th 2024 at 12:16 AM

Some feedback from testing this out on a server currently, we seem to avg around 6-15 players online.  We are currently running it on VS 1.19.7, server has 100+ mods on it.

Haven't noticed any performance issues yet, it's handy getting the grief notifications, our players have been poking and prodding it to see how it works.

Couple of things.

Is there anyway to filter the messages to just the admins, or by role?

It logs griefs when a small team is sharing the same claimed space, even though they have the permissions from claims to mine those blocks.  Could a feature be added to not report griefing, or disable that chat message, when players have permissions to mine blocks in a claim?

Would there be a way to get the messages in the main chat, since discord bots don't recognize other chat channels.  If the server does a reset the logs are lost, but if it's in the main chat to discord it's recorded there forever for an Admin to find it.

I appreciate the work you've put into this, so far it's working very well and we haven't encountered any errors while testing.  (I'm in the main VS Discord under the same name)

💬 FunnyBunnyofDOOM, Apr 6th 2024 at 2:03 AM

This is great! Let's colaborate if you'd like to. I'd like to help get animal tracking into this. I sent you a discord request.

💬 codeAtorium , Apr 1st 2024 at 2:45 AM

Currently this is only tested on 1.19.5, but I expect that it proably works for 1.19.* and maybe 1.18.*.  If you test it and find it does or doesn't work, please let me know.

💬 Aki_II, Mar 31st 2024 at 1:43 AM

Has this been tested for 1.19.3?

💬 codeAtorium , Mar 29th 2024 at 5:55 AM

I think it will work in 1.19.4, but I haven't tested it.  I marked it as compatible, but let me know if you have issues.

💬 MrL972, Mar 29th 2024 at 2:54 AM

work in 1.19.4 ?

💬 codeAtorium , Mar 28th 2024 at 2:17 PM

Now it requires installation on the server only.  The client doesn't need it.

💬 codeAtorium , Mar 28th 2024 at 7:07 AM

I think I have a solution to the lag issues that other mod ran into.  I'm storing the placement data on a per chunk basis, which makes it much quicker to query and save.  That new version is live.  I've included the source in it, if anyone wants to take a look.

💬 Kara, Mar 28th 2024 at 2:53 AM

i guess ill wait. 
check out https://mods.vintagestory.at/blocklog i think all its code wasnt turned into a dll file. it might help, with progression. RogueRaiden, yah the one i posted. we stopped using it, cause of the lag it would cause xD having something like https://www.spigotmc.org/resources/logblock.67333/ for VS would be amazing xD

💬 RogueRaiden, Mar 27th 2024 at 6:47 PM

This could be an absolutely amazing addition to servers!
The last mod that was doing this was fantastic for a while but it ended up causing world saves to take several seconds, 5-10+ seconds at times with lots of activity (20+ player activity after several hours, problem would compound). Made it too much of a issue to use.
Looking forward to more updates!

 (edit comment delete)