Thread: Apollo - Usability Project

Page 1 of 15 12311 ... LastLast
Results 1 to 10 of 141
  1. #1 Apollo - Usability Project 
    fumant viriditas quotidiana

    saifix's Avatar
    Join Date
    Feb 2009
    Age
    30
    Posts
    1,237
    Thanks given
    275
    Thanks received
    957
    Rep Power
    3304


    This thread is more for tracking development of some open source work rather than your typical project. If you were hoping for something fancy, or some project you could eventually play then you'd might as well stop reading here.

    Still reading? Great.

    One of the major blockers with Apollo is the lack of certain features, take combat for example. It's a complex system to put in place and takes a decent amount of time to get right while keeping the code clean enough to push upstream.

    Graham, Major, and a few other people put a great deal of effort into Apollo. It's a shame to see it go to waste due to negligence on behalf of the community. It's not perfect, but it's the best we've got.

    So enter the Apollo Usability Project. What is it? Well, it's an attempt to make Apollo more approachable and usable for everyone. To get some features on the plate and make it easier for Average Joe to `git clone` the repository and start hacking away. It's a bit of a long shot on my part, but work done here can at least benefit someone in the future. There are many issues to address, but the first one, I think, is the big one. I've been working away at it for a while and it'll soon be ready to merge upstream.

    Step 1: Combat

    I did have a look at some of the servers scattered around here for use as a reference. Unfortunately most of them were a bit weird. Though there was enough data to sift though and create a simple model.


    (don't mind the weird association arrows, draw.io's a bit iffy.)

    So there are Weapons, WeaponClasses, CombatStyles, Attacks, and AttackRequirements. If we exclude unique projectiles and other fancy stuff, this allows us to start with melee and ranged. It also gives us a way to define special attacks. Though we still need a good way to start creating weapons and their components and Ruby presents a great way to go about it.

    Code:
    DAGGER_WIDGET_ID         = 89
    DAGGER_SPECIAL_CONFIG_ID = 12
    DAGGER_SPECIAL_BUTTON_ID = 10
    
    create_weapon_class :dagger, widget: DAGGER_WIDGET_ID do
      defaults speed: 4, animation: 7041, attack_type: :stab
    
      attack_bonuses crush: -4, magic: 1
      defence_bonuses magic: 1
    
      style :accurate, button: 2
      style :aggressive, button: 3
      style :alt_aggressive, attack_type: :slash, animation: 7048, button: 4
      style :defensive, animation: 7049, button: 5
    end
    
    # Need a separate WeaponClass for the dragon dagger because
    # of the differing animations
    create_weapon_class :dragon_dagger, widget: DAGGER_WIDGET_ID do
      defaults speed: 4, animation: 402, attack_type: :stab
      special_bar DAGGER_SPECIAL_CONFIG_ID, DAGGER_SPECIAL_BUTTON_ID
    
      attack_bonuses crush: -4, magic: 1
      defence_bonuses magic: 1
    
      style :accurate, button: 2
      style :aggressive, button: 3
      style :alt_aggressive, attack_type: :slash,  button: 4
      style :defensive, button: 5
    end
    
    create_weapon /(?:drag|dragon) dagger.*/, :dragon_dagger do
      set_special_attack energy_requirement: 25, animation: 1062, graphic: { id: 252, height: 100 } do
        damage! delay: 0
        damage! delay: 1
      end
    end
    I think that's pretty nice and easy to work with. There's various options which can be set for the `damage!` call, including a damage modifier or a lambda which calculates damage for an attacker and target. We can set bonuses for the weapon class, and also for the weapon. The actual combat style `Attack`s are created in the create_weapon_class call, and it uses the type of weapon to figure out whether it should create a ranged or melee attack. The Attack implementations themselves are a bit more verbose, and are meant as internals. New attacks can be created via the AttackDSL (like with special attacks).

    The simplest BaseAttack looks like this:

    Code:
    class BaseAttack
      attr_reader :requirements, :range, :speed
    
      def initialize(speed:, animation:, graphic: nil, range: 1, requirements: [])
        @speed        = speed
        @animation    = animation
        @graphic      = graphic
        @range        = range
        @requirements = requirements
      end
    
      def do(source, target)
        source.play_animation(Animation.new(@animation))
    
        unless @graphic.nil?
          if @graphic.is_a?(Hash)
            source.play_graphic(Graphic.new(@graphic[:id], @graphic[:delay] || 0, @graphic[:height] || 0))
          else
            source.play_graphic(Graphic.new(@graphic))
          end
        end
    
        apply(source, target)
      end
    
      def apply(_source, _target)
        fail 'BaseAttack#apply unimplemented'
      end
    end
    and a melee Attack can extend that like so:

    Code:
    class Attack < BaseAttack
      def apply(source, target)
        do_damage! source, target, CombatUtil.calculate_hit(source, target)
      end
    end


    Now that we've got melee attacks working we need a way of dealing with all those unique ranged weapon projectiles. I did manage to find data on this, but large parts of it are missing (see below on how you can help this project!).

    When we see a projectile firing, two things happen. First we see a graphic played on the player, and then we see another graphic sent as a projectile. The actual speed, height, falloff and curvature of the projectile varies for different types of ammo. The graphic is different for every item.

    We can still set up a nice way to manage this, though. And my first attempt looks a little bit like this:

    Code:
    def create_arrow(item, hash)
      hash[:projectile_type] = :arrow
      hash[:weapon_classes]  = [:longbow, :shortbow]
    
      create_ammo item, hash
    end
    
    create_projectile_type :arrow, start_height: 41, end_height: 37, delay: 41, speed: 10, slope: 15
    
    create_arrow :bronze_arrow, level_requirement: 1, projectile: 10, graphic: 19, drop_rate: 0.3
    create_arrow :iron_arrow, level_requirement: 1, projectile: 9, graphic: 18, drop_rate: 0.35
    create_arrow :steel_arrow, level_requirement: 5, projectile: 11, graphic: 20, drop_rate: 0.4
    create_arrow :mithril_arrow, level_requirement: 20, projectile: 12, graphic: 21, drop_rate: 0.45
    create_arrow :adamant_arrow, level_requirement: 30, projectile: 13, graphic: 22, drop_rate: 0.5
    create_arrow :rune_arrow, level_requirement: 40, projectile: 15, graphic: 24, drop_rate: 0.6
    Here all of the arrows share a projectile type, and only have different graphics. We also define the level requirements and drop rates for the arrows inline (we can do bonuses too, but I haven't got around to that yet).

    We can use the same weapon DSL again to create bows which use these arrows:

    Code:
    BOW_WIDGET_ID         = 77
    BOW_SPECIAL_CONFIG_ID = 10
    BOW_SPECIAL_BUTTON_ID = 8
    
    create_weapon_class :shortbow, widget: BOW_WIDGET_ID do
      defaults animation: 426
      special_bar BOW_SPECIAL_CONFIG_ID, BOW_SPECIAL_BUTTON_ID
    
      style :accurate, speed: 4, range: 7, button: 2
      style :rapid, speed: 3, range: 7, button: 3
      style :long_range, speed: 4, range: 9, button: 4
    end
    
    create_weapon :shortbow
    
    create_projectile_type :msb, start_height: 41, end_height: 37, delay: 31, speed: 5, slope: 15
    
    create_weapon :magic_shortbow do
      set_special_attack range: 7, energy_requirement: 60, animation: 1074, graphic: { id: 256, height: 100 } do
        range_damage! projectile: 249, projectile_type: PROJECTILE_TYPES[:msb]
        range_damage! projectile: 249, projectile_type: PROJECTILE_TYPES[:msb], projectile_graphic: 256, delay: 1
      end
    end
    Again, it's pretty easy to follow and has good results:



    There's still a couple of things to do, like making arrows drop and other misc. stuff, but I think it's pretty decent so far. Next up is magic after everything for range is in place and a bit of post-new-feature cleanup is done. There's a feature checklist below for what's still to do and I'll update this thread whenever I need to with more media and info.

    Features:

    • [ ] - Attack effects (e.g., enchanted crossbow bolts, poisoned ammo / weapons)
    • [✓] - Projectile collision detection
    • [ ] - Auto-casting
    • [ ] - Magic attacks
    • [ ] - Equipment interface
    • [ ] - Prayer combat effects
    • [ ] - Support for hooking into combat (for e.g., differentiating between wilderness and safe minigames)


    Contributing

    There is still lots of information I need to gather to get this as close to RuneScape as possible. I don't have a decent account myself and I don't have the time to sift through all the servers in the Downloads section in search of the data I need. If you want to help at the moment, there's a list of stuff you can do below. More will come up as I uncover new edge cases and weird features so will update as needed.

    • Find bolt projectile data
    • Find darts / knives projectile data
    • Provide dumps of equipment and weapon bonuses
    • Point out inconsistencies in any of the info I've provided (either in video demos or in code snippets)


    Credits where credits are due

    • sfix
    • Major
    • Shiver
    • The creators of all the spaghetti servers I downloaded who went through the painstaking process of getting info.


    Other people who helped with bringing it together: Scu11, S Quare Quxx, Wizard Jesse

    When I'm happy with the framework I've written and it's upstream there's a lot more you'd be able to do to contribute. Around then, I'll throw up a simple development sandbox behind a tunnel (no attacking my dedicated server!) so it can be tested out.

    Step 2: Hey, Step #1 isn't done yet.
    "Im so bluezd out of my box.
    Im so fkd i canr even sens makeas Smoke blunt 420hash e tizday" - A legendary guy (1993 - 2015)
    Quote Originally Posted by nmopal View Post
    I will be creating a grimy dubstep song using these lyrics and vocaloid please prepare your bodies
    Reply With Quote  
     


  2. #2  
    Banned

    Join Date
    Mar 2011
    Posts
    982
    Thanks given
    384
    Thanks received
    61
    Rep Power
    0
    Good luck on further progress man! looks good so far.
    Reply With Quote  
     

  3. #3  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    29
    Posts
    9,688
    Thanks given
    1,752
    Thanks received
    3,103
    Rep Power
    5000
    gl might follow this.
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  4. #4  
    Best Rat Donor

    Australisch's Avatar
    Join Date
    Nov 2015
    Posts
    2,049
    Thanks given
    968
    Thanks received
    481
    Rep Power
    4962
    saifix will definitely do a good job on this.
    Rsn: vEetswa
    Reply With Quote  
     

  5. #5  
    H_E_N_T_A_I_H_E_A_V_E_N_
    Tatsumi's Avatar
    Join Date
    May 2013
    Posts
    1,779
    Thanks given
    537
    Thanks received
    269
    Rep Power
    337
    Following.
    Reply With Quote  
     

  6. #6  
    Extreme Donator Apollo - Usability Project Market Banned



    Join Date
    Dec 2010
    Age
    25
    Posts
    6,060
    Thanks given
    1,692
    Thanks received
    1,238
    Rep Power
    1765
    Will be following & contributing.
    Reply With Quote  
     

  7. #7  
    Head Veteran and Respected Member


    Thakiller's Avatar
    Join Date
    Dec 2006
    Age
    26
    Posts
    2,953
    Thanks given
    1,957
    Thanks received
    3,074
    Rep Power
    5000
    Good luck pal. It's nice to see Apollo's content become more vast - perhaps it'll encourage more people to use it as you suggest.
    Reply With Quote  
     

  8. #8  
    Member Apollo - Usability Project Market Banned

    James™'s Avatar
    Join Date
    Nov 2007
    Age
    29
    Posts
    2,467
    Thanks given
    280
    Thanks received
    298
    Rep Power
    497
    Nice work once its done i will use for osrs instead of hyperion

    You should just start this with a OSRS Revision

    goodjob safix
    Reply With Quote  
     

  9. #9  
    fumant viriditas quotidiana

    saifix's Avatar
    Join Date
    Feb 2009
    Age
    30
    Posts
    1,237
    Thanks given
    275
    Thanks received
    957
    Rep Power
    3304
    Quote Originally Posted by James™ View Post
    Nice work once its done i will use for osrs instead of hyperion

    You should just start this with a OSRS Revision

    goodjob safix

    I'm not sure what you mean. This is a plugin for Apollo.
    "Im so bluezd out of my box.
    Im so fkd i canr even sens makeas Smoke blunt 420hash e tizday" - A legendary guy (1993 - 2015)
    Quote Originally Posted by nmopal View Post
    I will be creating a grimy dubstep song using these lyrics and vocaloid please prepare your bodies
    Reply With Quote  
     

  10. #10  
    Banned

    Join Date
    Mar 2011
    Posts
    982
    Thanks given
    384
    Thanks received
    61
    Rep Power
    0
    Quote Originally Posted by James™ View Post
    Nice work once its done i will use for osrs instead of hyperion

    You should just start this with a OSRS Revision

    goodjob safix
    Apollo has multi revision support, all you have to do is rename the packets and convert the cache system :3
    Reply With Quote  
     

Page 1 of 15 12311 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Apollo 484 Project [Open SRC]
    By Cjay0091 in forum Projects
    Replies: 43
    Last Post: 09-11-2012, 04:16 AM
  2. Apollo Project - It's better together.
    By H3ll Ruler in forum Projects
    Replies: 105
    Last Post: 05-14-2012, 09:01 AM
  3. Replies: 7
    Last Post: 01-07-2012, 10:52 AM
  4. [530]: Apollo Framework - Project Development Thread
    By blakeman8192 in forum Projects
    Replies: 122
    Last Post: 02-27-2009, 01:41 AM
  5. Replies: 5
    Last Post: 10-02-2007, 09:06 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •