• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

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

Spencer

why a scripting engine??

13 posts in this topic

Hi! I am a new gameprogrammer and i am currently writing my own 2d-iso.-engine. Now, i have read some articles about scripting- engines and languages. My question now is: why should i have one of those? Is it for my own good? is it for if others use my 2d engine? is it for my own showing-off-in-writing-a-compiler?? please enlighten me!! --Spencer
0

Share this post


Link to post
Share on other sites
I''ve never actually implemented such a thing, so my answers are all in theory . One of the more obvious reasons is that it makes it easy for people to write mods. Another reason would be so you can work on character AI or scripted cinematic sequences (or whatever you want to script) without recompiling the game, or without even exiting the game if you can load and run scripts from an in-game console or something. I can see how a scripting engine might also help enforce well organized and modular code, at least in the area of objects and characters (and maybe special effects or whatever else the scripts can manipulate).
0

Share this post


Link to post
Share on other sites
The reason for having a scripting engine? Simple.

A good engine is supposed to seperate logic and data. If you were to hardcode the interaction sequences, monster data, and other things, it would be hard to get the engine code to act differently if you were to make a sequel or an entirely different game.

If you use scripts, you can just edit the scripts to get monsters to act differently. Sound good?

- DarkMage139 (Neokatana Software)

GDT Underground Info
Release Date: "When hell freezes over" (a.k.a. A very long time from now)
Genre: Action/Adventure
Platform: Windows 98 and DirectX 8
Status: [working on the engine]
l337ness: TOTALLY l337



0

Share this post


Link to post
Share on other sites
Game content development time can be significantly reduced with a scripted interface to your game engine. Where common engine tasks are automated, and depending on the power of your scripting engine anything that the game engine is capable of can be described and implemented in a simple script, which (presumably) is smaller and faster to write in than the much lower level language your engines are written in. Since it's instruction set is reduced to operations within the game that HAVE been hard coded and tested previously to writing the script, the chance for error is greatly reduced.

People who are incapable of writing the complex code of the inner workings of your game could more easily write content through the use of scripts. They are also very useful in making quick changes or total overhauls of sequences within the game, computer AI, you name it. In the end your code is less bloated, less prone to error, and FAR more extensible than hard-coding everything into the game.

In the end it depends entirely on the size and scope of your project. If you're making something very simple, then implementing a full-blown scripting interface is probably more trouble than you want to deal with, especially if you're programming in C++.

To script or not to script...

____________________________________________________

"Two wrongs do not make a right; it usually takes 3 or more."



Edited by - Ratheous on April 2, 2001 4:06:42 PM
0

Share this post


Link to post
Share on other sites
This was a hard and painful lesson I learned while writing my first professional title, I cannot stress this enough..

I try to put everything I can into scripts or config files..after you finish the game, there''s always going to be someone in design that says "Hey, can''t you make that grenade go a little faster?", or "can you make the player die after 6 shots instead of 5?", or even better, "Can''t the enemies sidestep between shots?"(new animations, new code, etc.)..(BTW these are REAL examples, and man, was I pissed..at myself)..

After rewriting and reworking code that should have been complete when I did it the way the design team asked for it the FIRST time, I realized that I was spending more time tweaking small things like this than doing my job, programming..

I put the project on hold for a whole month to develop an AI script and seperate the data from the code..after that, when I got hit with a last minute design change, I could do it in minutes instead of hours, AND in most cases I could tell the designers where things were and let THEM tweak the details to their hearts'' content..

Trust me..if even if you don''t think you need it, put EVERYTHING YOU CAN in some external script or textfile..even if you don''t write a full blown script compiler(a FUN and challenging experience), keep your game-specific data as far away from the actual game code as possible..



"Like all good things, it starts with a monkey.."
0

Share this post


Link to post
Share on other sites
The simplest answer is that scripting allows you to change behavior without recompiling. Scripting allows clients to change program behavior or create new behaviors (i.e. new levels) without needing access to the source code of your program or a setup to build it from scratch.
0

Share this post


Link to post
Share on other sites
i guess this is probably a dumb question, but how long does it take to recompile an entire game? i dont know because ive only worked on small things. is it really that long? i know it depends on the game, but say a new 3d shooter or something like that.

plus, how does the actuall engine and the script files interact? do you run the engine, and then it automatically opens the script? you say its easy for changing different types of ai and stuff, but doesnt the different types of ai that the scripts have to choose from depend on the types that you have hard coded into the engine? isnt that a lot of extra work?
0

Share this post


Link to post
Share on other sites
I have never *successfully* implemented a scripting engine, but I think I can answer that question... or at least the script/engine interaction part. I would guess (at least this is how I tried to do it) that the engine keeps a big database around with all the script files in it. It knows what scripts go with what other stuff because of the database. Then, if you want to load an AI into a creature, it reads something like "if bullets is coming at my head, move left" as opposed to "execute AI behavior 1" which seems to be what you were thinking A good script could completely influence the behavior of a bot.

--------------------


You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming

You are unique. Just like everybody else.

"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor

Yanroy@usa.com

0

Share this post


Link to post
Share on other sites
www.verge-rpg.com is a good game engine that uses scripts, and is open source, so you can see how it''s done.
I''m not planning on using scripts in my engine though, cause it seems like I could just make the engine files, and then just put another folder in my project for the data files, and just call functions in C++ like I would scripts...
And to solve MonkeyMan''s problems, why not just use variables for the max hits, grenade speed, etc? Seems like you''d have just as much trouble changing it in a script as you would in C++... Or maybe I''m just ignorant, as I''m still only working on engine code for my game. Not sure about sidestepping though, but it does seem like you''d just change the enemy AI functions the same as you would with a script.
From what I''ve seen, scripts just make it take a little less text to do things, and I''d probably spend a lot more time coding the script compiler/engine than I would just hard-coding it. Plus, it''d probably be a little faster too^^



-Deku-chan

DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)
0

Share this post


Link to post
Share on other sites
quote:
Original post by DekuTree64

And to solve MonkeyMan''s problems, why not just use variables for the max hits, grenade speed, etc? Seems like you''d have just as much trouble changing it in a script as you would in C++...



I am using variables, of course; I load them from the text file at startup and go from there..

I guess I strayed from the topic a bit(sorry), in addition to runtime scripts I was also talking about config files..

The situation I was referring to is when you''ve already written the code, everything''s solid, and the designers have to personally bug you to tweak some small thing("can''t you make that just a bit faster?"..recompile..redeliver.."now it''s too fast..can you slow it down just a hair?"..recompile..redeliver..

I got sick of it and started putting ALL parameters great and small in some text file so I could tell them to change it themselves; I have more important things to do than to tweak acceleration, viewheight, etc.

There are SO many things you can adjust in a game, from max damage hits to kill range for landmines, etc...you get the idea

Here''s another example:..let''s say you compiled your game, you''re showing it off on your friend''s system, and you want to change 1 small thing..you can''t drop everything and recompile if the system has no compiler..

If any variable that affects gameplay can be tweaked, it should be external to the code..it''s a hard habit to get into, but once you do you''ll never go back I promise

I cannot begin to estimate the time this has saved me..it''s not as mind-bending as writing an engine that uses runtime scripts(which I won''t even go into right now), but the benefits are immediate..just think, when was the last time you recompiled your project just because you wanted to tweak some small variable?..I know I''ve done it many times and in the long run it''s easier to dump it into a text file and load it at startup..

But the greatest part is, it keeps designer/artist/QA/non-programming people from bothering me


"Like all good things, it starts with a monkey.."
0

Share this post


Link to post
Share on other sites
Why does everyone think that you have to make your own scripting language to use one in a game? Python is a nice, well-rounded scripting language that can be used in a game.
0

Share this post


Link to post
Share on other sites
How can I use a script that I haven''t designed myself in my own
game engine. (For example Python?)

?????????
0

Share this post


Link to post
Share on other sites
How can I use a script that I haven''t designed myself in my own
game engine. (For example Python?)

?????????
0

Share this post


Link to post
Share on other sites