PSO Weapon and Armor Database (currently v2)

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

Post Reply
Lee
DCEmu Freak
DCEmu Freak
Posts: 53
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Mar 06, 2014 10:28 am
Has thanked: 0
Been thanked: 1 time

Re: PSO Weapon and Armor Database (currently v2)

Post by Lee »

check for read only on any of the files
Treamcaster
Insane DCEmu
Insane DCEmu
Posts: 148
Joined: Mon Jul 02, 2007 1:11 pm
Has thanked: 1 time
Been thanked: 0

Re: PSO Weapon and Armor Database (currently v2)

Post by Treamcaster »

Lee wrote:check for read only on any of the files
I've already checked that... must be something else.
Lee
DCEmu Freak
DCEmu Freak
Posts: 53
Joined: Thu Mar 06, 2014 10:28 am
Has thanked: 0
Been thanked: 1 time

Re: PSO Weapon and Armor Database (currently v2)

Post by Lee »

are you using the files i provided?
User avatar
Aleron Ives
DCEmu Nutter
DCEmu Nutter
Posts: 871
Joined: Wed Jan 05, 2011 2:15 pm
Location: California
Has thanked: 0
Been thanked: 25 times
Contact:

Re: PSO Weapon and Armor Database (currently v2)

Post by Aleron Ives »

OK, I have the first round of results. 8-)

Image

The new weapon works, but the Photon Gradient 2 slider is broken in the builder. The G and B values on Gradient 2 show the values of the Gradient 1 sliders, so you can't see what values you're setting on Gradient 2 G or B. The names and descriptions of my old items are unchanged, so it seems that the unitxt realignment was successful. :)

Image

I think this is a quirk with PSO. I added a new stat boost using one of the unused slots and set it to reduce my HP by 100. Instead, my HP decreased by 200. I think both HP + and HP - actually give 2x of whatever you put. (Last Survivor says it gives 10, but I'm pretty sure it gives 20 in game).

Image

The new Photon works for the new 080800 gun's body, but the bullets are still using the wrong colour from the 070800 gun. Is there a way to fix that?

Image

The new gun has 12 stars. Will it be reduced?

Image

Sadly, yes. Having > 9 * doesn't change reduction. Alas! My new Mechgun sucks. :(

Image

The new twin, however, is unreduced, since it's beyond the "basic" item section of the item list. I don't suppose there's an easy way to change this so that other weapons beyond the 07xx00 sub-type can be unreduced... ?

Image

Tekking works, but you do indeed see the "dummy" tek picture. If you can figure out a way to fix that, I think I can convert BB KT images to go into the Ver.2 KT.

I also found another more serious bug: if I try to add a new unit, PSO crashes when I try to launch the game. I'm guessing you didn't try to adjust the unit counts in pso.exe. If it's not possible to add new units, then you should probably disable the "Add Unit" button along with the one for adding Mags, since it doesn't work, anyway.

A much less important bug is that the builder generates a "Grid index out of range," error if I try to use the mouse scroll wheel on the Armor, Mag, or Items tabs. The mouse wheel works for scrolling the other tabs for some reason.

Progress! :mrgreen: I still need to test compatibility between patched and unpatched clients to ensure PSO behaves the way I think it will.
These users thanked the author Aleron Ives for the post:
w8prouser1
"Fear the HUnewearl."
Image
Lee
DCEmu Freak
DCEmu Freak
Posts: 53
Joined: Thu Mar 06, 2014 10:28 am
Has thanked: 0
Been thanked: 1 time

Re: PSO Weapon and Armor Database (currently v2)

Post by Lee »

i can't really do much about the reductions or the bullets since they are prob tied up hard coded exe values and i really don't want to have to go digging too much for so little gain, if pso is crashing when you add a unit i prob did something wrong in the unit code rather then it actually not being allowed to work, i'll fix it.

i had a feeling i hadn't messed up the tek pictures of regular items because of where i am inserting the new items, i am inserting them just before the mag id's and moving all the mag id's up by 1. alas i think because i did this, the tek pictures will never work because there are unit ids between this and the old weapons, you have to admit though this is better then nothing, to get around the mech issue with reduction, just add the mech to a hex group with unreduced which is a mech.

I'll look at the photon slider, i could have sworn though i locked the second photon to be the same as the first except for when you check the pulse flag.

Oh crap i see the issue with the photon the label is linked to the wrong bar woopsie
A much less important bug is that the builder generates a "Grid index out of range," error if I try to use the mouse scroll wheel on the Armor, Mag, or Items tabs. The mouse wheel works for scrolling the other tabs for some reason.
this happens on any grid if you try and scroll after using a drop downbox because of how i reload the grid when you set a value, i'll see if i can get around it but it's not exactly harmful just untidy
Treamcaster
Insane DCEmu
Insane DCEmu
Posts: 148
Joined: Mon Jul 02, 2007 1:11 pm
Has thanked: 1 time
Been thanked: 0

Re: PSO Weapon and Armor Database (currently v2)

Post by Treamcaster »

Lee wrote:are you using the files i provided?
Yes. But never mind, I tried in my other PC and it's working. Arghh windows needs format..

I always wanted to have a white sword.. yay:
Image
Lee
DCEmu Freak
DCEmu Freak
Posts: 53
Joined: Thu Mar 06, 2014 10:28 am
Has thanked: 0
Been thanked: 1 time

Re: PSO Weapon and Armor Database (currently v2)

Post by Lee »

I've fixed the photon slider, and the grid out of index issue already i think, going to take me a while to track down the unit issue though.
User avatar
Aleron Ives
DCEmu Nutter
DCEmu Nutter
Posts: 871
Joined: Wed Jan 05, 2011 2:15 pm
Location: California
Has thanked: 0
Been thanked: 25 times
Contact:

Re: PSO Weapon and Armor Database (currently v2)

Post by Aleron Ives »

Lee wrote:to get around the mech issue with reduction, just add the mech to a hex group with unreduced which is a mech.
The problem with doing it this way is that then it isn't possible to use a new Photon, because all Ver.2 weapons have hard-coded skins. For example:

Image
I'm still using the white Photon 19 I added, but the Red Mechgun skin overrides it. This screenshot does reveal something interesting, though...
Lee wrote:i can't really do much about the reductions or the bullets since they are prob tied up hard coded exe values and i really don't want to have to go digging too much for so little gain
Based on my results with Red Mechgun, it seems that bullet colour is hard-coded to correspond with sub-type. Red Mechgun is 00, so it has green bullets. My test gun is 01, so it gets blue bullets. The reason my first gun got yellow bullets is because of PSO's standard "if > max = max" check, because there are no bullet types defined after the yellow type for Rayguns and Vulcans. I guess it would be possible to add another bullet type for white Photons, but that would require finding where the list of bullet Photons is stored in pso.exe. I tried searching for the green Photon colour in the exe, but sadly it didn't work. It's probably referenced by Photon slot number rather than having the colour hard-coded in the exe. Meh.

Regarding the reduction problem, there are two possible ways I can think of to get around it:
  • Add the new weapons as S-Rank sub-types, rather than basic weapon sub-types. The problem with this is that it would require finding the code that controls the S-Rank special and making it only apply to the 00 sub-type, so my new 01 sub-types wouldn't have the S-Rank special (since it would override trying to set fixed specials). I've tried making new S-Rank sub-types before, and they had the S-Rank special.
  • Copy the existing weapon models and textures for the basic weapon types and add them again as duplicate entries at the end of the weapon list in the ItemTexture/ItemModel.afs files, so the new weapons could have their own IDs.
Blah. Everything is always so complicated.
"Fear the HUnewearl."
Image
Lee
DCEmu Freak
DCEmu Freak
Posts: 53
Joined: Thu Mar 06, 2014 10:28 am
Has thanked: 0
Been thanked: 1 time

Re: PSO Weapon and Armor Database (currently v2)

Post by Lee »

nothings going to be perfect ives, honestly just getting units working and that's prob as good as you'll get from me unless you can find someone else who has the time to dissemble the exe and find things for me to just patch in quickly (it's not exactly hard, it's just really time consuming).

That being said there are only 2 places in the exe with a > 4 = 4 check, it's possible one of these is for the photon colours on projectiles or both, thing is if you wanted a white photon you may have to juggle around some photon colours in the photon entry tab and on some of the weapons.

You'll find these checks btw in the following 2 functions:

@0x00421AB0
@0x00549C90

Oh and ives, looking for rgb values in the exe won't get you anywhere, photon colours are 4 single values, i just convert them to rgb so it's easier for people to understand them, really they use a fraction of 1 for intensity 1 = 255, then 0.5 = 127 ish etc
User avatar
Aleron Ives
DCEmu Nutter
DCEmu Nutter
Posts: 871
Joined: Wed Jan 05, 2011 2:15 pm
Location: California
Has thanked: 0
Been thanked: 25 times
Contact:

Re: PSO Weapon and Armor Database (currently v2)

Post by Aleron Ives »

I also tested the version compatibility, and Ver.2 works even better than I had hoped. When equipped, the new items show up to an unpatched player as a base item type, but in this case they have blue Photons, rather than green ones (presumably since green is what Ver.1 sees for unknown items). If you drop the item, it shows up as an unequippable X???? weapon with the correct sword/gun icon and no stats or description. It also keeps its percentages and grind value. If you leave the team or let the unpatched player bank the item, it retains all of its attributes and is still usable when the unpatched player drops it again (unlike Ver.2 items used in Ver.1, where they get permanently turned into whatever dummy item Ver.1 players seem them as). My guess would be that Sega added this compatibility mode to Ver.2 to facilitate planned interaction abilities with Ver.3 players, much as Ver.1 players can interact with Ver.2 players in a limited capacity.

Ver.1 doesn't work at all, though. If you equip a new weapon, Ver.1 sees you as unarmed, and you'll just punch when you attack (but making the punching noise the number of times the new weapon would attack, e.g. 9 punch noises for the Mechgun). If you drop a new weapon on the ground, it's invisible to the Ver.1 player. If you drop it on the ground on the same floor as a Ver.1 player, you can't pick it up again, and the weapon is deleted permanently.

I don't know how much of a role the server can play in this (as it could probably manually map new weapons to old weapons so that Ver.1 users could see them), but at present the only safe way to treat this would be to forbid you from entering a Ver.1 team if you have any new items (and to kick you from the team if you try to withdraw one from your bank).

I'm sure BlueCrab would be just giddy at the prospect of adding manual item mapping to Sylverant to let Ver.1 players interact with players who have items that don't exist in Ver.2 (although technically this is probably necessary to let Ver.1 players safely play in GC-compatible teams, since GC players could likely lose their items in a similar manner). ;)
"Fear the HUnewearl."
Image
Treamcaster
Insane DCEmu
Insane DCEmu
Posts: 148
Joined: Mon Jul 02, 2007 1:11 pm
Has thanked: 1 time
Been thanked: 0

Re: PSO Weapon and Armor Database (currently v2)

Post by Treamcaster »

Off-topic: Lee, you should join forces with Bluecrab! Sylverant is the future.
User avatar
Aleron Ives
DCEmu Nutter
DCEmu Nutter
Posts: 871
Joined: Wed Jan 05, 2011 2:15 pm
Location: California
Has thanked: 0
Been thanked: 25 times
Contact:

Re: PSO Weapon and Armor Database (currently v2)

Post by Aleron Ives »

Lee has already contributed lots of stuff to Sylverant, such as information on how the drops work for the server-side drop system (as evidenced in BlueCrab's comments).
"Fear the HUnewearl."
Image
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: PSO Weapon and Armor Database (currently v2)

Post by BlueCrab »

Indeed, Lee has contributed both in a bit of direct messages between us, and in information that I found that he had posted in various places on the Internet in the past. Lee certainly does deserve a lot of credit for the sheer amount of PSO-related stuff he's provided and helped along. :grin:

With regard to v1 stuff... I guess I can look at it at some point, and at least try to make it behave as well as v1 does for the v2 weapons. No promises though as to when I'll be able to look at it.
Lee
DCEmu Freak
DCEmu Freak
Posts: 53
Joined: Thu Mar 06, 2014 10:28 am
Has thanked: 0
Been thanked: 1 time

Re: PSO Weapon and Armor Database (currently v2)

Post by Lee »

btw ives the reason why i say the photon colours probably work the way they do is because on psobb and psopc, the mag colours are treated as photons and well if you edit itemmagedit.prs add a few entries it doesn't work untill you increase a simple > = check (in regards to the mags they all show as red because it 0's anything higher then max), but once you do that you can have what ever base mag colours you want.

psov2 vs bb in mag photon colours
Image

Itemmagedit files are actually pretty identical between psov2 all the way to bb, they just have more entries for more mags, I should check the v1 one too but it's prob the same.

Inb4 ives wants more mag colours lol... (i never learn).

I really don't need to be formally affiliated anywhere to be even slightly helpful as long as people are willing to be open with me with things they find, i have no problem with answering questions or providing info on things i already know.
User avatar
Aleron Ives
DCEmu Nutter
DCEmu Nutter
Posts: 871
Joined: Wed Jan 05, 2011 2:15 pm
Location: California
Has thanked: 0
Been thanked: 25 times
Contact:

Re: PSO Weapon and Armor Database (currently v2)

Post by Aleron Ives »

It would be nifty to allow more Mag colours, but that's certainly not a major priority. Is it even possible to do more colours in V2 when it represents colours using different bits than GC/BB does? Does ItemMagEdit have anything else interesting in it besides the bonus animation types and the colour possibilities? Those Header and Mag Data columns look interesting. ;)

Here are ItemMagEdit and ItemMagMotion from V1, if you want to add support for them.
"Fear the HUnewearl."
Image
Treamcaster
Insane DCEmu
Insane DCEmu
Posts: 148
Joined: Mon Jul 02, 2007 1:11 pm
Has thanked: 1 time
Been thanked: 0

Re: PSO Weapon and Armor Database (currently v2)

Post by Treamcaster »

Will it be possible to use these custom weapons on DC? I suppose not...?
Lee
DCEmu Freak
DCEmu Freak
Posts: 53
Joined: Thu Mar 06, 2014 10:28 am
Has thanked: 0
Been thanked: 1 time

Re: PSO Weapon and Armor Database (currently v2)

Post by Lee »

any added photon colour would behave like the regular colours, it just maps them to the parts on the model with the flags set which is done by the client version, so just like changing the photon colour of a saber in the pmt, the magedit will do the same on mags.

The header just seems to define the max stats a mag can have, 200, 200 120 etc... obv messing with these needs exe changes etc.

In order to use them on dc the dc main elf (the dc version of an exe) is the hard part that needs modification, now these are really easy changes to make it's just finding where to make them, and i don't have the benifit of either knowing sh4 assembly that well or a dissembler and debugger to help me.

If you can patch the main elf, the dc text files is easy to modify, and well dcv2 can just use the same itempmt as the pc version there's no difference, just a case of making a new disc for it.
AmonX
DCEmu Freak
DCEmu Freak
Posts: 80
Joined: Tue Sep 09, 2008 12:49 pm
Has thanked: 0
Been thanked: 0

Re: PSO Weapon and Armor Database (currently v2)

Post by AmonX »

Lee where does one find the item text description information in the pmt? ie for saber "A sword with a Photon blade. Attacks 1 enemy." I am just trying to figure out some missing information. In sylverant guard.unused4 is stat bonus

Code: Select all

#define PACKED __attribute__((packed))

typedef struct pmt_weapon_v2 {
    uint16_t index;
    uint16_t unused1;
    uint8_t classes;
    uint8_t unused2;
    uint16_t atp_min;
    uint16_t atp_max;
    uint16_t atp_req;
    uint16_t mst_req;
    uint16_t ata_req;
    uint8_t max_grind;
    uint8_t photon;
    uint8_t special;
    uint8_t ata;
    uint8_t stat_boost;
    uint8_t unused3[3];
    //uint32_t unused4;
} PACKED pmt_weapon_v2_t;

typedef struct pmt_guard_v2 {
    uint16_t index;
    uint16_t unused1;
    uint16_t base_dfp;
    uint16_t base_evp;
    uint16_t unused2;
    uint8_t equip_flag;
    uint8_t unused3;
    uint8_t level_req;
    uint8_t efr;
    uint8_t eth;
    uint8_t eic;
    uint8_t edk;
    uint8_t elt;
    uint8_t dfp_range;
    uint8_t evp_range;
    uint32_t unused4;
} PACKED pmt_guard_v2_t;

typedef struct pmt_unit_v2 {
    uint16_t index;
    uint16_t unused1;
    uint16_t stat;
    uint16_t amount;
    uint8_t pm_range;
    uint8_t unused2[3];
} PACKED pmt_unit_v2_t;


#undef PACKED
Lee
DCEmu Freak
DCEmu Freak
Posts: 53
Joined: Thu Mar 06, 2014 10:28 am
Has thanked: 0
Been thanked: 1 time

Re: PSO Weapon and Armor Database (currently v2)

Post by Lee »

you don't, you use the id to call it from unitext_e.prs, my pmt program calls all strings from that file
Lee
DCEmu Freak
DCEmu Freak
Posts: 53
Joined: Thu Mar 06, 2014 10:28 am
Has thanked: 0
Been thanked: 1 time

Re: PSO Weapon and Armor Database (currently v2)

Post by Lee »

Code: Select all

 TweapData = Record // Weapons data V2 24 bytes
    ID: Dword;
    Equip, ATPMin, ATPMax, ATPReq, MSTReq, ATAReq: smallint;
    Grind: byte;
    Photon, Special, ATAadd: byte;
    pad: Dword;
  End;

  TItemStarCounts = Record
    Weapon, Armor, Units, Item, Mag, Specials: Integer;
  End;

  TArmorData = Record // Armor data V2 24 bytes
    ID: Dword;
    DFP, EVP: smallint;
    block, a1, Equip, a2: byte;
    Alvl: byte;
    efr, eth, ice, edk, elt, dfpr, evpr: shortint;
    pad: Dword;
  End;

  TItemData = Record // Item Data V2 16 bytes
    ID: Dword;
    amount, T1: word;
    price, menu: Dword;
  End;

  TUnitData = Record // Unit Data V2 12 bytes
    ID: Dword;
    stat, amount, added, U2: smallint;
  End;

  TMagData = Record // Item Mag V2 16 bytes
    ID: Dword;
    M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13: shortint;
    mClass: Dword;
  End;

  Tunk1Data = Record // Load Unknown1 36 bytes
    U1: Dword;
    U2, U3, U4, U5, U6, U7, U8, U9: Single;
  End;

  TRangeData = Record // Range Data 20 bytes
    HDist, VDist: Single;
    HAng, VAng: Dword;
    MaxTar: Dword;
  End;

  TMagFeedData = Record // Load Mag feed table 1
    Defense, Power, Dexterity, Mind, Sync, IQ, U1, U2: shortint;
  end;

  TWSFXEntry = Record
    N1, N2: word;
    w1: Integer;
  End;

  TWSFXData = Record // Load weapon SFX 32 bytes
    Sound1: array [0 .. 3] of TWSFXEntry;
  End;

  TSpecialData = Record // Load Special data
    Special, amount: word;
  end;

  TStatBoostdata = Record // Load Boost data
    Boost1, Boost2: shortint;
    Amount1, Amount2: word;
  end;

  TSSFXData = Record // Load shield SFX 8 bytes
    N1, N2: word;
    S1: Integer;
  End;

  THeader = Record
    data: array [0 .. 7] of Dword;
  End;

  TTop = Record
    data: array [0 .. 15] of Dword;
  End;

  TDataArray = Packed Record
    Weapon: array of array of TweapData;
    Item: array of array of TItemData;
    Armor: array of array of TArmorData;
    Units: array of TUnitData;
    Mag: array of TMagData;
    Animation: array of byte;
    Unk1: array of Tunk1Data;
    Range: array of TRangeData;
    Unk2: array of Single;
    Unk3: array [0 .. 3] of Single;
    MagFeed: array [0 .. 7, 0 .. 10] of TMagFeedData;
    Special: array of TSpecialData;
    WSFX: array of TWSFXData;
    StatBoost: array of TStatBoostdata;
    SSFX: array of TSSFXData;
  End;

  TPointerArray = Packed Record
    block: array of Dword;
    Flags: array of word;
    Weapon: array of array [0 .. 1] of Dword;
    Armor: array of array [0 .. 1] of Dword;
    Item: array of array [0 .. 1] of Dword;
    Units: array [0 .. 1] of Dword;
    Mag: array [0 .. 1] of Dword;
    MagFeed: array [0 .. 7] of Dword;
    Combine: array [0 .. 1] of Dword;
    Unk4: array [0 .. 1] of Dword;
    Unk4_2: array of array [0 .. 2] of Dword;
    Event: array [0 .. 1] of Dword;
    Event_2: array [0 .. 2, 0 .. 1] of Dword;
    Unseal: array [0 .. 1] of Dword;
    Super: array [0 .. 1] of Dword;
  End;

Code: Select all

procedure TForm1.UnitextLoad1Execute(Sender: TObject);
var
  i, y, p, c, k, l, v, X, PikaSize: Integer;
  data: array [0 .. 1000000] of ansichar;
  pikauni: tmemorystream;
  filebuffer: array of byte;
  s: string;
begin
  for X := 0 to 87 do
    txt[X] := TStringlist.Create;
  if fileexists(extractfilepath(application.ExeName) + 'unitxt_e.prs') = true
  then
  begin
    fileuni := tmemorystream.Create;
    pikauni := tmemorystream.Create;
    pikauni.LoadFromFile(extractfilepath(application.ExeName) + 'unitxt_e.prs');

    SetLength(filebuffer, pikauni.Size);
    pikauni.ReadBuffer(filebuffer[0], pikauni.Size);

    fillchar(data[0], 1000000, 0);

    PikaSize := PikaDecompress(pansichar(@filebuffer[0]), pansichar(@data[0]),
      pikauni.Size);

    fileuni.Writebuffer(data[0], PikaSize);

    pikauni.Free;

    fileuni.Seek(0, 0);
    fileuni.ReadBuffer(idxcount, 4); // Read the top of the file
    fileuni.ReadBuffer(idx[0], idxcount * 4);

    k := PikaSize;
    fileuni.Free;
    p := 0;

    l := 0;
    for y := 0 to idxcount - 1 do
      l := l + Integer(idx[y]);
    if l > 2 then
      p := (idxcount * 4) + 4; // 296;
    for y := 0 to idxcount - 1 do
    begin
      txt[y].Clear;
      for i := 0 to idx[y] - 1 do
      begin
        pansichar(@c)[0] := data[p];
        pansichar(@c)[1] := data[p + 1];
        pansichar(@c)[2] := data[p + 2];
        pansichar(@c)[3] := data[p + 3];
        inc(p, 4);
        if c < k then
        begin
          s := '';
          s := PChar(@data[c]);
          while pos(#$0A, s) > 0 do
          begin
            v := pos(#$0A, s);
            delete(s, v, 1);
            insert('<cr>', s, v);
          end;
          txt[y].Add(s);
        end;
      end;
    end;
  end;
  IDNameL := idx[3] - 1;
  DSCL := idx[8] - 1;
end;
Post Reply