Jump to content

  • Log In with Google      Sign In   
  • Create Account


SriLumpa

Member Since 03 Mar 2009
Offline Last Active Aug 03 2013 05:54 AM
-----

Topics I've Started

Statically linking with a game engine

20 October 2010 - 06:26 PM

Hi,

My game currently uses Irrlicht and SDL_Mixer.
For those two, I would like to compile my binary in a way that users will not need to have them installed on their system, so I'm trying static linking.

It quickly becomes complicated, since to me it is not clear what other libraries they depend on. I ended up randomly adding libs like libjpeg etc ...

Is there a right way to do that ?

Do I have to go static all the way, or should I leave dynamic dependencies to keep some portability ?

I am using Linux + Codeblocks, if that matters.
Is there a philosophy difference between Linux/Windows about this ?

Thanks for any hint !

Migrating from home-made to an engine

09 March 2010 - 06:50 AM

Hi, My first little game is still quite early in its life, and currently I am using SDL + OpenGL rendering. I have only 2d sprites for now, but do not exclude wanting more in the future. Should I invest some time right now to migrate to a real engine or, if I decide to do it later, will this be much more costly ? If there are tricks to make a future migration easier, please let me know (anything more specific than avoiding spreading rendering code all over the place). Thanks for your experience !

boost::statechart

07 July 2009 - 06:40 PM

Hi, I am trying to use boost::statechart to handle game states. My idea was to have all state classes implement a common interface:
class GameState
{
    public:
        GameState() {};
        virtual ~GameState() {};
        virtual void processEvents() = 0;
        virtual void doGameLogic() = 0;
        virtual void display() = 0;
};

...

struct MainMenu : GameState, boost::statechart::simple_state<MainMenu, GameMachine>
{
    public:
        typedef boost::statechart::transition< EventExit, Exiting > reactions;
        MainMenu();
        virtual ~MainMenu();
        virtual void processEvents();
        virtual void doGameLogic();
        virtual void display();
...
};




However this approach leads me to things I'm not sure are clean. I am running my game loop from outside of the machine:
    while (_gameMachine->_running)
    {
        const_cast<GameState &>(_gameMachine->state_cast<const GameState &>()).processEvents();
        const_cast<GameState &>(_gameMachine->state_cast<const GameState &>()).doGameLogic();
        const_cast<GameState &>(_gameMachine->state_cast<const GameState &>()).display();
    }



What troubles me is the need to const_cast first (because state_cast can only cast toward some const state). Also, I seem to be doing other things in weird places: I trigger event processing from inside of the state classes, for example:
void MainMenu::processEvents()
{
    ...
    outermost_context().process_event(EventExit());
    ...
}
...
void Exiting::processEvents()
{
    outermost_context()._running = false;
}



All this feels not completely right to me. Does someone know of a better way of doing things ? Any kind of feedback is welcome. Thanks ! [Edited by - SriLumpa on July 9, 2009 2:17:24 PM]

Chiptunes

07 March 2009 - 09:30 AM

Hi, I'm nostalgic of my old atari st sounds. Are there some good programs to compose chiptune musics and sounds ? One working on Linux would be great. Is there a special file format ? Do libs exist to replay them from a game ? for Java or C++. Thanks for any clue !

PARTNERS