Jump to content

Laurens

Members
  • Posts

    564
  • Joined

  • Last visited

Everything posted by Laurens

  1. Laurens

    GUI system

    In that case I can see why you would request a GUI system to be built in although I also feel that there is something to be said for picking the right language for the job. This just seems like LE on hard mode Anyway, as long as I am not forced to use the LE implementation of whatever GUI library Josh may or may not roll in then I am impartial to the request.
  2. Laurens

    GUI system

    Several people here have integrated CEGUI with Leadwerks. I wrote an article about it some time ago: http://leadwerks.com/werkspace/index.php?/page/resources/_/programming/cpp/leadwerks-and-cegui-r30 I do not think it would be a good idea to integrate existing GUI libraries in the engine. People should have the freedom to pick whatever GUI library they want and not be stuck with the one Josh decides to roll in the engine. Leadwerks should just stick to doing what it's great at. Rendering 3D graphics. EDIT: think you mixed up GWEN and CEGUI. CEGUI has an OpenGL renderer included. Judging by GWEN's website, it does not.
  3. You mean overriding by return type? I have never tried it because I assumed it was not possible to do so from past experience in C# and Java. To work around it for now I just have one Read method returning a string.
  4. I may be way of base here but can't you just discard RealPlayer, install the K-Lite codec pack and just use Windows Media Player or something else that does not run in the background? You could also try using system restore to restore before the point where you had the slowdown.
  5. Holy ****! Suppose thats down to 50 from 150 Anyway. Whenever a PC is borked that far I would save yourself the trouble of trying to get it to run smoothly again. Shutting down services that would run just fine in the background before is not solving your problem, at best it is masquerading it. In the long run, a clean install is the only thing that will get your PC in proper shape again.
  6. That would work for reading strings. The whole point of templating the method was to convert properties when reading them. I won't be able to read int's now for instance using resource.Read<int>("MaxSpeed"); which is stored in the map as a string. I always thought that reinterpret_cast was the C++ equivalent of a C-style cast (a C-style cast does work, in fact, but I'd rather not use it). I suppose this is not entirely the case then, correct?
  7. That doesn't work Still stuck on the same error. Thanks for the fast reply though EDIT: Thinking I might have to resort to creating seperate ReadString, ReadInt and ReadFloat methods
  8. What I did when my PC got fried last time I reinstalled Windows 7, installed some stuff I know I will always use (such as Leadwerks) and created a disk image using Windows Backup. Now when I need to reinstall, I just put the disk image back. Almost painless.
  9. Hi everyone, At the risk of making a fool of myself I am asking here because I can't figure it out for the life of me I have an EntityResource class that has a map containing properties that represent the base settings for an entity. Such properties can include "CollisionHull", containing the path to the entity's .phy file, "Orientation", containing the entity's matrix and so on. I have a templated Read method to read a value and return any type I want. The cast fails on every type though and I have no clue why. Here is the abbreviated class with the offending method: #ifndef ENTITYRESOURCE_H #define ENTITYRESOURCE_H #include <map> #include <string> using namespace std; class EntityResource { map<string, string> properties; public: template <typename T> const T Read(string property) const { map<string, string>::const_iterator i = properties.find(property); if (i != properties.end()) { return reinterpret_cast<const T>((*i).second); } return NULL; }; }; #endif Calling: body = LoadBody(("abstract::" + resource.Read<string>("CollisionHull") + ".phy").c_str()); will result in: error C2440: 'reinterpret_cast' : cannot convert from 'const std::string' to 'const std::string' Any push in the right direction appreciated Thanks!
  10. A few years back when I developed a pilots logbook application and wanted to create a trail version I just limited it in features, physically removing the code from the trail version to avoid people reverse-engineering the application (which was also written in .NET). Easy peasy and no extra code to deal with time limitations which may or may not have been circumvented. The full version code just wasn't there You will probably also want to run Dotfuscator or some other tool Anyhoo, looking forward to seeing more of this tool!
  11. A seperate GUIView for that sort of thing would indeed be possible. It's something I have not yet looked into though.
  12. The Model does indeed hold all the data the View needs to work with. For example: I need to represent a spaceship. The Model would keep all data relating to the spaceship it needs to enforce the rules. This includes speed, hitpoints, mounted weapons, shield strength and so on. It also defines how the spaceship behaves and thus has methods such as FireWeapon(), BoostShields() and AddThrust(). Each Model is associated with one View so if I instantiated ten spaceships, there would be ten Models and ten Views. Now let's say the players hits the W key and the controller calls AddThrust() on the ships it's controlling. The Model will then raise the Moved event that the View is subscribed to. The method it is bound to in the View will be called and it can then update the actual position of the TEntity, passed through the EventArgs.
  13. I am extremely interested in this tool, would be great if you could get a trail version up when you do figure out how to properly restrict it
  14. That would work splendidly
  15. Good point. The View is never meant to manipulate the Model anyway so there is no reason for it I can think of right now to hold a reference. It can just wait for an event and have the Model pass it as an argument.
  16. This is indeed a bit of a trade-off but the benefits gained in terms of maintenance and porting to other platforms can be huge. And it doesn't have to be limited to 3D engines. Say I want to use SDL. The model can be untouched, all that would require updating is the controller and the view. The game rules would still be enforced because it doesn't rely on a certain technology.
  17. Basically every entity has a view that displays it. I have an EntityManager that stores and updates all entities it contains and for every entity that is added to or deleted from the manager, an event is raised that is picked up by a RepresentationManager that will create the appropriate view. What I have right now is mostly based on what I read in this article over at Gamasutra: http://www.gamasutra.com/features/20050414/rouwe_01.shtml Mind that the view we have been talking about is called an EntityRepresentation in that article. Otherwise you might be confused
  18. I have been using that extensively for some time now. It's awesome Good to hear we both had benefit from this thread then You're right. I wrote it down like that more for the purpose of explaining what I was taught about MVC. I'll admit that wasn't entirely clear
  19. I'm pretty sure someone was working on this although I do not remember his name right now. Perhaps someone else does. In any case, as Lumooja described, it is perfectly possible. EDIT: was it Tak who was creating an FPS supporting dismemberment?
  20. I believe everyone has a different take on the pattern just like any other theory. What we were taught in college was that the Model has an indirect association to the view, and the view has a direct association with the model. So what we did was this: the model is repositioned and then tells the view through an observer or event "Hey, I was moved!". Then the view would call model.GetPosition() and move the mesh it contains. I think that also answers your question as to how the model would ID the view it is associated with. It doesn't. The view would subscribe to events the model raises and update itself to represent the state the model is in after the event was raised. Let's say the model fires the "Moved" event. The view would then GetPosition() on the model and SetPosition() on the mesh it contains. Typing that I realize that I may be creating a giant performance bottleneck. Perhaps it is indeed best to contain the TEntity in the model and cut out the view, regardless of whether it is violating the pattern or not.
  21. Thats good to hear. I'll perform some tests before I fully implement it to see how animations behave though. Had not yet thought of that and deserves some looking into! That's an interesting perspective and had not yet looked at it that way. The downside to having the TEntity contained in the model is that view-specific code (even though hidden) has to be contained in the model as well. For example, let's say I am creating an RTS and want to tint selected units green. By having the TEntity contained the model I would have to go through the model to change the color while the model has entirely no interest in knowing what color it is. By having the mesh in the view it would simply query the model and if it is selected, tint it green. In an ideal world the model would simply enforce the game rules and nothing else. I do understand that all suggested approaches will most likely work though and it mostely is just me nitpicking, but I am trying to keep the reliance of the model on the engine to a bare minimum. If I ever need to change the engine to for instance LE 3.0 I can leave the model untouched. Secondly I feel it gives much cleaner code, having game rules, input and rendering neatly seperated. Anyway, thanks for all the insights so far
  22. Laurens

    Witch - Hunter

    I would really like to see this succeed. The concept art you have is great
  23. Hi everyone, I have been rewriting my project to apply Model-View-Controller. I like the idea of seperating game logic from rendering and input but I have hit a snag. In the engine, a TEntity is both a mesh and a physics body. The TEntity is contained within the view because it serves the rendering purpose. Now let's say a collision occurs in the game world that bounces the TEntity to a different location. There is no way to tell this to the model because the view is not allowed to change the state of the model and I do wish to keep this seperated. Now I though of a different solution and that is to contain the actual physics mesh (through LoadBody) in the Model, and the mesh (through LoadMesh) in the view, making the body the parent of the TEntity. My question is now, is it possible to set collisions callbacks and such on a Body? Is a Body also a TEntity? And will I run into any other snags I have overlooked right now using this method? Many thanks!
  24. That did it! Thanks a million for fixing it this fast Guess I can stick with ATI cards after all
  25. This piece of code won't run, getting an error message from Windows saying the display driver has stopped responding, yet Editor works just fine. EDIT: the display driver crashes on both the RenderFramework call and the Flip call. UpdateFramework is fine. #include <stdlib.h> #include "engine.h" int main() { Initialize(); Graphics(1280, 800); CreateFramework(); while (!AppTerminate() && !KeyHit()) { UpdateFramework(); RenderFramework(); Flip(); } Terminate(); return EXIT_SUCCESS; }
×
×
  • Create New...