PSO Network Trial Edition?

Sylverant is a homebrew open source server for Phantasy Star Online. Dreamcast users still play PSO online with this server even today! This is the official forum for both the online game server as well as the open source project itself. Feel free to post and get a gathering started online! We can also show you how to get connected!

Moderators: BlueCrab, Aleron Ives

FaithY
DCEmu Freak
DCEmu Freak
Posts: 84
Joined: Sun Jan 08, 2012 1:33 pm

PSO Network Trial Edition?

Post by FaithY » Sun Jun 02, 2013 8:56 pm

Never heard anything about this edition. Anyone know anything about this?

http://item.taobao.com/item.htm?spm=a23 ... 3255432902

http://m.youtube.com/#/watch?v=JMOfrZlw ... MOfrZlwFlc
:mrgreen:
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Mon Jun 03, 2013 12:36 am

Well, it is the only version of PSO that I know of for the Dreamcast that I don't have (of course, I would love to have it). :wink:
User avatar
Aleron Ives
DCEmu Nutter
DCEmu Nutter
Posts: 750
Joined: Wed Jan 05, 2011 2:15 pm
Location: California
Contact:

Re: PSO Network Trial Edition?

Post by Aleron Ives » Mon Jun 03, 2013 1:40 am

You still need to add support for the PC NTE on Sylverant. :lol: I would assume it is comparable to the Dreamcast one.
"Fear the HUnewearl."
Image
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 351
Joined: Wed Mar 30, 2011 12:13 pm

Re: PSO Network Trial Edition?

Post by RyoDC » Mon Jun 03, 2013 7:17 am

Better add support for PSO2 :)
How do I try to build a Dreamcast toolchain:
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Mon Jun 03, 2013 11:52 am

Aleron Ives wrote:You still need to add support for the PC NTE on Sylverant. :lol: I would assume it is comparable to the Dreamcast one.
Perhaps at some point... If I ever get the time. :?
RyoDC wrote:Better add support for PSO2 :)
Completely different game. Not interested in doing that. Not to mention the fact that Sega is still monetizing it, so I'm not going to trounce on their revenue stream anyway.
If I was going to add support for a newer game, I'd start with full Blue Burst support anyway. Then potentially PSU. And just to be clear, this doesn't mean I'm doing any of that stuff, any time soon (or ever).
User avatar
Jack L.
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 12
Joined: Sun Jun 16, 2013 2:58 pm

Re: PSO Network Trial Edition?

Post by Jack L. » Sun Jun 16, 2013 3:12 pm

The network trial edition is already supported I imagine. I know it has always worked perfectly fine on schthack. In fact, if you look at King IVVI's now ancient website it still hosts a patch that will patch the NTE to connect to Schthack. No reason I can really see why if we redirected the NTE here it wouldn't work.

King's old site, patch is right on front page:
http://www.oocities.org/straiff22/
User avatar
Aleron Ives
DCEmu Nutter
DCEmu Nutter
Posts: 750
Joined: Wed Jan 05, 2011 2:15 pm
Location: California
Contact:

Re: PSO Network Trial Edition?

Post by Aleron Ives » Sun Jun 16, 2013 8:31 pm

Sylverant requires registration, and the NTE has no serial number or access key, so even if you did redirect the game to connect here, you'd be blocked. ;) BlueCrab would need to add an exception to the server to allow NTE users to connect by automatically assigning them temporary Guild Card numbers. The NTE probably connects on a different port, too, so Sylverant would need to be able to respond to it.

The changes wouldn't be particularly grueling to implement, but the NTE wouldn't work immediately. Some changes might also be necessary to accomodate the fact that the NTE goes straight from the lobby to Forest 1 (bypassing Pioneer 2) and straight from the Dragon back to the lobby. Code would also be necessary to prevent the NTE from seeing teams in difficulties other than Normal mode, as well as Battle and Challenge teams.
"Fear the HUnewearl."
Image
User avatar
Jack L.
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 12
Joined: Sun Jun 16, 2013 2:58 pm

Re: PSO Network Trial Edition?

Post by Jack L. » Mon Jun 17, 2013 1:51 am

I believe it's all the same as the port and such goes. Back in the day people used to play on the NTE servers with the full version even. The serial thing would be an issue tho.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Tue Jun 25, 2013 7:36 pm

Gee... Look what happened to come in the mail today...
Photo on 6-25-13 at 8.23 PM.jpg
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Tue Jun 25, 2013 10:34 pm

And... Of course, the first thing I had to do was play around with the network trial a bit. Managed to sorta figure out how to get it to log on to the server (it uses a completely different set of login packets than any other version), up to the point where it tries to connect to a ship. Being that it is getting kinda late, I'm going to call it a night for tonight. I'll mess around with it a bit more tomorrow.

Some interesting things to note in the initial observations category:
  1. The serial number and access key for the NTE are each 16 characters long (on the other DC versions, they're just 8 characters long each). The serial number appears to only be made up of decimal numbers (other DC versions use hex), and the access key is a mix of upper- and lower-case alphabetic characters and numbers.
  2. There are no language options. Everything is in Japanese.
  3. There is no offline mode. There's a menu for it (just after you pick your character from the memory card or create a new character), but you can't actually move the selector to Offline Mode.
  4. Speaking of creating a new character, that works pretty much identically to all the v1 games.
  5. The opening movie is just a Japanese text crawl on a static background of the explosion on Ragol. The background music is the same as what's on the title screen of the game.
  6. There are various differences in the UI of the Network Trial Edition versus the other versions of the game. Lots of outlines of things seem to be missing.
  7. The options menu is kinda bare. There is only one option, and I have no idea what it does (sorry, can't read enough Japanese to figure it out).
  8. Luckily enough, the NTE actually works with the Broadband Adapter. Probably has the same requirement of having the ISP information for a dialup ISP, but it actually sorta makes sense with the NTE (as part of the dialup ISP information gets sent with the login packets to the server).
  9. The game tries to connect to port 9000 of pso02.dricas.ne.jp . There are other strings nearby in the binary that also look like server hostnames (such as pso03.dricas.ne.jp, pso04.dricas.ne.jp, and pso05.dricas.ne.jp, amongst other stranger hostnames). This port wasn't used by any other Dreamcast version of the game, but was used by at least one Gamecube version of the game (and potentially by the PC version, IIRC). I'm guessing the other pso hostnames are backup server names? No idea about the other hostnames in the binary.
  10. The game's binary references a full set of v1 game maps.
  11. The NTE really doesn't like there being multiple menus in the ship select. It will let me send the normal Ship Select/Download menu, and it'll display the ship select menu if selected, but then will hang when you try to pick a ship (it'll never send a packet to the server telling it what ship you picked). So, that pretty much means that only the first menu presented by the login server is valid. It also, for whatever reason, shows the menu title, unlike every other version of the game. I might try playing around with those to see if maybe it will work correctly with multiple menus if I change the menu titles or something.
  12. The NTE does not like the PSO Patcher Disc as it stands right now (the game goes back to the Dreamcast's BIOS when you try to boot it). I'll have to fix that at some point, obviously.
  13. There is no hunter's license check. That makes this the only Japanese Dreamcast version that doesn't have that.
That's all I can think of at the moment. If anyone else has the NTE, please don't try to use it yet. The changes I made to get what little I got working are not in the public repository and not in the running copy of the server either. You'll just end up crashing on a black screen.

I'll continue to update in this topic as I figure out more interesting stuff... 8-)
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Wed Jun 26, 2013 8:13 pm

Quick update...

So, the NTE is very picky with ISP information. If you're using a BBA, you must set the BBA's ISP information after setting the dialup one. Otherwise, when the game tries to connect to the login server, it will just go right back to the title screen.

Other than that, I'm happy to report that the NTE now appears to completely work with the login server. All NTE-related patches have been applied and the currently running instance should work with the NTE. However, no ships support the NTE, so you'll just get disconnected if you try to connect with it, once you pick a ship. :wink:

I'll be working on fixing ship server sometime soonish.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Thu Jun 27, 2013 12:53 am

Well, I have a bit more progress to report, but it comes with a caveat...

First, progress... Getting the NTE to display a block list was relatively painless. Works just the same as DCv1, but in response to a different packet (or at least it seems that way).

However, once it connects to the block, I'm not sure what to do. The normal process that Sylverant follows for every other version of PSO is to send it a packet confirming the user's guildcard, then send it a lobby list, then ask for the character data of the client. The first two steps work fine, but the last one crashes the NTE every time. If I bypass asking it for character data, and immediately try to send it to a lobby, it crashes as it tries to load into the lobby (which I suppose is to be expected since I wouldn't even be able to send the client its own character data to load into the lobby with since I can't get it through the normal manner). So, in other words, this will probably take a lot more work to figure out than I had anticipated it would.

Long story short, I dunno if I'm going to be able to make much progress in the near future on this, unfortunately. :?
User avatar
Aleron Ives
DCEmu Nutter
DCEmu Nutter
Posts: 750
Joined: Wed Jan 05, 2011 2:15 pm
Location: California
Contact:

Re: PSO Network Trial Edition?

Post by Aleron Ives » Thu Jun 27, 2013 1:59 am

Perhaps working on the DC and PC NTEs in tandem might shed some light on what the demos do differently, but there's of course no guarantee that Sega designed them the same way. For all we know, the PC NTE just works the same way as the full client, since it's based on Ver.2, while the DC NTE is based on Ver.1. :|
"Fear the HUnewearl."
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Thu Jun 27, 2013 2:15 am

Aleron Ives wrote:Perhaps working on the DC and PC NTEs in tandem might shed some light on what the demos do differently, but there's of course no guarantee that Sega designed them the same way. For all we know, the PC NTE just works the same way as the full client, since it's based on Ver.2, while the DC NTE is based on Ver.1. :|
I'd imagine the PC NTE works much more closely to the non-trial versions of the game, since it came out after the Dreamcast versions. It seems like in the DC NTE that the network stuff was still in a state of flux and packets got changed before the final release (hence the completely different login packets on the DC NTE -- the type codes of some of which later got reused in other versions of the game for different non-login purposes). Being that the DC versions established a relatively sane protocol, I'd imagine the PC NTE pretty much follows them (with the probable exception of using UTF-16 instead of SJIS/ISO-8859-1).
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Thu Jun 27, 2013 9:52 pm

So... Small update for tonight, but interesting none the less...

I was looking through a disassembly of the NTE's 1ST_READ.BIN file today and I noticed a lot of functions that seemed to be referencing the string that the game expects in the first packet sent out from the login server. I looked a bit closer, and most of them were simply using it as a base and offsetting from it. Since that string looks to be the first string in the binary, that actually makes a lot of sense (so, they can all easily find the .rodata section and offset from that to find their strings).

While that is somewhat interesting, the real interesting part came when I actually noticed what came in the binary a bit after the login server identification string (where the offsets mentioned above point to). Here's a small selection of what I saw in the strings below it:

Code: Select all

RcvLogOut
RcvChat
RcvDirList
RcvGameList
RcvStartGame
RcvStartGame2
RcvStartGame3
RcvStartLobby
RcvStartLobby2
RcvBaner
RcvBanerHead
RcvDownLoad
RcvUpLoad
RcvMessage
RcvPort
RcvBattleData
RcvSystemFile
RcvPsoData
RcvPsoDataLong
RcvGenerateID
RcvRoomInfo
RcvUserAns
RcvPing
RcvChatMessage
SndRegist
SndLogin
SndLogin2
SndReturn
SndLogin3
Those look an awful lot like function names of functions that either process or send packets. :wink:

I've always been an advocate of using printf() to help in debugging to trace where my code goes. Looks like Sega did the same thing, but left them in the binary at release (oh, and other later versions have similar tables of strings, interestingly enough).
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Fri Jun 28, 2013 11:16 pm

Well, they say that a picture is worth a thousand words... So here's a few thousand words?
IMG_20130628_234048.jpg
IMG_20130628_233503.jpg
IMG_20130628_233334.jpg
IMG_20130628_233253.jpg
Now, before anyone gets too excited, most of the time I can't even get to the lobby (I still dunno why I've been able to get on 3 times, but not the countless other times I've tried with the same code). Also, nothing in-game works yet, and the game will crash if anyone else connects to the lobby. But, progress is progress, I suppose.

More pictures are available over here.
User avatar
Aleron Ives
DCEmu Nutter
DCEmu Nutter
Posts: 750
Joined: Wed Jan 05, 2011 2:15 pm
Location: California
Contact:

Re: PSO Network Trial Edition?

Post by Aleron Ives » Sat Jun 29, 2013 5:06 am

The NTE shows your stats in a different order. Wow Sega, what an important change to make before the final release! :lol:
"Fear the HUnewearl."
Image
User avatar
Jack L.
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 12
Joined: Sun Jun 16, 2013 2:58 pm

Re: PSO Network Trial Edition?

Post by Jack L. » Mon Jul 01, 2013 7:49 pm

Ah this is quite a bit different than the old PC trial I was thinking of haha

Cool to see something like this online though. Even if you can just get lobby support going good who would have guessed they could be chatting on the PSO NTE in 2013? First brining my USv2 back to life with that HL code and now this, good work and thanks BlueCrab.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Mon Jul 01, 2013 10:14 pm

Progress, at this point, is unfortunately going pretty slow on getting it to work... :?

I've managed to at least make a few packets make sense by correcting a few things in the code, but I'm still stuck with the client disconnecting far more often than not when it gets to the lobby. :|

I have a feeling I might actually have to dissect the function in the game itself that responds to new character data to figure out what the NTE expects different from all the other versions (beyond the slightly shorter packet, which I figured out a while back). Unfortunately, this function is not exactly short, so it will take some time. Not to mention the fact that my eyes are bugging out from looking at this disassembly... :cry:
Jack L. wrote:First brining my USv2 back to life with that HL code and now this, good work and thanks BlueCrab.
Well, the Hunter's License thing was just a REALLY lucky guess on a theory I had. The fact that I got that working in as short of time/work as I did proves that Sonic Team was at least somewhat sane when programming the game. Note that I only say they were somewhat sane. :lol:
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5315
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: PSO Network Trial Edition?

Post by BlueCrab » Tue Jul 02, 2013 10:48 pm

So... There's actually real progress to report today...

I spent most of the day trying to dissect various functions in the disassembly of the NTE to find out why the game was disconnecting itself. Then I noticed something in the logs of the packets the client was sending to the server. Specifically, I noticed this packet, which was always the last one sent:

Code: Select all

60 00 08 00 1F 01 00 00
Now, that probably doesn't make a bit of sense to most people reading along, so I'll try to explain it a bit. All versions of PSO use packet type 0x60 (the type is the first byte) to mean packets that should be delivered to all clients in the same lobby or the same game. The third byte there (0x08) is the length, in bytes, which is correct as you can see. The fifth byte (0x1F) represents the type of data to be delivered in this type of packet, and the next byte is how many 32-bit values are in the packet, including the one that has the type of data and the count. Now, based on that, there's nothing wrong with this packet...

However, let's look at what the Sylverant code will do with this packet. First, look at the subcmd.h file to see if we have a type declared for 0x1F, which as you can see from this fragment, we do:

Code: Select all

/* Subcommand types we might care about (0x60/0x6C). */
#define SUBCMD_SYMBOL_CHAT  0x07
#define SUBCMD_HIT_MONSTER  0x0A
#define SUBCMD_HIT_BOX      0x0B
#define SUBCMD_TELEPORT     0x17
#define SUBCMD_SET_AREA     0x1F
#define SUBCMD_SET_AREA_21  0x21    /* Seems to match 0x1F */
So, let's look at what the server expects for 0x1F (SUBCMD_SET_AREA)...

Code: Select all

/* Packet used to update other people when a player warps to another area */
typedef struct subcmd_set_area {
    dc_pkt_hdr_t hdr;
    uint8_t type;
    uint8_t size;
    uint8_t client_id;
    uint8_t unused;
    uint8_t area;
    uint8_t unused2[3];
} PACKED subcmd_set_area_t;
The dc_pkt_hdr_t corresponds to the first 4 bytes of the packet, and each uint8_t is one byte (there are 3 in that unused2 area). So, we should already see a problem here, specifically that the NTE's packet seems to be missing 4 bytes compared to what I expect. Let's look at what Sylverant actually does with that packet type (I'll spare some of the boring details about how packets are parsed, and just skip to the actual function)...

Code: Select all

static int handle_set_area(ship_client_t *c, subcmd_set_area_t *pkt) {
    lobby_t *l = c->cur_lobby;

    /* Make sure the area is valid */
    if(pkt->area > 17) {
        return -1;
    }

    /* Save the new area and move along */
    if(c->client_id == pkt->client_id) {
        c->cur_area = pkt->area;
    }

    return lobby_send_pkt_dc(l, c, (dc_pkt_hdr_t *)pkt, 0);
}
Well, see there how the server is trying to check pkt->area for validity? Remember how the NTE's packet is missing the last 4 bytes, including pkt->area? Yeah, that's obviously a problem... Basically, the server would be picking up some other random byte there -- whatever happened to be in the packet buffer from before, most likely. So, 18 times out of 256, the server would pick something that looked like a valid area. The rest of the time, it would think the client was warping to an invalid area, and would go out via the return -1; line. Returning anything but 0 from this function will cause the server to disconnect the client -- thus, the client would disconnect most of the time.

So, lesson learned: the NTE has different packet types for the action packets and must be handled separately from other versions. This also means that in order for other versions to interact with the NTE (even to just be in the same lobby as it) that the server will have to do some translation of packets. That means I'm going to have to do some studying of both the NTE and other versions to figure out exactly what needs to be translated and how, or I'll have to separate all NTE clients from all non-NTE clients -- even in the lobby. :roll:

Oh well, at least things make a whole lot more sense now. :roll:
Post Reply