- Published on
Devlog #2 - Items
Items are one of, if not the most, important part of an MMORPG, so let's make a system that's really versatile this time around.
In FO all items were set in stone. They had their stats and that could never be changed. In FO2 items will be augmentable. This means certain items will be able to be enchanted, some will drop with random stat boosts, craftable items will have their crafter's name attached, and much much more.
When we talk about items in games there are two parts to an item. The first is the item's definition which is all the parts that are set in stone like the name, icon, level, etc. The second part is the item that you actually loot in game, an instance of an item definition. In FO, item instances were only unique to players. This means that when you loot an item you get an item instance in your inventory, then if you put that item instance on the market it is deleted and a new item instance is placed on the market. When someone bought the item on the market, the market item instance is deleted, and a new item instance is placed in the buyers inventory. In FO2 all item instances will be unique to the entire game world. When you loot an item instance in FO2 that item will keep it's unique identifier throughout it's life in the game. This is what will allow things like the crafter's name to be added to an item instance.
So to sum things up, FO2 will have game wide unique item instances that can be augmented in many different ways. So what will the base item definitions look like for FO2?
Here is the FO2 item definition design so far:
Name
Description
Icon
Quality - AKA Rarity
Level requirement
Stat requirements - If it requires armor, a faction reputation level, strength, etc.
Binding type - Whether or not an item is bound to the player after equip/loot/etc.
Slot - Which slot, if any, the item can go into. (Weapon, armor, etc)
Stats - If it adds to armor, agility, stamina, if it's part of a set, if it has sockets, if it's consumable, etc.
Stack size
Vendor buy for price
Vendor sell for price
This may be added to or removed from, but this is a good place to start.
I split off Name and Description into their own separate MySQL table so that we can actually support localization this time. And voila the MySQL tables are done and the Java loading is done. Item definitions on the server are now ready and come with a translation table. Nice! And since all that data is now in a nice Java class we can convert it to json and send it on over to the client.
This leads to a new issue, does the client need to know about all item definitions all the time? In FO item definitions were sent with item instances. In AO the client had all the item definition data built into it. In FO2 we're going back to only having item definitions on the server and we will send that info when we need to. This will make the client a smaller download, will cut down on maintenance, and it will allow for changing items and their translations without updating the client. So when a player logs in it will send over all their item instances across their bag, bank, etc and then it will compile a list of item definitions that are needed and send those over too. In situations like looting or the market, item definitions will be sent along with each item instance that is displayed.
So let's go ahead and add a Pointy Stick item definition to the server database and then add an item instance of the Pointy Stick to our player's main bag at slot 0. I also needed to write the code to populate the bag using item instance data.
And there it is, our old faithful Pointy Stick. Few things are better than one of these in the eye. Marshmallow upgrade extra.
I've even gone ahead and increased the size of item icons to 48x48 from 32x32 in the original. This will likely change as time goes on and we feel out what the right size is. Who knows, maybe it will even be customizable?
Now what about noob storage?
We also shouldn't be adventuring without a Fanny Pack. Would you rather call it a man-purse? Would that soothe your insecurities?
And there we go, we've got item definitions, item instances, they're stored on the server, they're sent to the client, and they're displaying in the main bag. That's some huge progress. It helps I've done this several times before. This would be months of work if I didn't already know how to do it.
Next we need to be able to move these items around from bags, to equip, to banks, and more. This part will actually require a lot of tricky code both on the server and the client so it will likely take a large part of the upcoming week. I'll likely also get to tooltips, the start of the character equip window, using custom fonts, window headers with titles, the top left player info display, and maybe even the shop window.
On the Patreon side of things, I've added new benefits to the Gamer tier.
"Patrons that join before early access launch will receive multiple of the first exclusive item. The number of first exclusive items received will be equal to the number of months as a Gamer tier Patron.
Also, starting sometime in March 2023 you will be able to reserve one username that will be used in-game for your first FO2 character! All usernames will be unique, so make sure you secure yours as soon as possible!"
Check back next Tuesday to participate in our first Patron exclusive poll!
Have Fun & Keep Gaming!