Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • SOUPSOUP: just get a vpn
      August 13, 2018, 06:44:28 PM
    • jme: _^_ will answer all of your javascript questions
      August 12, 2018, 07:11:00 PM
    • doomsale: and where is boxman?
      August 10, 2018, 03:16:59 AM
    • doomsale: Where can i play the Moparscape MMORPG with the Metallica instrumentals?
      August 10, 2018, 03:16:47 AM
    • doomsale: no longer clicking on doors and dummies at east bank
      August 10, 2018, 03:16:07 AM
    • doomsale: were all grown up now huh?
      August 10, 2018, 03:15:58 AM
    • _^_: hey everyone look at my graphs [link]
      August 06, 2018, 01:52:16 PM
    • braedyn: Someone pl0x help me out with PI Lottery!!
      August 03, 2018, 02:12:25 AM
    • Travas: p3n1s
      July 26, 2018, 09:46:33 PM
    • Krackkid: You up :eggplant:
      July 23, 2018, 06:18:17 PM
    • DeathsChaos9: no
      July 23, 2018, 03:53:31 PM
    • Emulous: Come check out Emulous: [link]
      July 22, 2018, 03:37:19 PM
    • Emulous:[link]
      July 22, 2018, 03:37:00 PM
    • Travas: ur mom
      July 21, 2018, 06:04:50 PM
    • YNRDAB: Watcha big ballers up too?
      July 20, 2018, 11:01:06 AM
    • dark250: i need help for coding client
      July 19, 2018, 08:27:37 AM
    • Travas: yes
      July 14, 2018, 02:19:44 PM
    • drubrkletern: lmao racist and sexist much?
      July 14, 2018, 01:11:52 PM
    • Cole1497: yeah i got you lil boat give me a second
      July 13, 2018, 03:19:35 AM
    • B0ATY.: yo can anyone unban my ip, i got banned for saying i hope someone gets aids :p
      July 12, 2018, 09:16:00 PM

    Author Topic: Asteria 3.0  (Read 7543 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinelare69

    • Member
    • ****
    • *
    • Posts: 5,322
    • Thanks: +0/-0
      • View Profile
    Asteria 3.0
    « on: July 07, 2015, 01:53:57 PM »
    Github Repository
    Direct Download
    Tutorial For Setting Up Asteria






    Prelude

    Asteria is an open source Runescape emulator for the #317 protocol. It has been in ongoing development since late 2013, and today I'm finally done and finished with it. I've improved as a developer throughout the multiple releases (being as I started when I was 15, I'm 17 now), and for that reason there's some code currently present that I cringe at. I don't have the determination to go back and rewrite it all, at this point I'd honestly rather just start something entirely new.

    If you're using 2.0 (or God forbid 1.0) I highly recommend taking the time out to port your content over to this release. Although it's not mandatory, so many things were fixed and changed that it'd really be in your best interest to make the change. I'll go over some of the major things that were changed later in the topic. You can (and I encourage you to) still post your issues on the Github issues page, although I can't guarantee they'll be fixed as fast as they were before. Sorry. 



    Whats different?

    Tons of things were worked on and improved such as the location model, item containers, tasks, skills, minigames, utilities, as well as tons of bugs fixes and other performance/design optimizations.


    Networking

    I was wrong about the cycle based reactor design, it's not scalable enough. You have to handle logins every game sequence which results in missed login requests under high stress, not to mention the overhead of doing all logins on the game thread. With that said I have decided to switch from raw NIO to Netty 4 for the networking. I chose Netty because it's high performing, has a very nice abstraction model, and because there's lots of support for it (if you need help).


    Plugins

    It's nothing elaborate, just a simple easy-to-use plugin system that utilizes listeners. Plugins are compiled into Java bytecode and are all currently written in Groovy. If that isn't your thing you can write them in Scala, Jython, JRuby, Xtend, plain Java, or any other programming language that can be compiled into Java bytecode.


    NPC Dialogues

    The whole Dialogue -> DialogueAction concept was defective and therefore has been replaced with the DialogueChainBuilder -> DialogueChain model, which performs better, is easier to use, and includes full support for more complex things like dialogue options.


    Player Serialization

    Albeit I'll be the first to admit it's a bit messier, the new serialization system allows for serialization/deserialization tokens to be written on one line. Serialization is done asynchronously (of course) and will make use of Guava's caching model so during deserialization the file is only loaded when it's absolutely needed to.



    Media

    Not much media, most of the media is on the Asteria 2.0 thread which you can view here.

    (click to show/hide)



    Special Thanks

    Ryley
    blakeman8192
    « Last Edit: July 07, 2015, 06:18:01 PM by lare69 »
    hi. check out luna:)
    Runescape Gambling

    OfflinePure_

    • Member
    • ****
    • *
    • Posts: 4,687
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #1 on: July 07, 2015, 02:19:29 PM »
    You shouldn't really be serialising the player.
    Why not? So he can manually add logic for loading and saving an attribute everytime he adds/removes one?

    @op I appreciate you taking your time to do this and I'll be featuring this in this week's news post.
    i won the forum
    Runescape Gambling

    OfflinePure_

    • Member
    • ****
    • *
    • Posts: 4,687
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #2 on: July 07, 2015, 03:49:54 PM »
    You shouldn't really be serialising the player.
    Why not? So he can manually add logic for loading and saving an attribute everytime he adds/removes one?

    @op I appreciate you taking your time to do this and I'll be featuring this in this week's news post.
    I'm pretty sure that's not what serialisation is meant for lol
    https://stackoverflow.com/questions/2232759/what-is-the-purpose-of-serialization-in-java
    i won the forum
    Runescape Gambling

    Offlinelare69

    • Member
    • ****
    • *
    • Posts: 5,322
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #3 on: July 07, 2015, 04:17:00 PM »
    You shouldn't really be serialising the player.
    what... im not serializing the entire player Object only certain values from the player class, hence why I referred to "tokens"

    -> certain tokens are taken from the player Object
    -> they are added to a LinkedHashSet (order preservation and duplicate prevention)
    -> the set is iterated through and the tokens are added to a JsonObject
    -> the JsonObject is serialized and cached

    maybe you should just go look at how it works
    « Last Edit: July 07, 2015, 05:36:22 PM by lare69 »
    hi. check out luna:)

    OfflinePure_

    • Member
    • ****
    • *
    • Posts: 4,687
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #4 on: July 07, 2015, 05:46:31 PM »
    Why can't you just get values directly from the object using getters and instead of serialising a json object, save the data in a json format? You've lost me :s

    Pure_ serialisation wasn't meant for saving like this
    Do you want to explain to me why not? I'm interested.
    i won the forum

    Offlinelare69

    • Member
    • ****
    • *
    • Posts: 5,322
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #5 on: July 07, 2015, 06:09:17 PM »
    Why can't you just get values directly from the object using getters and instead of serialising a json object, save the data in a json format? You've lost me :s
    getters are used to add values to the tokens, which are then added to the JsonObject, which is then serialized... what don't you understand? the JsonObject is needed so I am able to add multiple tokens of different types to serialize

    i could create a custom serializer so that i could serialize the player Object directly without serializing everything in the class but that wouldn't allow me to put the tokens on a single line in one place, which was the goal of designing it that way
    hi. check out luna:)

    Offlinet4

    • Member
    • ****
    • *
    • *
    • *
    • Posts: 6,798
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #6 on: July 07, 2015, 06:09:34 PM »
    Why can't you just get values directly from the object using getters and instead of serialising a json object, save the data in a json format? You've lost me :s

    Pure_ serialisation wasn't meant for saving like this
    What's serialization, a name given for persisting data structures/values, used for then? :)

    While a relational database would be best suited for this in terms of optimizing space, large scale modification, and inherent caching of save data it doesn't buy you anything in terms of basic functionality in comparison to say json. Keep in mind json is also human readable, sql db impl. not so much.

    Oh and here's a kicker: you could have a serialization wrapper over a player data object and use getters/setters to build insert and update queries for a database (no, I don't mean putting blob/text data like json into a column)! :O

    OfflineDan0194

    • Member
    • ****
    • Posts: 1,140
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #7 on: July 07, 2015, 09:36:12 PM »
    Looks really good buddy.
    lol who told you winterLove had bad codes
    Smart man.
    if you read this your a fagit

    Offlinet4

    • Member
    • ****
    • *
    • *
    • *
    • Posts: 6,798
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #8 on: July 07, 2015, 10:13:22 PM »
    But to serialise just to store values and not state?
    What is state without any values?

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #9 on: July 07, 2015, 10:40:02 PM »
    Some designs in here are a bit strange. Also how the fudge do you have 30 stars, that's mind blowing. I think thats more than apollo.

    Offlinelare69

    • Member
    • ****
    • *
    • Posts: 5,322
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #10 on: July 08, 2015, 12:07:31 AM »
    Some designs in here are a bit strange. Also how the fudge do you have 30 stars, that's mind blowing. I think thats more than apollo.
    Apollo has something like 40 stars, this only has 22. It's mostly people from R-S.

    Also, which designs in particular? Would be nice to know what I can do better for future projects.
    « Last Edit: July 08, 2015, 12:09:30 AM by lare69 »
    hi. check out luna:)

    OfflinePure_

    • Member
    • ****
    • *
    • Posts: 4,687
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #11 on: July 08, 2015, 09:04:12 AM »
    Some designs in here are a bit strange. Also how the fudge do you have 30 stars, that's mind blowing. I think thats more than apollo.
    It tailors toward RuneSource's audience. I doubt half of the people who looked at Apollo understood what was going on, let alone how to change the server's name, lol.
    i won the forum

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #12 on: July 08, 2015, 05:36:01 PM »
    - You use a few patterns (bootstraping, builders) without using them correctly and it makes thing a tad bit harder to comprehend what the objective is for certain modules.
    - You employ the idea of a service, although I'm not entirely sure what you intended to use it for since you employ it more like a periodic task which makes sense specifically for the game service but beyond that it's hard to understand what controls the service and what it's internal state is.
    - There are a few engineering shortcuts I'd call out.

    Code: [Select]
      @Override
        public void create() {
            World.getPlayers().forEach(p -> {
                if (super.getPosition().withinDistance(p.getPosition(), 60)) {
                    p.getMessages().sendObject(this);
                }
            });
        }

    Pretty inefficient.

    Code: [Select]
    return OBJECTS.stream().filter(obj -> obj.getPosition().equals(position)).findFirst();

    .___.

    O(N), not a good idea especially with 100~ objects, and 100~ players pressing objects.

    Also why is that a singleton? Why is the world a singleton? THAT, is more acceptable however I am not anywhere close to being a fan of that design practice.

    I don't understand the purpose of animations priority I mean it's a mechanic that could be accepted however with the way you process an entity action the animation sent after the action is processed should automatically be assumed to be the priority animation.


    Offlinelare69

    • Member
    • ****
    • *
    • Posts: 5,322
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #13 on: July 08, 2015, 08:36:27 PM »
    It tailors toward RuneSource's audience.
    definitely but I don't see why, the only thing that resembles the original Runesource at all is the updating logic

    Code: [Select]
      @Override
        public void create() {
            World.getPlayers().forEach(p -> {
                if (super.getPosition().withinDistance(p.getPosition(), 60)) {
                    p.getMessages().sendObject(this);
                }
            });
        }

    Pretty inefficient.
    do you have a better way? :s

    Code: [Select]
    return OBJECTS.stream().filter(obj -> obj.getPosition().equals(position)).findFirst();

    .___.

    O(N), not a good idea especially with 100~ objects, and 100~ players pressing objects.
    What would be a better solution? Was originally going to use a Position -> ObjectNode Map or change the hashcode/equals implementation to work with the position for O(1) time (since all game objects have a unique position)

    Also why is that a singleton? Why is the world a singleton? THAT, is more acceptable however I am not anywhere close to being a fan of that design practice.
    i don't recall using the singleton design pattern anywhere but i probably should've just kept global state to the "World" class, idk if you noticed but i was trying to avoid global state more in this release than in the previous one

    I don't understand the purpose of animations priority I mean it's a mechanic that could be accepted however with the way you process an entity action the animation sent after the action is processed should automatically be assumed to be the priority animation.
    actually comes in handy, i.e if you want to prioritize the combat attack animation over the block one or prioritize skilling animations like agility over everything else, etc. etc.
    hi. check out luna:)

    OfflineStrucker

    • Member
    • ****
    • Posts: 2,970
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #14 on: July 08, 2015, 09:42:36 PM »
    I didnt understand most of the thread but whatever i took the time to read it l0l
    OT: great job lare, i wish i had improved in the past two years as much as you
    Times flies and im wasting it

    Offlinelare69

    • Member
    • ****
    • *
    • Posts: 5,322
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #15 on: July 08, 2015, 11:49:43 PM »
    I didnt understand most of the thread but whatever i took the time to read it l0l
    OT: great job lare, i wish i had improved in the past two years as much as you
    well i told you to stop using deltascape but you didn't wanna listen lol
    hi. check out luna:)

    OfflineStrucker

    • Member
    • ****
    • Posts: 2,970
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #16 on: July 09, 2015, 12:32:33 PM »
    I didnt understand most of the thread but whatever i took the time to read it l0l
    OT: great job lare, i wish i had improved in the past two years as much as you
    well i told you to stop using deltascape but you didn't wanna listen lol
    LOL i did quit it, just didn't start anything new
    Times flies and im wasting it

    Offlinedevenb123

    • Member
    • ****
    • Posts: 1,411
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #17 on: July 09, 2015, 11:10:00 PM »
    I'm almost never on these forums anymore nor do I ever comment on threads much, however, great work here. Very impressive oldschool look and feel that I miss about RS/(PS).
    Skype: Deven_barbero
    I love KroniKz_ <3

    Offlinelare69

    • Member
    • ****
    • *
    • Posts: 5,322
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #18 on: July 10, 2015, 08:32:14 PM »
    I didnt understand most of the thread but whatever i took the time to read it l0l
    OT: great job lare, i wish i had improved in the past two years as much as you
    well i told you to stop using deltascape but you didn't wanna listen lol
    LOL i did quit it, just didn't start anything new
    the problem of why you didn't improve isn't a mystery then :o
    hi. check out luna:)

    OfflineStrucker

    • Member
    • ****
    • Posts: 2,970
    • Thanks: +0/-0
      • View Profile
    Re: Asteria 3.0
    « Reply #19 on: July 13, 2015, 02:48:22 PM »
    Recommend me any client please?
    nvm
    « Last Edit: July 13, 2015, 02:51:31 PM by Strucker »
    Times flies and im wasting it

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal