16
In the Dreamer Studio, composed of second-hand office equipment, we welcomed our first official day of development.
The air was still filled with the scent of cheap pizza and dust, but everyone's face was filled with excitement.
"Alright, guys, let's have a morning meeting." I clapped my hands, calling over Qian Duoduo, who was staring blankly at a digital tablet, and Lin Wanyu, who was lost in thought while wearing headphones.
I turned my laptop toward them; on the screen was the core design document for "extraordinary worker" that I had stayed up all night to finish.
"Our first step is to create a basic playable version, which is a 'Prototype'. This prototype doesn't need exquisite art or perfect music, but it must get our core gameplay running."
I pointed to the flowchart on the screen: "The core loop consists of three points: 'Work' to gain resources, 'Events' to bring variables, and 'Ending' to reach settlement. Duoduo, I need you to first draw the basic character models, a standard 'extraordinary worker', and a few simple scenes, like an office or a rental apartment. Also, design the UI interface simply for now, like health bars, money, and mood values."
Qian Duoduo made an "OK" gesture, his eyes shining: "No problem! The images of the 'balding' boss, the'slacking' colleague, and the 'PUA' supervisor are already having a party in my head!"
I nodded and looked at Wanyu: "Wanyu, for the soundtrack, I hope you can try to make some emotional music clips, like 'the joy of payday', 'the frustration of being scolded by the boss', and 'the ecstasy of an unexpected windfall'. Our game events are random, so the music will need to be dynamically spliced in the future; for now, you can just accumulate material."
Lin Wanyu listened seriously, sketching in her notebook, and then nodded gently at me: "Understood, modular music design. I will produce a few demos with different emotions first."
"Very good." I took a deep breath and assigned the final task to myself. "As for the rest—building the game framework, implementing the core logic, and integrating both of your work... I'll leave that programming work to me."
Qian Duoduo looked at me with admiration: "Brother, you even understand complex programming? This game isn't as simple as 'Plucking the Moon', is it?"
I waved my hand modestly and smiled inscrutably: "Just a little knowledge, just a little."
【Bullet Screen】: Here it comes! The Streamer's classic "just a little knowledge" segment!
【Bullet Screen】: Last time he had "just a little knowledge" of marketing (pyramid schemes), he beat many paid-poster companies and tricked a semi-retired independent music producer into joining; the time before that, he had "just a little knowledge" of art and entry-level programming and tricked the little chubby guy. This time he has "just a little knowledge" of complex programming, let's see how he handles this.
【Bullet Screen】: Don't bash him, the front row, The Streamer really did make 'Plucking the Moon' on his own! Although I think the code was written like a pile of sh*t...
【Bullet Screen】: 【Viewer "Code Reviewer" tipped "Liver Protection Pills" x1】! My heart aches for The Streamer's hair.
The meeting ended, and the studio immediately fell quiet, leaving only the sound of Qian Duoduo's pen tip rubbing against the digital tablet and the faint melody coming from Lin Wanyu's headphones.
As for me, I fell into a real hard battle.
The logic of 'Plucking the Moon' was very simple, almost a straight line. But the "rogue-like" gameplay of "extraordinary worker" involved a large number of random event triggers, numerical judgments, state stacking... its complexity far exceeded my imagination.
I used my amateur self-taught knowledge (although most of it was knowledge infusion rewarded by the system), writing and deleting, deleting and writing.
An hour later, I finally got the little character on the screen to move for "going to work" and "getting off work".
Two hours later, I added the "salary received" function, but a bug followed—no matter if he went to work or not, the money was crazily increasing automatically.
Three hours later, I tried to fix this bug, which resulted in the game crashing directly and refusing to open again.
I grabbed my hair irritably, sweat already starting to break out on my forehead.
The alien bullet screen in front of me had already turned into an ocean of joy.
【Bullet Screen】: Hahahaha! I knew it! The classic "I fixed one bug, but ten more appeared"!
【Bullet Screen】: The Streamer's method of bug-oriented programming is so retro, it makes me so nostalgic.
【Bullet Screen】: His code structure is so messy. All events are judged using if-else. If you add another hundred events, this code will be unmaintainable.
【Bullet Screen】: Actually, he should use an 'event-driven' architecture, make each event an independent script object, and then write an event manager to call them randomly. That way the coupling will be low.
【Bullet Screen】: The person above is right, but how do you explain what an 'integrated circuit' is to someone still living in the Stone Age?
"Event-driven... script object... event manager..."
I looked at these familiar yet strange terms floating in the bullet screen, lost in thought. I had seen these concepts in some programming tutorial videos, but never truly understood or practiced them.
Just when I was at my wit's end, a golden, bolded bullet screen floated by.
【Bullet Screen】: 【Viewer "Galactic Architect" tipped "Logic Flowchart" x1】! Stop using if-else! Here is the simplest design pattern for you, go learn what a'Strategy Pattern' is! Treat each of your work behaviors and each random event as an independent'strategy', and use an 'environment' class to call them! Idiot!
Strategy Pattern?
This word was like a lightning bolt, splitting through my chaotic thoughts!
I immediately went online to search for information on this design pattern. When I saw those clear class diagrams and example code, I was instantly enlightened!
So that's how it is! So it could be written like this!
Isn't this just putting a tangled mess of wires into separate little boxes, and then using a master switch to control them?
I felt the blood in my whole body boiling. I immediately deleted all the garbage code I had written before and, following the philosophy of the "Strategy Pattern", rebuilt my program framework from scratch.
I wrote until late at night.
Qian Duoduo and Lin Wanyu had long since left work; I was the only one left in the empty studio. I connected that precious server I found in the second-hand market to the power, and the humming of the fan became my only companion.
The next morning, when Qian Duoduo and Lin Wanyu arrived at the studio, what they saw was me with bloodshot eyes, but an exceptionally excited look.
"Brother, did you... did you pull an all-nighter?" Qian Duoduo asked cautiously.
"Come over, look at something good."
I called them to my computer and clicked the run button.
An extremely crude game window popped up. A pixel character stood in an equally crude "rental apartment".
I clicked the "Go to work" button, the character moved to the "Office" scene, the time at the top of the screen began to pass, and the amount of money slowly increased.
I clicked the "Slacking" button again, the speed at which the money increased slowed down, but a red "!" suddenly popped up above the character's head.
【Random Event: Leadership Inspection!】
【You are slacking off and were caught red-handed by the boss.】
【A: Sincere apology (Mood -20, Salary -100)】
【B: Pretend to be checking information (Judging... Judgment failed! Mood -30, Salary -200)】
Qian Duoduo watched, dumbfounded. He pointed at the screen and stammered: "This... this is already made? Didn't it keep throwing errors yesterday?"
Lin Wanyu also leaned over and adjusted her glasses. She saw the trick: "Your code structure... it seems completely different from yesterday. All events are loaded independently; the extensibility is very strong. This framework is built very beautifully."
I suppressed the urge to yawn and leaned back in my chair, acting casual: "Oh, I suddenly had some inspiration last night, so I just refactored it."
Qian Duoduo opened his mouth wide, looking at me as if looking at a monster: "Just? Refactored? Brother! You call this 'just a little knowledge' of programming?"
I smiled and didn't answer.
Only I knew that this so-called "genius inspiration" was nothing more than translating a "standard answer" from the stars and seas.
Watching their shocked and admiring expressions, I silently opened the game design document and placed a bright red √ next to the first item on the "To-Do List".
【√】 Core gameplay prototype.
