I'm a bit confused about the GameComponent class, and its intended use. It would seem that it would be perfect for inheriting particular subsystems. InputComponent, NetworkComponent, etc... but you wouldn't want to draw any subsystem.
So what was the logic behind having a Draw method for GameComponent Did the cart come before the horse, so to speak, with the GraphicsComponent How exactly is GameComponent meant to be used
I thought I'd get it straight from the horse's mouth... and I have no idea what's with all the horses in this post.
(My suggestions are in third post, if anyone cares).

GameComponent.Draw()... why?
vtortola
Sarath.
But here are some random thoughts, which are really brainstorming and beyond the scope of my actual suggestion:
Yeah, I think it would make since for GameComponent to include Update(). I think UIComponent would be better named as DrawableComponent and should introduce the Draw method.
I could see the Game having an AddComponent method, and internally it could manage them by type. It could also have an UpdateComponents() method (sort of a FrameUpdate) which could automatically invoke Update() on all GameComponents, and Draw() on the Drawable ones.
I think SubsystemComponents should be restricted to a single instance per type. LogicComponents, while superficially similar, would not be restricted in this way. You could have an AILogicComponent (hypothetically), with a distinct instance for each active entity in a scene, for example... Subsystems couldn't do this.
kuntushi
For example, somewhere I saw mention of a Framerate component from MS that you can just drop in to have the framerate displayed.
If the GameComponent class didn't provide a defined place to do drawing each component would need to come up with its own way of doing it and knowing *when* to do it. By defining the place to do it, components that want to make use of it can, those that don't, well, don't.
While not an official response, I hope it answers your question.
Cheers,
James
angelina
pankajsparashar
A SceneGraph, in my imagined perfect world, would be implemented as a DrawableComponent. And if you look at my elaboration, all GameComponents DO have an Update() method, but only DrawableComponents have a Draw() method.
DigitalFusion
Hi Dave,
How would you see the current GameComponent changing Would UIComponent introduce Draw() What would GameComponent look like. You're correct in that the "looseness" of the structure provided by the GameComponent encourages them to be "system like" components. We're trying to figure out how far to go here in v1. On one extreme you have what is in the beta and on the other you have something more policy-laden like WinForms Control or something. Somewhere in-between might be interesting (or more specifically, what is GameComponent now is really your SubsystemComponent (or maybe your UIComponent, not sure)).
Note that "system like" things are probably more services (Game.GameServices) which are available as a mechanism for components to publish/subscribe to centralized services (c.f. IGraphicsDeviceService). Services are different from GameComponents in that services are disconnected from the update/draw mechanism.
We're really interested in feedback here. We want to know what people want to see in a game component infrastructure.
autistic_clown
The rendering of content should be handled by the SceneGraph. I once bought an Australian Game Engine made by the makers of Trainz: Auran Jet. Their OO design was just perfect for games development, I never found any other game engine design using OOP that would provide all the inheritance advantages while preserving the logic of a game engine.
I think you may find some interesting ideas on it. If I remember well, they have on their website a demo with source (the engine is quite old now on the rendering part but the rest is just wonderful).
For new game developers, be careful, Auran Jet was a C++ game engine.
Elad ga
wendling lionel
SteveMargetts
Yeah. Physics could even be implemented as a PhysicsSubsystemComponent (meaning there is only one instance), and individual entities could have something like a PhysicsEntityComponent : LogicComponent, which would update and reconcile the entity's information with the PhysicsSubsystemComponent.
I think having these subclasses would enforce good design without taking any flexibility from the developer.
Richard_Wolf
It also seems that any given component should either be drawn, or not be drawn. If it is not drawn, it probably should not have a Draw method. That's why it would be a good idea to make the distinction with seperate abstract classes, DrawableComponent and LogicComponent.
Note that a LogicComponent could provide it's own Draw method and draw itself in those rare cases where bad design leads one to need such a method.
Boreholes_to_Bottom_Lines
So, unless I am misunderstanding something, I have a suggestion for the XNA dev team if they are interested in suggestions.
It might be a good idea to refine the whole "component" idea a bit. Of course, it is possible to go overboard, but I think that having GraphicsComponent on the same level as display elements is strange. I think a generic but well-defined taxonomy of Components would be nice:
GameComponent --> SubsystemComponent --> GraphicsComponent (supplied with framework), NetworkComponent, InputComponent, etc...
GameComponent --> UIComponent --> HUD, Scoreboard, PIP, whatever...
GameComponent --> LogicComponent --> WorldEnvironment (day night, temperature, whatever)...
Just an idea.
NetPochi
Is the concern with Draw on GameComponent performance or some semantic issue Certainly you can make GameComponents that don't override Draw. :)
JesseD70