XNA Creators Club Online
Page 1 of 1 (11 items)
Sort Posts: Previous Next

Deployment problems

Last post 2/9/2010 6:56 PM by Exadon. 10 replies.
  • 2/8/2010 8:23 PM

    Deployment problems

    Hi, sorry for posting so much recently.
    When i try to deploy my game, the game is deployed the files are loaded and VisualStudio says ready at the bottom. The problem is that when the game starts, all there is is a black, empty screen and it only lasts for about 5 seconds then goes back to the connect to computer screen. Ive inserted a breakpoint on game.Run in the Main method, but it brings back no results.
    If anyone could help it would be great!
    MelonSponge
    Robert Forrest----- Coming soon.... a game which i cant think of a name for
  • 2/8/2010 8:26 PM In reply to

    Re: Deployment problems

    Ummm, code?!? :\
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 2/8/2010 8:38 PM In reply to

    Re: Deployment problems

    http://text.pastebin.com/f76db3fb2

    I started from the Heightmap collision sample
    Robert Forrest----- Coming soon.... a game which i cant think of a name for
  • 2/8/2010 9:36 PM In reply to

    Re: Deployment problems

    Have you tried running it just on your PC and not deploy it to your xbox?  Does that work/give you your expected results?
  • 2/8/2010 11:04 PM In reply to

    Re: Deployment problems

    If you've never deployed to the 360 before, try deploying an empty project. It should display a beautiful cornflour blue colour.
  • 2/9/2010 5:14 PM In reply to

    Re: Deployment problems

    Dan Weatherman:
    Have you tried running it just on your PC and not deploy it to your xbox?  Does that work/give you your expected results?


    i made a windows copy of it and it turn out that i have a StackOverFlow exeption in my GameObjects class at this line:
        

    gameobject =

    new GameObject();

     


    Ive never had a StackOverFlow exeption before so i dont know how to handle it. Any ideas?

    MelonSponge
    Robert Forrest----- Coming soon.... a game which i cant think of a name for
  • 2/9/2010 5:34 PM In reply to

    Re: Deployment problems

    You got infinite recursion going on here. Why are you doing this?
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 2/9/2010 6:08 PM In reply to

    Re: Deployment problems

    Jim Perry:
    You got infinite recursion going on here. Why are you doing this?


    ok, ill explain. When i intergrated the GameObject class to the Heightmap Collision Sample, i had to put in a reference to the GameObject class to get the DrawModel method to work. There were no errors from that apart from a nullreference exeption from this line:
    Matrix boneTransforms = new Matrix[gameobject.model.Bones.Count]; 

    in the Game class. So, i put it into the GameObject class as this:
    public Matrix[] boneTransforms; 

    and then to the constructor of GameObject as:
    boneTransforms = new Matrix[gameobject.model.Bones.Count]; 

    to make that work i needed a referance to the GameObject class, which is this:
    gameobject = new GameObject(); 

    Now there are no errors, just a StackOverFlow exeption, which only seems to apear when the game is ran on windows.
    Thats the story.
    MelonSponge
    Robert Forrest----- Coming soon.... a game which i cant think of a name for
  • 2/9/2010 6:25 PM In reply to

    Re: Deployment problems

    Ummm, if you don't understand why that's a problem I would suggest learning a bit more about C# before going any further.
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 2/9/2010 6:33 PM In reply to

    Re: Deployment problems

    Yes, i think i made a bit of a mistake of thinking that i could learn as i went, like i did with VB.
    Robert Forrest----- Coming soon.... a game which i cant think of a name for
  • 2/9/2010 6:56 PM In reply to

    Re: Deployment problems

    Answer
    Reply Quote
    MelonSponge:
    Yes, i think i made a bit of a mistake of thinking that i could learn as i went, like i did with VB.

    The problem is really simple when you look at the code. Take a look

         public GameObject() 
            { 
                gameobject = new GameObject(); 
                boneTransforms = new Matrix[gameobject.model.Bones.Count]; 
              
                
            } 

    Here you  have gameobject = new a new GameObject. So when you run this method if a Gameobject is created it will make a new GameObject,
    then that GameObject will run the same method and create another GameObiject, this will happen forever. This is why you get the stack overflow. Does that make sense?

    Think of it this way. 

    I create a new game object called Paul when Paul is created it runs the method inside and creates a gameobject = to a new GameObject();
    when gameobject is created it then creates a new gameobject inside that gameobject.

    This will never end.
    • Paul
      • gameObject
        • gameObject
          • gameObject
            • gameObject
              • gameObject
                • ~~~~~

    If you wish to pass data inside methods you should do something like the following :
    using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Text; 
     
    namespace ConsoleApplication1 
        class Program 
        { 
     
            static void Main(string[] args) 
            {         
         
                //This calls the method and passes the vars 1 and 2. The result will be 3.  
                 
                //Write to console 
                Console.WriteLine( 
                        //Call the Add2Number Method, Pass in the int of 1 and 2 
                        //the .ToString will convert our int to a string 
                        Add2Numbers(1, 2).ToString()); 
                //Pause so user can see output 
                Console.ReadLine(); 
            } 
            //Set method to acept 2 numbers to add 
            static int Add2Numbers(int a, int b) 
            { 
                //add numbers passed in 
                int answer = a + b; 
                //return result  
                return answer; 
            } 
        } 
     

    Or in your case you would want something like this:

         public GameObject(Model model)  
            {  
                boneTransforms = new Matrix[model.Bones.Count];  
            }  


    then when you call the method do something like

    GameObject(gameobject.model); 





Page 1 of 1 (11 items) Previous Next