Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled game support #31

Closed
crankycyclops opened this issue May 23, 2013 · 1 comment
Closed

Compiled game support #31

crankycyclops opened this issue May 23, 2013 · 1 comment
Assignees
Milestone

Comments

@crankycyclops
Copy link
Owner

I think it would be fun to implement "compiled game" support. This would mean that data structures are loaded from game.xml once, then compiled into data that gets injected directly into the binary at runtime to avoid future parsing.

This would be relatively simple (at least in theory.) My method would go something like this:

In Game::init():

if (game.xml exists) {
   parse it and use its data;
}

else {
   attempt to load shared object (game.so, game.dll, etc.);
   if (doesn't exist) {
      error and exit;
   }
}

There would be a separate tool that would use the Parser class to parse game.xml, create a C++ file that corresponds to it (instantiating entities, configuring them via setters, etc.) and compile it into a shared object that can then be loaded by the game at runtime.

To make shared objects as cross-platform as possible, look into this: http://boost-extension.redshoelace.com/docs/boost/extension/index.html

@ghost ghost assigned crankycyclops May 23, 2013
@crankycyclops
Copy link
Owner Author

I've implemented the instantiator and separated that logic out from the parser, which goes a long way toward this goal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant