Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing renders in wp, after adding a default box to the logo scene. #3

Closed
Cookingsource opened this issue Mar 12, 2012 · 16 comments
Closed

Comments

@Cookingsource
Copy link

Hi, I've followed the getting started tutorial I configured it so the full export worked. After that I opened the xna project added the new assets as showed in the tutorial. Set the scene processor. Everything ok. After that I added a default unity box tothe scene but i couldn't see it in the wp7 emu, device, or even pc project.

I added the new box xml to the content. I've tried putting a light, putting the object closer or further from the camera but no luck. I spent a day trying to figure it out but didn't find a reason.

It is pretty weird, could you please give some guidance about this problem?

@fehaar
Copy link
Owner

fehaar commented Mar 12, 2012

Yes. That sounds pretty wierd. Please check that the Cube you have put in is exported to the scene XML - and that you are loading the correct scene in Game1.cs.

Do you have the source somewhere that I can look at?

@Cookingsource
Copy link
Author

I won't have access to that computer until night (here is 11:32pm) I'll try to regenerate the issue in this computer and give you the feedback, if i can't regenerate the issue here I'll send you the feedback tonight.

Thanks for your quick reply ^^

@Cookingsource
Copy link
Author

The cube is included in xmlcontent and the logo scene. The loaded scenen by default is Scenes\Logo

******************************** Call LoadLevel Logo ***********************************
******************************** Do Scene Load Logo ***********************************
'taskhost.exe' (Managed): Loaded 'Microsoft.Xna.Framework.GamerServices.dll'
******************************** Scene Load Complete ***********************************

The debug info detects an object in the scnene, it shows it in the body count. Given all that, I still don't see the default cube, it is shown in the game viewport of unity but not when i run the xna project( in any platform, not only phone).

I follwed these steps.
1- Download FFWD and Template, unpack template and framework, put the framework files in the FFWD folder of the template.
2- Launch unity open the template unity folder. Add a script folder(to prevent directory not found exception), and a default box. Move the box so it is shown in the game viewport. Export all.
3- Open the xna project, include in xml contents the logo scene and the cube. Compile, set the scene processor. Add the content references (Content and XmlContent) to the wp game project.
4- Set the wp project as startup project. Run it.

result - debug data, body count 1, no cube on screen. I tried adding and removing a point light and moving around the box to check if it was a culling problem, no luck.

Here's the project in the described state.

http://www.2shared.com/file/HjoQfibb/CubeTest02.html

@fehaar
Copy link
Owner

fehaar commented Mar 12, 2012

It is very odd that you don't see the cube. I opened your project in VS, Changed the build platform to Windows Phone. And ran it. That gave me the following output. So it seems that things are working fine. I also ran it in Windows and got the same output.

http://dl.dropbox.com/u/691629/capture.png

Beware that pointlights are not supported at the moment. The Phone is not really capable of handling them as there is no support for custom shaders or other fancy stuff, so they haven't been made. If you want to test lighting, use directional lights or lighmaps. At some point I would like to have point lights for the 360, but there are some other things to take care of first.

@fehaar fehaar closed this as completed Mar 12, 2012
@Cookingsource
Copy link
Author

Ok, no problem with lightning y simply included them to test fi it was a matter of lightning. I've tested it in another pc, and i ended up in the same situation (Indeed the one i sent you is from my work pc). I can only see the cube if its in position (0,0,0), when i rotate it the projection goes crazy, showing a very flat cube even occluding the entire screen. I've also changed the light type.

I've tried updated direct x, ill try to update all my sdks just in case, but i think they're up to date.
I'll keep you informed.

@fehaar
Copy link
Owner

fehaar commented Mar 12, 2012

Ah... I have an idea! This is probably a crazy XNA issue where the floats in the XML files gets read with the local encoding scheme and not with English as is expected. If you do like this:

  1. Open "Region and Languages"
  2. In the Formats tab, select "Additional settings"
  3. Change the "Decimal symbol" to be . (dot) and "Digit grouping symbol" to be , (comma).
  4. Apply.
  5. Restart Visual Studio and make a rebuild. Now things should be working as it is.

It is a scary issue that has bitten me more thatn once. I have not found a way to specify encoding in Visual Studio. So this is the only workaround I have.

@Cookingsource
Copy link
Author

Man! It was that! I owe you one ^^. I know elideb and he knows how to solve that locale issue he'll probably have it solved soon. I think now that we know, there should be some mention in the wiki until is solved.
Can you reopen this issue or do i create a new one as new xml content importer issue?

@fehaar
Copy link
Owner

fehaar commented Mar 12, 2012

I will write it in the wiki as it is pretty important to know. It is a bug in XNA AFAIK so I won't open an issue on it since it is not something that I can fix.

@Elideb
Copy link
Contributor

Elideb commented Mar 13, 2012

Hi there.

After trying several approaches and almost giving up on finding an elegant solution (elegant == one that didn't change VS locale until closed), CookingSource and I found inspiration on a SO question and I started learning and tampering with MSBuild.

I have managed to create a task that, called from the BeforeBuild and AfterBuild targets on XmlContent.csproj, sets the compilation locale to en-US and later reverts it to the original value, leaving VS as it was. Once I've uploaded the code and CookingSource verifies it works in one of those 100% non-English PCs I'll send you a pull request.

@fehaar
Copy link
Owner

fehaar commented Mar 13, 2012

Ok. Very cool. It is a pain to have to change your locale settings for this. I have actually looked into controlling the content build process anyway and decouple it from the normal build process - perhaps tying it into the export process. When your XNA project gets large enough, it can take ages to do the content build, and most often it will do the build when you have changed some code in the framework that does not require a content build. It slows you down massively. Maybe the code you are making would give me a good starting point for that.

@Cookingsource
Copy link
Author

From what I have tested, its solved in Elideb branch. Just have to say that for those that already have the bug, they'll have to force a rebuild or change something in the xmlcontent project so it actually recompiles it(otherwise they'll se the old buggy scene).

I already reverted my system region settings to the old numeric system and everything works as expected.

I've decided to make my DreamBuildPlay game with your tool so you'll see me more over here. I'll do my best to make this tool a great one ^^

@fehaar
Copy link
Owner

fehaar commented Mar 13, 2012

You are right about the rebuild/reexport. I will check out your addition when I get the pull request.

Very cool that you decide to make a DBP entry using it! If you report bugs, I will do what I can to keep up with what you need.

@Elideb
Copy link
Contributor

Elideb commented Mar 13, 2012

Unfortunately, I've found a problem. AfterBuild, in spite of some things I read on the internet, does not run if the compilation fails, so the CultureInfo is not reset when the XMLs are incorrect (they shouldn't be, since users of FFWD are not supposed to touch them). You can recover the previous Culture by closing/opening VS or using the tasks to restore the desired locale (a bit messy). This is still better than having to change the culture settings of the whole computer, so I'd gladly go with it.
Also, if someone uses BeforeBuild/AfterBuild in another project of the solution, there will be collisions. I'll probably end creating a couple of custom targets for this.

I've created a question in SO regarding this issue, so we might still find a fix.

@fehaar
Copy link
Owner

fehaar commented Mar 13, 2012

Ok. That pust some limitation on its use. Let me know if you find a good resolve for this.

@Cookingsource
Copy link
Author

Well, at least we're on the way, im completely sure there should be a way to run something always before and after a project builds, until we find an elegant solution we can do this. We could use pre and post build events to make the change, they can be configured to always execute, the thing is I think the commands launched from there must be command line commands.

There shuldn't be an issue to translate your taks to a mini command line app that changes the system region settings, you can serialize the var somewhere and check for it.

@Elideb
Copy link
Contributor

Elideb commented Mar 14, 2012

Fixed.

I had to do some tweaking to the contentcsproj, but now it properly reverts the locale after compilation, even if it fails. The solution also prevents the BeforeBuild/AfterBuild redefinition issues, as it uses custom targets. For details check the SO question or the comments in the project file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants