BaseItem - outside of Server/Core files

Discussion in 'Suggestions and Requests' started by zerodowned, Apr 7, 2015.

  1. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    Was reading through the Mod Suggestion board on RunUO and found this thread: http://www.runuo.com/community/threads/baseitem-basemobile.464064/

    Basically Vorspire suggested creating a BaseItem script so to be able to implement changes to a large range of items without having to make the same edit in multiple files.

    Makes sense to me and I can't tell you how many times I've wished for that.
     
    • Like Like x 1
  2. Ravenwolfe

    Ravenwolfe Administrator Staff Member JustUO Developer

    Well, that was considering that RunUO was not really releasing and supporting the core, whereas ServUO and JustUO give you access to the core and a simple compiler to make the changes. So its much easier to edit Item.cs and then recompile. However, we certainly could do a BaseItem and BaseMobile in the scripts folder and have them inherit from Item and Mobile.

    I guess I just wanna know why this should be done when we now have access to Item and Mobile? Seems to me its just one more link in the chain to break.

    I'm gonna see if Vorspire can weigh in on this one as well, he is working towards a common core and I want to see how this would impact that.
     
    Last edited: Apr 8, 2015
    • Like Like x 1
    • Agree Agree x 1
  3. Talow

    Talow Grandmaster Member

    Well with the BaseI/M being out of the core scripts you can have the core handle the networking stuff and skip everything else, then move the rest to the base, then the core is just about packets, not every step the mob takes ext.

    Edit: another words separation of church and state, or code in this case.
     
    • Like Like x 1
  4. Ravenwolfe

    Ravenwolfe Administrator Staff Member JustUO Developer

    Ok, so in your scenario, you would just move Item.cs and Mobile.cs out of the core and into the scripts folder instead of creating a new BaseItem.cs and BaseMobile.cs inheriting from Item and Mobile in the core?
     
    • Like Like x 1
  5. Talow

    Talow Grandmaster Member

    No, I'd leave Item and Mobile on the core, but only keep the network functionality there (in the core) for communicating to clients. Then in the scripts put a baseI/M with the actual functionality that was in core.
     
    • Like Like x 1
    • Agree Agree x 1
  6. zerodowned

    zerodowned Administrator Moderator JustUO Developer Gold Star Member Et Cetera, Et Cetera

    Sure, we can make changes to the Core and recompile, but everytime you make changes, you have to recompile.

    I like Talow's suggestion, keep everything in the Core that needs to be there. Things that should not and/or could not be changed without really breaking the server.
     
  7. Dian

    Dian Administrator

    There is not much in the core left that can or should be safely lifted out to the script side.
     
    • Agree Agree x 1
  8. Crome696

    Crome696 Illustrious Member

    DonĀ“t forget if you move something from core to scripts, that you need to find a suitable way to keep saves alive. Changing Queue in the Stream would kill all Game files from productive shards and could be a dead end for the fork.

    It maybe more suitable to find a more dynamic method to save data before you actual do that.
     
  9. Talow

    Talow Grandmaster Member

    Those are both very true statements. I've wanted to do a rework for the saves to an entity style frame work over a DB structure. Sadly I don't have the skills yet to produce this. I am learning though on another project so we'll see what I can do in the future.
     
  10. Crome696

    Crome696 Illustrious Member

    I always wished it could be done like the xmlserializer :)
     
  11. Talow

    Talow Grandmaster Member

    I kind of would want to use the Drupal Data Structure, it's really robust and easy to manipulate.
     
  12. Crome696

    Crome696 Illustrious Member

    The xml object serializer is pretty easy to use. Adding new attributes will just add the power to read and write. With about 6 lines code u can serialize any object, the problem is that i only have experience using it as filewriter not for substreams.
     
  13. Talow

    Talow Grandmaster Member

    Well the static serialize that happens on timer is what I'd want to move away from. I mean we have DB tech out there now that runs really well and fast. Using it we can save whatever on the fly by telling a DB class to tell the DB to do the work, and what it do naturally.
     
  14. Crome696

    Crome696 Illustrious Member

    That as default could be troublesome. Not all Users know how to handle databases, handle errors or optimize it. That Runuo almost doing most out of Core was always the strong point of it. UO for anyone....
     
  15. Talow

    Talow Grandmaster Member

    That's where I say that the Drupal Data Structure is very robust, Yes I know many of our community are here as a hobby but if they don't have to interact with the database, and instead can interact with an entity, which is similar to a class style anyways, because there is another class to handle the DB interaction for you.

    Edit: This would also allow for creation of object entities in game too.

    Edit 2: this is also way off topic I think it's time to create one for this topic if we want to continue.
     
  16. sith

    sith Super Contributor JustUO Developer

    I think the way to go from here is for some enterprising person to design that system, lay out the requirements, build it, test it, do a detailed write-up about it with instructions for intermediate users!
     
    • Winner Winner x 1

Share This Page