Go Back   Zune Boards > Zune Discussions > Zune Games > Development Discussions

Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related.

Reply
 
LinkBack Thread Tools
Old 09-17-2008, 08:11 AM   #1 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 332
shutout5591 will become famous soon enough
Default XNA 3.0 Beta Changes

The purpose of this thread is for developers to post differences they have noticied from 3.0 CTP to Beta. This will make the process of converting and learning the Beta easier.

I will start off:

Code:
Beta:
MediaPlayer.PlayPosition - Get

CTP:
MediaPlayer.PlayPosition - Get, Set
Anybody know how to set the play position??

Also: Here is a link to the official connect site, where we can post feedback and read the feedback of others.

https://connect.microsoft.com/feedba...spx?SiteID=226
__________________
~Shutout5591~

[FINAL] Asteroids 1.0
If you like me work or I have helped you, + Rep me!

Last edited by shutout5591; 09-17-2008 at 08:13 AM.




shutout5591 is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old 09-17-2008, 09:35 AM   #2 (permalink)
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
Default

Here is another change:

Code:
Beta:
MediaPlayer.MovePrevious();
MediaPlayer.MoveNext();

CTP:
MediaPlayer.Queue.MovePrevious();
MediaPlayer.Queue.MoveNext();
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html

Last edited by Netrix; 09-17-2008 at 04:05 PM.




Netrix is offline   Reply With Quote
Old 09-17-2008, 03:22 PM   #3 (permalink)
Faded Divinity
zB Programmer
Jr. Member
 
Join Date: Feb 2007
Posts: 377
Fade3e is on a distinguished road
Default

just wondering, in hexic and poker they have the normal zunes ui popup when the music options are hit, is there now ways to do this like tiptups eblade or was that just programmed into those games
__________________
Twitter - http://twitter.com/FadeCE
Follow my programming status etc







Fade3e is offline   Reply With Quote
Old 09-17-2008, 03:30 PM   #4 (permalink)
Jr. Zuner
 
Join Date: Nov 2007
Posts: 39
sectionboy is on a distinguished road
Default

Quote:
Originally Posted by Netrix View Post
You can set the play position to a specific time by doing the following:

Code:
 MediaPlayer.PlayPosition.Subtract(MediaPlayer.PlayPosition + new TimeSpan(x,y,z));
...where x = hours, y = minutes, and z = seconds.

So if you just want to set the play position back to the beginning, all you have to do is this:

Code:
MediaPlayer.PlayPosition.Subtract(MediaPlayer.PlayPosition);


Have you tested it? It didn't work when I did, zune just ignored PlayPosition and kept going on its own pace.


I filed a suggestion on ms connect here:
https://connect.microsoft.com/feedba...080&SiteID=226

Last edited by sectionboy; 09-17-2008 at 03:36 PM.



sectionboy is offline   Reply With Quote
Old 09-17-2008, 03:58 PM   #5 (permalink)
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
Default

Quote:
Originally Posted by sectionboy View Post
Have you tested it? It didn't work when I did, zune just ignored PlayPosition and kept going on its own pace.


I filed a suggestion on ms connect here:
https://connect.microsoft.com/feedba...080&SiteID=226
EDIT: Silly me... public TimeSpan Subtract(TimeSpan ts); returns:
Quote:
A System.TimeSpan whose value is the result of the value of this instance minus the value of ts.
So no, it is not a bug. The problem is that MediaPlayer.PlayPosition is readonly.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html

Last edited by Netrix; 09-17-2008 at 04:04 PM.




Netrix is offline   Reply With Quote
Old 09-17-2008, 04:00 PM   #6 (permalink)
you lost the game.
zB Programmer
Moderator
Elite Zuner
 
itsnotabigtruck's Avatar
 
Join Date: May 2008
Posts: 2,434
itsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud of
Default

Quote:
Originally Posted by Netrix View Post
You can set the play position to a specific time by doing the following:

Code:
 MediaPlayer.PlayPosition.Subtract(MediaPlayer.PlayPosition + new TimeSpan(x,y,z));
...where x = hours, y = minutes, and z = seconds.

So if you just want to set the play position back to the beginning, all you have to do is this:

Code:
MediaPlayer.PlayPosition.Subtract(MediaPlayer.PlayPosition);

Here is another change:

Code:
Beta:
MediaPlayer.MovePrevious();
MediaPlayer.MoveNext();

CTP:
MediaPlayer.Queue.MovePrevious();
MediaPlayer.Queue.MoveNext();
TimeSpan structs are immutable, so the Subtract function is actually returning a new TimeSpan with the modified result. Flipflopping the track should work though (not sure about the result if it's playing the first or last tracks)
__________________

signature by vettexl




itsnotabigtruck is offline   Reply With Quote
Old 09-17-2008, 04:01 PM   #7 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 332
shutout5591 will become famous soon enough
Default

Quote:
Originally Posted by fade3e View Post
just wondering, in hexic and poker they have the normal zunes ui popup when the music options are hit, is there now ways to do this like tiptups eblade or was that just programmed into those games
I believe this can be called with:

Quote:
guide.Show();
I forget the actual syntax, but its a a guide,a nd its very easy to impliment.
__________________
~Shutout5591~

[FINAL] Asteroids 1.0
If you like me work or I have helped you, + Rep me!




shutout5591 is offline   Reply With Quote
Old 09-17-2008, 04:49 PM   #8 (permalink)
Jr. Zuner
 
Join Date: Nov 2007
Posts: 39
sectionboy is on a distinguished road
Default

Quote:
Originally Posted by Netrix View Post
EDIT: Silly me... public TimeSpan Subtract(TimeSpan ts); returns:


So no, it is not a bug. The problem is that MediaPlayer.PlayPosition is readonly.
Isn't that what the first post says? Now you know.



sectionboy is offline   Reply With Quote
Old 09-17-2008, 05:05 PM   #9 (permalink)
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
Default

Quote:
Originally Posted by sectionboy View Post
Isn't that what the first post says? Now you know.
No... It just says that Set is no longer implemented for PlayPosition. That does not necessarily mean that it is readonly.

As for Subtract() and Add(), at first I thought it would modify the PlayPosition directly by using them, but all they do is return the result, and leave the original variable untouched. The only way (that I know of so far) to change the PlayPosition is to do 'MediaPlayer.PlayPosition = new TimeSpan(...)', but that can not be done now, since it is readonly.

This is definitely a problem. I really hope that they change it back to the way it was before.

Another change:
Quote:
MediaPlayer.MoveNext(); and MediaPlayer.MovePrevious(); do not work when used while MediaPlayer.State == MediaPlayer.Paused.
It used to advance to the next song while the MediaPlayer was paused, but now it causes the MediaPlayer.Queue.ActiveSong to become null, and the MediaPlayer.Queue.ActiveSongIndex to become -1. To get it to work correctly, the MediaPlayer must be playing.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html

Last edited by Netrix; 09-17-2008 at 05:14 PM.




Netrix is offline   Reply With Quote
Old 09-17-2008, 06:14 PM   #10 (permalink)
you lost the game.
zB Programmer
Moderator
Elite Zuner
 
itsnotabigtruck's Avatar
 
Join Date: May 2008
Posts: 2,434
itsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud of
Default

Quote:
Originally Posted by Netrix View Post
No... It just says that Set is no longer implemented for PlayPosition. That does not necessarily mean that it is readonly.

As for Subtract() and Add(), at first I thought it would modify the PlayPosition directly by using them, but all they do is return the result, and leave the original variable untouched. The only way (that I know of so far) to change the PlayPosition is to do 'MediaPlayer.PlayPosition = new TimeSpan(...)', but that can not be done now, since it is readonly.

This is definitely a problem. I really hope that they change it back to the way it was before.

Another change:

It used to advance to the next song while the MediaPlayer was paused, but now it causes the MediaPlayer.Queue.ActiveSong to become null, and the MediaPlayer.Queue.ActiveSongIndex to become -1. To get it to work correctly, the MediaPlayer must be playing.
For a value type, if there isn't a set accessor for a property (which is the case here), the property is by definition read-only. Even if the Subtract function did modify the TimeSpan value in-place, you would only be modifying a copy of the TimeSpan.
__________________

signature by vettexl




itsnotabigtruck is offline   Reply With Quote
Old 09-17-2008, 06:52 PM   #11 (permalink)
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
Default

Quote:
Originally Posted by itsnotabigtruck View Post
For a value type, if there isn't a set accessor for a property (which is the case here), the property is by definition read-only. Even if the Subtract function did modify the TimeSpan value in-place, you would only be modifying a copy of the TimeSpan.
Well could the following not be the case?

Code:
public TimeSpan Variable
        {
            get { return actualVariable; }
        }
'actualVariable' could still be modified by the class in which it is, could it not? It would not be able to be set by other classes that only knows it by 'Variable', but its class should still be able to modify actualVariable.

Of course, that would still make it effectively readonly to everything except the class to which it belongs.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html

Last edited by Netrix; 09-17-2008 at 06:55 PM.




Netrix is offline   Reply With Quote
Old 09-17-2008, 07:02 PM   #12 (permalink)
you lost the game.
zB Programmer
Moderator
Elite Zuner
 
itsnotabigtruck's Avatar
 
Join Date: May 2008
Posts: 2,434
itsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud of
Default

Quote:
Originally Posted by Netrix View Post
Well could the following not be the case?

Code:
public TimeSpan Variable
        {
            get { return actualVariable; }
        }
'actualVariable' could still be modified by the class in which it is, could it not? It would not be able to be set by other classes that only knows it by 'Variable', but its class should still be able to modify actualVariable.

Of course, that would still make it effectively readonly to everything except the class to which it belongs.
In that case, the property is considered read-only. The field isn't, unless it's declared with the readonly modifier (then it can only be modified by the constructor).

Since properties are pairs of functions, and value types used in return values are always passed by value, even a non-immutable struct can't be modified from a property (even a read/write property). This is because you're only modifying a copy of the struct.
__________________

signature by vettexl




itsnotabigtruck is offline   Reply With Quote
Old 09-17-2008, 07:16 PM   #13 (permalink)
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
Default

Quote:
Originally Posted by itsnotabigtruck View Post
In that case, the property is considered read-only. The field isn't, unless it's declared with the readonly modifier (then it can only be modified by the constructor).

Since properties are pairs of functions, and value types used in return values are always passed by value, even a non-immutable struct can't be modified from a property (even a read/write property). This is because you're only modifying a copy of the struct.
Oh.. Thank you for clarifying that. I forgot a couple things that I should know. That happens sometimes. I suppose it is obvious that the field itself is not readonly, since it is changed whenever a song is playing, but that is useless to us, since we have no way of accessing the field directly.

I apologize for spreading misinformation.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html




Netrix is offline   Reply With Quote
Old 09-18-2008, 09:06 PM   #14 (permalink)
Experienced Member
 
LedZepp's Avatar
 
Join Date: Mar 2007
Posts: 976
LedZepp has a spectacular aura aboutLedZepp has a spectacular aura about
Default

I dont think we need RIG anymore, turns out we can deploy .ccgame files now.
Try it:
Open your project, go to the Build file menu, then select Package XXXX as XNA Creators Club Game

Then just find the XXXX.ccgame file in the bin folder of your project.
When I tried it with a game it said the Target platform was Zune(Baked)
Baked is my zunes name, so Im not sure if a ccgame file is limited to your zune or if it just takes your zunes name out of your computer


Scratch that, You still need XNA to use ccgame files, but still this makes it alot easier to redistribute
__________________
Game Request Template

Last edited by LedZepp; 09-18-2008 at 09:16 PM.




LedZepp is offline   Reply With Quote
Old 09-18-2008, 09:26 PM   #15 (permalink)
you lost the game.
zB Programmer
Moderator
Elite Zuner
 
itsnotabigtruck's Avatar
 
Join Date: May 2008
Posts: 2,434
itsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud of
Default

Quote:
Originally Posted by LedZepp View Post
I dont think we need RIG anymore, turns out we can deploy .ccgame files now.
Try it:
Open your project, go to the Build file menu, then select Package XXXX as XNA Creators Club Game

Then just find the XXXX.ccgame file in the bin folder of your project.
When I tried it with a game it said the Target platform was Zune(Baked)
Baked is my zunes name, so Im not sure if a ccgame file is limited to your zune or if it just takes your zunes name out of your computer


Scratch that, You still need XNA to use ccgame files, but still this makes it alot easier to redistribute
But you have to have XNA.

Thanks to the new bundled games (which deploy the XNA runtime, whether they actually use it or not), the runtime issue will be eliminated with RIG DP Phase 6. This means that games will finally be able to be deployed without legal impediment.
__________________

signature by vettexl




itsnotabigtruck is offline   Reply With Quote
Old 09-18-2008, 09:34 PM   #16 (permalink)
Faded Divinity
zB Programmer
Jr. Member
 
Join Date: Feb 2007
Posts: 377
Fade3e is on a distinguished road
Default

Quote:
Originally Posted by shutout5591 View Post
I believe this can be called with:



I forget the actual syntax, but its a a guide,a nd its very easy to impliment.

i guess there is no way to add subitems\menus to that huh?
__________________
Twitter - http://twitter.com/FadeCE
Follow my programming status etc







Fade3e is offline   Reply With Quote
Old 09-18-2008, 10:00 PM   #17 (permalink)
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
Default

Quote:
Originally Posted by LedZepp View Post
I dont think we need RIG anymore, turns out we can deploy .ccgame files now.
Try it:
Open your project, go to the Build file menu, then select Package XXXX as XNA Creators Club Game

Then just find the XXXX.ccgame file in the bin folder of your project.
When I tried it with a game it said the Target platform was Zune(Baked)
Baked is my zunes name, so Im not sure if a ccgame file is limited to your zune or if it just takes your zunes name out of your computer


Scratch that, You still need XNA to use ccgame files, but still this makes it alot easier to redistribute
You are forgetting about the Book Reader... The .ccgame package is useless (right now) for it, and other games where the user needs to provide their own files for the game.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html




Netrix is offline   Reply With Quote
Old 09-19-2008, 03:59 AM   #18 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 332
shutout5591 will become famous soon enough
Default

Quote:
Originally Posted by LedZepp View Post
I dont think we need RIG anymore, turns out we can deploy .ccgame files now.
Try it:
Open your project, go to the Build file menu, then select Package XXXX as XNA Creators Club Game

Then just find the XXXX.ccgame file in the bin folder of your project.
When I tried it with a game it said the Target platform was Zune(Baked)
Baked is my zunes name, so Im not sure if a ccgame file is limited to your zune or if it just takes your zunes name out of your computer


Scratch that, You still need XNA to use ccgame files, but still this makes it alot easier to redistribute
So i followed the above steps made the ccgame file, double clicked it, and an extracter pops up. It turns out that this maybe the answer to our problems!
__________________
~Shutout5591~

[FINAL] Asteroids 1.0
If you like me work or I have helped you, + Rep me!




shutout5591 is offline   Reply With Quote
Old 09-20-2008, 08:07 AM   #19 (permalink)
Experienced Zuner
 
narutor22's Avatar
 
Join Date: Jun 2008
Location: The Magical Land of Zewbie Slayers
Posts: 186
narutor22 is on a distinguished road
Send a message via Yahoo to narutor22
Default

While attempting to port ZuneHero over to 3.0 beta I encounter this error:

Error 1 No overload for method 'GetVisualizationData' takes '2' arguments C:\Documents and Settings\KAA\Desktop\AD Stuff\AD Games\to be deployed\Revised\ZuneHero\ZuneHero\ZuneHero\ZuneHe ro\Game1.cs 466 13 ZuneHero

Here is the code:

public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
songs = library.Songs;
MediaPlayer.IsShuffled = true;
MediaPlayer.IsVisualizationEnabled = true;
MediaPlayer.Play(songs);
MediaPlayer.MoveNext();
songIndex = MediaPlayer.Queue.ActiveSongIndex;
graphics.PreferredBackBufferWidth = 240;
graphics.PreferredBackBufferHeight = 320;
Services.AddService(typeof(Game1), this);
}

public void noteSpawn()
{
float spawnRate = 0;
float oldRate = 0;
MediaPlayer.GetVisualizationData(freq, sample);
for (int i = 1; i < 5 ; i++)
{
spawnRate = sample[i] * 3;
oldRate = sample[i-1] * 3;
if (spawnRate > 1 && spawnRate != oldRate)
{
addNote(spawnRate);
break;
}
}
}

What should I do?

Last edited by narutor22; 09-20-2008 at 10:16 AM.




narutor22 is offline   Reply With Quote
Old 09-20-2008, 09:40 AM   #20 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 332
shutout5591 will become famous soon enough
Default

Quote:
Originally Posted by narutor22 View Post
[A large amount of code...]
O my GOD! We need a smarter community. Why would u post ALLL the code.

Post the lin that is giving you trouble, and the relevant variables ONLY
__________________
~Shutout5591~

[FINAL] Asteroids 1.0
If you like me work or I have helped you, + Rep me!

Last edited by Netrix; 09-20-2008 at 10:39 AM.




shutout5591 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools