Chapter 91

I like getting things for free

Chapter 91 I like getting things for free

When Pac-Man incorporates AI technology, how should the game proceed?

Ethan didn't know.

But when Evelyn pulled him into the garage of their new home, which was also the girl's new base, the girl, who had spread out design blueprints on the workbench, already had an idea. "Ethan, we can slowly make things like levels, scores, models, and rewards. But we must consider these four intelligent ghosts first, because I think that without them, the whole game would have no soul."

Ethan agreed with this view.

With his nod of agreement, Evelyn smiled and said, "Shall we start with the creation of the ghosts? My first question is, in your inspiration, what common patterns do these four ghosts share?"

"Because once the common mode is determined, the relevant code can be directly copied."

Ethan felt he understood, but not entirely.

What you mean by "understanding" is simply copying.

There's no way around it; in his past life, there were just too many jokes about programmers copying code.

As for not understanding...

"Oh Evelyn, I'd like to know what you mean by 'common mode'?"

Ethan asked decisively.

"Common patterns? This actually refers to whether there are any commonalities in the behavior of the ghosts in your design?"

Since Ethan didn't understand, Evelyn patiently explained, "For example, four ghosts chasing the player is actually a common mode, but in our case, the term 'common mode' doesn't apply because you've given the four ghosts different characteristics."

"You set the Red Ghost's characteristic to be direct pursuit, so when writing the code, its characteristic is to calculate the shortest distance between itself and the player in real time, and then keep moving along that path."

"You set the Pink Ghost's characteristic to ambush the player. So when writing the code, the calculation method is to calculate the player's position in real time, and then determine some pixels forward according to the player's facing. Then, turn this virtual target that the player may move towards into the ghost's destination, and make the Pink Ghost go to this location. At the same time, every time the player moves, the Pink Ghost's forward position will also change."

"The feature you set for the blue ghost is to cooperate with the red ghost to surround and trap. In this case, the player's location must be identified as the center point, connecting the red ghost on one end and the blue ghost on the other. In this process, the red ghost's movement path must be calculated first. If it moves horizontally, that is the X-axis; if it moves vertically, that is the Y-axis. In this case, the blue ghost's movement path must be symmetrical to it to create a right-angle intersection. When the right-angle intersection appears, the encirclement effect you want can be achieved, and the blue ghost can hunt down the player in a pincer movement in the game."

"For the last orange ghost, your design feature is to guard. So when writing the code, its feature is to guard near the spawn point, and set a detection radius centered on it. When the player enters the radius, the orange ghost will calculate the shortest distance and start chasing. When the player leaves its detection radius, the orange ghost will stop chasing until the player reappears."

"Because their pursuit patterns are different, we can't call the ghosts' pursuit a common pattern. Conversely, if the ghosts' behavior patterns are exactly the same, then these codes are..."

Evelyn drew out her voice.

Ethan nodded knowingly and added, "It's common."

"Bingo!" Evelyn snapped her fingers with a laugh. "So... in your opinion, what are the common patterns?"

Evelyn had already made herself so clear, so it was much simpler for Ethan to describe it.

Although he had only played the game "Pac-Man" in his previous life and had not tried to make it, the common patterns of the four ghosts were still very easy to identify, such as running away and being caught.

First, the so-called escape is when the player character eats the glowing beans in the four corners of the map, which gives the ghost a debuff.

When the player eats the glowing bean and becomes invincible, the four ghosts will enter a state of fear and hiding. This is because at this time, the player's character can kill them. Thus, changing color and running away becomes a common pattern for the four ghosts.

Second, being caught, this refers to the ghost's death state after the player eats it while invincible.

In Pac-Man, ghosts can be resurrected after death, but they must return to their lair in the middle to regroup.

Therefore, this process is also a common pattern among the four ghosts.

To be honest, although Ethan had written a lot of content before, this kind of segmented analysis was not actually on the draft paper.

Therefore, when he recalled the common pattern of the four ghosts under Evelyn's questioning, Evelyn quickly wrote it down.

Meanwhile, Evelyn's mouth didn't stop, and she kept saying, "If you break it down, the escape mode is a behavior where the four ghosts detect the disappearance of any one of the four glowing points on the map, and then they start running in the opposite direction..."

"Being caught means that the four ghosts overlap with the player character at the same coordinates on the map during their escape. This needs to be distinguished from the ghosts capturing the player, because the coordinate detection is interconnected and cannot be wrong. So... add a time detection? For example, if a ghost overlaps with the player for a period of time after the glowing point on the map disappears, then it means being caught?"

Watching his sister's figure as she diligently wrote, Ethan felt a pang of emotion.

When he decided to make Pac-Man, he never expected that the game would be so difficult.

Should the judgment be written separately?

This workload is just too much!

But at the same time, a sense of curiosity also arose in his heart.

"Evelyn," he called the girl's name.

"Huh?" the girl answered instinctively.

Can I ask you a question?

"explain."

"I want to know, why did you choose time-based detection for the determination of whether someone has been arrested?"

Ethan asked doubtfully, "In my design, when a player eats a glowing point, the ghost will have a negative status effect, and it will also change its appearance. So, can't we set the detection to be the change in appearance? When the player touches a ghost whose appearance has changed, the ghost will die. Doesn't this logic work?"

"Of course." Evelyn understood what Ethan wanted to say.

However, she also explained, "But with this setup, there's a problem with the game's detection. Suppose a player collides with a ghost that has a negative status effect, and the ghost's negative status effect just disappears, how should the game determine that?"

"The ghost will determine that it has no negative status, while the overlapping code that collides with it will determine that the ghost has a status."

"Because these two codes are calculated simultaneously."

"In this situation, did the player eat the ghost, or did the ghost kill the player?"

"The machine can't calculate it."

"This kind of crude judgment without regard to priority may cause problems in the game's judgment. Therefore, I think the best anchor point for detection is the time with the highest priority. With this setting, the code only needs to judge one variable and is less prone to errors."

So that's how it is?

Ethan understood.

"Wouldn't that mean we'd have to write less code?"

"Of course," Evelyn nodded. "After all, our memory is limited; if we can provide 4K, we definitely can't provide 8K."

"Adding a little more would mean an increase of more than thirty dollars in cost."

Good grief! This is considered cost?

Ethan was shocked.

But Evelyn's confidence reassured him quite a bit.

Through their conversation, the two of them had already analyzed the AI ​​of the four ghosts that very night.

The next day, Evelyn stayed home and tried writing code.

To be honest, if it were any other game company, the production progress of a game like Pac-Man that requires writing code would not be very fast, because the penetration rate of personal computers in the market was quite low at the time.

Even if those commercial companies wanted to jump from circuit board arcades to CPU arcades, they would first have to purchase personal computers and then hire engineers who knew programming to make games.

In this process, they may also encounter problems such as the unreliable joystick computers like those on Altair, as well as various issues related to CPU compatibility.

As for Ethan and his friends...

There is absolutely no such concern.

Because Evelyn's personal computer was an Apple 1 that Steve Wozniak had handcrafted and given to Ethan.

Moreover, the MOS 6502 is their own product.

When the inventors of the CPU, the most important component in game development, and the inventors of the personal computer, who provided the production tools, can be found so easily, Ethan really can't imagine who in this world could stop him from making Pac-Man.

Especially after he called Chuck Patel to inquire about the MOS 6502's encoding language, and Patel faxed over the 151 opcodes and 56 instructions in less than an hour...

Even though Evelyn had never used MOS 6502 before, she was able to quickly get the hang of it by looking at the instruction set.

When Ethan called Steve Wozniak to add a disk interface to his Apple 1, Wozniak had all the external devices ready for him in less than three hours…

Evelyn doesn't need to worry about losing the data.

Of course, Ethan's call also piqued the curiosity of the others.

Chuck Patel asked him on the phone if he had any new ideas.

Ethan smiled and agreed, adding that he would send him a portion after he finished.

Steve Wozniak, on the other hand, was more direct, wanting to see Ethan's inspiration.

Although this did not comply with the rules for protecting trade secrets, Ethan agreed anyway.

After Steve Wozniak finished reading it, the chubby boy became extremely excited—

"Oh! Sxxt! Is this your inspiration?"

"Oh my God! This design makes me want to play with it!"

"How about you include me in the game development team?"

"I don't want money! I just want to make it!"

"I'll take charge of any project you want! Whether it's writing the path for the four ghosts, designing the basic panel, or creating the map and levels, I can handle it all!"

"real!"

"I'm incredibly good at coding!"

Ethan was overjoyed by the suggestion, and Evelyn was happy to have someone share her workload.

So, on the first day of game development, the Pac-Man team grew from two to three people.

On the same day, Steve Wozniak, the chubby guy, discovered a problem as soon as he started working.

"Ethan, Evelyn, didn't you forget something?"

"Because in your design, the four ghosts, like the player, all start from the small house in the middle of the map. However, only the red, pink, and blue ghosts will relentlessly pursue the player, while the orange ghost will monitor the area."

"So, when the game starts and the player runs out of the middle, three ghosts will chase after them after the gate opens, while the fourth orange ghost will just wait in the middle. Wouldn't that make it very easy for the player to avoid it?"

"My suggestion is that, if possible, it should also come out of the haunted house and move along the walls of the maze at regular intervals. For example, if the difficulty is low, it could move for 30 seconds, then advance for 10 seconds and rest for 30 seconds. If the difficulty is high, could it be changed to 20 seconds? Or 10 seconds?"

"We could make it a wandering, aimless creature that would fiercely hunt down players when they enter its range. Wouldn't that be more engaging?"

This suggestion left Ethan stunned.

Although he didn't know if the orange ghost in Pac-Man was designed this way in his previous life, it didn't matter, right?

Because Steve Wozniak's suggestion sounds really fun!

"very good!"

"It's very oppressive!"

"I'm leaving this matter to you!"

Ethan patted Steve Wozniak on the shoulder, entrusting the chubby boy with an important task.

It's all free anyway!

If a tech guru is willing to do more, why would he be polite to the other party?

That doesn't exist!

(End of this chapter)