Recent Events Discussion (RED) Thread

NJM1564

New Member
Jul 29, 2019
2,348
-1
0
Small picture for the logger progress. Its getting there!

B8e_FAVCIAMRSjD.png:large


Is this going to have a roleback system?
Because if it does then you might want to try to figure out a better way of handaling fluid rolebacks. Some sort of fluid movement logging system.
Because that's something none of the old bukket systems could handle well. As fare as I know.
All they could do was remove the source blocks. And leave the fluids until they were manually updated.
You might also want to consider adding a way to chart the effects of the fluid movements. Lost or displaced torches and things. I Don't know if that would be necessary though.
 
  • Like
Reactions: pc_assassin

Claycorp

New Member
Jul 29, 2019
55
0
0
Is this going to have a roleback system?
Because if it does then you might want to try to figure out a better way of handaling fluid rolebacks. Some sort of fluid movement logging system.
Because that's something none of the old bukket systems could handle well. As fare as I know.
All they could do was remove the source blocks. And leave the fluids until they were manually updated.
You might also want to consider adding a way to chart the effects of the fluid movements. Lost or displaced torches and things. I Don't know if that would be necessary though.

If the hooks exist it should be possible. Again this is extremely early in development and has zero testing with other mods and real use.
We have no idea if rollbacks will be viable (yet). I will write this all down though so it can be looked into!
 

NJM1564

New Member
Jul 29, 2019
2,348
-1
0
If the hooks exist it should be possible. Again this is extremely early in development and has zero testing with other mods and real use.
We have no idea if rollbacks will be viable (yet). I will write this all down though so it can be looked into!

It should be doable is combined with a normal snapshot function. That way you only have to track changed between each snapshot rather that from the beginning of the servers lifetime. You can also improve snapshot efficiency and only recording the chunks that get updated. And have a outside utility program that would stitch together the chunks if a pull from the backup is needed. This methid while harder to program for would/should speed up the backup proses and reduce the lag it creates.
You might also want to get in touch with Armoa1997 he/she/it already has a fairly well functioning backup mod and working together to create a doublearomaclaydoor mod might be a good idea. At the very least he/she/it might be able to and willing to give you some advice or even help.
 

Claycorp

New Member
Jul 29, 2019
55
0
0
It should be doable is combined with a normal snapshot function. That way you only have to track changed between each snapshot rather that from the beginning of the servers lifetime. You can also improve snapshot efficiency and only recording the chunks that get updated. And have a outside utility program that would stitch together the chunks if a pull from the backup is needed. This methid while harder to program for would/should speed up the backup proses and reduce the lag it creates.
You might also want to get in touch with Armoa1997 he/she/it already has a fairly well functioning backup mod and working together to create a doublearomaclaydoor mod might be a good idea. At the very least he/she/it might be able to and willing to give you some advice or even help.

Theres a huge difference in ingame logging and backups. Also the rollbacks and backup restoring are also extremely different.

Backups take all the data about the world and save it regardless of what it is or how it came about. This means it affects everyone over a defined period of time no matter what they did. AKA Copy/Paste This also means you can't do this live on the server if something happens. You need to shutdown swap files and restart. (Unless this has changed but i doubt that.)

Rollbacks work block by block. So now instead of just creating clones we need to track what's happening where and by who. If this was done with everything that exists at once the databases would be huge and would take forever to do anything. So to solve this issues we only track what people do, where it happens and what they did. Because we are only watching a fraction of what people do we can do live changes(If mods allow). This means it only affects people that it needs to, In areas that only should be affected and you don't need to shut stuff down to do so.

On top of this for us to know what people are doing we need hooks. If someone interacts with something with a hook we can log it because somewhere in some code its shouting "HEY HE DID SOMETHING!" If he then interacts with something without a hook it might whisper to whoever needs it and nobody else will ever know something happened thus making it impossible for us to track and rollback.

Currently we have the fastest way possible (That we know of) for storing and retriving data. Thats why our main database is mostly numbers. Its cheap to look for numbers rather than other things like strings.

I hope this provides more information on how it works and why. Its 3 AM and i'm tired so i likely fuged up something. (Hopefully Dries007 doesn't kill me :p) Feel free to correct me!

Side note: DoubleDoorDevelopment is something Dries and I are both equally part of. Sometimes i don't make this clear enough and it's stupid of me. He codes, I do everything else. (I know pathetic amounts of java) We have an extremely odd relationship compared to most of the modded community. He deserves way more credit than what appears! Im not trying to hide or steal any of the work he does. This is a whole other topic that i could write an equally large amount of information on. I <3 mah buddy Dries007 :p
 

Strikingwolf

New Member
Jul 29, 2019
3,709
-26
1
On top of this for us to know what people are doing we need hooks. If someone interacts with something with a hook we can log it because somewhere in some code its shouting "HEY HE DID SOMETHING!" If he then interacts with something without a hook it might whisper to whoever needs it and nobody else will ever know something happened thus making it impossible for us to track and rollback.
There are ways to do this. I know @chbachman did some tricky things to manufacture his own onArmorDequip for MA
 

VikeStep

New Member
Jul 29, 2019
1,117
0
0
Reflection...

^
I threw together a basic implementation of the onArmourDequip. It wasn't awesome, but it worked. However, Bachman added extended player properties and things...
Reflection can only get you so far. When you want to modify a method and not a field then ASM or asking for a proper Forge hook is the only way. However Forge is no longer receiving additions for 1.7 so the latter is out.

Event handlers are also an option as you can disable them and do your custom action but the problem is that it means you will conflict with other mods who also cancel that event and recreate the following steps.
 
  • Like
Reactions: Strikingwolf

VikeStep

New Member
Jul 29, 2019
1,117
0
0
Reflection should be the first choice if usable though. ASM is often incompatible and always confusing.
I believe that if you have to use ASM, then there is a way to maximise compatibility with other mods. My rule of thumb is to not ever delete instructions and when searching for an instruction check that the instruction has the same data and that the following instruction has the correct opcode and data. If it can't find the instruction because someone else tampered it, I don't modify the ASM. Also, there is also a handy sortingIndex feature which will guarantee that one mod loads its ASM after another

I have only had one issue with ASM and that was a conflict with CodeChickenCore because he removed the instruction I was searching for. I talked with him about it and he changed it to a GOTO after the block that he removed so he can leave it for me intact to edit.
 

dries007

New Member
Jul 29, 2019
44
0
0
Someone must teach me ASM some day... I think you can replace lines, which I guess would keep compatibility (?).
ASM is fairly straightforward, if you have any experience with assembly its be even easier.
You can basically manipulate the compiled java code, so you can do everything that you can do with regular java.
The hardest part is debugging, really. Especially when you have some nice ide plugins :p