Jump to content

Laurens

Members
  • Posts

    564
  • Joined

  • Last visited

Posts posted by Laurens

  1. Thought I'd share this bit of code with you I found quite useful. It basically checks if your game has already been started to prevent players from going bananas on your executable. If your game has already been started, it brings it to the front.

     

    const bool Application::IsOnlyInstance(const std::string title) const {
       HANDLE h = CreateMutex(0, true, title.c_str());
    
       if (GetLastError() != ERROR_SUCCESS) {
           HWND hWnd = FindWindow(title.c_str(), 0);
    
           if (hWnd != 0) {
               ShowWindow(hWnd, SW_SHOWNORMAL);
               SetFocus(hWnd);
               SetForegroundWindow(hWnd);
               SetActiveWindow(hWnd);
           }
    
           return false;
       }
    
       return true;
    }
    

     

    Title refers to the caption in the window's title bar so you do need to call this after having called SetAppTitle(...).

     

    From GameCode: http://code.google.com/p/gamecode3/

     

    Cheers!

  2. I'm inclined to say yes based on a quick glance over the documentation. It just requires a fair amount of glue to have it play nice with Leadwerks. Is there anything in specific you are stuck with?

  3. I'm an advocate for throwing exceptions in constructors as well. After a constructor has been called, the object should be in a fully usable state and not in some unusable zombie state that requires more methods to be called for proper initialization.

     

    A try-catch clause does not result in more code either. More like the same as an if-then-else.

  4. Thanks for the insighful replies both. After consideration I have indeed decided to only define the public API in the requirements, leaving implementation up to the developer. Got positive feedback from the team so I'm happy :-)

     

    Thanks!

  5. Hi,

     

    I am currently involved with a project unrelated to Leadwerks (or even game development) building a generalized framework for developing all sorts of business applications. It basically provides a set of classes that define companies, employees, customers, products and orders. I have written requirements before but this was for actual applications where I could see how use cases made sense. Now with this library, I am at a loss as to how to properly define the functional requirements.

     

    For instance, a functional requirements for an application might be:

     

    The system shall register the new user when the username and password textbox have been filled out and the user selects the submit button.

     

    But how would one define such a requirement when building a library?

     

    The system shall define a Customer-class with the following properties:

     

    - Username

    - Password

     

    That seems like I am steering to an implementation way to much as opposed to actually defining a requirement. Would it be ok (or even mandatory) to define the public API in the requirements when working on a library instead of an application considering your main actor is a developer?

     

    I hope I have made myself clear! If anyone can offer any insight that would be greatly appreciated :-)

     

    Thanks!

  6. By the way, there's more reasons for multithreading:

    - fetching online highscore and...

    - refreshing master server and..

    - joining multiplayer games!

     

    It's a pain in the buttocks if game freezes for few seconds when you are "refreshing master server list" or "joining game".

     

    Multithreading +many. I would love to be able to call on Leadwerks from different threads. Since streaming terrain is on the roadmap I suppose you can't get around it anyway.

  7. I highly recommend getting "Game Coding Complete (Third Edition)". It walks you through creating a tried and true client-server architecture that supports instant replay by routing all game events (move, rotate, fire for example) through a central event manager. It allows you to write all these events to file and replay the game simply by pushing the events from file back into the event manager.

     

    DirectX is used as the graphics library so it does require some minor modification building it around Leadwerks but that is no big deal.

  8. Voted for Bullet because of the same reasons Brent and Lumooja have already pointed out on the condition that the engine will still support the large scenes we can currently have, vegetation-wise.

     

    EDIT: Voted before reading the other 3 pages of this thread. I am only OK with PhysX as long as it does not lead to any additional licensing fees, which is not completely clear to me right now. Under what terms is PhysX used in Leadwerks?

  9. Whenever a client is authoritative there is going to be cheating so I would avoid it at all cost. For example, mixed mode could easily be cheated by modifying the client to never send the "hit" message.

     

    You can solve it quite easily by not using physics and just do simplified calculations by "hand" (which several modern MMO's such as WoW, Lord of the Rings Online and EVE Online seem to do) but Lumooja's solution is of course far more elegant :rolleyes:

  10. If you don't call FreeEntity at the end of your program it is not really an issue since the OS will reclaim the memory your game used anyway. If you don't call it when entities go out of scope while your game is still running it will cause memory leaks.

     

    Cheers!

  11. If LUA scripting is disabled in the evaluation kit then no, it won't be possible. If it is not bundled with Engine.exe to start a game from scripts, then no, it won't be possible.

     

    Leadwerks is worth every penny though, twice. If you are serious about creating a game then I would recommend you purchase the engine. Besides, there is only support for licensees, and it's hard to go without when you're new to the engine :)

     

    Cheers!

×
×
  • Create New...