fuzziqersoftware / newserv

Phantasy Star Online game server, proxy, and reverse-engineering tools
MIT License
166 stars 37 forks source link

Possibility of making $edit npc work on Ep3 and PSO GC Plus? #536

Open Star-X555 opened 4 months ago

Star-X555 commented 4 months ago

The recent development of a way to run patches on PSO GC Plus makes me wonder if the $edit command could be expanded to cover V3 games and Ep3. Since, to my knowledge, no save editor exists for PSO GC, or Ep3, it's very difficult to get a working NPC skin in those games, and in Ep3's case, damn near impossible.

The protections on the Plus client were formerly thought to be insurmountable, but obviously that wasn't the case. Is it therefore possible to get the $edit command working on V3 games and/or Ep3, especially the NPC option?

fuzziqersoftware commented 3 months ago

This is indeed possible, but is a nontrivial amount of work. We would either need to save the entire character file on the server side, edit it, then load it to the client again, or write a client function that updates the character data in-place. I'll probably implement this by doing the latter, but I can't promise when I'll get to it.

Star-X555 commented 3 months ago

Yeah, no rush. That being said, if/when I recompile my Steam Deck's newserv instance, I'll be experimenting with the $savechar command and seeing how it's actually formatted. Would be funny as hell if it turned out to be in a format where even someone who's pretty bleh with hex editing and/or programming could find the one variable in the entire file that controls NPC appearance XD

fuzziqersoftware commented 3 months ago

$savechar saves files in BB format on the server side; the format is documented in SaveFileFormats.hh. For setting NPC flags in a hex editor, I think you'll want to set disp.visual.extra_model (byte at 394 in the .psochar file) to the NPC value (see name_to_npc_id) and set disp.visual.validation_flags (byte at 3AA in the file) to 2.