Sign in to follow this  
Moe

[.net] [XNA] What have you discovered by playing with XNA?

Recommended Posts

Well, for the first time a few days ago, I cracked open Visual Studio C# Express and tried making a simple XNA program (as described in by these tutorials). After doing a bit of poking around, I came across the properties for the application settings. (To see what I mean, open up the window where you can view your different components - the design view of the main part of the program, and right click->properties. I had no idea that XNA programs by default had a fixed time step. I have also discovered: - the graphics component doesn't automatically handle alt-tab - XNA help is available through the Help->Contents menu. I had no idea that there was this much documentation available. I was trying to figure out how the heck people were making simple 2d games based of the few tutorials that I have seen...[rolleyes] So, what things have you guys/gals discovered with XNA?

Share this post


Link to post
Share on other sites
Quote:
Original post by Moe
So, what things have you guys/gals discovered with XNA?

That's it's gonna make game development a heck of a lot easier. :)

I like the components/services system. Once the community gets rolling and releases components, it'll be a matter of dropping them on a game component, setting some properties and having the skeleton of a game pretty much done. Just write a little gameplay specific code and you've got a game.

Once the content pipeline is in and we can run games on our 360s, life will be good. If they create an XNA Live Arcade type system, so much the better.

Share this post


Link to post
Share on other sites
The design behind XNA is absolutely brilliant. I've played around a bit with the component and services model and am really impressed with how it all comes together. One of the game components I put together was a TrueTypeFontComponent, which when dragged onto the design screen, gives you the ability to load and render TrueType fonts.

Share this post


Link to post
Share on other sites
Once I learn enough, I would like to produce a simple GUI component, with things like buttons, checkboxes and a custom cursor. Mind you, I don't know if I will ever get around to it, but it is something I have been thinking about.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Since XNA is effectively C# with knobs on, does it still feature the DLL interop services?

Or put another way, can I still wrap opengl in a dll and use that instead of dx?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Since XNA is effectively C# with knobs on, does it still feature the DLL interop services?

Or put another way, can I still wrap opengl in a dll and use that instead of dx?


No platform invoke, if you want to keep what you write working on XBox360 as well as your PC.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yeah I figured it wouldn't be possible on the 360, different os and all, but the pc version still has it though right?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Yeah I figured it wouldn't be possible on the 360, different os and all, but the pc version still has it though right?

Yes. You can do anything in an XNA PC game that you can regularly with C#.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
XNA is great. The one thing I was wondering about is whether Game.GameServices.GetService calls are expensive in terms of processing time, as I'm currently making several of them each frame to make sure my references are correct (eg after a device reset, or on the first frame, etc).

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
XNA is great. The one thing I was wondering about is whether Game.GameServices.GetService calls are expensive in terms of processing time, as I'm currently making several of them each frame to make sure my references are correct (eg after a device reset, or on the first frame, etc).


It looks like they have implemented the feature as an Dictionary which is essentially an hash table. Therefore the cost of the look up should be pretty small. The overhead in a hash table is generally cased by the use of extra non used memory blocks needed by the algorithm (Depending on the implmentation).

I really wish they would release a beta of the content pipeline. Seeing that the October DirectX SDK will be out Monday, and it does not include anything XNA related, I don't forsee it being released early. I'm kinda stuck between a rock and a stone on my 3D project right now. Its one of those, do I say screw the pipeline and write everything myself, or do I wait and reap the benefits.

Share this post


Link to post
Share on other sites
Quote:
Original post by Billr17
Its one of those, do I say screw the pipeline and write everything myself, or do I wait and reap the benefits.

Are you under some kind of deadline? If not, wait. Isn't there other non-pipeline code you can work on?

Share this post


Link to post
Share on other sites
I haven't had a problem with it yet. I've whipped up almost a half-dozen components so far. I've rarely come across a need for multiple inheritance with C#. There's always interfaces, which you can implement along with inheriting from a base class in C#.

Share this post


Link to post
Share on other sites
Quote:
Original post by Krisc
It just occured to me that XNA Game Components require you inherit a class and that C# does not allow multiple inheritance. Kind of lame if you ask me.


While its true that you can only inherit from a single class, you *can* inherit from as many interfaces as you wish (in addition to a single class if you so choose.)

Honestly, I have never run into a case that was best solved by true multiple inheritance. The implimentation is sticky in languages like C++ and its considered to be a broken paradigm by many smart programmers (though I'm sure there are smart programmers who would disagree with them.)

Share this post


Link to post
Share on other sites
I've discovered that it took me 30 minutes to get something vaguely looking like a pong clone with no prior experience with XNA. That's what I discovered and it freaking rocks.

Quote:
Original post by Ravyne
Quote:
Original post by Krisc
It just occured to me that XNA Game Components require you inherit a class and that C# does not allow multiple inheritance. Kind of lame if you ask me.


While its true that you can only inherit from a single class, you *can* inherit from as many interfaces as you wish (in addition to a single class if you so choose.)

Honestly, I have never run into a case that was best solved by true multiple inheritance. The implimentation is sticky in languages like C++ and its considered to be a broken paradigm by many smart programmers (though I'm sure there are smart programmers who would disagree with them.)


Deriving the class you want to inherit from the game component class.

Share this post


Link to post
Share on other sites
I have discovered that if you get it installed, there is no reason at all why you can't use it with .Net languages other than C#. I was kinda annoyed that I had to download both C# Express and Game Studio Express just to use the XNA Framework assemblies in a VB.Net Project. It works just fine. I plan on using it for a lot of 2D graphics, but I haven't gotten that far into it yet.

Share this post


Link to post
Share on other sites
Well, I think I just learned something new. You can't pass a GraphicsDevice by reference. So, does this mean the only way to do it is by value? That seems like a lot of memory copying going on, each time I need to use it in my own home grown modules.

Share this post


Link to post
Share on other sites
Quote:
Original post by Moe
Well, I think I just learned something new. You can't pass a GraphicsDevice by reference. So, does this mean the only way to do it is by value? That seems like a lot of memory copying going on, each time I need to use it in my own home grown modules.
I think what you're talking about is ownership of the GraphicsDevice object, which introduced the concept of GameServices and the GraphicsService to manage the creation and deletion of GraphicsDevices.

Share this post


Link to post
Share on other sites
Quote:
Original post by ernow
Isn't a GraphicsDevice a reference type? Passing by value then means that the reference is copied, not the entire object!

Is that the case? If it is, sweet! [smile] I can't say I have done much more than reading a few simple tutorials, and my own poking around with XNA. Perhaps I should do a little more digging around in the documentation...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this