Difference between revisions of "Game Optimization"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "What is optimization? Optimizing is a term used to describe the betterment or efficiency of how something works, runs, operates. A quick example of this would be in how fast a...")
 
m
Line 1: Line 1:
What is optimization? Optimizing is a term used to describe the betterment or efficiency of how something works, runs, operates. A quick example of this would be in how fast a game, or application loads &/or runs. Also it could be a reduction in the amount of processing power, ram or vram required to run your application. It could even be a reduction in the amount of hard disk space required for your application.
+
What is optimization? Optimization, or optimizing is a term used to describe the betterment or efficiency of how something works, runs, operates. A quick example of this would be in how fast a game, or application loads &/or runs. Also it could be a reduction in the amount of processing power, RAM or VRAM required to run your application. It could even be a reduction in the amount of hard disk space required for your application.
  
2D games often require more memory to run, because the games animation file-sizes are usually larger than 3D animations, depending on the resolution of your game & the size of your animations. In Visionaire Studio there are various methods you could use to reduce the file-size of each of your animations frames, thus speeding up the loading time of your game, which is great for mobile devices & low-mid range gaming machines.
+
2D games often require more memory to run, because animation file-sizes in 2D games are usually larger than their 3D animation counterparts; depending on the resolution of your game & the size of your animations. In Visionaire Studio there are various methods you could use to reduce the file-size of each of your animations frames, thus speeding up the loading time of your game, which is great for mobile devices & low to mid range gaming machines.
  
 
== Scaling Up ==
 
== Scaling Up ==
The basic idea behind scaling up is that for animations that don't need to be sharp (in focus) & don't matter too much about looking a little blurry/pixelated, such as environment animations like rain, snow, fog, clouds, water etc, or animations in the background, you could create the images at say 25% or 50% of the intended (actual) scale & then use a simple line of lua script to scale them up to regular size. This is a great way for cutting down the final file-size of your images & animations.
+
The basic idea behind scaling up is that for animations that don't need to be sharp (in focus) & don't matter too much about looking a little blurry/pixelated, such as environmental animations like: rain, snow, fog, clouds, water etc, or animations in the background. You could create the images at say: 25 to 50% of the intended (actual) scale & then use a simple line of Lua script to scale them up to regular size. This is a great way for cutting down the final file-size of your images & animations.
  
 
=== Object Sprite ===
 
=== Object Sprite ===
Line 14: Line 14:
  
 
=== Animation ===
 
=== Animation ===
Scale up an animation. This can be an animation linked to anything from a scene object, a character, an interface, or even a mouse cursor. The best place to add this code is inside of the ''initial frame'' of an animation via an '''execute a script''' action part. ''The animation has be active (playing or preloaded) for this code to work. Visionaire Studio 4.1 + is only required for the shorthand method.''
+
Scale up an animation. This can be an animation linked to anything from: a scene object, a character, an interface, or even a mouse cursor. The best place to add this code is inside of the ''initial frame'' of an animation via an '''execute a script''' action part. ''The animation has be active (playing or preloaded) for this code to work. Visionaire Studio 4.1 + is only required for the shorthand method.''
 
<syntaxhighlight>
 
<syntaxhighlight>
 
ActiveAnimations["water_ripple"].AnimationSize = 400 -- scale "water_ripple" animation up to 400% (shorthand method)
 
ActiveAnimations["water_ripple"].AnimationSize = 400 -- scale "water_ripple" animation up to 400% (shorthand method)
 
getObject("ActiveAnimations[water_ripple]"):setValue(VAnimationSize, 400) -- same as above, but longhand
 
getObject("ActiveAnimations[water_ripple]"):setValue(VAnimationSize, 400) -- same as above, but longhand
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 17:38, 4 January 2015

What is optimization? Optimization, or optimizing is a term used to describe the betterment or efficiency of how something works, runs, operates. A quick example of this would be in how fast a game, or application loads &/or runs. Also it could be a reduction in the amount of processing power, RAM or VRAM required to run your application. It could even be a reduction in the amount of hard disk space required for your application.

2D games often require more memory to run, because animation file-sizes in 2D games are usually larger than their 3D animation counterparts; depending on the resolution of your game & the size of your animations. In Visionaire Studio there are various methods you could use to reduce the file-size of each of your animations frames, thus speeding up the loading time of your game, which is great for mobile devices & low to mid range gaming machines.

Scaling Up

The basic idea behind scaling up is that for animations that don't need to be sharp (in focus) & don't matter too much about looking a little blurry/pixelated, such as environmental animations like: rain, snow, fog, clouds, water etc, or animations in the background. You could create the images at say: 25 to 50% of the intended (actual) scale & then use a simple line of Lua script to scale them up to regular size. This is a great way for cutting down the final file-size of your images & animations.

Object Sprite

Scale up an image sprite linked to a scene object. You could use this for an overlay image, or maybe for a solid color image that you might want to use to obscure the screen during loading or scene transitions, etc. Visionaire Studio 4.1 + is required to scale object sprites.

Objects["rock"].Scale = 4.0 -- scale "rock" object sprite up to 400% (shorthand method)
getObject("Objects[rock]"):setValue(VObjectScale, 4.0) -- same as above, but longhand

Animation

Scale up an animation. This can be an animation linked to anything from: a scene object, a character, an interface, or even a mouse cursor. The best place to add this code is inside of the initial frame of an animation via an execute a script action part. The animation has be active (playing or preloaded) for this code to work. Visionaire Studio 4.1 + is only required for the shorthand method.

ActiveAnimations["water_ripple"].AnimationSize = 400 -- scale "water_ripple" animation up to 400% (shorthand method)
getObject("ActiveAnimations[water_ripple]"):setValue(VAnimationSize, 400) -- same as above, but longhand