Giter Club home page Giter Club logo

uw2ol's Introduction

Introduction to Project uw2ol(Uncharted Waters 2 Online)

    Goal
       An MMO that's essentially Uncharted Waters 2

    Methods

       Code
           Language
                Python only(for both client and server)
           Frameworks
                twisted(event driven network engine)
                pygame(game engine)
                pygame_gui(GUI engine)

       Assets
            All taken directly from the original game
            Could be replaced later if necessary

    Current Files

        documents
            ReadME
                overview of this project
            requests
                to dos, including new requests and bug fix requests
            how_to_dos
                how to dos
                what to dos(Requests here!)
            main_story
                the story line
            python_lib_requirements

        assets
            all resources

        dist
            for distribution, an exe plus a folder for assets

        code
            client
                client_packet_received
                    handles packets from server
                draw
                game
                    game loop
                gui
                handle_gui_event
                    such as menu click, input box,
                handle_pygame_event
                    handles key presses, mouse clicks
                map_maker
                    makes port map and world map
                sprites
                    all spirets(anything you can see on screen) should be here.
                    some are not due to historical reasons.
                translator
                    translates english to other languages

            server
                data(folder)
                    holds players' game role data(couldn't store in MySQL, maybe later)
                    players' accounts are in MySQL
                data_backup(folder)
                    backup for stuff in data folder
                DBmanager
                    interacts with MySQL(register, login, make character)
                server_1
                    starts the server
                server_packet_received
                    handles packets from clients
                npc_manager
                    manages all npcs(fleet on the sea), port_npcs are managed locally
                player_manager
                    holds all online players

            common
                hashes(folder)
                    all data files, mostly dictionaries
                constants
                    configurations
                protocol
                    packets transmitted between C and S
                role
                    class(the player's role in game. has name, can move...)
                    All methods of the role class can be directly called by the client.
                    When a role(client) calls a method, the client runs the method locally,
                    and then sends the method to the server. When the server receives the method(protocol),
                    it runs the method on the server side copy of the role, and broadcasts the method to all
                    other roles that are currently in the role's map(either, port, sea, or battle) and nearby.
                test
                    for testing anything

    Run it
        You can run the server and multiple clients locally.

        1 get MySQL
            create a database named py_test
            set password to dab9901025
            create a table named accounts
                column name     data type    length  DEFAULT     PK?   NOT NULL?   AUTO INCR?
                id              int          11                  T     T           T
                name            char         12
                pw              char         12
                online          tinyint      1       0
                role            char         12

        2 get python and the missing libraries(consider using a mirror if it's slow)
            (if it misses a module named PIL, install Pillow instead)

        3 run server_1.py
        4 run client.pyw

        now you are in.

        shortcut to login:
            if you have an account like this:
                account 1
                password 1
            you can login by just pressing 1

            any number from 1-9 will work

    Join us
        contact any of the contributors to join us. test1.

uw2ol's People

Contributors

timewarpsgh avatar lychees avatar

Stargazers

haker avatar  avatar Wei Wu avatar James avatar fofo avatar  avatar  avatar LemonNeko avatar Remi_IO avatar

Watchers

 avatar

uw2ol's Issues

错误按键导致程序崩溃

  • 海上按 M 导致程序崩溃。
  • 按 ctrl 键、光标键等,event.key 值域超过 ascii 范围导致程序崩溃。
  • 在登录页面使用聊天框导致连接丢失。
  • 聊天框不支持中文。
  • 某些情况下 GUI 未彻底关闭,需要按 esc 才可以在码头移动。

地图贴图错误

image

疑似麦加门口的一处贴图错误,不确定原作是否也有类似问题。

NPC 对话与持久化

大航海时代 OL 的很多任务交接都是直接发生在港口里,和 NPC 对话完成的,目前 uw2ol 触发事件的方式局限在进入建筑的内部。
和 NPC 实现对话并不困难,麻烦的是目前港口的 NPC、天气、时间等信息是客户端生成的,会产生交互不一致的问题。
最好可以将港口的信息、时间和 NPC 等也存储在服务器端,实现这一 feature 可以更好的扩展 rpg 玩法,也可以为日后实现进一步的岸上探险玩法做准备。

补给港口相关。

目前 Port 总数 130 个,其中前 100 个是标准港口,后 30 个是补给港口。
虽然 Constant 里有 PORT_COUNT 这一数值,但是实际上代码中依然有 hard code 成 130 的地方。
这种设计使得增加新港口不太方便(例如淡水、那霸、etcs)。

  • 目前无法在补给港口触发剧情
  • 所有补给港口的地图一样

冒险功能的实装

image

根据大二的设定,冒险发现物的功能有:

  • 汇报给学者以增加冒险声望。
  • 作为和酒吧女郎的谈资。

目前均未实装。

image

请问您有解析游戏资源的代码吗

您好,
我本人也对大航海时代2解析很感兴趣。贴吧上有这样一个帖子:贴吧描述了游戏资源文件的结构但是作者并没有公布解压缩的代码。请问您能否把解压缩的代码分享给我呢?感谢!

术语统一

游戏中目前的有效装在数据中为 useful_capacity。
但在 gui 中有个别称叫做 'affective_capacity': f'{ship.useful_capacity}'。

features request.

  • 单挑实装
  • 风向与洋流实装(大2的参考实现) 感觉不必拘泥于大2踩格子的移动,直接矢量移动效果绝对会更好
  • 季风与洋流 大4的参考实现
  • 支持与港口的 npc 对话
  • 交易时默认交易量为 max,卖出时显示 delta。
  • 更多的角色行走图 参考
  • 可修改角色国籍、出生地
  • 跟随系统
  • 队伍系统
  • 商会系统
  • 国家系统

交易页面的交互

image

image

对比图如上。
To do list:

层叠页面的交互缺陷

  • 关闭左边对话框时,右边 买入/卖出 窗口依然 active。
  • 还是上述的原因,卖出的时候几乎第一次一定会操作错误导致 panel 失效。
  • InputBox 不支持显示默认参数。

购买页面

  • 选择船只时,显示船只的剩余容量
  • 选择船只后,默认自动填入剩余容量与剩余金币可购买商品数量两者的较大值
  • 不可购买数量为 0 的商品。

卖出页面

  • 显示该船货品购买时的平均价格
  • 用绿色和红色区分盈利与亏损
  • 默认自动卖出最大数量的商品
  • 不可卖出数量为 0 的商品。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.