Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualachild

Posted 10 August 2012 - 09:35 AM

There's probably not a "better" way. It really depends on your needs. (I know that answer doesn't help). So, let's take some very well known examples.

Most games from Id Software: Engine - EXE Game Code - DLL
Source last time I looked: Engine - Many many DLLs (engine dll + many library dlls it uses) Game Code - Another DLL (exe ties it all together) or an EXE
Many successful indie games: Engine - EXE Game Code - Also in the EXE

As you can see there's no better way in a generic sense. Each had their reasons for doing it their way.

So for your first go at this, honestly, it'd probably be better to put your game in an exe and put your generic code (engine) in a dll. And even this would only be to force you to think of them separately to encourage reuse. As long as they're separated, repackaging in various forms won't be hard.

(Yes - I know the common advice is "just make your game" and then when you make your next game, pull out reusable stuff. IMHO that makes it harder because you probably did not design it to be reusable and it can sometimes be a huge refactoring task. Better to just design them this way from the beginning, because it forces you to think of things in a way that also makes all your code that much more maintainable and understandable).

#1achild

Posted 10 August 2012 - 09:34 AM

There's probably not a "better" way. It really depends on your needs. (I know that answer doesn't help). So, let's take some very well known examples.

Most games from Id Software: Engine - EXE Game Code - DLL
Source last time I looked: Engine - Many many DLLs (engine dll + many library dlls it uses) Game Code - Another DLL (exe ties it all together) or an EXE
Many successful indie games: Engine - EXE Game Code - Also in the EXE

As you can see there's no better way in a generic sense. Each had their reasons for doing it there way.

So for your first go at this, honestly, it'd probably be better to put your game in an exe and put your generic code (engine) in a dll. And even this would only be to force you to think of them separately to encourage reuse. As long as they're separated, repackaging in various forms won't be hard.

(Yes - I know the common advice is "just make your game" and then when you make your next game, pull out reusable stuff. IMHO that makes it harder because you probably did not design it to be reusable and it can sometimes be a huge refactoring task. Better to just design them this way from the beginning, because it forces you to think of things in a way that also makes all your code that much more maintainable and understandable).

PARTNERS