Jump to content
Live Updates
HaedHutner

The Boring Dev Log

Recommended Posts

Alright, so this is something that will not appeal to most people. In fact, I would say hardly anyone would get much out of reading this. Unless you're interested in the nitty gritty technical details of programming and plugin development, you can skip this one.

 

Introduction

 

The entire point of the boring dev logs is to give you an insight into how we're going about developing A'therys plugins.

 

Since we've decided to go modded, we have to run a Forge Server. However, this brings with it some unfortunate implications, including having to use Forge to create... well, anything, really. I, for one, do not want to be making mods when the functionality is best described as a server-side plugin, thus I don't see the point in using Forge for any of our gameplay mechanics.

 

Luckily, we have Sponge ( Found at https://www.spongepowered.org/ ). It offers a higher-level abstraction atop Forge which makes it so much easier to work with. Of course, this comes with limitations, but so far I will say that I have not felt limited by Sponge in 99% of cases, and it's only in some corner cases where Sponge has proven to be lacking. But even then, I've managed to find workarounds which have worked just fine.

 

Great, so we have our starting point then, right? Well, not quite. Sponge offers a beautiful abstraction, but for our needs we need more than just a plugin framework. The elephant in the room is Persistence, with Sponge not offering any high-level solution for this. But there are other, smaller things which could improve the speed with which we develop our plugins. Thus, something I've nicknamed the "A'therys Framework" is born out of these needs.

 

This first Boring Dev Log is going to cover what the A'therys Framework is, and why it's necessary.

 

AtherysCore

 

In actuality, the A'therys Framework is represented by a single plugin: AtherysCore ( Found here: https://github.com/Atherys-Horizons/AtherysCore ). Core provides all the tools and utilities we need to make A'therys plugins better, faster and stronger. And that's all it does. It has no functionality in it. For all intents and purposes, it is nothing more than a library built atop Sponge.

 

Annotation-Based Command API

 

In Sponge, the way you'd traditionally go about creating a command is described here ( https://docs.spongepowered.org/stable/en/plugin/commands/index.html ), and it's a process that often times requires several classes ( not just the one it's described in ), plus more code relating to the command that's placed in the plugin main class. Overall, it creates a very disjointed feeling to command creation, with code being split up in several places. This makes it not only harder to read, but also harder to maintain.

 

The Annotation-Based Command API is described here ( https://github.com/Atherys-Horizons/AtherysCore/wiki/The-Command-API ) and it's quite a simple abstraction atop Sponge's commands, yet it makes it so much easier to work with.

 

Gson Utilities

 

Gson is a library that Minecraft ( and therefore Bukkit/Spigot and Sponge also ) uses to parse json into meaningful objects that it can use. Specifically, any time you describe something in JSON that has to be read by the game ( see: data packs in the latest updates ), Gson will be used. It's a great library written by Google and it works well for 90% of cases. The problem is the other 10%.

 

More specifically, Gson has issues with polymorphic structures and inheritance. If you have a ClassA interface/abstract class, which is inherited by ClassB and ClassC, you have to describe that relationship explicitly to Gson otherwise it's not going to be happy. It will try to instantiate abstract classes during deserialization, which obviously results in errors. The fix for this, as provided by Gson, is a class lovingly named the RuntimeTypeAdapterFactory. I shorten this to RTAF.

 

In the RTAF, you provide the abstract class, and link it to several possible implementations. Gson will then embed the implementation type into the serialized data, so it knows for the future which implementation to use for the json it's deserializing. Overall, this is a swell strategy, but it results in some boilerplate which is not very pleasant to look at.

 

The result therefore is the TypeAdapterFactoryRegistry class ( https://github.com/Atherys-Horizons/AtherysCore/wiki/TypeAdapterFactoryRegistry ), which will store multiple RTAFs and create Gson instances using them. The result is much more organized code, and less boilerplate.

 

Interaction/Attachment Service

 

This is something @Rynelf wrote to solve yet another issue with commands. Sometimes, a command needs to be more interactive. For example, you might need to write a command, and hit a block or an entity in order to achieve something.

 

The details of it are pretty straightforward and you can read the code here ( https://github.com/Atherys-Horizons/AtherysCore/tree/hibernate/src/main/java/com/atherys/core/interaction ), so I won't go into too much detail.

 

PluginConfig

 

Plugin configuration in Spigot was a pain in my opinion. And in Sponge, despite best efforts, it's still not the easiest thing in the world to set up a configuration file. That's why the PluginConfig class exists. It offers an abstraction atop Sponge's Configurate library, which is really nothing but the boilerplate required to setup an ObjectMapper and a ConfigurationLoader.

 

Question API

 

Another simple addition is the Question API which allows one to easily create text-based question-and-answer forms. Underneath it uses Sponge's Text API to create a question under the form of "Question? [Answer1] [Answer2] ... [AnswerN]". The player can then click on any of the answer buttons to execute some code.

 

Sound Utilities

 

Makes it easier to create and send sounds to a player.

 

Alright, and now we come to the big daddy of them all...

 

Persistence( JPA/Hibernate )

 

Persistence means storage, essentially. For example, you create a town, and you want that town to still be there after the server restarts. Might seem simple enough from a user perspective, but it falls under the massive field of persistence. And for this, we've gone several different directions in the past, gone through multiple iterations of each, until we've finally arrived to where we are today: JPA and Hibernate.

 

Originally, the Core plugin didn't offer any persistence abstractions. Each plugin was responsible for handling it's own, which proved to be inefficient at best. The first abstraction was based off of the NoSQL database MongoDB, which has been proven to be robust and high-performance. Over the course of 5-6 months, in became clear that the simple abstraction atop Mongo simply wasn't enough, and we'd need something better: an ORM.

 

An ORM stands for an Object-Relational Mapper, and what it does is translate memory data structures into database data, without the programmer having to do much for it. And in the beginning, we used Morphia, which is an ORM for MongoDB. We ran with this for a good 3-4 months, until it became clear that MongoDB in and of itself was simply not a good solution to our needs.

 

With that revelation, I decided to finally just go for the big one: Hibernate and JPA ( short of Java Persistence API ). It will take any Java object, and store it into an SQL database almost as if by magic, with minimal effort on the programmer's part. The only thing that I did was write a simple 80-line abstraction atop JPA which gives access to basic JPA functionality, such as CRUD operations, criteria and other such ( including JPQL queries ). What I intentionally missed out on were native queries which, while fast, lock the implementation of the database to a single driver ( such as Postgre or MySQL ).

 

And speaking of drivers, the default database I've chosen to go for is PostgreSQL. It's much faster than MySQL, though still an SQL database, and even offers additional potentially useful features such as JSON support, partitioning, and others.

 

Conclusion

 

To conclude this long boring dev log, I would like to say that you can still find all of the source code for our plugins at https://github.com/Atherys-Horizons. And specifically the AtherysCore plugin at https://github.com/Atherys-Horizons/AtherysCore. I don't know if I'm going to make a second one of these. It depends a lot on the time I might have or would want to spend on writing long threads like these, as opposed to writing code. So, we'll see. Take care for now!

  • Like 4
  • Thanks 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Our picks

    • The Mortal Plane Awaits...


      v2/ Evo Monas Roth

      To honor the past versions of our amazing server and its legacy, we are returning the world of A'therys Ascended to your pleasure once more! Thanks to the tireless work of our beloved admin @Dannie, he has managed to pull my old build server from the depths of Minecraft limbo.

       V1 Calastore

      Whilst many of you use to use my build server, this will give you a chance to revisit your old builds on there. However beyond that, we have also restored the other worlds on there, including the A'therys v1 and v2 worlds. But to push the goal even further, we have also managed to bring back the A'therys Evo world. 


      v2/ Evo Vrovona (Capital)

      Unfortunately you cannot play on the world as we did once before. All of our main resources are committed to delivering A'therys Horizons. However, in the mean time, why not take a trip down memory lane? Or even better, introduce our new and upcoming friends to the world you once knew. 


      As we look beyond the Horizon, to a world we all do not know and adventures that await, we can treasure the past and the legacy of A'therys Ascended.


      v1 Qhul-Rahav

      You can connect to the server via the Conquest Reforged client OR with vanilla Minecraft 1.12.2. You can get to this server by running the command /server old. To get permissions just ask any fellow staff member, as the server is running off my original A'therys Evo build server set up with PermissionsEX. You can easily visit all of the worlds via multiverse by using /mv list and /mvtp <world name>. Any issues please contact us via the #support channel on our discord: https://discord.gg/b7HdQVN


      v1 Dorrod Muth

      We will continue to work on hard on putting together and delivering A'therys Horizons, but in the mean time we hope you enjoy this opportunity to revisit A'therys Ascended.

       

      ENJOY AND HAVE A HAPPY, PROSPEROUS, AND SAVE NEW YEAR! 

      -A'therys Horizons Staff Team

       


      Atherys v1 Map


      Atherys v2 Map


      A'therys Evo Map

       

       
        • Like
      • 4 replies
    • December 24, 2018

      So with the website returning to it's dark theme, we've made a bunch of improvements to the lorelanding!

      Added a MAP to the lorelanding!


      This map (see below for all 5 playable nations lit up) will light up a nation when you hover over it; and allow you to click into it to go to the nation's overview page!
       



       




      Original Map Artistic Render by @cicetil


      Overlay graphics and new HoriRule [the nifty divider in the lore sections] by @Xathas


      Coding by @Rynelf (HTML, CSS, and JavaScript!)
        • Like
    • December 22, 2018

      Small Governmental Update put in today!

      Added Government of the Gennaian Isles



      Governmental Concepts originally by @Xathas



      Very long-winded Isles Chat with @Foe, @Tristan_vr, @raxiam, @Dani, and @redninja685 . Fortunately there were no casualties. 🤯



      Compiled by Xathas; Edits and Revisions by @Foe
        • Thanks
        • Like
    • Wiki Entry Wednesday - January 10, 2018
      It's that time of week again!

      Today we explore the city risen from seafoam, Glasscastle.

      Added the cty of Glasscastle to Atvoria



      Original draft by @Xathas



      Critiques and edits by @RuddyF , @Rynelf , and @Kmartinator
        • Thanks
      • 0 replies
    • Wiki Entry Wednesday: January 3, 2018
      Happy New Year, and Wiki-Entry Wednesday!

      This week marks a return to new nation info, specifically: Dalkun-Tir

      Added Technology of Dalkun-Tir to the Wiki



      Original draft by @Dani



      Second draft by @Xathas


      Critiques and edits by @Dani , @Foe , and @Kmartinator

       






      Added Marao's Fall to the Wiki


      Original draft by @Xathas


      Critiques and edits by @RuddyF , @Foe , and @Kmartinator
      • 0 replies

About Us

A’therys Horizons is an upcoming Minecraft Modded RPG Server, a world truly unique with many experiences for Roleplayers, Pvpers, Builders & Merchants alike.

Useful Links

Keep up to date!

×

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy