Sign in to follow this  
WazzatMan

To Extend or to Embed

Recommended Posts

I've never really tried to do either. I plan to do some of one or the other in my next project--Note I'm a newbie. But I wanted to get a few opinions on which design scheme works best. The project is an rpg, which means it will be content heavy, with extensive use of OOP to minimize hard coding. Thus embedding script calls into the code seems like a logical choice. However, it also makes sense to extend the engine using scripts. Thereby allowing me to do simple calls to the engine with high level and easily customizable code. This would mean designing the C code to be as barebones and open as possible, and writing most of the high level structures in the script. Making the game that much more customizable. In my humble, and hardly educated, opinion, the later approach seems more natural. But the majority of commercial games I've seen use the former. P.S. This will be an open source game. I suspect that adds some weight to this design decision.

Share this post


Link to post
Share on other sites
Scripting large games it a set of technology within itself. Most companies don't have that level of expertise, so they fallback upon their well worn methods of coding logic within C++ but still use data driven design to some extent. It's order of magnitudes slower (development wise), but perhaps for their games it doesn't matter (they can throw people at it).

Large open world games, MMOs and other highly scripted games like RPGS invariably use the later method ( extending vs embedding ). High level languages allow for more concise coding and their sandbox nature coupled with the just in time compilation allows for much more productivity.

The difficult part is to find a good demarcation between what to put in script and what to keep in c++. You'll have to weight the factors of performance, stability, flexibility and security. If you put too much in scripts you'll find that they become a bottleneck in performance, too little and you won't be harnessing the full power of the system you've built.

Good Luck!

-ddn

Share this post


Link to post
Share on other sites
Quote:
Original post by ddn3The difficult part is to find a good demarcation between what to put in script and what to keep in c++. You'll have to weight the factors of performance, stability, flexibility and security. If you put too much in scripts you'll find that they become a bottleneck in performance, too little and you won't be harnessing the full power of the system you've built.


I've done a lot of game programming in scripting languages, and when the need arises, moving the script-based logic into C++. I find most of the work is in determining the best way to implement whatever system I might be working on, and this work exists in whatever language I might be using, high-level or low-level. Once this is done in the scripting language, moving it into C++ is an almost mechanical endeavor.

In my experience, the straightforward approach of writing in script when you can and profiling and moving what needs to be moved into a lower level language when the need arises, has worked well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this