Adding custom features to my private server?

Discussion in 'Troubleshooting' started by Monomate, Aug 24, 2019.

  1. Monomate

    Monomate Member

    Hi all,
    First off wanted to say: it's amazing what this community has done to keep Phantasy Star Online alive. PSO has been my favorite game since I bought it on the Dreamcast, and replaying all these years later has been an incredible nostalgic experience.

    I set up a private server recently to introduce the game to my friends, and wanted to add a few features. Here is what I was thinking:
    1. Play a custom sound effect when a red box drops
    2. Display a message to everyone when someone picks up a rare item, and (if possible) what item type it is (i.e. "Kireek picked up a rare shield")
    3. Show monster HP under the monster's name in the bottom left corner (the way Ultima does it)

    Are any of these realistic? So far, I've been able to send a message when a rare item drops. Can someone kindly point to where in the code I would be able to add features like these to my home server? Thank you for reading!
  2. Soly

    Soly Member

    Both playing a sound and showing the monster's HP (bar) require editing the client's assembly (either in the executable itself or patching it live like we do with a library).
  3. Monomate

    Monomate Member

    Thanks for the info, Soly. I appreciate what you do for keeping this game alive. I've done simple hex editing of PSObb.exe... can you ELI5 about live patching? Just trying to figure out how feasible it is. How about the message showing when someone picks up a rare? Is that also done through the executable or a library? Thank you!
  4. Soly

    Soly Member

    The "live patch", I meant that the library (dll) applies the patches when the game loads it (the library).
    The end result is no different than patching the game executable, while both methods require at least knowing what to patch, you can have more freedom doing it with a library.

    About the message, the game already has quite a few message windows and the banner thing, so that's already doable.
    You'd just have to tweak the code to send a message to everyone as well as decide which items to trigger it with.
    Monomate likes this.
  5. Monomate

    Monomate Member

    Thanks again for the info. Would the messages feature be done through ship_server.c? Is there a section of code I should be on the lookout for?

    Also, is there any documentation functions I can use in the DLL file? Otherwise I can try reverse engineering. I have "psobbaddonplugin-". Thank you!
  6. Sodaboy

    Sodaboy Administrator Staff Member

    Benicia, California
    This really isn’t an ELI5 thing.

    You have to have a knowledge of programming AND reverse engineering as well as using your own brain to figure things out on your own in order to do this.

    You could have already figured out the message stuff on your own with simple logic.

    One example: You already know you can send messages as a GM in the code that already exists. So, look in the source for how sending a GM message works and then add a similar auto function for when specific rare items drop and you’ve got your message.

    Another example for monster HP: Hook psobb.exe with a debugger and search for the unicode word Booma while in Forest. Set it to break on access. Walk up to a Booma. Just before the name appears on the screen, you’ll probably be in the function that looks up its name from the unitxt, you trace from that part on to get to the real procedure that sets up the window. You’d modify and add code from that point.
    jajaswipo and Ryan like this.
  7. Monomate

    Monomate Member

    Thanks. Yeah, was able to reverse engineer the message send for a rare drop, but was double-checking if there was any documentation before hunting through the code and any possible dependencies. Not a good use of brain power or time otherwise. Thankfully the code is pretty rudimentary, so I'm looking forward to getting in and trying stuff out. Thanks!

Share This Page