• Content count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About Xunil_RJ

  • Rank
  1. I see two options here: Inversion of Control With Dependency Injection - [url="http://unity.codeplex.com/"]http://unity.codeplex.com/[/url] Dependency as Composition - [url="http://mef.codeplex.com/"]http://mef.codeplex.com/[/url]
  2. XNA Storyboard Animation project

    I have a XNA project too, in Codeplex ( http://machinaaurum.codeplex.com/ ), maybe we can exchange some ideas. I will send you a private message with my email and live messenger.
  3. XNA Storyboard Animation project

    Exactly... the inheritance is really a problem... but for example... FloatAnimation fa = new FloatAnimation() { Duration = TimeSpan.FromSeconds( 1.0 ), From = 0.0f, To = 1.0f, TargetAction = ( value ) => UserControl.Opacity = value };
  4. XNA Storyboard Animation project

    Although the Silverlight/WPF Story Board approach is very powerfull, the animated object need to implement a very intrusive contract ( the inheritance and the Dependecy Properties ). Why not make a more functional approach?
  5. This can help you? http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/8f6d94d5-a6c7-423f-aabe-5119a45939f2 http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/24604bef-3632-47c3-97db-ee229f77a24c http://yurimahgi.spaces.live.com/blog/cns!6F2E6C72AEFB319!207.entry?wa=wsignin1.0&sa=875350646 ( removes the embeded manifest )
  6. cvs, svn, or git, and which online service?

    As Yann said: in a commercial project a centralized repository is much better because back-up is really easy. In a distributed scenario is very hard to know what to back-up, who has the important information ( sure you can have a centralized repository in Git but than you are not beeing distributed - is as you buy a Ferrari to drive at 50km/h ). In a centralized server you know: "Just back-up this computer" and everything is safe. Linus thinks in another way, quoting him: “Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it.”
  7. cvs, svn, or git, and which online service?

    First i want to quote the book "Version Control with GIT". "Git’s initial support for submodules was unapologetically awful—for the simple reason that none of the Git developers had a need for them. [...] As of this writing, the KDE project is considering a switch from Subversion to Git, and submodules are their main point of contention. An import of the entire KDE repository into Git is still several gigabytes in size. Every KDE contributor would have to have a copy of all that data, even if they wanted to work on only one application. But you can’t just make one repository per application: each application depends on one or more of the KDE core libraries. For KDE to successfully switch to Git, it needs an alternative to huge, monolithic repositories using simple partial checkouts. For example, one experimental import of KDE into Git separated the code base into roughly 500 separate repositories" The problem is: Git does not have partial checkout. In a game context. The game repository can have all the files: code, music, models, textures and etc... Using Git the developers have to have all the music files and the modeler have to have all the code. With Subversion you can have everything in one repository and the developer only checkout the "source" folder. Better, he only have access to the "source" folder. He does not even known the existance of the others folder. Only in the builder server all the folders are checked-out and the game pack is made to be sent to the testers. In a distributed scenario can be a nightmare to download the whole repository. The book give the example of the KDE that has several gigabytes. Obviously, this has solutions in git ( git submodules ) but the Subversion solution is much better! Another point that comes to my mind is the lack of lock in Git. Lock makes sense when we speak of images, music, models. This kind of files makes no sense to talk of merge. Subversion, as a centralized VCS, have a lock to such cases. I think that Yann is right. There is no always-right-solution, but Git have a lot of nice features. Let competition make both ( and others ) better.
  8. Yes. The game loop could be something like.. Input->Update(); Network->Update(); foreach ( IController c in _Controllers ) { c->Update(); } foreach ( IView v in _Views ) { v->Update(); } And with this approach the controller class respet the open/close principle. We can add behavious to the system without altering classes, only adding classes. And others: Single Responsability ( NetworkController only interpret TCP packets, GenericController only change the model etc... ). But this approach have one problem. Can be a problem or not depends. Let´s imagine that the list _Controllers have the followings controllers registered: <KeyboardandMouseController ( control my player ), HardLevelController ( analysis the model and take some action ), EasyLevelController ( samething )> In the for loop my information ( the player ) will be updated before the computer players. When the computers player will be updated they will see the modified model by my input. They have a advantage on me!! That´s why i purpose to use the Memento pattern on the model. It allow me to get a representation of the model before the updates of the models. Every controller see this representation, but modify the real model. This give a simulation of the controllers running in parallel. It´s kind of a transaction. And a second factor is that the Memento can be used to facilitate the persistance step. Save and Load Games becomes very easy this way.
  9. Another example that came to my mind. If your game will have a server the GenericController example that i gave above can work with the NetworkController. Interpret the commands from the network as a decorator to the generic controller. And the server does not need to render nothing. But you can use a view like: BroadCastSomethingToUsers. I don´t know, just a example. This view serialize the model and send to all users, or just one. In a Chess game server the server has a NetworkController that move the pieces and the View can serialize the board and send to the other user. If the View and the COntroller depends on each other you cannot unplug one withou unplug the another... So the system kind of loose some flexibility.
  10. In this case the card selection depends on how the card are rendered. So i would create a layer of abstraction using the Decorator Pattern. Intead of the controller look for keyboard or mouse i would make a generic controller that interprets game commands... class GenericController { protected: void selectcard ( CARD card ); }; Now i would make a Decorator controller . This decorator would interpret the mouse click and send the generic game messages to the generic controller. This decorator controler should know the View but only he! class 2DViewToGenericController { public: 2DViewToGenericController ( GenericController controller, 2DView view ) : _controller ( controller ), _view(view){} protected: void update() { if ( _view.IsCard(mouse.position) ) { _controller.selectcard( _view.getCard(mouse.position) ); } } } This model is expansable because you can make a NetworkControler that interprets TCP packets and talks to the GenericController. "Also, the game is turn-based, the model should not be rendered as it is real-time. The *change events* should be rendered (card floating from hand to table..), and only at the end of that render, the model should be actually changed (from now on, card is no longer drawn in hands). This will ensure that the AI's views are only updated when the new card is lying on the table (the game uses a combination of AI and human players, and speed is important factor in scoring). But I think the Memento pattern can be used for that easily?" To me this solution depends how you are gonna make the animation tracking. If it´s like a timeline with commands just put the command to change the model at te end. For example.. make a class that receives a Sprite object and change it´s position of a initial position to a final position in a linear way. At the en of the animation this class call a generic class ICommand ( Command Pattern ). Then you pass your concrete command to the animator class. This command can be a decorator to the generic controller and call the appropiate method.
  11. The controller class interprets the input information that you have and translates them to models modification. if ( A button is pressed ) { player.position ( 0 ) } That´s the only thing the controller class do. The model classes only have its methods that change their states and knows how to persist its information ( for a OO approach to persistable object see the Memento Pattern ). On the other side you have the view classes. The view uses the observer pattern to know if a model changed it´s state. In a real time game this can be ignored if you imagine that in every frame every object can change its states. And in the mais game class you configure the controllers that will be used and the views. Ideally use some kind of config file, script, something that can be changed. In this way you can change the KeyboardAndMouseController for something like ReplayController on the config file and now the game can replay some action. How you are gonna implement this can vary. A list of controllers in the main game class, each model have a pointer to it´s controller and view etc... The main point is... Controller interpret the input and change the model The model controls the persistable information. Save and then load the model should return to the exact same point. View interpret the model and render it. The model should not know the concrete type that is controlling it and should not know the concrete class that is rendering it. This way you can change the configuration to change the game behaviour.
  12. It´s a option... the persistance layer may be a problem as is for enterprise. If you are in the .NET world, maybe http://code.msdn.microsoft.com/karvonite it´s a easier option.
  13. Microsoft Visual C++ produces ( generally ) better code than gcc ( mingW ) nad the VC++ IDE is wonderfull. Visual Stuido 2005 has a project that creates setups too... And can create a Class Diagram ( that looks like UML ). Besides that have integration with SourceSafe, AlienBrain ( others )... Visual Studio comes with a huge Help.... Besides Visual Stuido 2005 comes with the suport to C# that can help to build Tools to your game... Visual C++ 2005 comes with Profile Otimization... you first run your program and the "profiler" will see how he can optimze the code... than you use it to generate a otimized code.
  14. i was thinking in something to minimize the creation of temp ( and invisibles ) variables... and allow some kind of metaprograming that looks like normal functions... datatype vector has < param N > reals as _Coord datatype vector has operator +, - as each result._Coord = ApplyOperators ( operators, operands._Coord ) ... vector<3> v = a + b + c - d; ... with this i'm showing my opinions for how a "template parameter" could be done. May someone will ask why do i type "datatype vector" again. One featura thar i would like to see is that you can partial declare a "class". Maybe someone want to do a DotProduct function in the class. With partial definition you don't need to change the original source of the class. in any other source you do. datatype vector hasDotProduct as ..... the ApplyOperators would be a metaprogramming function that the operators as expected. And making the operators functor like ( a + b = + ( a, b ) ) this function can be used with a any list of functors. So the operators keyword it's just a list of functors so a + b + c - d is operators [ + , +, - ] operands [ a, b, c ] remember the idea is to permit the compiler to use this as a metafunction and generate te code of the functino in the compile time. [Edited by - Xunil_RJ on March 29, 2006 12:34:43 PM]
  15. HW Occlusion Culling ?

    I heard that NVIDIA is doing a NVX_conditional_render extension, that, besides others things, can do hardware occlusion without querying a result. So, there is no latency...