Runtime Errors

Nov 18, 2010 at 9:20 PM

Bamyazi,

When I run the most recent source code in Visual C# 2010 Express I get the following errors;

 

Error    1    Metadata file 'C:\Users\Ash\Desktop\TechCraft\TechCraftEngine\bin\x86\Debug\TechCraftEngine.dll' could not be found    TechCraft

 

 

Error    5    Errors compiling C:\Users\Ash\Desktop\TechCraft\TechCraftEngine\Content\Effects\ParticleEffect.fx:
C:\Users\Ash\Desktop\TechCraft\TechCraftEngine\Content\Effects\ParticleEffect.fx(173,20): error X3000: syntax error: unexpected token 'VertexShader'    C:\Users\Ash\Desktop\TechCraft\TechCraftEngine\Content\Effects\ParticleEffect.fx    173    20    TechCraftEngine

 

Is there any obvious reason? I suspect i'm just being stupid, only immediate difference I can see I'm using the Express edition but I doubt that's the case.

 

Any pointers?

Thanks

-Ferret

Jan 6, 2011 at 9:26 AM

I have the same problem. Any solution for this?

-Magnus

Feb 22, 2011 at 6:08 PM

Converting to xna4 took me 3 hours, with http://www.nelxon.com/blog/xna-3-1-to-xna-4-0-cheatsheet/ and http://blogs.msdn.com/b/shawnhar/archive/2010/04/19/vertex-data-in-xna-game-studio-4-0.aspx, and little 3d experience (opengl in java) but no xna experience.

The tricky part is making VertexPositionTextureShade implement IVertexType by  adding

      public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(VertexElements);
        VertexDeclaration IVertexType.VertexDeclaration { get { return VertexDeclaration; } }

just after the VertexElements part.

It's a good exercise to understand the code so I wont post the zip (unless someone asks politely ;)

Feb 23, 2011 at 1:15 AM

Hey enomi, could you post the zip?  I tried a couple times to upgrade to XNA 4 and I failed everytime.  I keep getting error X3000: syntax error: unexpected token 'VertexShader' in TechCraft\TechCraftEngine\Content\Effects\ParticleEffect.fx 173 20 TechCraftEngine also.  Does anyone have a 4.0 example?

Feb 23, 2011 at 1:41 AM

Err actually fixed the shader error but does your game appear normal after you did all the XNA 3 to 4 updates?  My game does NOT look normal.

Feb 23, 2011 at 2:36 AM

maybe you did the same mistake I did : put blendstate.additive instead of opaque. there should be absolutely no blendstate.additive in the code. nelxon.com guidelines were a bit misleading but you need to think 2 minutes about what additive blending is . But it makes a good see through walls / over exposed white balance mod :)

  For now I just need to fix the particles, currently I replaced point sprites with lines blindly so I get ...  lines :) But the code is a copy paste of the microsoft particles example ( + 3 lines for fog ) and there is an xna4.0 port of this same example on app hub, so it would be manageable I think.

Thanks to Bamyazi for this great piece of code (And thanks to infiniminer authors for the initial codebase ! )

Feb 23, 2011 at 4:38 AM

Post some source, lets upgrade this project to 4.0

Feb 24, 2011 at 3:12 AM
Edited Feb 24, 2011 at 3:13 AM

Done, in patch section ! I even upgraded the particle system from the xna4 sample and added or tweaked some minor things like flying or no trees underwater :)

http://techcraft.codeplex.com/SourceControl/list/patches

Feb 24, 2011 at 7:32 AM

Damn looks really good was able to run it.  Going to dive into in a bit.