This article is a brief guide to solving the majority of problems that you will find when you upgrade your game project from WaveEngine 2.4.1 version to 2.5.0.
Although WaveEngine has an upgrade tool that runs when you open an old game project with the current WaveEditor 2.5, you can find some issues listed below.
An important point to bear in mind is that Model, ModelRenderer and MaterialsMap components are not longer supported, so you should replace them to use FileMesh, MeshRenderer and MaterialComponent respectively. For more details, you can read the following article. We allowed them to be used in the previous version as deprecated classes.
So, here we go!
Loading Game Info
The most important change is that we need to Load the GameInfo file (.wgame).
WaveEngine 2.4.1
1 2 3 4 5 6 7 |
// In the Game.cs file public override void Initialize(IApplication application) { base.Initialize(application); // The rest of the Initialize code } |
WaveEngine 2.5.0
1 2 3 4 5 6 7 8 9 |
// In the Game.cs file public override void Initialize(IApplication application) { base.Initialize(application); this.Load(WaveContent.GameInfo); // The rest of the Initialize code } |
RenderLayers
Main difference is LayerType properties has changed to LayerId, holding now an int identifier instead of a Type.
WaveEngine 2.4.1
1 |
material.LayerType = DefaultLayers.Opaque; |
WaveEngine 2.5.0
1 |
material.LayerId = WaveContent.RenderLayers.Opaque; |
WaveEngine 2.4.1
1 2 |
// drawable2D can be a SpriteRenderer, SpriteAtlasRenderer, TextRenderer2D, etc. drawable2D.LayerType = DefaultLayers.Alpha; |
WaveEngine 2.5.0
1 2 |
// drawable2D can be a SpriteRenderer, SpriteAtlasRenderer, TextRenderer2D, etc. drawable2D.LayerId = WaveContent.RenderLayers.Alpha; |
Mainly every property Type LayerType has been changed to int LayerId.
Sampler State
The AddressMode has now evolved to the SamplerState, and can be configured in the Texture Asset, instead of the material or the component.
StandardMaterial
WaveEngine 2.4.1
1 |
standardMaterial.Diffuse = diffuseTexture; |
WaveEngine 2.5.0
1 |
standardMaterial.Diffuse1 = diffuseTexture; |
WaveEngine 2.4.1
1 |
standardMaterial.DiffusePath = WaveContent.Assets.Textures.Texture1_png; |
WaveEngine 2.5.0
1 |
standardMaterial.Diffuse1Path = WaveContent.Assets.Textures.Texture1_png |
WaveEngine 2.4.1
1 |
standardMaterial.TexcoordOffset = Vector2.Zero; |
WaveEngine 2.5.0
1 |
standardMaterial.TexcoordOffset1 = Vector2.Zero; |
WaveEngine 2.4.1
1 |
standardMaterial.Ambient = cubemapTexture; |
WaveEngine 2.5.0
1 |
standardMaterial.ENVTexture = WaveContent.Assets.Environment_cubemap; |
WaveEngine 2.4.1
1 |
standardMaterial.AmbientPath = WaveContent.Assets.Environment_cubemap; |
WaveEngine 2.5.0
1 |
standardMaterial.EnvironmentPath = WaveContent.Assets.Environment_cubemap; |
Dual Material
The DualMaterial class has been removed. It has been merged into the StandardMaterial, which now has Diffuse1 and Diffuse2 properties, among others.