An explanation video by the developer who ported 'Portal' to NINTENDO64 will be released



YouTuber James Lambert has remade

Portal , a masterpiece of an action puzzle game that was released on PC in 2007 and later ported to Xbox 360 and Nintendo Switch, so that it can be played on Nintendo 64. We have released a video that tells the story behind the production.

How I optimized Portal to run on the Nintendo 64 - YouTube


The project Lambert took on this time was simply to make Portal playable on NINTENDO64.



It's not just a port, it's also compatible with the NINTENDO64 vibration pack.



Below is Mr. Lambert.



Start playing 'Portal' with a NINTENDO64 controller. If you look closely, the menu is in Spanish.



Although the translation is not perfect yet, it is now possible to switch subtitles to various languages.



One of the things Mr. Lambert did when creating this work was to optimize the compiler.



A compiler is a program that converts code into a program. Optimizing this reduces the time it takes to compile and build a program, and makes it easier to identify bugs.



According to Mr. Lambert, who explains while playing the NINTENDO64 version of Portal, there are some bugs that occur due to optimization, so he was worried about enabling optimization. However, fortunately there were no particular problems. Furthermore, in order to check whether there were any bottlenecks in the code, Mr. Lambert conducted ``

profiling '' to identify where the processing was stuck.



Initially, Lambert predicted that physical calculations would put a strain on game processing, but thanks to profiling, he found that rendering was taking longer. Therefore, Mr. Lambert decided to send only the visible objects to the GPU for rendering.



However, since the CPU was constantly checking whether the object was displayed on the screen, the CPU became overworked.



Therefore, Mr. Lambert introduced a method called

Boundary Volume Hierarchy (BVH) . BVH refers to treating objects that are close to each other as a group using a 'bounding box'.



Although it's called a 'bounding box,' it's not just a box filled with objects.



Lambert explains that a 'bounding box' is rather the smallest box that can contain multiple objects.



This allows you to check one bounding box and render all objects inside the box if it is within view, omitting rendering if it is outside, saving CPU and GPU processing without sacrificing performance. I was able to minimize it.



Lambert was able to significantly improve the frame rate with this process. In the video, you can see it around

7 minutes and 20 seconds from the start of playback.



Test Chamber 11 seems to be difficult for Mr. Lambert, and while explaining it, he says, ``This is impossible.''



Another point of porting is vibration pack support.



As a result, the controller now vibrates when firing the portal gun.



However, there was a problem with the vibration pack that the connection between the internal pins was broken due to vibration, and once it started shaking, it would not stop, so it was difficult to deal with it.



I tried sending a command three times to stop the vibration, but it didn't work, so I resorted to brute force by sending a command to stop the vibration pack every frame when it shouldn't be vibrating.



Sending commands to the controller already takes about 2 milliseconds round trip. Since vibration pack management was added to this, in the end, about 10 milliseconds per frame, or one-third of each frame, was spent managing the controller.



While explaining, the particles of light behave unnaturally and Mr. Lambert complains, ``I found a new bug.''



Returning to the topic of controllers, the time taken to manage controllers was actually idle time spent just waiting, so Lambert decided to separate the controller threads, freeing up the CPU while it was waiting. We have made it possible to process the following. In this way, Mr. Lambert was able to make the NINTENDO64 version of Portal compatible with vibration packs.

in Video,   Game, Posted by log1l_ks