SSF2 Dev Blog #12 – Performance and Quality Settings

Hi everyone! I’m 135, a coder and balancer for SSF2. Today I’ll be covering new features in Beta which will help the game run faster, even on older computers.

As a gaming platform, the PC has its set of advantages and disadvantages. It is customizable and relatively powerful. However, PCs are not standardized. All Wiis, for example, have proper specs to smoothly run games designed for Wiis. PCs, on the other hand, vary drastically in performance, and therefore PC game designers need to do their best to accommodate machines of varying strengths. Unfortunately, even the most optimized games can still lag on slower machines. And lag is bad.

To ensure that SSF2 Beta runs as smoothly as possible for everyone, we have made two significant improvements to the game: collision detection optimization and customizable quality settings.

Collision detection is a very computationally-intense process. Every frame, the game engine checks to see if any “collision boxes” bump into each other. These boxes can be Hit-Boxes, Hurt-Boxes, or boxes for items, grabbing, and Ledge detection. Let’s look at an example.

Just a little farther.. Just a little farther..

In the picture above, the Hurt-Boxes are shown in yellow while the the Hit-Boxes are in red [1]. The light green boxes are used to detect items near the players. In general, an object (character, projectile, item, or stage element) can have up to five Hurt-Boxes and three Hit-Boxes.

This is how the v0.9b engine would check for collisions: Each of Marth’s three Hit-Boxes check to see if they intersect with any Luigi’s three Hurt-Boxes, for a total of nine checks. Here, Marth’s F-Tilt fails to touch Luigi. While straightforward an algorithm, things can get messy, especially with more players…

It’s a massive four-player Free-For-All! It’s a massive four-player Free-For-All!

In the picture above, for example, each of Marth’s 4 Hit-Boxes would have to check against 13 other boxes, while Bowser’s Hit-Box would have to check against 18 other boxes. This totals up to 70 checks in a single frame, which might be problematic for slower computers.

But don’t worry; Beta speeds up the process using what I’d like to call the Big Box. Simply put, every object has a Big Box, which contains all its other collision boxes.

Hmm...can you guess how these pink rectangles might help? Hmm...can you guess how these pink rectangles might help?

In Beta, before two objects check for collisions, they first check to see if their Big Boxes (shown in pink) touch. If not, then they are far enough from each other that there is no way for them to interact. Since Marth’s Big Box only touches Goku’s, his Hit-Boxes don’t check whether they collide with Bowser or Zero Suit Samus. Similarly, Bowser’s Hit-Box does not run any checks. Furthermore, after one Hit-Box of an attack is discovered to connect with an opponent, subsequent Hit-Boxes are no longer checked redundantly against that particular opponent. In this case, the number of total checks drop from 70 to 18. A drastic improvement!

Not only have we improved the collision algorithm, but Hit-Boxes themselves have been adjusted across the board. They are much more accurately drawn now.

 

Now, on to customizable quality settings!

In v0.9b, you could choose between several quality options to suit your machine’s performance. However, the options were somewhat limited. SSF2 Beta’s quality settings, meanwhile, offer much, much more control:

Oh my! That's a lot of freedom! Oh my! That's a lot of freedom!

The new menu speaks for itself. You may choose from five levels of preset configurations, with Minimum being the least graphically intensive, and Maximum the most. Or, you can choose to configure your own graphics settings using the Custom option.
Here are several comparisons between screenshots taken under Maximum settings (left) and Minimum settings (right).

Having toggles for display options allow us to enrich the game with beautiful effects without having to worry about making it too laggy for players on older computers. We hope that the additional control our new quality menu offers will help everyone to run the game smoothly while still being able to have as rich a visual experience as possible. From optimized algorithms to increased control over display graphics, SSF2 Beta includes many updates to ensure its operation at full FPS on any machine.

 

 

…Well, almost any machine.

 

That’s it for this week’s Developer Blog! Tune in next week as the other numberdude, 194, sheds light on some of Beta’s major character overhauls.

[1]: As an aside, note that the Hit-Box covers the blur of the sword. This is called “interpolation”, and is very important to ensure that collisions are detected properly. Furthermore, as a rule of thumb, sword-users should have Hit-Boxes on their arms and torsos when they attack. Characters who punch or kick generally have Hit-Boxes extending beyond their limbs, and those Hit-Boxes should have interpolation as well.