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.

Devlog #2 - Achievements, Inventories and upcoming features
Started by zProxxy

zProxxy

zProxxy

Administrator
Joined
07 Feb 2023
Last Seen
10 Oct 2024
Topics
34
Posts
34

Hi!

This is the second devlog! In this thread I will talk about our achievements, inventories and what could be some upcoming features.

Introduction

It's been a while since the last devlog - however nothing worth mentioning happened.
About 85% of the database connections have been reworked, as well as several core functions, features and behind-the-scenes stuff (which can now easily be implemented to front-end stuff such as GUIs (inventories) or chat messages etc.)

Achievements

Achievements have been a major issue in the current code of STN - simply just because they were pretty much hardcoded.

Hardcoded basically means that something is coded specifically for one situation and the same code cannot be used for a similar situation unless you copy-paste it. And as you may have guessed: This causes massive issues when working on a giant project such as STN.

Why was it hardcoded? The achievements system and its code were one of the first systems made for STN. You probably noticed that every achievement currently in the game is only achievable in dungeons, there is not a single achievement for the main lobby or any other area of the game.
The achievements were introduced with STN v2.2, that was two or three content updates before STN was public for the first time to all players. The main lobby didn't even exist back then!

We didn't really think STN would become this complex at that time and my coding skills were way way worse than before, so I thought hardcoding these would be totally fine!

The achievements are still not 100% reworked, however they are no longer hardcoded and new achievements should be much easier to add and existing achievements are easier to modify and work with now.

Inventories and Shops

Inventories and Shops are one of the core parts of the front-end of STN, simply because minecraft doesn't offer many other ways of displaying things and of letting players interact with stuff, therefore reworking these was quite an essential thing to do.

Just image: Every single inventory was coded manually before, there wasn't any layout (even tho many inventories look pretty much the same ingame). And that would get quite annoying to do every single time we needed a new inventory!

Same thing goes for shops: I had to add every item to a shop manually, define its price and then create a listener for each item individually, check its item price manually, check if a player could even hold it in their inventory and then add it.
This would also become quite annoying to do (considering the amount of items we have in shops right now), also maintaining shops, changing prices of items etc. would become a time-consuming task.

This is why I finally added templates for inventories and shops. They now rely on a pre-built inventory which only requires a couple information to create (just as inventory size, if it's a shop or no and so on).

After that I can simply just add the inventory-specific items to it and that's it!

Shops rely on pretty much the same layout, however they are slightly different as they also have to contain the "Sell Item"-item or the recently sold item for item buyback depending on if you sold something or not.
However for shops I just have to create a ShopItem instance which contains the price, the item amount and everything else required for buying an item.
All of these shop items listen to the same listener, so that I don't have to create one manually.
Sounds good right? Yes! I really don't know why I haven't done this earlier.

 

More things changed

This obviously wasn't everything I have done since the past dev-log. I have reworked the scoreboard system and reworked many many other systems such as our custom recipes.

The new recipe system for example would allow us to add some sort of quick crafting.
As well as that you could potentially now also click on items in recipe overviews to check how they are crafted instead of having to go back to their respective collection.

Many many more things have been reworked which are now ready to be implemented to GUIs etc, however I won't go over all of them as that'd take too long.

 

Upcoming features

None of these features are guaranteed to find their way into STN, however they might!

- Extra Item Attributes
We would like to track more information of your items ingame! Therefore we might add some more NBTs to your items (non stackable items are affected only!):

  • Origin Tag: This would contain information on where you obtained the item (e.g. Crafting Table, Dungeon Loot Chest).
  • Item Date Tag: This would contain the exact timestamp on when you obtained the item.

Not sure on how you'd profit from that, however future updates might use that data to your advantage.

- Modifying ingame appearance
I already stopped several things from being hardcoded that are part of your appearance ingame.
For example the STN Level icon (
).

I have added methods to the code which allow us to change the icon for either everyone or a specific player.
This could become an official feature of STN where you might be able to customize your STN Level icon (visible for everyone) by achieving certain things ingame or unlock new icons by progressing in the game.

- Pre-generated Dungeon maps
Soon after the backend changes are completed, I want to experiment with a way of pre-generating dungeon maps.

You may have noticed the major lag when joining a dungeon instance and starting it. This is caused by the server generating a random dungeon, preparing all locations and finding a path through it and as there are several million blocks affected by this, this lags the server for quite a while.

This can be really annoying when you want to do some fast runs and actually grind, as that's like a minute of downtime.

I want to experiment with a pre-loading system, which generates a couple maps on a seperate server and then just takes one of the already generated maps when a dungeon instance is requested. After that the external server generates another map to keep up but you won't notice the generation as it happens on a completely different server! This way you would get your dungeon map immediately without any lag or having to wait for the server to generate anything!

- API
This feature might not be available for a while if we decide to actually do it, however some people already requested an API or client-side mods for STN.

However since I am busy with working on the game itself and I don't know anything on how to code minecraft modifications, I am not able to provide any official QOL STN mods.

With adding an API to the game you guys would be able to do so!
This API would contain most core information about the player, such as storage, any types of currencies, quest progress, dungeons and much more!

With that information some creative minds out there could create something really nice for STN - however these modifications will most likely not be official and confirmed by us, so you'd rely on other players!

 

Conclusion

A lot of what was to do has been done already, however we are not quite at the end just yet!
I will keep you updated however!

 

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 (abt 80%)
  • STN Creatures
  • Inventories
  • NPCs
zProxxy · 4 months ago · Last edited: 4 months ago