SurviveTheNight

There are currently 0 players online.

Connect now using the IP mc.survivethenight.net

Internet Explorer

Internet Explorer is not supported. Please upgrade to a more modern browser.

zProxxy

Administrator

Feed

There are no wall posts here yet.

About

Registered:
about 1 year ago
Last Seen:
1 day ago
Profile Views:
876
Minecraft
zProxxy

Latest Posts

about 1 month ago
Devlog #1 - Items

Hi!

This is the first devlog! In this thread I will talk about our items system, what we have changed and how this may improve future development.

Introduction

Items are an extremely essential part of SurviveTheNight. They give you some stats, they allow you to use certain abilities and you can customize them! Or atleast some of them.

While it looked like our items were working fine and there was no reason for us to change them: No! They weren't fine nor were they easy to work with.

The previous system

Before I get into how our previous system was like, you have to understand how an item (or ItemStack) is constructed.

An ItemStack can be split up into atleast three different parts:

  • The general information: This includes the Material type (For example STICK, BOOK, STONE, so basically what the item looks like), the amount (How many of them should be in that stack we're creating) and the sub ID (STONE:0 would be stone while STONE:3 would be diorite)
  • The ItemMeta: This contains a bunch of different data such as the item description (also known as the item lore), the displayname, vanilla enchants, some special attributes to hide certain properties and much more.
  • Custom NBT: You may also add custom NBT to the items. Why would this be useful? It allows us to save custom data on an item without it being visible for casual players. These can be useful to store certain values such as an NPC value, a UUID, etc. on the item.

Okay!
So how did our previous system look like?

Every STN item was coded manually. Each item has its individual STN ID which is used to identify the original item when it's modified, add certain abilities to it and just check for items in general.

All the possible modifiers were coded manually and whenever joining a server a brand new copy of the original itemstack (depending on their STN ID) would be loaded from the plugin and then every applied modifier of the original item would be applied to the new item.

This basically allowed us to keep all the items updated when switching servers but also make them not lose any of your applied modifiers. However the main issue was applying the modifiers in the first place.

As I already said every modifier was coded manually instead of having a modular design.
There was a bunch of code repitition (which is never fun and not what you should be doing when coding), which lead into the modifiers class containing about 4.000 lines of code and the entire modifier system not being modular at all. Adding new modifiers would be a pain as I'd have to implement that modifier at like 30 different locations in various classes in the entire code.

     Creating/Crafting new items:
As you may have noticed: Loading in items or crafting new items in the crafting menu would take a couple ticks for them to actually load in and update properly.
This was caused by another issue we've had: This issue required us to wait a couple ticks for the server to properly create a new copy of the original itemstack before being able to modify it, otherwise it would modify the original itemstack and apply the modifier to EVERY item with the same STN ID on the entire instance - crazy, I know! (This issue caused me alot of pain in the past btw, I really hate it.)

    The NBT structure:
Aswell as all of that, the NBT on the items were kinda confusing and hard to read - not like you should read them, however for us for debugging purposes it was really annoying to work with:

All of our custom NBT was saved into "STNData" on the item and a pickaxe for example would end up looking like this:

STNData: {
            itemUUID: "0abd2c29-b306-4082-8522-cdeac2f1718e",
            itemType: "Pickaxe",
            stnID: "CRYSTALLIZED_PICKAXE",
            efficiency: 5,
            pickaxeUnlockedModes: "engine:handle:prism",
            doubleDrop: 0,
            npcValue: 720,
            miningExpReq: 25,
            handMiningFortune: 350,
            itemUUIDDC: "ca30a282-0a61-4c60-818f-a4a0f9c6e160",
            breakingPower: 7,
            pickaxeModeSelected: "handle",
            handDiggingRate: 1950,
            propertyOne: "multiblocks5",
            propertyTwo: "overflow5"
        },

As you can see: Nothing is sorted nor are the values or names easy to understand.

The new system

The main reason we did the revamp was because of the difficulty when it comes to adding new modifiers to items.

I managed to figure out a system where I can just add one line of code which contains all the necessary information to add a whole new modifier - and trust me: This is way way easier to work with than before.

This would be how a modifier in the new system looks like:

MAGICIMBUED(ModifierTypes.GLOBAL, "MAGICIMBUED", new Object[]{"STNData", "magicImbued"}, null, true) {@Override public <t> ItemStack addNBTTags(ItemStack iS, T additionalData, boolean update, ItemStack... prevStack){return new GlobalModifiers().addNBTAndLoreMAGICIMBUED(iS);}},</t>

It may look a little confusing, however this is probably the easiest I could do.

It contains a ModifierType which basically says which item types this modifier can be applied to,
a modifier name which is required for updating the item,
an NBT "path" to the data of the modifier on the item and
an STN ID blacklist which contains IDs with items that cannot have this modifier ("null" in this example as there's no exception).

I also reworked the system which made new items require a couple ticks before being able to be modified, so that any types of delay when it comes to creating new items, crafting new items or loading new items should be completely gone.

The NBT structure of items is way easier to read now, even tho it may not seem like it at first sight:

STNData: {
            coreItem: {
                itemType: "pickaxe",
                stnID: "CRYSTALLIZED_PICKAXE"
            },
            miningExpReq: 25,
            mOrigTag: "ITEMUUID&&ITEMUUID&&PICKAXEPROPERTY_1&&PICKAXEPROPERTY_2&&PICKAXETIER&&PICKAXEPERK&&PICKAXEMODE&&PICKAXEMODEACTIVE",
            itemUUID: "ca30a282-0a61-4c60-818f-a4a0f9c6e160",
            enchants: {
                efficiency: 5
            },
            npcValue: 720,
            modifiers: {
                pickaxePerk: {
                    extradrops: 1
                },
                breakingPower: 7,
                pickaxeMode: {
                    draconicPrism: "true",
                    active: "reinforcedHandle",
                    reinforcedHandle: "true",
                    pickaxeEngine: "true"
                },
                propertyOne: {
                    multiblocks: 5
                },
                propertyTwo: {
                    overflow: 5
                }
            },
            profileStats: {
                diggingSpeed: 1950L,
                miningFortune: 350L
            }
        },

And saving the itemstacks to databases has also been improved. Instead of being saved as some type of yml "string" (which is like a million characters long), they're now being saved as Base64 encoded itemstacks.

I also took some time to rework the design of item descriptions! This is what a pickaxe will look like when the changes come to the main server:

The overall structure of modifiers has been changed, every modifier now has its own section.
The pickaxe now also not only shows the selected pickaxe mode but also the already unlocked ones on the pickaxe.

Future development

If you took a look at the new NBT structure you may have noticed an enchants section.
Yes! We are finally able to properly add multiple enchants to the game without any issues.

Aswell as that we are able to easily add new pickaxe perks, modifiers, attributes, stats and make changes to the current ones.

Every item now has a proper item category so that we can make global changes to every item in a certain category.

Overall it's just much much easier to modify, add and remove new items, their stats and modifiers.

 

Conclusion

This system took a lot of time to rework. Obviously a system like this wasn't my first approach when thinking of a new modular item modifier system, so it took a couple days to experiment with NBTs and much more.

After about two weeks of coding, trying and fixing bugs this system does seem to work decently fine. It does require more testing and if you notice anything disappearing on your items once the servers are back online, please immediately report issues!

However especially when looking into the future, reworking this system was necessary and will allow us to bring new enchants, modifiers or items almost effortlessly to the server!

 

Systems that must still be reworked

This is more like a checklist with systems that will probably receive their own devlog once they're done.

  • Items
  • Achievements
  • STN Creatures
  • Inventories
  • NPCs

That's it! Hope you learned something new! I didn't go too much into detail on this one, otherwise you'd read for another 2 hours probably.

I'm sorry for not including too many pictures, I'll try and add more in the upcoming devlogs.

about 1 month ago
The Backend Changes - A short update

Hi!

This is a thread regarding the current maintenance and backend changes.
While STN is down I thought I'd give you something to read about STN and the current backend situation since it's offline right now!

Introduction

Before I start I just want you to know:
We've NOT lost interest in working on STN nor has this project been abandoned!

STN is a somewhat RPG Minecraft server with various custom features, items, monsters etc.
Most of you probably aren't too familiar with the technical aspects behind it, so I'll introduce you a little bit to what I've been doing here.

I've split up this thread into a few parts so it's easier to navigate for you or if you only want to read certain parts of the thread:

  • Minecraft Plugins and complexity
  • Our current situation
  • The Backend Changes
  • Why is STN down and when will it be back?

 

Minecraft Plugins and complexity

Atleast some of you probably haven't coded a minecraft plugin before. The main problem with coding plugins is that coding these is pure java code above minecraft basically. You have nothing, you don't have a game engine you can work with. The only thing you can work with pretty much is a set of commands and functions to interact with the minecraft server, also known as an API.

STN itself is almost completely self-made. Our Lobby services for example only run three download plugins:

  • LuckPerms (A permissions and ranks plugin, so players have certain permissions across the entire network depending on their rank)
  • ViaVersion (A plugin which allows players to join the server even if they're joining with a newer version than the server is running on)
  • WorldEdit (Well-known plugin which allows to edit your world basically, paste in things and replace other blocks)

All of these systems run on a Cloud system (CloudNet) which hasn't been made by me either.

Everything else is coded by us - or me rather.

STN also comes with ALOT of security and background-running systems, so everything you're actually looking at works the way it does right now.

Our current situation

If you may think that everything is fine with the server because most things work as expected and those that don't work require just some minor patches: Unfortunately not.

Some pieces of code, especially code related to our STN Dungeons is EXTREMELY outdated and not coded well in any way. I've started working on this project when I was 14, so about 5 years ago from now.

Due to that and to my extremely lacking knowledge back then when it comes to Java, most of the code is poorly written and not really easy to add new features to.

I do know alot better by now, however when it comes to our Lobby systems, I basically just was too lazy to write decent code from the beginning, so the code pretty much became a mess again.

Our newest update - the early game update - was extremely painful to code: Not only because it required me to use some techniques I've never used before, but also because the Lobby code wasn't made to be extended for new features. This became an issue really fast and adding new things such as Collections require way too many lines of code to be properly implemented.
Some systems in STN are even worse as I rushed through the process of coding them instead of taking my time and thinking about what possibly could happen with it in the future and if or how we want to extend certain things or make them more customizable.

Another issue is the server performance - Accessing databases and processing their data mostly happens synchronously (It basically runs on the main thread of the server and therefore slows it down) instead of asynchronously (Runs on a seperate thread to the main thread: If anything lags out you wouldn't notice a performance drop such as bad TPS or a lagspike).

 

The Backend Changes

Backend itself is way harder for me personally to focus on and to code a proper future-proof major system like the background-running systems for STN compared to frontend.

I took a look into the general structure of our systems and immediately knew it would take a while to fix this issue.

As already said most internal systems are not coded to be extended with new features nor to be customized. Changing the drop chance of an item a monster may drop for example shouldn't require multiple changes in the code but instead only one.

Right now I'm working on our databases, adding new data to them, making them future-proof and merging your profiles to them!
It requires alot of time, especially for our system that manages all the ingame items. Items were encoded very poorly so far, aswell as them losing custom data sometimes. I won't go too much into detail with that, otherwise you'd be reading for a couple hours probably.

After the databases I can finally focus on more fun things: The overall systems.
If the databases work fine, then the rest will also work decently fine most likely. If all the data can be stored and retrieved safely, then the systems may start working and processing that data.

 

Why is STN down and when will it be back?

You may ask why STN is currently offline? Well, we are "only" doing backend changes instead of adding alot of content which may break the game, however I wasn't expecting these changes to take this long. I've already started merging your profiles to new databases, so if I'd reopen STN all of your progress you'd gain until the backend changes are fully done would be lost and I wouldn't be able to restore it.

Yes. I could merge your data again once the backend changes are done, however that is more effort than you may think and could possibly lead to some data loss.

When will STN be back? Unfortunately I can't tell. It fully depends on how the progress is going and how bad the code is that I have left to rework.

I really wasn't too motivated to work on the backend changes over the past 1-2 weeks, therefore I took a short coding break instead of writing some bad code once again that would need a rework in a couple months.
As you probably guessed: Coding on STN is not my actual job, we are not earning any money with this, this all happens in our freetime. Therefore I don't have too much time to work on this project in general and since I'm the only developer as of right now everything takes even longer.

Either way: I'm giving my best to bring back STN to all of you as soon as possible!

Once we are ready for some major testing of our backend changes, we will let you know!

 

Alright, this is it. You now got a short insight in what I'm actually doing here and why everything is delayed, aswell as why exactly we are doing these backend changes.

If you made it until here: Congratulations!

Further necessary updates on the current maintenance will be posted in the discord!

 
 

3 months ago
⦅STN v2.7.016⦆ MAR 7th | Bugfixes

Hello everyone!

Changes:

  • Changed the color of the guild system (chat messages): Dark Red -> Aqua
  • Added a system icon (⁑) which indicates a:
    • Guild Message
    • Direct Message
    • Party Message
    • Guild Player Join/Leave
    • Friend Join/Leave
      (This makes important messages easier to see in the decently spammed ingame chat)
  • You no longer receive both messages: Friend Join/Leave and Guild Join/Leave:
    • If a player is in your guild and friends list, you only receive the Guild Join/Leave messages instead of both to avoid chat spam!
  • Changed colors of Guild Ranks:
    • Guild Leader: Gold -> Aqua
    • Guild Moderator: Yellow -> Light Aqua
  • Fixed being able to send empty guild messages
  • Some changes to internal systems

3 months ago
⦅STN v2.7.015⦆ MAR 6th | Guilds & Balancing

Hi!

We just rolled a new update to STN:

 

 GUILDS
You want to team up with some friends? Sure! Go ahead and create a guild!

You may now create a guild using /guild!
Creating a guild requires atleast the MVP Rank!

Guilds may have up to 25 players!

Guilds feature many features:

  • Guild Tags
  • Guild Ranks
  • Guild Chat & Join/Leave messages
  • Guild Invites
  • ... and much more!

Other changes:

  • Added a 2-Piece-Bonus to Crazy Mining Set
  • Buffed Ash Master Armor:
    • 2-Piece-Bonus: 1% -> 2-Piece-Bonus: 0.5% for each piece worn
    • 20% Double Drop -> 33% Double Drop
  • Ores now should not get stuck in blocks anymore when mined
  • Fixed collection T4 rewards sometimes showing incorrect reward data
  • Fixed sometimes having a 0 Spruce Itemstack from Boss Loot
  • Fixed teleportation out of wall not working for some mining mobs
  • Fixed Inverted Burnt Ashes visually glitching when spawning multiple in the same spot

That's it!

 

4 months ago
⦅STN v2.7.011⦆ MAR 3rd | Small Communication & Security Update

Hello everyone!

Over the past few days we received a bunch of bugreports, however sometimes we didn't get the necessary information we need to identify, replicate and fix the reported issues.

For future bugreports please make sure to provide the necessary information we need to help you out.

Changes:

  • Changed our discord ticket bot messages to possibly make it easier to see that some information are required
  • Improved our Server ID and log system
  • Added some more security options to our ingame instances

Nonetheless we are very thankful for all the bugreports we received over the past weeks! Please continue reporting bugs if you find any so we're able to fix them and constantly improve STN.

That's it!