Archived

This topic is now archived and is closed to further replies.

Esap1

Scripted Actions?

Recommended Posts

I wanted to know how in Proffesional Games how they design a level so that when you walk by a door it opens. I know it is not Hard Coded. And like when you step on a platform it moves up. Or when you shoot a Monster it runs its dieing Animation. Could you explain to me how they do this. Have a Links to Any Tutorials, on either Scripting or this Subject. Thanks a lot for your time.

Share this post


Link to post
Share on other sites
Could it be done if I write an overly Simplified version of something like UnrealScript. UnrealScript seems like it would fits those needs. Is that how they use UnrealScript? Any Tutorials on writing a Script Engine(Ive seen the one on Flipcode).

Share this post


Link to post
Share on other sites
heh well its not exactly a tutorial but....

Adding Languages to Game Engines


its an artical about the development of COG ummmm it a scripting lang for Jedi: Dark Forces 2''s scripting lang... ummm I think it have links to scripting lang resources... I didn''t bother to check into it....

Great Milenko

Words Of Wisdom:
"Never Stick A Pretzel In Your Butt It Might Break Off In There."


http://www.crosswinds.net/~milenko
http://www.crosswinds.net/~pirotech

Share this post


Link to post
Share on other sites
I dont really understand When they compare Scripts to DLL''s. Whats contained in the DLL''s. And how can they do the same thing a script? thanks for the help(and the link), later,

Share this post


Link to post
Share on other sites
I''m definitely not an expert on this subject, but maybe they are putting each script command into a DLL, and then loading them when the engine starts up?

It wouldn''t be too hard to make a plug-in-like interface for the commands, and then just load all DLLs in that directory. I think the main problem with that idea would be speed...




- null_pointer
Sabre Multimedia

Share this post


Link to post
Share on other sites
See, but when They talked about DLL vs. Script, a Pro for the DLL was speed, and a CON of Scripting was Speed, so I just dont know, Any one else have any input?

Share this post


Link to post
Share on other sites
DLLs vs. scriptz:

DLL:

Fast caus'' it''s precompiled. No runtime scripting needed.

Script:

Slow caus'' it must be executed at runtime. In other words the program needs a routine just to "execute" the script, while a DLL just loads a single compiled routine to do the same function NOTE: less overhead- this is why runtime executed BASIC is no longer a viable computer OS

null_pointer wants to make a scripting language with DLL support for new features- this method won''t increase speed.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Scripting languages can be better because although you lose some speed, properly set up scripting engines won''t crash your game if something goes wrong on your script. In general most scripting engines can run scripts without compiling making development somewhat easier and users don''t need to learn the host language in order to do the scripting. At the same time you can restrict which data can be accessed from the scripts (this may be an advantage or a disadvantage depending on your point of view).

Now as to the speed issue, this isn''t really as big a concern as one might think, some engines are actually very good as far as speed goes. Lua, for example, has very good execution speed and has been used in a number of Bioware products including MDK2 and the Infinity engine (used in Baldur''s gate and several other games).

DLL''s do have their place though, for things that must be called very quickly or have access to complex data types (STL commands are a good example), but for most scripting tasks, DLL''s are overkill.

Share this post


Link to post
Share on other sites
Here's an idea from Hexen: have common scripts that are associated with specific objects (Door->Open)hard-coded into the engine so they're fast and easy to use. Then you can make an additional scripting language for other operations. In addition to object-associated scripts, Hexen made use of its own language called Action Code Script, which level designers could use to produce really complex effects.

That article Great Milenko mentioned is almost required reading for anyone who wants to make a scripting language. I read it a long time ago. Actually, I copied it into WordPerfect and made a print-out because I thought it was so good.

If you're serious about making your own scripting language, there's a great series of articles at FlipCode on how to do so. Here are links to all nine articles, to make your life easier:

Part 1 (Overview)
Part 2 (The Lexical Analyzer)
Part 3 (The Parser)
Part 4 (Symbol Table & Syntax Tree)
Part 5 (Semantic Checker & Intermediate Code Generator)
Part 6 (Optimization)
Part 7 (The Virtual Machine)
Part 8 (Executable Code)
Part 9 (Advanced Subjects)

Edited by - Tom on July 19, 2000 12:19:32 AM

Share this post


Link to post
Share on other sites
Quake3 does moving platforms, opening doors, etc. by flags. Because each block in the level has their own flags. Now when you collide with this block, the engine checks it''s flags. Then it makes the appropriate action. Now certain flags are not objects. So the block isn''t drawn. That''s how they do spawn points and other things.

Hope this helps!



~-=-=-=-=-=-=~
~Justin Eslinger~
~.."BlackScar"..~
~-=-=-=-=-=-=~

Share this post


Link to post
Share on other sites
Two other disadvantages of using DLLs that have not been mentioned are that they are less secure than custom script, and they are specific to platform (both of these were issues for Quake2 I believe, which used DLLs).

Regards

Starfall

Share this post


Link to post
Share on other sites
Q2 ''s dll effectivly act as the interpreter. In Q2 the level scripts are embedded in to the bsp file in an almost plaintext state. Of course the actual code that produces the effects are hard coded in to the dll, the text just spawns\configures the objects.

Effectively what Q2 does is use what I call ''world objects'' (entities) that know how to interect with the player. So, when a player walks up to a door, the door checks it configuration (speed, direction etc) and moves.

What I''m interested in is the opinions of people around here on the pro\cons of using a robust premade scripting engine like seer or small? Personally, looking at the code I cant tell too much of a difference from something like C that also needs compiling. I guess the sole good point over compiled C is it''s platform independence (providing aplatform specific interpreter is available). This makes me thing java is a better ''platform independent'' scripting language. (Not that I''m going to learn java)

So, I guess personally if my game was Win32 only then I''d just use c\c++ DLL''s, but if I were to do a platform independent game I''d want to use a PI scripter to ensure that players creating scripts don''t have to have a quad booting machine to release a single script..

Is that about the idea of it... ???

gimp

Share this post


Link to post
Share on other sites
THe Dark engine has a very interesting scripting system based on COM and client DLLs. The designers can write scripts easily, partially because Looking Glass defined macros for level designers to use so they can avoid having to deal with pointers and memory in general.

Share this post


Link to post
Share on other sites