Nowadays most games that use a license from
a TV show or a movie end up not being that great. There are a lot of examples,
such as Defiance for example. But the truth is that you will rarely have games
that deliver on the license, and SpongeBob SquarePants: Battle for Bikini
Bottom is one of them. One of the reasons why this game is so popular is
because it was designed from the ground up to be insanely fun and rewarding.
It’s all about pushing the boundaries and bringing in a creative set of ideas.
Plus, the main focus is on quality.
In SpongeBob SquarePants: Battle for Bikini
Bottom you have pretty much all the important locations from the SpongeBob
SquarePants TV show. Not only that, but they went beyond that with 3 original
bosses too. The game design itself is made to be as close to the originals as
possible and yes, it still manages to impress with its great ideas and cool
little nods you can find here and there. Another important aspect here is the
fact that the gameplay is very fluid.
They did a very good job at creating a
powerful, exciting and easy to play game that everyone loves. The license is
used really well, the missions are fun and you do get to explore the spongebob
lore at your own pace. It’s a great achievement and one that really helps
enhance your experience in great ways.
It’s nice to see that they also have
multiplayer too, which is great. This was not in the original, but it’s nice to
see anyway. The multiplayer is basically a horde mode that puts you in multiple
islands as you fight hordes and hordes of enemies. And yes, you can play as one
of your favorite characters.
SpongeBob SquarePants: Battle for Bikini
Bottom is also beloved by a lot of people because it was designed from the
ground up to bring in great challenges. You can play as many of the characters
in the game, you have a lot of props and you will also get character abilities
too.
All these little things really add up to
give a lot of character to the game and provide you with some cool moments. We
already have a great connection with the characters, so being able to control
them in a vibrant Bikini Bottom world is what really sets things apart. You
will also get to collect all kinds of items, which is very cool in the game.
At the end of the day, SpongeBob
SquarePants: Battle for Bikini Bottom is a very fun game, with a great story
and a wonderful world to explore. It’s fun, easy to play and enjoy, and the cool
thing is that it constantly encourages you to push the boundaries and come up
with something new. You do want to check it out for yourself and in the end it
will be insanely fun. There’s a reason why we are getting a remaster now,
because the game is very good and it has created a cult community around it!
Robin Williams was a great man and a very good actor. But
despite the fact that he is known for all the movies and charitable events he
was a part of, Robin Williams is also quite famous for the fact that he was one
of the few actors which actually had a passion for video games.
In fact, Robin Williams considered himself to be a great
gamer. He actually spent a lot of time playing video games. He was so esthetic
about that to the point where he actually played a lot of Zelda and he even
named his daughter Zelda. He admits that he ended up playing Legend of Zelda
for hours upon hours, and that on its own offered him plenty of fun and allowed
him to fight depression!
According to Robin Williams, he also liked Mario a lot. In
fact, he did want to call his son Mario or Luigi, yet another thing that people
just don’t know about the fabled actor. It’s safe to say that Robin Williams
was and still is a very important person in the acting world.
Ever since he passed away, a lot of people wanted to remove
the fact that he was indeed a great man and his work has constantly showed us
that. But the fact that he continually played video games to have fun and fight
depression is nothing short of amazing. It clearly shows that everyone,
including people that don’t really like video games in general will end up
having plenty of fun with them!
But Robin Williams wasn’t like that at all. He adored video
games and he liked the idea of playing them a lot. In fact, video games were
his life when he was a bit younger and as he got better and better at acting,
he worked extremely hard to figure out a way to balance gaming and acting as
well.
He was particularly a fan of Zelda at first. But he did
realize that there are lots of great games that he should try. And this is why Robin
Williams wanted to focus on some other types of games.
This is how he got into World of Warcraft. According to many
interviews, Robin Williams considered the game to be very addicting and just a
ton of fun. It’s easy to see why he would think something like that. The game
was and still is very fun and it did receive numerous upgrades all the time.
However, Robin liked the interaction between people and the fact that the
gameplay was always unique and diverse.
This is pretty hard to find in the gaming world, especially
for an MMO. But Robin Williams also enjoyed playing puzzle games like Portal.
He particularly found them revolutionary and very good to keep a true focus on
your mind’s capabilities. He liked playing these with other people, and that’s
what made Portal one of his favorites. As we all know, Portal was and still is
a revolutionary game in this perspective and one that did end up with quite the
interesting gameplay and unique ideas to say the least.
Moreover, Robin Williams also liked Half Life. He was a fan
of the story and setting, which is exactly what he wanted in his games. But
that wasn’t the only shooter he enjoyed. During an interview, Robin Williams
shows that he actually believes Call of Duty is Cyber Cocaine. Why is that?
Because the game is too addicting and it makes you play again and again all the
time. That’s exactly what happened here and in the end that was quite
impressive to be honest.
Knowing Robin Williams, you will most likely see him as a
family guy. Yes, he really was one and he focused a lot on spending a lot of
time with his kids. This is how he actually managed to shared his passion for
gaming with his daughter and son as well. He was very competitive and he always
wanted to find some new, creative ideas and projects to focus on. That’s what
really shined and it brought that sense of perspective into the mix for him.
It seems that Robin Williams was particularly into military
games. He liked Battlefield a lot and he always tried to play some of the
newest shooters. He liked that sense of action, the intense gameplay and the
unique arsenal that gamers had in the game. He also focused on finding a new
set of tools that would allow him to play better and faster. It’s clear to see
here that Robin Williams was not only a great person, but also an avid gamer.
He was a very avid gamer and he inspired a lot of people to
start playing games. His time with Zelda and World of Warcraft was amazing and
he always talked about games with a lot of love. They did help him go through
plenty of dark times and they really showed him the way towards a better and
more enticing life as a whole.
It’s safe to say that Robin Williams was very important for
the WoW community as well. They actually created a funeral in the game after he
died, a testament to what he meant for the community and how important the
community was for him to begin with.
Being dedicated to games as a celebrity can be quite
interesting. More and more celebrities like Robert Kazinsky for example talk
about their addiction to games like World of Warcraft, but there are still many
of them that do play games despite not admitting that. One thing is certain
here, Robin Williams was and still is an icon for the movie industry and he still
is one of the best gamer celebrities out there. It’s definitely an amazing
thing to have such a major actor in the gaming world. At the end of the day, he
was and he will always be an icon, so we are definitely glad to welcome people
like him in the gaming industry.
Best Armor in The
Legend of Zelda: Breath of the Wild
Many different pieces of gear and armor are available to you
in The Legend of Zelda: Breath of the Wild, and it can be overwhelming to
decide what to use. Whether you want to focus on a specific activity or find a
good set of armor for general use, here are some to keep in mind.
Climber’s Armor
Planning a long climb? Whether there’s a mountaintop shrine
you’re struggling to reach or you just want to explore the heights of Breath of
the Wild’s world, each piece of Climber’s Armor will increase your climbing
speed with Climb Speed Up. Once you have the entire set, you can wear it in its
entirety to gain Climb Stamina Up and make your climbs even easier.
Zora Armor
Meanwhile, if you need to spend a lot of time swimming, the
Zora Armor set is exactly what you need. Each piece of gear in the set grants
you Swim Speed Up for faster swimming, but there’s more to it than that. The
Zora Armor piece also includes Swim Up Waterfalls, the Zora Helm gives you a Spin
Attack to use, and wearing the entire set gives you a set bonus of Swim Dash
Stamina Up.
Flamebreaker Armor
Having trouble with fire? Each piece of armor in the
Flamebreaker set grants you Flame Guard, and the set bonus is Fireproof.
Snowquill Armor
On the other side of the temperature spectrum, you can get
Cold Resistance from each piece of armor in the Snowquill Armor set. The bonus
for wearing the entire set is Unfreezable, which makes it even more helpful
against ice-based attacks.
Desert Voe Armor
The Desert Voe Armor Set is helpful because each piece has
Heat Resistance, but what makes it stand out even more is your bonus for the
entire set. If you wear the entire set of Desert Voe Armor, you’ll also gain
Shock Resistance, making this armor invaluable for facing heat and electricity.
Champion’s Tunic
The Champion’s Tunic may not be part of an armor set, but it
has the highest defense once it’s fully upgraded. Not only that, but it also
includes an ability that lets you see the enemy’s health. Since it isn’t part
of a set, you’ll miss out on any set bonuses if you use the Champion’s Tunic,
but it’s still a useful piece to match with others.
Armor of the Wild
Similarly, each piece of armor with “of the Wild” in its
name offers a fair amount of defense. None on its own reaches the same level as
the Champion’s Tunic, but the full Armor of the Wild set is formidable.
However, they have no additional effects and no set bonus. You might consider
matching them with the Champion’s Tunic.
Stealth Armor
If you’re planning to sneak around enemies, each piece of
equipment in the Stealth Armor set grants you the Stealth Up effect. When you
wear the entire set, you’ll also get Night Speed Up as its set bonus. This
increases your movement, climbing, and swimming speeds at night.
Barbarian Armor
Then again, maybe you want the exact opposite of stealth—you
just want to effectively attack everything. The Barbarian Armor set is an
excellent choice for an offense-focused playstyle, as every piece provides
Attack Up. This set comes with two set bonuses, as well, Charge Attack Up and
Stamina Up.
Fierce Deity Armor
The powerful Fierce Deity Armor is another offense-focused
set, as it brings with it increased attack power, Charge Attack Up, Stamina Up,
and a fair amount of defense as well. However, the Fierce Deity Armor can only
be unlocked through use of an as-yet-unreleased amiibo figurine.
Breath of the Wild is a
remarkable accomplishment in terms of gameplay, depth and art direction. I
recently played it on Nintendo Switch and was compelled to write what I felt
about it. The beautiful plot of the game mesmerizedmethe moment Istepped into
it.The diversity of the location and its vastness leftmein awe. Let’s take a
look what it has for you.
Thisopen world game puts
you in the shoes of ‘Link’ the protagonist, gives you sheer freedom to explore
and discover Hyrule and complete dungeons in any order without disrupting the
main flow of the game. You can climb any surface and travel in any direction
you want. What I found most interesting is the fact that it does not dictate or
guide you in any way. You learn through trial and error, build your own path
and follow it to discover hidden secrets.
Another feature worth
mentioning is its connection with real life. For example, your weapons are
perishable just like in the real world;they can break or wear down with usage
or environmental hazards. Metal weapons attract lightening and can get you
killed. You should dress according to the climate to save yourself.
Like in any other
action game you have to kill enemies, solve complex puzzles, discover mysterious
landmarks, find enemy camps and get rewardedin the form of hearts, increased
stamina bars, and weapon upgrades. As your skills and stamina improve, you can
reach more locations, but be prepared for rains, thunderstorms andother random natural
catastrophesthat could slow you down. The wild combats involve swords, spears
and axes with archery playing the major role. Youcan use variety of arrow types
to conquer yourenemies.
Ah, I forgot to mention
about ‘Cooking’.It might delight you.
When you don’t have any recipes to consult, you can simply experiment with
ingredients and pray that the outcome is edible. Different mixtures of the
ingredients yield different rewards like they may replenish yourhealth or give youextra
resistance to a specific climate. I ended up producing rotten things most of
the time, so be careful about the elements you are mixing.
Playing Breath Of the
Wild is an amazing experience. 50 hours into the game and I am still
encountering dozens of new tantalizing things to explore and can happily play
for 10 more hours without getting bored. The textures of the game may seem
blurry on Switch’s6.2” display,and the game also suffers brief frame rate
hiccups in heated situations. But these factors do not spoil the spirit of the
game.
Hudson Soft was a very popular video game company. They
released a lot of games during the 80s and up to 2012. The company had its
headquarters in the Midtown Tower in Tokyo, and they also had an office in
Sapporo.
The company was founded in 1973 and it dealt with personal
computer products at first. However, it soon expanded to publishing video
games, creating mobile content and recording music. They did become a videogame
publisher and they are the ones that published series like Bonk, Bomberman,
Adventure Island, Bloody Roar and so on. They also made the TurboGrafx-16
alongside NEC, and they completed against SNK, Sega and Nintendo that also had
consoles at the time.
They were a second party developer, but at the same time
they were constantly trying to adjust the way they created consoles and
published games. Not a lot of people know this, but Hudson Soft had a great
relationship with Konami. They did end up getting hit by the collapse of the
main bank they had at that time, Hokkaido Takushoku.
When they tried to find some new financing alternatives, they
decided that the best thing they could do was to enter the stock market for the
first time. This brought in Konami that purchased around 5.6 million shares
from them. In those terms, Hudson ended up acquiring the Konami Sapporo
division, and they renamed it Hudson Studio at that time.
In 2005, things became clear that Hudson did end up being a
part of Konami when they still allowed Hudson to stay as a video game publisher,
but Konami worked close with them all the time.
It was in 2011 when Hudson Soft turned into a wholly owned
Konami subsidiary. The California subsidiary ended up being liquidated during
this process, a very important thing to keep in mind in this regard.
It was on March 1 2012 when Hudson Soft creased to exist.
They merged with Konami Entertainment, and their music business was absorbed
into KME Corporation.Yet despite all of that, Konami still uses their brand
name to share stuff online and stuff like that. It makes a lot of sense,
because they are the ones that still own the brand name in the first place.
However, since 2014 the Hudson website was retired, and now you can’t find any
mention of Hudson Soft anywhere unless it’s a part of Konami, and that’s from
many years ago.
As you can see, Hudson Soft is one of those companies that
died because they became a part of a larger corporation. And that’s ok. All you
can see there is that it does matter how a company manages itself, because
situations such as this one can appear out of nowhere. And you really need to
be in control, otherwise you can end up dealing with various issues all the
time. That’s why Hudson Softdied, because they ended up selling to a larger
company that ended up not having any use for their brand anymore. Which is a
shame, because they were a great publisher!
Mega Man X was the first Mega Man game to be developed in 16-bit however, it's not one of the main games. This game is a spin-off from the main series and was released for the SNES in 1993. However, the game has been ported to PC, the Nintendo GameCube, PlayStation 2 and also the Nintendo Virtual Console for download on the Wii, Wii U and Nintendo 3DS. There is also a remake for the PlayStation Portable which is called “Mega Man Maverkic Hunter X”.
Like previous Mega Man games, this one was developed by Capcom and published by Nintendo.
One if the most iconic villians from the game is Vile. He appears several times and is even a mid-game boss. Unlike many other characters we've covered, Vile is a character in various Mega Man games. He appeared in: Mega Man X3, Mega Man Xtreme, Mega Man X8 and was even a playable character in the PSP remake, Mega Man Maverick Hunter X.
Vile was an A-Class Maverick Hunter originally but he collected a large amount of disciplinary charges for his reckless and bloodthirsty behaviour on missions. When Sigma took hunters with him for his war on humanity, Vile followed him willingly.
While Vile is a recurring villain in the Megan Man X series, his time in the spotlight appears to be over now. This game series seemed to 'end' in 2004 with Mega Man X8 and Mega Man X: Command Mission. However, there have been several remakes since then which feature this powerful villain.
It's currently unknown if Vile is alive or not as he was defeated at the end of Mega Man X. The full ending for the game also leaves this open so it wasn't surprising when he made several re-appearances in different Mega Man games.
It's possible that this villain will return to other games in the future but for now, Vile is currently resting and waiting for his chance to strike once again.
Turok The Dinosaur Hunter
is one of those games that impressed all of us when it came out. And for an excellent reason. Not only is it a delight
to play, but it has the uniqueness, distinct visual appeal, and features that make it so interesting and rewarding right off the bat. This is a very
goodgame and it manages to easily integrate all the features that you
would want to have from a dinosaur game!
The beginnings
The character of Turok was initially a part of the comics
published by Dell Comics and Western Publishing. He appeared in one of their
comics in 1954. Valiant Comics soon ended up revamping the series, and they brought the character back in
1993, also in comic format. But as you can imagine, this was set to become a
game, and that’s what made it so unique,
to begin with.
Acclaim Entertainment ended up purchasing Valiant in 1994, and they also acquired Iguana Entertainment,
a developer, a year later. Acclaim was focused
on creating great content and video games based on comic books. So, it was only
a matter of time when Turok was announced to be released rather soon. The
announcement took place in August 1994,and
the game was set to be an exclusive for the Ultra 64 console, which ended up
being called the Nintendo 64 in the end.
What made the game distinct was the fact that they wanted to
bring in the full array of powers and stories from the comic books inside Turok
The Dinosaur Hunter. And that was hard to pull off, especially with the
technology at that time.
Development
The development process for Turok
The Dinosaur Hunter started in 1996. At its core, the game was based on the comic book, but Iguana Entertainment
went ahead and tried to make the game a lot more action oriented. This was a great idea and one that would
ultimately bring in front a multitude of nice
ideas.
At first, Turok The Dinosaur Hunter was supposed to be a
side scroller. However, the idea did wear
off very fast, as the developers knew that there were too many of those
already. They did want to create something in third person similar to Tomb
Raider and Super Mario 64, but in the end,
they decided to go for a first person shooter. It was the only way to showcase the power of the Nintendo 64, so
opting for an FPS was the right pick.
Most of the developers working at Iguana at that time were
inexperienced, and that did show. Even if they have complete support from Acclaim,
it was clear that the gameplay ideas weren’t 100% going to stick, so trying to
find another approach.
Since there was a lot of violence in Turok The Dinosaur
Hunter, this game was pushing the limits of that console, but Nintendo didn’t
want to check the console nor did they want to focus on anything for the time
being. But once Iguana started to talk with
them. Nintendo was supportive in the end. However, Iguana still had to
create all their development tools, and
that was certainly very time-consuming in
the end.
The primary challenge during the Turok The Dinosaur Hunter development was the fit the game on the 8
MB cartridge. The game was larger than that. So they had to find some creative
ways to deal with that sort of problem. They ended up reducing the music quality, and they also compressed everything.
Yes, some specific measures
and issues weren't exactly helpful for the development team. Yet despite that, they did use particle
systems, real-timelighting, and many
other features., They even used the motion capture studio at Acclaim tomake the humanoid characters more convincing
and entertaining.
The problem they encountered was that Acclaim had some major
financial issues later during the game’s development. Even if they were publishing
lots of 16-bit games, they did want to focus on something else other than SNES
and Genesis. People were not ready, and obviously
this did come as quite the shocker.
And while the game
development process ran well, albeit, with its challenges, the reality is that
the marketing for it ended up being extremely hard to do.In fact, Turok
The Dinosaur Hunter was the major hope
that Acclaim had at that time, and a lot
of pressure was on the development team
to deliver. Based on the cash flow issues, the marketing was weak.
In fact, Acclaim relied mostly on the sales of Magic: The
Gathering: Battlemage. The lack of a good marketing was indeed a problem. And
then you had a very high price for Turok The Dinosaur Hunter, which was $79.99
in the US, around 130 dollars in Australia and 70 pounds in the UK. Obviously,
the addition of a Mature rating also meant that the sales would not be good,
simply because parents would not get this for kids.
The game was initially set to appear in 1996, but they
pushed the release date to January. As soon as the title started to get close
to its release, presales started to show
that Turok The Dinosaur Hunter did entice a lot of people and people were very
positive about the idea of a dinosaur
hunting game. In fact, they announced a sequel that was set to come later in 1997
as well.
Closing thoughts
Thankfully, the reality is that Turok The Dinosaur Hunter
was and still is one of the best dinosaur hunting games, and it was remastered
so new generations can play it too. But the legacy of Turok The Dinosaur Hunterstill remains, and it shows that even a very
violent game can still have a chance on the market. It all comes down to the
way you approach it and howopen your
audience is about things. It’s certainly one of the most interesting things to
note is that the new concept and incredible graphics managed to make the game a
success and a cult classic. In fact, the game even received a sequel, and a few other games inspired by it
appeared too, a legacy of its success!
While Bomberman 64 isn't the first game in the Bomerman series, it was loved by fans for a variety of reasons. From the great adventure mode to the high quality single-player mode however, the multiplayer for the game wasn't as highly rated by gamers or critics.
The game is the first 3D entry to the Bomberman series and is focused around platforming which is different to the original game. The original game was focused around arena's filled with enemies and other environmental dangers.
Over 40 developers from Hudson Soft [1] worked on bringing the game to life and it was finally released in 1997 for the Nintendo 64. However, the game was also released in 2017 for the Wii U Virtual Console allowing players to revist it. While Hudson Soft developed the game, Nintendo published it in North America and Europe.
One of the big baddies in the game is Regulus, one of the Masked Trio who serves under Altair and is his right-hand man. Unlike the other villians in the game, Regulus becomes an ally to Bomberman and even supports him in the final fight against Siruis. During the final fight, the player must also ensure that Regulus survives the fight while also defeating Siruis.
This isn't the end of Regulus however as he's also featured in Bomberman 64: The Second Attack! where he is called “Bulzeeb” instead throughout most of the game. Towards the end of the game however, he rejects the name and demands to be called “Regulus” once again.
There was some suggestion from fans that Regulus could be in the Super Bomberman R game which was released in March. Fan theories stated that the “R” could stand for “Reunion” [2]. However, this turned out to be incorrect and there was no Regulus.
There have been no hints from Hudson Soft or Nintendo about a possible Bomberman 64 release for the Nintendo Switch eStore. Hopefully the developer and publisher will release a statement in the future confirming that this classic game is getting another lease of life.
Use physics to create an ever-growing atomic nucleus.
Use the profiler to investigate performance.
Measure and display the frame rate.
Prevent the creation of temporary strings.
Stabilize the frame rate by averaging multiple frames.
Colorize the frame rate display.
In this tutorial we'll create a simple test scene and then measure its performance. We'll first examine the profiler, then we'll create our own frame rate counter.
This tutorial requires a basic understanding of scripting in Unity. It has been made for Unity 5.0.1 and up. If you're new, have a look at Constructing a Fractal first.
Smash together spheres until your frame rate tanks.
Building an Atomic Nucleus
We need a test scene. One that ideally covers both high and low performance situations. I suggest we create an atomic nucleus by fusing more and more nucleons together. As the nucleus gets bigger, performance will worsen.
The nucleons will be simple spheres that will be attracted to the center of the scene, where they will bunch up and form a ball. This is of course not a correct representation of an atom, but that's not the point.
We can model a nucleon with a default sphere and a custom Nucleon component. This component makes sure that a rigidbody is attached to its object and then simply pulls it towards the origin. The strength of the pull is determined by a configurable attraction force and the distance from the center.
Create two nucleon prefabs using spheres, one for protons and another for neutrons. Give each a different material so they look distinct. We could suffice with only one nucleon type, but that's boring to look at.
Nucleon prefabs.
To spawn these nucleons we need to create another component, NucleonSpawner. It needs to know the time interval between spawns, how far away from the center to spawn, and what to spawn.
Playing this scene should result in spheres shooting towards the center. They will overshoot for a while, until they collide with each other so much that a ball is formed. This ball will keep growing, physics computations will become more complex, and at some point you will notice a drop in frame rate.
If it takes too long for you to see performance worsen, you can increase the spawn rate. Speeding up time by increasing the time scale works as well. You can find it via Edit / Project Settings / Time. You can also decrease the Fixed Timestep, which will result in more physics calculations per second.
Now that we have a scene that will eventually bring down the frame rate of any machine, it is time to measure the actual performance. The quickest thing you can do is enable the statistics overlay of the game view.
Game view statistics overlay.
However, the frame rate shown there isn't accurate at all, it's more like a rough guess. We can do better by opening Unity's profiler, via Window / Profiler. The profiler gives us a lot of useful information, especially the CPU usage and memory data.
The profiler, showing lots of vsync time.
If vsync is enabled, it will likely dominate the CPU graph at the start. To get a better idea of how much CPU resources our scene needs, turn vsync off. You can do this via Edit / Project Settings / Quality. It is found at the bottom, under the Other heading.
No more vsync.
Now you can get a better look at the CPU usage. In my case physics requires most time, followed by rendering, and then my scripts. This remains true for a long time, even though everything will slow down as the sphere count goes up.
Profiler without vsync.
There are also two unexpected observations that we can make. First, there are occasional spikes of CPU usage. Second, the memory graph shows frequent GC allocation spikes, which indicates that there is memory being allocated and subsequently freed. As we're only creating new objects and never throw anything away, this is odd.
Both phenomena are caused by the Unity editor. The CPU spikes happen whenever you select something in the editor. The memory allocations are caused by a call to GameView.GetMainGameViewRenderRect, which is invoked by the editor. There is additional overhead as well, especially if you have both the game and scene view visible at the same time. In short, the editor itself interferes with our measurements.
You can still get plenty of useful information from in-editor profiling, but if you want to eliminate the editor itself from your measurements, you have to make a standalone build. You can still use the profiler if you make a development build and even automatically connect to it when running your app. You can configure this via File / Build Settings...
The profiler attached to a standalone app.
When profiling a standalone build, the data looks quite different. Memory allocations are now only caused by nucleons being spawned, and no more garbage collection occurs. In my case rendering takes more time, because I'm running the app full-screen instead of in a small game view. Also, the scripts are so insignificant that they're not even visible in the graph.
Measuring Frames Per Second
The profiles gives us useful information, but it still doesn't gives us a good measurement of the frame rate. The FPS numbers shows are just 1 divided by the CPU time, which is not the actual frame rate that we're getting. So let's measure it ourselves.
We need a simple component that tells us the current frames per second that our app is running at. A single public property suffices. We make it an integer because we don't really need fractional precision.
We measure the frames per second each update by dividing 1 by the time delta of the current frame. We cast the result to an integer, effectively rounding down.
However, there is a problem with this approach. The time delta is not the actual time it took to process the last frame, it is influence by the current time scale. This means that our FPS will be wrong unless the time scale is set to 1. Fortunately, we can also ask Unity for the unscaled time delta.
Some kind of UI is needed to show the FPS. Let's use Unity's UI for that. Create a canvas with a panel inside it that in turn contains a text object. These can be added via the GameObject / UI submenu. When adding a canvas you'll also get an EventSystem object to handle user input, but we don't need that, so you can remove it.
UI object hierarchy.
I used the default canvas settings, except that I made it pixel-perfect.
A pixel-perfect canvas.
The panel is used to create a semitransparent black background for the FPS label. That way it will always be readable. I put it at the top-left corner of the window. Set its anchor to top-left so it remains in place regardless of the window's size. Set its pivot to (0,1) for easy placement.
Position the label inside the panel in a similar way. Make it white bold text, centered both horizontally and vertically. Design the whole thing so it snugly fits two digits.
Building the UI.
Now we need to bind the FPS value to the label. Let's create a component for this purpose. It needs an FPSCounter component to retrieve the value from, and a reference to a Text label from the UnityEngine.UI namespace to assign the value to.
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(FPSCounter))]
publicclassFPSDisplay : MonoBehaviour {
publicText fpsLabel;
}
Add this component to our panel and hook it up. We attach it to the panel because that's our whole FPS display, not to the label. We'll include more labels later.
Setting up the display.
The display component simply has to update the label's text each frame. Let's cache the reference to the counter so we don't need to invoke GetComponent every time.
The FPS label is now updating! But as we designed it for two digits, it will show useless values whenever our frame rate exceeds 99 per second. So let's clamp displayed value. Anything above 99 performs good enough anyway.
Everything appears to work fine now, but there is a subtle problem. We are now creating a new string object each update, which is discarded the next update. This pollutes the managed memory, which will trigger the garbage collector. While this isn't a big deal for desktop apps, it is more troublesome for devices with little memory to spare. It also pollutes our profiler data, which is annoying when you're hunting for allocations.
Temporary string objects are created each update.
Can we get rid of these temporary strings? The value that we are displaying can be any integer between 0 and 99. That's 100 different strings. Why not create all these strings once and reuse them, instead of recreating the same content all the time?
Updating the FPS value each frame has an unfortunate side effect. The label will fluctuate constantly when the frame rate isn't stable, making it hard to get a useful reading. We could update the label only once in a while, but then we would no longer get a good impression of how the frame rate is behaving.
A possible solution is to average the frame rate, smoothing the impact of sudden changes, producing a less jittery value. Let's adjust FPSCounter so it does this over a configurable range of frames. Setting this value to 1 would be the same as not averaging at all, so it is effectively optional.
publicint frameRange = 60;
Configurable frame range.
Let's change the property name from FPS to AverageFPS, as that is a better description of the value it now represents. Either use your IDE to refactor the name, or manually update the display component to use the new name.
publicint AverageFPS { get; privateset; }
Now we need a buffer to store the FPS values of multiple frames, plus an index so we know where to put the data of the next frame.
int[] fpsBuffer;
int fpsBufferIndex;
When initializing this buffer, make sure that frameRange is at least 1, and set the index to 0.
The Update method becomes a little more complicated. It begins by initializing the buffer if this is needed, either because we just started or because frameRange has changed. Then the buffer has to be updated, after which the average FPS can be calculated.
But we'll quickly fill our entire buffer, and then what? We'll have to discard the oldest value before adding the new one. We could shift all values one position, but the average doesn't care about the order that the values are in. So we can just wrap the index back to the start of the array. That way we always override the oldest value with the newest, once the buffer has been filled.
Calculating the average is a simple matter of summing all values in the buffer and dividing by the amount of values.
void CalculateFPS () {
int sum = 0;
for (int i = 0; i < frameRange; i++) {
sum += fpsBuffer[i];
}
AverageFPS = sum / frameRange;
}
Our average frame rate now works, and with a reasonable frame range it is a lot easier to get a good reading. But we can do even better. As we now have data from multiple frames, we can also expose the highest and lowest FPS in this range too. This gives us a lot more information than just an average.
Add two more labels to the UI and hook them all up. I put the highest FPS at the top and the lowest FPS at the bottom, with the average FPS in the middle.
As a final touch to the FPS labels, we can colorize them. This can be done by associating colors with FPS values. Such an association can be represented with a custom struct.
As FPSDisplay is the only thing that will use this structure, we put the struct definition directly inside that class and make it private so that it won't show up in the global namespace. Make it serializable so that it can be exposed by the Unity editor.
Now add an array of these struct so we can configure the coloring of the FPS labels. We'd typically add a public field for that, but we can't do that because the struct itself is private. So make the array private as well and give it the SerializeField attribute so Unity exposes it in the editor and saves it.
Go ahead and add some colors! Make sure that there is at least one entry, order them from highest to lowest FPS, with the last entry for 0 FPS.
Coloring.
Before applying the colors to the labels, restructure the Update method by introducing a separate Display method that takes care of adjusting a single label.