- Published on
Devlog #41 - 2023 Wrapped
Gem rewards will be sent out on January 1st for active patrons. Upgrade your Gamer tier today to make sure you get more Gems on January 1st!
Battle Pass #1 has been delayed until January 19th. On January 19th Elf Crafting will leave until next holiday season and Battle Pass #1 will be released. All active patrons on January 19th will get Battle Pass #1 for free via in-game mail.
For issues related to Patreon please DM me directly on Patreon.
For bugs in the game or website please post to #bugs on Discord.
https://discord.gg/fantasyonline2
To prepare for the Battle Pass window I decided to do the work I've been putting off. That work was to clean up, refactor, and speed up the GUI code. To do this I've been building my own core GUI components that replace most of what BabylonJS GUI offers. The problem with BabylonJS GUI is really that it is incredibly slow once you start adding several layers of controls that use their auto layout system. StackPanels are the worst offenders by far, especially if you use the adaptWidth/HeightToChildren options.
The main goal of this GUI work has been to seclude a bear minimum of BabylonJS GUI controls to one TypeScript file and I've done just that. So now we have a GUIControl, GUIContainer, GUIImage, GUITextBlock, and GUIScrollViewer being the only GUI classes that extend BabylonJS classes. Eventually I will write my own versions of those as well but that's a lot of work for another day.
While doing this GUI rewrite I decided to clean up the GUI and make a lot more of it pixel perfect.
Here are the bags showing of their new header left and right edges along with the pixel perfect placement of item slots. There are 4 pixels between each slot and 4 pixels separating all 4 edges of the windows from the edges slots.
Here is the new Barber window showing the pixel perfect centering of the hair selection container along with the newly redesigned scroll bar that doesn't have an outline anymore. The scrollbar now has a much slower scroll wheel speed across all scrollbars.
Here is the refreshed Quest window. As you can see, if the window does not have an exit button in the top right it will use the new top left and right corner images. Also, all basic "system" button code has been consolidated into one class now thankfully. This means all buttons that are red with yellow text should look and work the same. They highlight a bit when moused over and they shrink in scale when clicked.
The updated Collector window features pixel perfect spacing along with tooltips for the item icons and a new drag and drop look for the bottom of the window. It scrolls with zero lag on my machine thanks to the removal of StackPanels all over the GUI codebase. Eventually I will replace this code one more time with something that attempts to only render what's visible but for now we'll stick with the BabylonJS ScrollViewer as that code can take quite a bit of time to write and debug.
The Shop window is now pixel perfect with that same 4 pixel spacing found in bag windows for item slots. I also removed the slot icon from behind the item icon and changed the font to use the main FFF Harmony VX font for the price text. We currently have two fonts that are still in use. I've been working towards eliminating the font 8.ttf from use and we're almost there. I just have to remove it from the top left player info containers and from the top right currency/time container now. Then we'll only have to load one font file on startup which will make loading faster. The shop window also has the same new drag and drop bottom as the Collector window.
The Crafting window didn't need much of an update. It still looks pretty much the same as before but now runs on the new code. It still has some StackPanels inside it so I'll come back and clean it up in the future. Like all the windows, the window header title text now uses the bitmap version of the FFF Harmony VX font which greatly speeds up rendering.
This is what the bitmap font looks like. It's essentially the same font but packed into a png. It's called a bitmap font because bitmaps used to be used for these fonts when they were first used back in the dark ages of the 80s/90s. Although for some reason, the bitmap font creator app I've been using seems to export the font with thinner characters that what the ttf font file renders with BabylonJS. I'll have to investigate that some day so the bitmap font and the ttf font look the same on screen. So pairing this png file with another json file that gives the location of each character in the png let's us create text by putting cutouts of the png next to each other.
SkillBook window, Quest Log window, Mail window, Character window, and a couple other GUI elements have been moved over to the new system but will still need some love in the future.
So with the GUI in better shape I can move on to the Battle Pass GUI. That is after we design the Battle Pass MySQL tables.
So how should we define a Battle Pass?
Let's start with a base BattlePassDefinition.
CREATE TABLE BattlePassDefinition
(
Id
int(10) unsigned NOT NULL AUTO_INCREMENT,
DaysToFinish
int(10) unsigned NOT NULL DEFAULT '60',
XPPerTier
int(10) unsigned NOT NULL DEFAULT '2000',
PRIMARY KEY (Id
)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
We've got an Id, the number of days to finish, and how much xp is required per tier.
Then we'll need a BattlePassTierDefinition.
CREATE TABLE BattlePassTierDefinition
(
Id
int(10) unsigned NOT NULL AUTO_INCREMENT,
BattlePassId
int(10) unsigned NOT NULL,
Tier
tinyint(3) unsigned NOT NULL,
RewardType
tinyint(3) unsigned NOT NULL,
Reward
int(10) unsigned NOT NULL,
PRIMARY KEY (Id
),
KEY fk_battlePassId
(BattlePassId
),
CONSTRAINT fk_battlePassId
FOREIGN KEY (BattlePassId
) REFERENCES BattlePassDefinition
(Id
) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
This, like everything in MySQL, has an Id, the Id of it's parent Battle Pass, the tier number, the reward type id, and the id of the reward itself.
So what kind of reward types do we have? So far I have the types being item id, Gems, and quest id. We can add any kind of type we need in the future. So if the reward type is Gems then the reward is the number of Gems. If the reward type is item id, then the reward is the item id to give.
So now that we have the basics of a Battle Pass defined in MySQL table form we can add the first pass and add a few tiers. After that I load it onto the server just like all the other data.
So BattlePassDefinition and BattlePassTierDefinition define a Battle Pass but we need to actually keep track of active Battle Passes that people are currently progressing through.
BattlePassesActive table does just that.
CREATE TABLE BattlePassesActive
(
Id
int(10) unsigned NOT NULL AUTO_INCREMENT,
BattlePassId
int(10) unsigned NOT NULL,
AccountId
varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
StartTime
datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (Id
),
KEY fk_battlePass
(BattlePassId
),
CONSTRAINT fk_battlePass
FOREIGN KEY (BattlePassId
) REFERENCES BattlePassDefinition
(Id
) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
I'm still working on this table so it's a bit barebones at the moment but you get the idea. It's a per account instance of a BattlePassDefinition essentially. It still needs more things like XPGained and some more constraints but this is the general idea.
So when you use a Battle Pass consumable item in the game, the server will insert a row into the BattlePassesActive table with your account id, the battle pass id, and the start time.
It will then be sent to the client for you to view in the Battle Passes window. Next week I will have the GUI for the Battle Pass within the Battle Passes window to share but until then here's a blank window showing where they will go.
Once again we've had a few patches since the last devlog.
Patch Notes #20 - Santa Hat & Bugs
Patch Notes #21 - Elf Crafting & GUI Rewrite
Patch Notes #22 - Fireworks & Surgeons
Elf Crafting, elf NPCs, elf quests, elf shop will be leaving on January 19th until next holiday season.
Body Surgeon, Eye Surgeon, and Barber will be free forever. Premium versions of these will appear in later zones. Likely in New Crab City.
Quests now deal with moving items around, selling items, etc. They just don't deal with already existing items when the quest is accepted but I'll get to that eventually.
I've updated all the Patreon Membership descriptions to show how many Gems each tier gets every month. I've also decided to remove the limited capacity for Ultra Gamer and Double Ultra Gamer tiers. Now, the only tier with limited slots will be Triple Ultra Gamer.
https://www.patreon.com/posts/what-should-be-93301673
The January box will be coming mid January and it looks like the Pirate Box has won! This may end up being a January/February Box as Battle Pass #1 is taking up a lot of bandwidth.
The current 2 daily Gem Quests will be replaced with new quests in the next patch.
As 2023 comes to an end I've been planning work for 2024 Alpha Phase 2 which will run until early July 2024. I'll be posting a rough roadmap for Alpha Phase 2 on January 1st, 2024.
In this upcoming first week of 2024 I will be working on the Battle Pass GUI, Battle Pass server side code, Swamp Grotto drops, bugs, and more GUI tweaks. The Mirabella Cove map has made it's way to the test server so that will be next on the list after Swamp Grotto is finished.
We had a great and productive 2023! Here's to an incredible 2024!
See you soon!
Have Fun & Keep Gaming!