-
May 24th, 2022, 12:11 PM
#1
Animation Implementation
A silly question but I started thinking about it and Google didn't help much.
First, I'm not a gamer and don't know much about it. I started playing a Match 3 game, you win money for each game completed, which you spend on things for a fish tank, fish/objects/plant/feeders.....
After a while I had over 50 fish randomly swimming around, plant swaying, bubbles..... Then I thought if I had this many objects, even just stationary, a screen refresh would probably be slow. But this little game wasn't having any problems with the animation being slow or jerky.
When I Googled, I read about they use animation engines. But how can it move so many objects without any speed issues.
-
May 24th, 2022, 10:41 PM
#2
Re: Animation Implementation
They wouldn't all be separate objects on the screen. If you were using WinForms and had a PictureBox for all the fish then that would be an issue, because each control would be resource intensive. In the case proper game engines, they do all the calculations in a loop and then create the entire scene, then render that in one go.
-
May 25th, 2022, 01:35 AM
#3
Re: Animation Implementation
Originally Posted by jmcilhinney
They wouldn't all be separate objects on the screen. If you were using WinForms and had a PictureBox for all the fish then that would be an issue, because each control would be resource intensive. In the case proper game engines, they do all the calculations in a loop and then create the entire scene, then render that in one go.
Thanks, that makes sense. It's amazing all that can be done quickly enough to make the flow look constant. Then again, I'm still baffled at how search engines like Google can search billions of records and return the results in a fraction of a second. lol
-
May 25th, 2022, 11:17 AM
#4
Re: Animation Implementation
Yeah, I have a VB6 demo where 5 "car sprites" race around and around on a square "track" turning 45° then 90° crudely in each right-angle turn. I just tried shrinking the cars and lanes to half size and doubled the number of cars and lanes to 10, a quick and dirty change.
It still animates without flicker.
I suspect that using slightly more advanced techniques (like Direct2D) would enable animating far more items than that over a larger area.
-
May 25th, 2022, 11:39 AM
#5
Re: Animation Implementation
Originally Posted by wes4dbt
After a while I had over 50 fish randomly swimming around, plant swaying, bubbles..... Then I thought if I had this many objects, even just stationary, a screen refresh would probably be slow. But this little game wasn't having any problems with the animation being slow or jerky.
Are the graphics in this game using any kind of specially effects like glowing effects, shadows, lighting ect? Or are they just plain sprites being moved around without any kind of effect being applied to them?
50 sprites is nothing to animate on a modern PC without any problems as long as you're not using any blending techniques for special effects. You could use plain old GDI/GDI+ or any non-accelerated graphics library to animate hundreds on items on screen without any problems.
Note that I am assuming this game uses sprite-based graphics. If it is using 3D graphics then what I said above doesn't apply. 3D graphics must be rendered by the GPU for good performance which means the game would be using either OpenGL, DirectX or some other 3D library for rendering. Even the most basic GPUs of today would have zero problem animating 50 texture mapped models on screen without problems.
Last edited by Niya; May 25th, 2022 at 11:44 AM.
-
May 25th, 2022, 12:05 PM
#6
Re: Animation Implementation
Originally Posted by Niya
Are the graphics in this game using any kind of specially effects like glowing effects, shadows, lighting ect? Or are they just plain sprites being moved around without any kind of effect being applied to them?
50 sprites is nothing to animate on a modern PC without any problems as long as you're not using any blending techniques for special effects. You could use plain old GDI/GDI+ or any non-accelerated graphics library to animate hundreds on items on screen without any problems.
Note that I am assuming this game uses sprite-based graphics. If it is using 3D graphics then what I said above doesn't apply. 3D graphics must be rendered by the GPU for good performance which means the game would be using either OpenGL, DirectX or some other 3D library for rendering. Even the most basic GPUs of today would have zero problem animating 50 texture mapped models on screen without problems.
I'm not sure if they are plain sprites or not. they don't look flat and they have a lot of subtle motion with their body/fins. I don't know if they're 2D or 3D.
What I was interested in was what type of programming technics were used, jmc's info helped. Still curious how all the various movements of the objects are generated.
-
May 25th, 2022, 12:33 PM
#7
Re: Animation Implementation
Originally Posted by wes4dbt
they don't look flat and they have a lot of subtle motion with their body/fins.
In this case they are almost certainly 3D.
Originally Posted by wes4dbt
What I was interested in was what type of programming technics were used, jmc's info helped. Still curious how all the various movements of the objects are generated.
3D graphics use a wire mesh of triangles with texture mapped onto it. Movement is achieved by moving vertices of the triangles of the mesh. Certain types of movement like rotations I believe is handled entirely by the GPU. Rendering of this graphical data is also handled by the GPU. GPUs have thousands of cores and a lot of graphical operations are highly parallelizable. Your GPU is doing thousands of pixel calculations simultaneously while leaving your CPU free. This is the essence of why 3D games perform so well.
-
May 25th, 2022, 01:24 PM
#8
Re: Animation Implementation
Originally Posted by Niya
In this case they are almost certainly 3D.
3D graphics use a wire mesh of triangles with texture mapped onto it. Movement is achieved by moving vertices of the triangles of the mesh. Certain types of movement like rotations I believe is handled entirely by the GPU. Rendering of this graphical data is also handled by the GPU. GPUs have thousands of cores and a lot of graphical operations are highly parallelizable. Your GPU is doing thousands of pixel calculations simultaneously while leaving your CPU free. This is the essence of why 3D games perform so well.
Thanks, that's interesting. Maybe you'll know this. Does the programmer have to tell the animation engine every single movement of the object or can it be more general like, move the fish tail back and forth or move the side fins up and down?
-
May 25th, 2022, 02:36 PM
#9
Re: Animation Implementation
Originally Posted by wes4dbt
Does the programmer have to tell the animation engine every single movement of the object or can it be more general like, move the fish tail back and forth or move the side fins up and down?
I believe that the animations like a tail wagging would be pre-calculated in 3D modelling software like Maya or whatever is the top 3D modelling software is today or perhaps even something made inhouse. This software would essentially allow you to create all the data for the pre-defined paths of movement for vertices of the mesh. This data would imported into the game and it's 3D engine could reproduce the movement using the data. More general movement like rotations and resizes and reflections could be calculated on the fly by the game engine itself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|