diff --git a/content/blog/2023/primoprod-progress-report-3.md b/content/blog/2023/primoprod-progress-report-3.md new file mode 100644 index 0000000..4a2288d --- /dev/null +++ b/content/blog/2023/primoprod-progress-report-3.md @@ -0,0 +1,134 @@ +--- +title: "Primoprod Progress Report 3" +date: 2023-12-29 +tags: +- tech +- primoprod +- featured +--- + +Welcome back to another one of these development posts! It's been almost two years since [the last one](/blog/2022/primoprod-progress-report-2), so there are plenty of changes to talk about. Primoprod is more polished than ever, but a couple of questionable initial design decisions made it harder to work on than before. + + + +## Pretty pretty pulls + +There's a summary screen for 10-pulls now! It has that nice slide-in animation from the base game too, along with (largely) proper item alignment and a sorting algorithm that is not exactly like the base game's but works well enough to generalise outside of Genshin too. + +The last step for this screen is to have the rush of particles in the base game for 4- and 5-star items, but that's incredibly difficult for someone not frontend-oriented like myself. + +![(SPOILERS FOR FONTAINE'S ARCHON QUEST) Hydro Dragon acquired!](primoprod-10pull.webp) + +Not only that, there are lots of small improvements to better mimick the base game! For example, weapons now have their weapon background behind them: + +![What a beautiful sword.](primoprod-weapon-bgs.webp) + +Banner headers are now dynamically generated instead of taken from screenshots, so now they can be nicely animated! + +![No more screenshots >:(](primoprod-banner-headers.webp) + +Version 3.0 of the base game brought a new book UI for the details and wish screens. I'm proud to announce that Primoprod was the very first simulator to incorporate it into its design! + +![](primoprod-book.webp) + +## Performance and prefetching + +These are only a few of the design changes that make Primoprod a prettier and happier simulator. However, beauty means nothing if no one can see it. Luckily, update 1.2.2 of Primoprod brought some much-needed optimisations that make its web version much more palatable. + +As of writing, Primoprod has around 75 MB of assets that it may need to show to users, the bulk of which is wish splash art. Previously, all of this was delivered as PNGs on demand, which resulted in noticeable lag waiting for the image when going through 10-pulls. By converting media to more modern formats, Primoprod gains nearly a *5x decrease in load times!* + +Specifically, all PNGs were converted to WEBPs, MP4s to WEBMs (except for Safari, which doesn't support it), and MP3s to OGGs (except for Safari, which doesn't support it). + +But that's not all! A 5x decrease in load time is still noticeable load time. The user doesn't want t to wait a few hundred milliseconds when they click the wish button, so we need as little latency as possible. + +As it turns out, fetching the wish animation videos while the user is chilling on the main banner screen is both incredibly easy and incredibly rewarding — as long as the user doesn't wish right away, they can download the videos in the background so that when they start gambling, they don't have to wait at all! + +Primoprod uses this same tactic to prefetch pull splash screens. Because rolls are determined the instant the user presses "Wish", it can prefetch the splash images required while the meteor animation plays, which means that splash screen animations are also instant! With a sufficiently fast internet connection (~1-2 MB/s), there ends up being *zero load time* for the user. + +Of course, the downloadable versions of Primoprod (desktop/Android) will still always be faster, but this is such a noticeable decrease for users that it was a no-brainer. + +## Quash the larvae before they hatch + +### Oh, you sweet summer child + +Things have changed a lot in the web development landscape since I began this project back in July 2021, and those changes have highlighted both the bad and the good in my initial designs. + +I chose to use TypeScript and Vue 3, both decisions that hold up today. However, I opted for Vue's Options API over the new Composition API, which resulted in [a headache](https://github.com/potatoeggy/primoprod/pull/54) when I tried to read my old code — not helped at all by the fact that Primoprod was my first foray into web development, and there is some truly atrocious code: + +```vue + +``` + +Another issue I didn't foresee but still ended up to be a real pain was Webpack. [Vite](https://vitejs.dev/) is the new kid on the block, built specifically for Vue, with the major advantage of being extremely fast. At Primoprod's scale — and Primoprod isn't even that big of a project — Webpack takes more than ten seconds to start the local dev server. Which is slow! + +``` +Done in 12.38s. +yarn build 57.47s user 9.66s system 535% cpu 12.528 total +``` + +### You will never take prop drilling away from me + +Behind the scenes, a lot of systems have been tweaked and changed over the years as Primoprod grew in scope. [Pinia](https://pinia.vuejs.org/) is a global store for Vue (similar to Redux in React) that Primoprod now uses to hold information such as the current banner, inventory, and settings. + +Previously, all of these were drilled deep into nested components, which is really not great. + +What *you*, the user, gets out of this are a bunch of bug fixes and some really nice quality-of-life features: + +![Why earn gems when you can just cheat?](primoprod-settings.webp) + +Now you can choose to have infinite fates! And roll only Qiqi! And even go back to older banners, a long-overdue feature. + +### Quests + +Quests have been rather neglected since their release pre-1.0 a couple years ago, largely because I no longer use it to stay productive. Recently, they've received some love and a *lot* of patches to fix some really strange behaviour. + +![](primoprod-quests-overhaul.webp) + +First, there is a character limit in the title, and the box height has been slightly increased to allow multiline titles to properly overflow. Daily commissions now have icons to make it more obvious and also to copy the base game. Lastly, a bunch of bugs related to lists and quest ordering were squashed to avoid the janky horror that was pre-1.4 quests. + +### For the mobile gamers in chat + +Primoprod's mobile version has received the most love of all! Strangely, in WebKit-based engines (Chrome, Safari, Android WebView), using `background: fixed` with `transform: rotate(...)` causes the browser to ignore the `background-image` property. This broke mobile backgrounds on everything but Firefox Android, so that needed to be worked around. + +On Android, things have tidied themselves up a bit as Primoprod comes ever closer to being able to fool the untrained eye. The notification bar used to annoy people by being ever present in the corner — now it's gone. There used to be a strange black flash right before playing videos — now that's gone. And video playback used to be very squashed on mobile — that's fixed too! + +All in all, the squeaky platform got the grease. + +## The future + +As Primoprod approaches its two-and-a-half-year anniversary, it is slowly time to say goodbye. Updates have become more sporadic, and even I don't use it to be productive anymore. There is only so much one can polish something before it starts to blind them. This progress report may be its last. + +But it was fun while it lasted! \ No newline at end of file diff --git a/content/stories/shorts/illusion-of-solitude.md b/content/stories/shorts/illusion-of-solitude.md new file mode 100644 index 0000000..037bba5 --- /dev/null +++ b/content/stories/shorts/illusion-of-solitude.md @@ -0,0 +1,297 @@ +--- +title: "Illusion of Solitude" +date: 2023-12-29 +tags: +- birdseye +- featured +--- + +**Summary:** An old bluebird takes her grandson human-watching in Vancouver. This time, they find a young child dealing with grown-ups who just don't understand. + + + +--- + +Keep to the left. Mind the seagulls. We're approaching the coast. Those bastards appear far too often. One of the only reasons why there isn't a permanent bluebird population in Vancouver. + +We've almost reached our destination. I suppose we could fit *one* more experiment here. Reach out to one last human. For this last one, how about you pick? You've seen me do it a couple of times. If you need assistance, I'll be right here. + +That building? That could be anything. If I were to guess, judging by the number of residential buildings in the area, that might be a school. Good timing. School should be in session by this time in the morning. + +Ah, these are younger children. Perhaps no older than two hundred times your age. An excellent choice, any of these. I don't believe we've watched any humans so young. It'll be more difficult, though. Usually you see their parents hovering around them when they're so young. Perhaps not at school, but once outside the compound, humans become fiercely protective of their young. Like no other species I have ever seen. + +These particular children over here playing outside. Mind the adult. If he sees you, he'll chase you away and keep a more careful eye out. They must be in recess from learning. + +Which one do you like the most? The one talking to the wall in the corner away from all of the other children? You have good taste. + +"Zoe, do you want a cup of tea? Here. I made it nice and cold for you. Do you like it?" + +She is truly talking to the wall with nothing in her hands. Is the wall named Zoe? + +"Ruth, are you talking to nothing again? Why don't you play with the rest of the kids?" + +"Mrs. Pernumble, I'm having a tea party with Zoe! And *you're* not invited. So go away." + +"Right. Zoe. Your…" + +"My friend. She's waving at you. Oh — be careful, Zoe! You'll spill the tea if you wave your hand like that." + +I do not see a child waving with a cup of tea. + +"I…see." As a trained expert in recognising human patterns and mannerisms, I, Elizabeth von Turdidae, can attest that the woman is lying. Kindly lying, but lying nonetheless. + +"Surely Zoe wouldn't mind if you spent a few recesses playing with Jeremy and Sheila. Doesn't it sound fun to play soccer? They're all laughing in the field. It sounds to me like they're having the time of their lives!" + +Children are such mysterious creatures. This one might be staring daggers into the woman. "I can't leave Zoe here. She doesn't like soccer. And she gets scared without me. And I haven't finished my cup of tea!" + +I would like to re-attest that there is, in fact, a lack of any tea or anything resembling tea in the immediate vicinity. + +"I could keep Zoe company. She's got a lot of questions for me, right? So perhaps we could have a conversation while you play soccer." + +"I don't think so, Mrs. Pernumble." + +"Why not?" + +"Because you haven't said a word to her and now she's very upset. It's okay, Zoe. I'll never leave you. Have another cup of tea." + +I know that I'm getting along in years, but I *do not* see a human child. Several worm children that look very tasty, yes, but no human child. Or tea. Do you see a human child? + +Where is it? + +Interesting. Perhaps this is a special human child. I have not known any human child that could hide themselves from other people, but humans still have plenty of surprises in them yet. + +…But where's the tea? + +"Oh, Ruth. Please. I'm sure the other kids would love to play with you. Can I tell you a little secret?" + +"La la la I can't hear you. Can you hear a Mrs. Pernumble talking, Zoe? Yeah, me neither. Oh, thank you for the biscuit! Let me refill your tea again. You're a fast drinker!" + +Heh. If there's one thing that is common between humans and bluebirds, children exasperating elders is universal across species. + +Although I certainly wouldn't sigh and walk away like her. No, misbehaving children must be punished so they don't do it again. + +"Thank you for the biscuit, Zoe. Have you heard from Miss Piggy recently? I heard that Miss Froggy and her had the most delicious of teas the other day. Mm. You're right. That *is* very interesting." + +I must admit, it is rather strange to watch a conversation happening with a human I cannot perceive in any way. I hope you're learning more than I am. + +"Um, Ruth?" + +That sigh does not belong on a child her age. How adorable — perhaps she thinks that if she's as petulant as one, others will see her as an adult. + +"I'm *so* sorry, Zoe. I know you don't like it when our tea parties get interrupted. What *is* it, Peter?" + +"Who are you talking to?" + +"Zoe, of course. My best friend. She says hi, by the way. Now, get to the point. What do you want?" + +Ha! Another victim of Zoe's invisibility! He looks so confused — oh, my sides. + +"Mrs. Pernumble said that maybe you wanted to play with me and Alfred over there? We're playing cards." + +"Oh. She — um. I… I can't. Zoe needs me to keep her company. She doesn't like it when I leave her alone." + +"Who? I don't see her." + +"I *told* you, Zoe's my best friend. It's not *her* fault that you can't see her." + +That hesitant wave — the worm on top! Glorious. I might have to start observing the younger humans more. They're such a racket! Two inexperienced creatures learning about the world. + +"Are you sure she's real?" + +"Of *course* she's real! Say sorry to Zoe, right now! I can't believe you'd say that. I'm sorry, Zoe. He didn't mean it. He just doesn't know better. Right?" + +"Uh, I'm sorry!" + +"Zoe's over *here*. Look at her properly when you say sorry." + +"…Sorry." + +"Hmph. She says she forgives you this time." + +"If she wants, she can play with us too?" + +"Nah. Zoe doesn't like cards." + +"Okay then. If she doesn't want to. Bye bye." + +"Bye bye." + +My scientific mind is racing at the possibilities. The child couldn't see her. The human couldn't see her. I can't see her. What are the criteria for who can and cannot see Zoe? + + + +------ + + + +"Be sure to finish the letters worksheet — I expect to see perfect 'A's from everyone! Now, children, fetch your bags — it's time to go home!" + +The chatter of children after school is the same regardless of their age. It's always so relaxing to immerse oneself in the wave of conversations taking place left and right. + +"Sheila, Sheila, are you still coming to my house after school?" + +"I got this super cool fire truck for my birthday! Leo, you gotta bring your cars!" + +"Nooo! My mom grounded me. You have to beat the boss without me, Dylan! You have to!" + +"Come on, everyone. Less talking, more moving! Once you've changed into your outdoor shoes, line up against the wall outside the classroom!" + + + +------ + + + +Well done, child. You're following your humans quite well. I barely had to help you at all. + +"How was school, honey? Did you learn a lot of new things?" + +"We learned about the alphabet! I can draw lots of little 'A's now. Today we learned about the big 'A'." + +"Hey! It's my favourite kiddo! Ruth! Ruthie. Beat up any boys today?" + +"Zoe almost. Hmph. Peter was being mean to Zoe. I feel so bad for Zoe, daddy. No one understands her and they're all so…so mean to her!" + +"There's cookies and juice for you on the dining table, Ruth. Make sure to wash your hands." + +"Aw, that sucks. Does Zoe want a glass of orange juice, too? Maybe it'll help her feel better?" + +"Daddy! Zoe is *allergic* to orange juice, remember? I told you *yesterday!* She'll have her unicorn hair tea like she always does. Mommy, can I eat my cookies upstairs? Me and Zoe are having a tea party again." + +"All right, but don't spill any of the crumbs! We don't want ants moving into our house, don't we?" + +Oh! How unfortunate. Child, I must interject — allergies are new to you, yes? Bluebirds don't particularly have the horrid disease. If some humans — and it's impossible to tell which humans before they actually eat it — eat certain foods, like peanuts! Or fruits, or nearly anything — they could *die*. That's called an allergic reaction. + +To have an allergy toward a fruit — truly a pitiable existence it must be. + +"Tea party time! Zoe, here is your unicorn hair tea. Freshly stirred! Only the best for my best friend. Oh, thank you! Yes, I'm doing great. Can you help me with my homework after this? You're always so good at drawing those weird lines. Mrs. Prenumble says that they're part of letters, which are part of words. + +"Zoe… Why does everyone hate you so much? They never want to talk to you. Even Mrs. Prenumble. They all pretend that you're not a *real* person. But don't worry. *I* know that you're real. No matter what everyone else says. You're my best friend, right? I can't leave you alone. If you want, I'll stay with you, forever and ever! + +"Will you also stay with me, forever and ever?" + +Human children. So adorable! Already forming pacts for life in the tender young stage of pre-adolescence. + + + +------ + + + +Finally some change. Pardon me, but I can only listen to a child have a multi-hour tea party go on for so long before even *my* patience wanes. Let us investigate the commotion at the door. Ooh. An older boy. A family! Human families are so small. Their babies don't die nearly as often as bluebird babies, but there are just so few of them in the world. I suppose that explains the parents' protectiveness. But if they want their children to succeed, why don't they simply have more children? That would maximise the probability of successful children reproducing in the future. + +"Mom, dad, I'm home." + +"Welcome home, Jacob! Dinner will be ready in just a minute. Could you call Ruth downstairs from her room?" + +"Hey, kiddo! How was school? Beat up any girls today?" + +"Oh my god, you can't *do* that, dad!" + +"Hmph. All these fancy schmancy new norms are stifling. Back in my day, you could hit whoever you wanted, and the other guy would just hit you back! None of this 'no hitting girls' nonsense." + +I knew that humans discriminated between their sexes, but I didn't realise that they couldn't hit females. All kerfuffle and waffle, if you ask me. If someone has wronged you in any way, giving them a good knock in the old noggin is always an excellent first move. Really sets the atmosphere for a full-out fight. + +"They're weaker, so it's not fair. They can't hit back, so it's up to us men to show other men who's boss." + +Nonsense! Excuse *me?* I don't know about *humans*, but female *bluebirds* pack a pretty punch in their wings. It's true that males usually only fight males and females usually only fight females — because, let's be honest, why would a female ever need to fight a male? — but I did not realise that there was *no* cross-sex combat in human world. Strange, too. I could have sworn that I'd seen human males fighting human females multiple times over my many years. + +"Son, maybe the times are changing. And I respect that. But no matter what happens, never lose that fighting spirit. Can't fight the girls? Fine. There's still a good half of the population you can beat some sense into. Now, if they say that *fighting is bad* and that *no one should do it* or whatever? That's when you put your fist down and screw the rules. Let no one tell you what you can or can't do." + +"I'll do my best, dad!" + +"I know you will, son. Make me proud. Nothing like a good fist to the noggin to help loosen any lips." + +Wonderful parenting. *This* I can get behind one hundred percent. I know I have a lot of negative things to say about humans, but in reality, they're so diverse that there are so many different viewpoints to learn from. There are some that are objectively wrong, some that are objectively right, and then most are in the middle. It's rather refreshing to have one's opinions validated every once in a while. + +And what camaraderie! Certainly bluebird children are never so close to their parents. Or their grandparents, for that matter. + +"Now bring Ruth downstairs like your mom said, will you?" + +"Yessir! Ruth!" + +"You might have to go upstairs to bring her down. I think she said that she was having a tea party with Zoe again." + +"Zoe? Ugh. How long are we gonna entertain her, dad?" + +"As long as she wants." + +"Hmph. Ruth! Open up! Mom says it's time for dinner!" + +I wonder why she isn't responding. Drat! If only we could be invisible and incorporeal like Zoe must be, so we could position ourselves *in* the door and see both sides of the conversation. Having to move around to the back of the house just to see the hallway is *so* irritating. + +"Ruth! If you don't say anything, I'm coming in in three…two…" + +"I'm having a tea party! Go away, Jacob." + +My. She sounds aggravated. What kind of dirt landed on her head while we were away? + +"I'm not gonna wait here for you to finish your prissy tea party. I'm comin' in!" + +This is actually quite nice. It means if we circle around to the other side of the house, we should get a nice and proper view of everything that is happening. + +"HEY! I didn't say you could come in! Zoe doesn't like you, you know. She says that you're big and fat and dumb and stupid for interrupting her tea party. Get out." + +"Oi. I just came to pass on a message. Why do you have to get so pissy?" + +"This is *my* room." How funny. Ruth trying to push Jacob out of her room. Certainly it isn't happening unless it's under his own volition. Valiant effort, though. I would applaud like the humans do if I had hands. "Can't you read the sign? It says NO JACOBS!" + +"Do you even know how to read?" + +"Shut *up!* Zoe said that you can't be here, and that means you can't be here! Zoe needs her time to herself. She's has a very tiring day and she needs her tea and biscuits —" + +"Zoe this and Zoe that. Jeez, don't you have any *real* people to back you up?" + +Oh. That one might have hit her harder than him slamming the door open. What is that expression on her face, I wonder? + +"Yeah? Don't have anything to say, dontcha? I wonder why?" + +"Say sorry to Zoe right now. She's my *best friend."* + +"Oh my god, Ruth. How are you still so stuck on her? Zoe's not real! She's in your *mind!* She's one of those *imaginary friends!"* + +Certainly not. I find it rather unlikely that the human adults and the human children spoke to her if she wasn't real. That Mrs. Pernumble or whatever it was wanted to have a conversation with her, too. + +However, judging by the blankness of Ruth's face, she might believe him. + +"No." + +"Yes." Rather gleeful of him. "You're *imagining* her. Probably because no one likes you enough for you to have *real* friends." + +"That's not true. Shut *up.*" + +"Oh, yeah? What's her favourite colour?" + +"Yellow!" + +"What's her favourite food?" + +"Unicorn hair tea with rainbow biscuits!" + +An eyebrow raised. In his defense, I didn't think that those were real either. But it makes sense to me. What else would an invisible person eat? Oh! It just clicked for me. That must be *why* she's invisible! All of these exotic ingredients must have an effect on the body that makes her difficult to perceive. And Ruth must be consuming enough that she can perceive her but not turn invisible herself. + +My cleverness and intelligence scare me sometimes. But I digress. + +"What's her last name?" + +"It's! Um…" + +"Where does she live?" + +"I… She must have told me…" A fearful glance to her right. Is she losing the fight? Come on, how difficult could it be to prove that a human exists? + +"Exactly. What does she do when she's not with you?" + +"…Stop it…" Hm. Personally, I would prefer physical combat over verbal combat. Not nearly as emotionally messy. Much easier to know when the damage is done and when they've learned their lesson. Most importantly — much easier to restrain oneself. I suppose she's been thoroughly beaten. Her father will be proud — Jacob finally beat up a girl. + +"When did you meet her?" + +Oh? + +"When grandmama went home! She's *real*, Jacob! I *know* I met her. She was outside on the swing outside grandmama's house when the sun was setting and I was sad and we went on the swing together and we were friends ever since. Zoe's *real!"* And here comes the crying. If she was sobbing before, she's bawling now. + +Hm? Why isn't he saying anything else? Are tears so effective against physical and verbal combat? He seems shocked. How could this be surprising? Bluebirds meet new bluebirds all the time. Is this not true for humans? + +"Jacob. Come over here, please." Oh, my. All of the tension in the air and I didn't even notice the mother in the doorway. + +"Oh! Um. Mom, I can explain. I was just…" \ No newline at end of file diff --git a/public/images/posts/primoprod-10pull.webp b/public/images/posts/primoprod-10pull.webp new file mode 100644 index 0000000..36517d6 Binary files /dev/null and b/public/images/posts/primoprod-10pull.webp differ diff --git a/public/images/posts/primoprod-banner-headers.webp b/public/images/posts/primoprod-banner-headers.webp new file mode 100644 index 0000000..c65d530 Binary files /dev/null and b/public/images/posts/primoprod-banner-headers.webp differ diff --git a/public/images/posts/primoprod-book.webp b/public/images/posts/primoprod-book.webp new file mode 100644 index 0000000..7cb1a33 Binary files /dev/null and b/public/images/posts/primoprod-book.webp differ diff --git a/public/images/posts/primoprod-quests-overhaul.webp b/public/images/posts/primoprod-quests-overhaul.webp new file mode 100644 index 0000000..6c05ffc Binary files /dev/null and b/public/images/posts/primoprod-quests-overhaul.webp differ diff --git a/public/images/posts/primoprod-settings.webp b/public/images/posts/primoprod-settings.webp new file mode 100644 index 0000000..4a3966a Binary files /dev/null and b/public/images/posts/primoprod-settings.webp differ diff --git a/public/images/posts/primoprod-weapon-bgs.webp b/public/images/posts/primoprod-weapon-bgs.webp new file mode 100644 index 0000000..d265c44 Binary files /dev/null and b/public/images/posts/primoprod-weapon-bgs.webp differ