hestia-rsps / hestia

An open-source Kotlin game server.
BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

Rearchitecture #62

Closed GregHib closed 4 years ago

GregHib commented 4 years ago
Name Folder Description Examples
Engine engine Essential functions. Layer to the outside world; client or database. Networking, File handling, Game loop, Queues, Event, Plugin & Script management
Core mechanics core The core game mechanics Entities, Movement, Collision, Events, Client Updating, Widget actions, Dialogues
Game content content Gameplay content made of multiple core mechanics. Quests, Combat, Skills, Distractions & Diversions, Shops

Ideal architecture being:

Network handlers should be in engine but this will mean some communication will be needed for e.g player count to send to social-server for worlds, and classes such as SyncStage and UpdateBlock to stay inside the engine.

Originally posted by @GregHib in https://github.com/hestia-rsps/hestia/issues/32#issuecomment-561888769

List exactly what needs migrating from engine -> core and core -> plugins beforehand to get a sense of what effect these changes will have.

GregHib commented 4 years ago

Will content need a dependency on the engine?

GregHib commented 4 years ago

Naming conventions. Should packages have a strict no plurals rule?

GregHib commented 4 years ago

https://softwareengineering.stackexchange.com/a/75929/352855

Use the plural for packages with homogeneous contents and the singular for packages with heterogeneous contents.

com.myproject.task.TaskCollection com.myproject.task.Task com.myproject.task.TaskHandler com.myproject.task.TaskFactory

com.myproject.tasks.TakeOutGarbageTask com.myproject.tasks.DoTheDishesTask

GregHib commented 4 years ago

new structure including the majority of potential future features

content
    interaction
        item
        floor item
        spell
        object
        mob
        player/bot
        widget
    transport
        teleport
        shortcut
        fairy ring
    community
        assist
        clan
        friend
        trade
        eco
            shop
            exchange
    activity
        achievement
        quest
            free
                novice
                intermediate
                experienced
            member
                mini
                novice
                intermediate
                experienced
                master
                grandmaster
                special
        diversion
            time
                daily
                weekly
                monthly
                random
            item
            trail
            holiday
        skill
            gather
            combat
            support
            artisan
        combat
            boss

core
    client
        update
        network
            handlers
        camera
    entity
        player
        bot
        mob
        item
        object
    world
        region
        map
        land
        movement
        collision
    widget
        dialogue
    task
        deferrals
    script

engine
    artemis
        bag
        dsl
        event
    game
        archetypes
        plugin
        task
            defer
        instance
        right/privilege
        timer
        attribute
    network
        client
        world
    service/data/model
        cache
            definition
        save
        database

api
model
    components
    events
    archetypes
logic
    systems
    ?