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

Making examples available as starter kits.

Last post 9/6/2008 11:26 AM by Stainless. 11 replies.
  • 8/8/2008 11:36 AM

    Making examples available as starter kits.

    I am forever grabbing a copy of this or that from the examples section, then manually changing everything into a new namespace, etc. etc. when I start a new project.

    Particularly the game state management sample, I use that a lot.

    Any chance you could make them available as starter kits?

    Or even just as project templates?

     

     

     

    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
  • 8/8/2008 2:11 PM In reply to

    Re: Making examples available as starter kits.

    You could always just make a project template for yourself :-) just go to File / Export Template ...
    Joel Martinez - XNA MVP
    Blog: http://codecube.net
    XNA Unit Testing: Scurvy Test
  • 8/11/2008 10:12 AM In reply to

    Re: Making examples available as starter kits.

    Sadly it's not as simple as that.

    You can turn them into project templates with a bit of messing about, in fact I have for a couple of them. The procedure is..

    1) Click on the solution and "show all files".

    2) A new content folder will appear in white, right click on that and "add  to project"

    3) Export as project template

    4) Open the zip file that is created in My Documents\vs2005\templates and extract all files to a temp directory.

    5) Open the .vstemplate in a text editor

    6) edit the file and add this line

    <PromptForSaveOnCreation>true</PromptForSaveOnCreation>

    after this line

    <EnableLocationBrowseButton>true</EnableLocationBrowseButton>

    7) Save file and zip folder contents back up again

    8) Replace the generated zip with the new zip

     

    Normally this will work, though if you have any links in the project they will be broken, I haven't found any way around that yet.

     

    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
  • 8/11/2008 4:05 PM In reply to

    Re: Making examples available as starter kits.

    Nazeeh put together a template version of the Game State Management sample.

    The problem with shipping all our samples in starter kit format is that Visual Studio doesn't deal very well with large starter kits. It assumes that starter kits will be mostly source code, and not very large in terms of raw megabytes. But most of our samples contain graphics and audio content, which makes them pretty big! Installing many such large content files into Visual Studio causes a huge delay any time your install or uninstall VS plugins, for instance.

    XNA Framework Developer - blog - homepage
  • 8/13/2008 8:21 AM In reply to

    Re: Making examples available as starter kits.

    Is this any better in 2008?

    I am noticing a lot of little annoyances with VS 2005, things like XBOX not being defined even though it's specified in the project settings. I have to manually type in #define XBOX360 every time I swap from PC to XBOX....  aaagggh

    minor but time wasting.

     

     

     

     

    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
  • 8/13/2008 4:07 PM In reply to

    Re: Making examples available as starter kits.

    There are comprehensive steps for creating custom project templates for XNA Game Studio 2.0 in this blog post.  These steps will be roughly the same for Visual Studio 2008 and XNA Game Studio 3.0.

    Also, I'm not sure what you mean about the XBOX or XBOX360 symbols not being defined.  Which projects do you see that symbol not being defined for currently?  If it is a Windows game project, you should be able to right-click on the project in the VS Solution Explorer and choose Create Copy of <project name> for Xbox 360...  That will create an Xbox 360 copy of the project, and it should define the XBOX and XBOX360 symbols for you automatically when you do that.

    Thanks!

  • 8/14/2008 4:09 PM In reply to

    Re: Making examples available as starter kits.

    They are defined in the project settings, but if you type in

    #if XBOX360

    #endif

    The code block is NEVER compiled, you have to manually #define it

     

     

     

     

     

    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
  • 8/14/2008 4:30 PM In reply to

    Re: Making examples available as starter kits.

    I haven't been able to reproduce this issue on my systems so far.  Do you have a sample project that you could post on a file server so I can try it out?

    Thanks!

  • 8/16/2008 9:31 AM In reply to

    Re: Making examples available as starter kits.

    will try and put something together

     

    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
  • 9/4/2008 8:51 AM In reply to

    Re: Making examples available as starter kits.

    Have tracked this down.

    1) Create a windows game

    2) Create an xbox version from this (right click on solution and 'create copy of project for xbox...' )

    3) put in some code surrounded by a #if XBOX360

    4) At the top of the window set the active configuration to XBOX, and click on 'build ->build solution'

    Fails

    5) Right click on the xbox version in the solution explorer and select build

    Works

     

    It seems to be the active configuration that is getting ignored by the build menu.

     

     

    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
  • 9/4/2008 5:30 PM In reply to

    Re: Making examples available as starter kits.

    Thanks for the additional information.  This scenario is a bit confusing when first getting started, but this is how Visual Studio is designed to work for multi-project solutions, and XNA Game Studio is inheriting that behavior.  There is some information that we are adding to the documentation in XNA Game Studio 3.0 to try to give some better guidance about this type of scenario.  Here is an early draft of some of that information in case it is helpful to you here:

    Using Solution Configurations

    Solution configurations store solution level properties that direct which style of object and executable output are produced by the Start (F5) key and Build commands. In a cross-platform solution in XNA Game Studio, the solution configuration platform setting is a composite of the platform settings for each project in the solution.

    It is important to understand that the solution configuration does not determine which projects are built and deployed. This is determined by the startup project setting (described in the previous section).

    The solution configuration controls in the Visual Studio toolbar establish the "Active" (or default) configuration for all projects in the solution. For example, the active configuration may be set to the "Debug" configuration, which includes all symbol information and minimal compiler optimzation, or the "Release" configuration. Changing this setting will affect the build of all projects set to the active configuration.

    Each project may have its own configuration settings, which may override the active configuration. The project's configurations will also specify the target platform (for example, Windows, Xbox 360, or Zune). The platform settings are set automatically for a project when you use the Create Copy... command to create the synchronized project for a new platform.

    To view the project configuration settings:

    1. In Solution Explorer, right-click the project to view it, and then click Properties.
    2. In the Project Designer now displayed, click the Build tab.
    3. You can view the project configuration, and change it in the Configuration and Platform settings.

    Setting Deployment Options

    You can use the Build and Run settings to limit Start and Build commands to the startup project.

    To set Build and Run options:

    1. From the Tools menu, click Options...
    2. If you are using Visual C# Express, make sure the check box in the Options dialog at the bottom left-hand corner labeled Show all settings is checked.
    3. In the Options dialog, expand the Projects and Solutions node, and select the Build and Run options set.
    4. Check the box labeled Only build startup projects and dependencies on Run (it is unchecked by default).

    This setting will limit build and deployment to the startup project.

    In addition, you may wish to set the option that automatically sets the currently selected project as the startup project.

    To automatically set the startup project

    1. Check the box labeled For new solutions use the currently selected project as the startup project (it is unchecked by default).

      This setting will establish that the currently selected project is the startup project. This option will only take effect for new solutions.

    Setting the Startup Project Manually

    The startup project is the project that will be the first built, debugged, and deployed by Visual Studio. When you deploy a solution, the startup project is the first project to run. If you set the Build and Run settings as described previously, the Start and Build commands will be limited solely to the startup project.

    Further, if the startup project is set automatically to the currently selected project, it is not necessary to manually set the startup project.

    The startup project name always appears in boldface in Solution Explorer.

    To set the startup project manually:

    1. In Solution Explorer, right-click the project you wish to set as the startup project.
    2. In the context menu, click Set as StartUp Project.
    3. You also have the option of either selecting the project in Solution Explorer or, from the Project menu, selecting Set as StartUp Project.

     

  • 9/6/2008 11:26 AM In reply to

    Re: Making examples available as starter kits.

    Thanks for that.

    The issue for me is that when you change the active configuration with the selection box at the top of the screen, the #defines are not reflected in the source code.

    For example in a project with a default PC solution regions wrapped by #if XBOX360 are never active. Which is a pain in the proverbial as none of the editors usefull behaviours are active.

    I think it caused by the file sharing, i.e. game1.cs is a part of the PC solution always, even though it is in the XBOX solution as well.

     

     

     

     

     

    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
Page 1 of 1 (12 items) Previous Next