What would your ideal scripting language look like?

Discussion in 'Game Development (Technical)' started by Adrian Lopez, Mar 11, 2011.

  1. Adrian Lopez

    Original Member

    Joined:
    Sep 7, 2004
    Messages:
    489
    Likes Received:
    0
    Now imagine that license being displayed in something like an iPhone game. :)

    A URL pointing to what? And what's the point if you can't click it?

    Depends on the license. Here's an excerpt from the Boost license: "The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor." (emphasis added)
     
  2. Bad Sector

    Original Member

    Joined:
    May 28, 2005
    Messages:
    2,742
    Likes Received:
    5
    Put it in the last page of the credits screen. There, problem solved.

    BUT! If you still think that this won't solve the problem, feel free to use my scripting language, LIL :D

    The license is
    Code:
    /*
     * LIL - Little Interpreted Language
     * Copyright (C) 2010 Kostas Michalopoulos
     *
     * This software is provided 'as-is', without any express or implied
     * warranty.  In no event will the authors be held liable for any damages
     * arising from the use of this software.
     *
     * Permission is granted to anyone to use this software for any purpose,
     * including commercial applications, and to alter it and redistribute it
     * freely, subject to the following restrictions:
     *
     * 1. The origin of this software must not be misrepresented; you must not
     *    claim that you wrote the original software. If you use this software
     *    in a product, an acknowledgment in the product documentation would be
     *    appreciated but is not required.
     * 2. Altered source versions must be plainly marked as such, and must not be
     *    misrepresented as being the original software.
     * 3. This notice may not be removed or altered from any source distribution.
     *
     * Kostas Michalopoulos <badsector@runtimelegend.com>
     */
    
    Simple, readable, etc :). It is the zlib license.

    LIL code looks like this:
    Code:
    [b]func[/b] call-entity-class-constructor {clsname} {
        # try fullbrown constructor
        [b]if[/b] [[b]reflect[/b] has-func ${clsname}-class-constructor] {
            [b]return[/b] [[b]${clsname}-class-constructor[/b]]
        } {
            # failed, try manual construction with modelname == classname
            [b]set[/b] mdl [[b]load-model[/b] $clsname]
            [b]if[/b] $mdl { # success!
                [b]set[/b] ent [[b]new-raw-entity[/b]]
                [b]set-entity-model[/b] $ent $mdl
                [b]return[/b] $ent
            } { # failed, issue warning and return empty entity
                [b]print[/b] warning: ${clsname}-class-constructor not defined, returning raw entity
                [b]return[/b] [[b]new-raw-entity[/b]]
            }
        }
    }
    The above is the code for the call-entity-class-constructor function which is called by the engine each time an entity needs to be created with the entity's class name. The function simply checks if there is a classname-class-constructor function, which is supposed to create and return the entity and if so it calls it. Otherwise it tries to create a dummy entity with a model file with the same name as the passed class name (this saves writing boilerplate code for each static model entity, like decoration models). If this fails too, it prints a warning message (which is displayed in the HUD/console) and retusn an empty entity.
     
  3. HairyTroll

    Original Member

    Joined:
    Jul 29, 2004
    Messages:
    582
    Likes Received:
    0
    Andy Gavin talkes about the language he made for Crash Bandicoot: GOOL.
     
  4. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,390
    Likes Received:
    12
  5. dannthr

    dannthr New Member

    Joined:
    May 11, 2007
    Messages:
    456
    Likes Received:
    2
    English...


    :eek:
     
  6. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    Do you guys really need a scripting language? Ok, may be if you are building a massive game but otherwise, isn't that completely over enginering?

    I prefer to adopt a data driven way of programming. Meaning that you don't need a huge amount of code (so, you can keep c++). Then the problem is move toward building great tools (editors) to have a nice/quick/effective way to edit your data. I've done that for massive AAA project and for my small own games. Everytime was a winning combination. Now, I'm experienced with this way of developping and it is very fast for me to create the right editor for my games.

    JC
     
  7. jpoag

    jpoag New Member

    Joined:
    Mar 15, 2008
    Messages:
    806
    Likes Received:
    0
    How massive is massive? Something like a match-3 clone might be overkill, but I've seen games as small as AHOGs benefit from a scripting language.

    I completely agree with the data/content driven design. Over the years, each of my projects has grown towards data-driven until I just recently sat down and rewrote my core engine to be completely data-driven (the editor is next).

    The thing is, scripts are data too.

    I will submit that some people view scripting as a shiny new tool and will attempt to use it in the most inappropriate manners. "When all you have is a hammer, everything looks like a nail."
     
  8. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    Check Anka, I made it on my own (3 hours worth of click and play adventure goodness (made with editor) + billions of mini games made in c++). It would have costed me 10 time the amount of time if I had to code it with code (script language). Instead, I created an editor (1 month of work) but I was able to create a scene in a very efficiant way. I could even draw the collision detection inside the editor or fade in/out snd or even create the animations, well everything from the adventure part. Despite beeing a very experience coder, a scrip language would I have slow me down so much that I would have never finished the game.

    Yes, but a very inneficiant one. It is a generic tool. Personaly, I prefer to invest a tiny amount of time creating a more specific tool that speed the rest by a factor of 10x. You know I'm wright :)

    JC
     
  9. luggage

    Moderator Original Member Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    2,132
    Likes Received:
    0
    The problem I find with scripting languages is it's usually programmers who end up writing it. Then you've got to start asking yourself, "is it actually better being a 'script' rather than a 'source file'?" Being able to use a debugger is a huge advantage.
     
  10. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    +1

    My ideal scripting language is called C++
     
  11. lightassassin

    lightassassin New Member

    Joined:
    Nov 21, 2009
    Messages:
    191
    Likes Received:
    0
    GOOL article was interesting, then again it was more a replacement language rather than a scripting language extending an engine written in another language. Especially since it used a compiler of it's own.

    Some of the ideas sound dreamy, like the way it deals with threads, but it can be done with C++ but it just needs to be built to suit games.

    My biggest gripe would the the lisp syntax, I can see how some of it is valid, but C/C++ has that right level of "I can read that" to "the computer understands this" in my opinion.
     
  12. jpoag

    jpoag New Member

    Joined:
    Mar 15, 2008
    Messages:
    806
    Likes Received:
    0
    I think your ignorance comes from confusing a programming language with a scripting language. A lot of languages can easily be both (like Python or Javascript).

    A scripting language provides variable functionality on top of a well written code base.

    That sounds extremely amateurish: "Scripting languages are no good because I made a cool editor I can draw collision detection inside of..."

    "I'm an experienced coder except for embedding script languages into a game."

    Lol, it takes me 1/10th the time. Don't let your ignorance and inexperience color your judgement. If you don't know how to use a script language effectively and efficiently, then don't weigh in against it.

    Scripting can be as generic or as specific as you make it. If you had more experience embedding scripting languages you'd know that. Scripting as data is a very powerful design.

    It's hard to 'know that you're wright' when I have so much experience that tells me you are wrong.

    C++ can be a scripting language is used correctly. It's a trade-off between runtime editing and debugging.
     
  13. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    Lol jpoag, did you wake up on the wrong foot?

    I never said Scripting language are not good. I just said they are inferior to a good editor build specificaly for the problem you want to solve.

    FYI, I'm no newby nor stupid. When working in the AAA industry I was paid a fortune because my tools/tech made things possible or improved many time productivity (on a team of 50 or more, that's really important). To finish on that subject, you don't need to be a programmer to use a good/tool editor, you must be one to use a scripting language.

    You can call me an old fart or whatever, but not ignorant or amaterish :) you've got your experience, I've got mine.

    JC
     
  14. Emmanuel

    Moderator Original Member

    Joined:
    Nov 23, 2004
    Messages:
    859
    Likes Received:
    0
    Jean-Claude made "Black & White" (with cliffski) and "The Movies" :)

    When you're the only one writing the logic for the game, the tradeoff between being able to change things without recompiling, and being able to step through a debugger and see the whole stack from game logic to rendering engine isn't obvious - the lack of the latter is a productivity killer. It's a clearer win for a big adventure HOG for instance when you're in a team with artists and designers and you want to let other people change the behavior of game objects so they can improve the game in little touches everywhere.

    When you're on your own even with a mostly data driven engine there is merit in having a simple, high level script specialized to the kind of game you're making where you can define the game flow. That's something that can be very much in flux until close to shipping. Azada was fully C++ and changing the flow late in production as ideas came up was a pain in the ass. I did it as each change clearly made the game better but I'm sure it shortened my lifespan.

    Best regards,
    Emmanuel
     
  15. jpoag

    jpoag New Member

    Joined:
    Mar 15, 2008
    Messages:
    806
    Likes Received:
    0
    You're saying that scripting is inferior because you build great editors. Great editors, data-driven design and scripting are not mutually exclusive. Hello? Flash? Flash 5 made the jump to incorporate a script language. (AS3 is a programming language more than a scripting language).

    I didn't say you were stupid or n00bish, I said you were ignorant. Taking up a position :
    • they are inferior to a good editor build specificaly for the problem you want to solve
    • a scrip language would I have slow me down so much that I would have never finished the game
    • very inneficiant [as data in a data-driven design]

    ... without having embedded a scripting language. That's ignorance.

    Maybe that's why Black & White 2 has script monkeys and Black & White doesn't.

    I said your comment was amatuerish: defending your position on scripting by telling us how great your editor is.

    As for having experience? You (admittedly) have no experience embedding a scripting language.

    [No Scripting experience] + [opinion] = [ignorance]

    Your game shouldn't have the renderer and game logic in the same stack, but I understand what you meant.

    Personally, I use a in-game console that allows me to inspect the script tables and execute statements. It's not as good as being able to break on a statement or condition, but it's better than coding blind (or console trace statements alone).

    My experience with other with designers is that they won't work on scripts. I've never had the luxury of hiring designers/coders/script monkeys. The first time I implemented scripting in an AHOG I wondered why I did it if I was the only one working on the code. So I called up some friends who had done it before and asked them what they did and what they wished they had done.

    3 games later and now I know how an embedded scripting language fits into a data-driven design.

    Before anyone interjects, it is possible to implement flow control using C++ in a scripting fashion. I've seen it done in games and I can think of 2-3 implementations off the top of my head. (At the very-least on a macro level)

    The very first thing I did with scripting was implement flow control. It's a blessing.

    I get 3-4 emails a week asking about you and the other thing.
     
  16. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    Jpoag, why do you keep pretending you didn't understand what I meant?

    I was talking about coding game logic/gameplay/level with a scripting language, using scripting monkey (as you call them). Anything related with building the actual game.

    If you want to use scripting language hidden in your code/tools then good for you but that's different from using one to create the game. Unless, I really have no clue what your about, you are talking engine, I'm talking game creation.

    JC
     
  17. jpoag

    jpoag New Member

    Joined:
    Mar 15, 2008
    Messages:
    806
    Likes Received:
    0
    Game creation, game logic, flow control, event handling, in-game scripting.

    I'm not pretending that I don't understand what you meant, I'm pretending that you don't understand what you are talking about.

    If you can't understand what I'm saying, then perhaps it's because you don't understand how to properly utilize a scripting language in a game (data-driven design or otherwise).
     
  18. Adrian Lopez

    Original Member

    Joined:
    Sep 7, 2004
    Messages:
    489
    Likes Received:
    0
    Aside from eliminating the need to recompile whenever you make changes to your game's code (the "massive game" issue, as you call it), the greatest advantage I see is in terms of making games more portable by turning game engines into environments for the execution of game logic. Port the engine once and all the games that use it will run on the new platform without any changes to their code.
     
  19. Adrian Lopez

    Original Member

    Joined:
    Sep 7, 2004
    Messages:
    489
    Likes Received:
    0
    A scripting language's interpreter could provide debugging hooks to enable any host application to provide a suitable debugging environment.
     
  20. luggage

    Moderator Original Member Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    2,132
    Likes Received:
    0
    I realise - but all this is added work. This is why you have to be careful when deciding whether to add scripting in. If all you're doing is saving a recompile and you're going to be writing your own scripts anyway then where's the gain?

    Our project and it's parent library does a full rebuild in under 30 seconds. For day to day work the rebuild times are non-existent so hitting F5 after writing a bit of code isn't really a hardship. I get to use and debug in dev studio with all it's associated tools.

    Personally, the only reasons I'd consider a scripting language are...

    1) If build times are massive - saying that you should really be bringing down your build times instead.
    2) Writing a piece of engine middleware.
    3) Wanting a game that can be extended by the customer.
    4) I had nothing better to write.

    JCottier: So you had a hand in B&W? Damn you! I had the job of working on the PS1 version of it after another couple of companies had a stab at it.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer