Re: A few questions about scripting
Gabriel Ware <[email protected]>
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <[email protected]> |
Hi Hao, Sorry for the late reply. I just read the whole thread and there are a lot of good information regarding your questions. Here are my thoughts on your last questions... Why do studios use scripts to code "gameplay logic" ? Nobody have a definitive answer and as many have said before me : it usually depends on the technical direction and decisions (in my opinion it does not really depends on game genre but more on some kind of technical decision). Why does gameplay code frequently use script ? Because lot of persons think that using a scripting language allows for fast prototyping. This is not always true though : Setting up a good VM, debugging tools, finding scripters and so on does have a cost in term of time and money. Another reason for using script for gameplay code is the kind of code itself. Gameplay code usually encodes game knowledge which can sometime be more easier to write using script as those languages provide different features than C++. Is making games really more enjoyable that playing tricks with languages? Depends on the point of view. Most acclaimed games are pushing the hardware and/or the creativity of its engineers to some limit. In my experience and from what I can see of other studios, making enjoyable games usually require playing tricks with both the languages and the hardware. And whether it be C++, lua, squirrel, dsl or anything else, you will end up playing tricks with the language in order to ship the game with as much features in it as possible. That's only my point of view ... For the numbers, I don't have any real metrics, so I can totally be wrong. If it's 25% script code, it's 75% something else. It is difficult, in my opinion, to have a clear cut between engine code and native "game" code. Everything is "game" code and data. The technique should serve the game, not the other way around. A usual way to work with script is to do "as much as possible" with it as long as the language allows for better iteration than other solutions and move power hungry code to native/compiled whenever needed (or anticipated). Having lot of script generally impacts in some way the performances so we generally have to move a lot of thing to native compiled code. Lastly, I just wanted to say that lot of people criticize interpreted language.'s performances. It is obvious that interpreted language will run slower than compiled ones but it is only as slow as the programmer decide so. Opimizing a VM can lead to huge performance gains (maybe I should say getting back some performance). This is no different from the kind of tricks optimization programmers do when re-arranging c++ code. In my opinion if scripting serves the team and the gameplay then be it, we'll optimize scripts & vm as needed to ship. Whatever the language we're always trying to get back some lost-cpu cyles or lost MB ... HTH, Gabriel 2010/4/27 Hao Wu <[email protected]> > Hi Gabriel, > > Thanks for sharing. > > On Mon, Apr 26, 2010 at 6:00 PM, Gabriel Ware <[email protected]> wrote: > > Hi Hao, > > > > From what I've seen until now, games are using script for : > > - Game logic : obviously some of the gameplay can be scripted, but > usually > > scripts just do the logic while compiled languages are used to code more > > "computational intensive" part of the engine > > - UI logic : engines I've seen are using either graphical languages or > > domain specific languages / API to code the UI and user events handling. > > - real time cutscenes : Engines can also rely on scripting to describe > real > > time cutscenes (handling characters displacement, interactions, triggers > and > > such) > > - quick time events / triggers > > - Modding / extending the engine after the release date : lastly, I > believe > > most engines supporting mods use some kind of scripting language to > extend > > their capabilities. > > Very specific. I was thinking that the scripts may mainly be used in > the gameplay logic, > saying, game logic or cinematic procedures in your sense. Can I ask > why these parts? > because they are highly subject to change? or because they are > actually the "game" itself > and needs more productive way to program? > > > > > Your second question is very difficult to answer, at least for me. I > think > > it greatly varies with the kind of game, platforms, media, and community. > > I believe script code can range from 0 to 25 % of the code base for > console > > games. I'm also interested if anyone is willing to share on this subject. > > I've seen lots of developers trying to remove all the script from their > > engine as they realized the only ones who are using it are experienced > C++ > > developers and didn't necessarily need the benefits of scripting. > > On the other hand, there are still engines that really need scripting > > because of their modding community or because they have very skilled > > scripters. > > you are right, one of reasons is the scripters. I understand it will become > a > touch problem when building up a commercial game. But, to my mind, I would > rather use more friendly scripts to make games comparable to c++. > I'm not saying c++ is not friendly, but I think making games is more > enjoyable than playing tricks with languages. > > for the numbers, were you saying the scripts part is no greater than 25%? > how about the else? 50% engine code and 25% native game code? > > > > > My 2 cents, > > Gabriel > > > > 2010/4/26 Hao Wu <[email protected]> > >> > >> Hi, there, > >> > >> I noticed that there was a heated discussion regarding to game > >> scripting. I just have some general questions about it. > >> > >> Since I don't have experience on industrial development, I am curious > >> about scripting, hoping someone could show me some real numbers. My > >> questions are, > >> > >> 1. What parts of game development are written by scripting? > >> engine base code/gameplay/or others? can anyone specify more details? > >> > >> 2. For an entire game, how many percents of codes are written by > >> scripting? > >> I know it varies dependent on many aspects, but could anyone show some > >> real numbers? or maybe a range? > >> > >> Any comments are welcomed. Thanks in advance! > >> > >> Best, > >> Hao > >> _______________________________________________ > >> Sweng-Gamedev mailing list > >> [email protected] > >> > >> > http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com > >> > > > > > > > > -- > > Gabriel Ware > > PS3 Programmer > > Tel : +33 6 64 35 9119 > > > > _______________________________________________ > > Sweng-Gamedev mailing list > > [email protected] > > > http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com > > > > > > Thanks again! > > Best, > Hao > _______________________________________________ > Sweng-Gamedev mailing list > [email protected] > http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com > > -- Gabriel Ware PS3 Programmer Tel : +33 6 64 35 9119 _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com