Re: [GD-General] I just don't get it (Was: Scripting Systems)
Brought to you by:
vexxed72
From: Brian H. <ho...@py...> - 2004-01-31 02:41:53
|
> Please enlighten my heathen mind: Why not simply compile your > "scripts" into C/C++ .DLLs? The sheer number of them can be daunting. In a lot of cases you're talking about several hundred if not several thousand scripts if you want to be able to dynamically load/reload chunks of code. I actually posed the same question not too long ago (look for the thread "DLLs as game objects"). But other considerations: - scripts now requires real programming, whereas a language like Lua or Python is (in theory) a bit friendlier when doing basic scripting like behaviour, triggers, etc. - security problems since you can't sandbox C++ particularly well > Um, really? Is Lua any easier to write than C? Yes, since there aren't any pointers. Remove memory management, and probably 50% of newbie C mistakes are gone. Get rid of arcane syntax like the whole & vs. * thing, and you get rid of another good chunk. Get rid of "stack" vs "heap" and hey, more problems go away. > 3. The security of a sandbox. > > > Ok, you've got me there, if your primary goal in scripting is to > allow your fanbase to create new content without exposing other > users to a variety of security scenarios, then I suppose you've > found your holy grail. That's a pretty major one, IMO. Not just that, but sandboxing protects your own designers from inadvertently trashing something if they're trying to make an edit on a live world (e.g. in an MMOG). > All that aside, I do believe there are some C-syntax scripting > ideas, Battlefield 1942 uses a "scripting" language that is really > more along the lines of a gameplay balancing dataset. Well, there's the whole data-driven vs. procedural argument, but I don't think we have time to get into THAT one again here... > I'm just not significantly compelled to go beyond dynamic library- > based extendability for the time being. I felt the same way, but for the particular problem domain I'm working in, I specifically need reloadable code, sandboxing and ease of use. Brian |