PyOT2 (private project, will open-source/share for contributions)

Discussion in 'Discussion' started by e.e, Sep 28, 2018.

  1. e.e

    e.e Rule 10. Don't ask questions.

    Joined:
    Sep 16, 2016
    Messages:
    398
    Likes Received:
    173
    Best Answers:
    0
    Background:
    So I've been working on a new private OT project mostly for fun recently that I've simply named PyOT2 after the old abandoned project PyOT.
    Prior to this I tried to get in touch with the couple of guys involved with the original but completely abandoned PyOT project that are still actively chatting in their PyOT discord channel if nothing else, however after being rudely treated by Amir out of nowhere I left and started my own little project from scratch instead which doesn't throw a syntax error on execution due to broken dependencies and garbage spaghetti code as is the case with the original PyOT :p
    Also PyOT2 supports my favorite client version 7.7! :)

    Basic description:
    Now in brief this is a barebones experimental server in very early development that is mainly useful for conceptual OTS development and small highly creative OTS projects, it's written in Python with as few lines of code and dependencies as possible (currently 0 third party deps), and is currently and may continue to be restricted to client version 7.7.
    It's a private project and I have no plans to release any of this code to the public for now considering that this is 100% my own work and codebase, but I'm open to the idea of sharing the code in exchange for equal contributions (scroll down to the bottom for more info).

    Current basic features:
    * Logging in (very easy to change everything about the character).
    * Logging out.
    * Moving around in 8 directions.
    * Turning.
    * In-game commands (currently only !pos).
    * Talking in default.
    * Looking at items and tiles which outputs formatted network data in-game.
    * Throwing items outputs formatted network data in-game (doesn't actually throw item yet).

    Screenshot:
    [​IMG]

    Current technical features:
    * Less than 500 lines of code and most of it is basic formatting and logging character in (just the opcodes without any functionality or packet content parsing is about 100 lines).
    * Recognizes and names all standard 7.7 opcodes.
    * Single threaded application with separated game and network logic.
    * Lightning-speed network code (100k+ connections per second according to 3rd party benchmarks).
    * C speed RSA encryption/decryption (0.7ms on my 8 yrs old laptop) implemented by myself (no 3rd party dependencies).
    * XTEA encryption/decryption 10x slower than C (PyOT2 speed: 10µs for small packets on my 8 yrs old low/medium price laptop) without any 3rd party dependencies. Will likely be able to achieve C or near-C speeds later on, XTEA just seems more complicated of an algorithm than RSA so I've let go trying to optimize it further for the time being.
    * Current CPU consumption on my 8 yrs old laptop while running around full speed non-stop in-game: 0.3-0.7% of a single core, and the server currently runs on a single core. This isn't terribly impressive considering how basic the current engine is, but at least it means that this server isn't going to melt your CPU or anything doing basic shit in-game, and hey, technically it is still lower consumption than both cipengine and OTHire for now, both being at around 1% ¯\_(ツ)_/¯ (for reference: these are the only two other distros I have run at all this decade, so it's all I can compare it to)
    * Items (objects.srv) parsing.

    Plans:
    * Keep the core as simple and basic as possible.
    * Re-organize the code in an effort to make the code as modular as possible.
    * Adding more basic functionality.

    Bottom-line:
    Ok, but what do you want from me?
    In general I'd be interested to get to know some other creative developers in this community and have a chat.
    I'm also interested in the idea of collaborating with someone both for the fun of it and to reduce the amount of work.
    And I have no qualms about returning or exchanging favors.
    For example I'm more than willing to exchange my code or any other number of things for contributions with a 1:1 ratio, and have a clean history of always helping out people who have helped me first (and many other people too but too often regretting it, so I'm more careful now).

    Contact:
    My PMs are open and my discord's in my signature.

    Anyway, I might be posting more updates for fun here in the future, so stay tuned for that :p
     
    Last edited: Oct 1, 2018
    szymek879, president vankk and Bogart like this.
  2. ochmar

    ochmar Member

    Joined:
    Feb 27, 2016
    Messages:
    85
    Likes Received:
    31
    Best Answers:
    1
    Is there any github/bitbucket fork of this; or is it private?
     
  3. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,708
    Likes Received:
    525
    Best Answers:
    70
     
    Okke likes this.
  4. Acubens

    Acubens Old Penguin

    Joined:
    May 6, 2008
    Messages:
    970
    Likes Received:
    71
    Best Answers:
    1
    Look very fine, but closed-source really?
     
    ochmar likes this.
  5. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,978
    Likes Received:
    672
    Best Answers:
    17
    I believe in closed source projects cus people who work on it care about his project and its not waiting for someone else to do his job. I like it and I wish I know more python to help you in some stuff. Good luck on this.
     
    e.e likes this.
  6. e.e

    e.e Rule 10. Don't ask questions.

    Joined:
    Sep 16, 2016
    Messages:
    398
    Likes Received:
    173
    Best Answers:
    0
    Thank you very much :)
    I think those are some true words especially for this community in this time and age!

    Thanks, but it's really neither closed nor open source, it's something sort of in between like conditionally open source.
    I'll make it open source if I have an absolute guarantee that I'll receive code contributions or financial support equal to or greater to what I've put in it, but the only way to get that guarantee is by receiving said contributions or support first.
    This is kind of similar to what Fenrisus is doing with his Unity3D client project, with the main difference being that he's set up a Patreon with $600 pledged already and he has promised that he's going to release most of the code (I don't understand why he doesn't make a git so other people can contribute if he's definitely going to release the code like he's said, but that's a completely different topic).

    So to be honest I don't really understand why you're shocked in the first place about me deciding not to immediately release the source code to this.
    To recap:
    * It's the only OTS to my knowledge that exists (and for that matter that is in active development) in this forum that's written in a scripting language and that actually runs/works.
    * It doesn't have a lot of features yet, but on the flipside it's not restrained to old and rigid conventions of coding and functionality (namely trying to replicate exactly how cip made their game with only moderate levels of success).
    * It's the best/imo. perfect OTS engine in current existence for small teams/solo developers that doesn't know how to or doesn't want to write hundreds to thousands of tedious lines of C++ code to add a new feature, or for anyone relatively new to OTS engines to learn how OTS engines actually works on the inside.
    * The codebase is uncomplicated, consists of less than 500 lines, is easy to read, easy to modify, and has endless potential.
    And if you don't think such a project deserves to be closed sourced until someone are willing to contribute to it, which is the new Open Tibia standard: demand more free stuff and contribute less, then that's really just too bad for you ¯\_(ツ)_/¯
    Either way my plan is to continue enjoying myself developing this whenever I feel like it and launch my own games in the future whether or not anyone here are interested, it's just a matter of how much time and fun will be involved along the way and how many people will get their hands on something like this ✌️
     
    Last edited: Sep 29, 2018
    Acubens likes this.
  7. Acubens

    Acubens Old Penguin

    Joined:
    May 6, 2008
    Messages:
    970
    Likes Received:
    71
    Best Answers:
    1
    Excuse me, you are in the correct way, my comment wasn't made correctly i hope see this grow.
     
    e.e likes this.
  8. e.e

    e.e Rule 10. Don't ask questions.

    Joined:
    Sep 16, 2016
    Messages:
    398
    Likes Received:
    173
    Best Answers:
    0
    It's ok. Thanks for the post and feel free to ask more questions in the future if you have any, I get maybe a bit defensive in the start of new projects because I'm used to a lot of criticism from people that doesn't know or understand what I'm doing or what I'm trying to do since I'm not very conventional, but this phase is pretty much over now, so I'll try to and probably will be able to be more calm in the future.


    @Everyone
    I'm still looking for collaborators / contributors particular for small and basic tasks at the moment, such as translating protocolgame.cpp functions to pythonic pseudo-functions.
    For example: ProtocolGame:: parseLookAt original code:
    Code (Text):
    1. void ProtocolGame::parseLookAt(NetworkMessage& msg)
    2. {
    3.     Position pos = msg.GetPosition();
    4.     uint16_t spriteId = msg.GetSpriteId();
    5.     uint8_t stackpos = msg.GetByte();
    6.  
    7.     addGameTaskTimed(DISPATCHER_TASK_EXPIRATION, &Game::playerLookAt, player->getID(), pos, spriteId, stackpos);
    8. }
    Python translation:
    Code (Text):
    1. def parseLookAt(net):
    2.     x = net.getShort()
    3.     y = net.getShort()
    4.     z = net.getByte()
    5.     spriteid = net.getShort()
    6.     stack = net.getByte()
    7.     print(x, y, z, spriteid, stack)
    Pretty basic.

    Hopefully this will be a good and comfortable start for anyone new to the project who may be interested to contribute, although you may contribute any way you wish if you're more interested in other tasks.
    I have moved on to the code organization and conceptual design of the server for now.
     
    Last edited: Oct 6, 2018
  9. ochmar

    ochmar Member

    Joined:
    Feb 27, 2016
    Messages:
    85
    Likes Received:
    31
    Best Answers:
    1
    If only I was better at python =(
     

Share This Page

Loading...