Jump to content

Photo

Zelda Modern


  • Please log in to reply
411 replies to this topic

#271 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 13 July 2010 - 12:10 PM

Python's pretty useful. I've made IRC bots, scripts to save me work for school, etc... Yeah, you can't exactly put it on a resume, but it is a very useful language for productivity.

#272 Koopa

Koopa

    The child behind the turtle

  • Members
  • Location:Switzerland

Posted 13 July 2010 - 12:14 PM

If anyone comes up with a DO/END syntax I'll make a perl script that allows me to use braces and translates between the two icon_wink.gif

Seriously, Gleeok has a point. My main likeness for C-style syntax comes from the fact that it's whitespace-independent, that is I can use any whitespace I like how I like to make my code readable to humans - one of the great weaknesses of BASIC is that it utterly fails there. And { is one character to END's three.

#273 Snarwin

Snarwin

    Still Lazy After All These Years

  • Members
  • Real Name:Paul
  • Location:New York

Posted 13 July 2010 - 10:29 PM

Personally, I really liked the idea of using Lua that was brought up earlier in the thread, since it's got cool things like dynamic typing and objects and first-class functions, and it's still one of the fastest embeddable languages out there.

Quite frankly, I think all this talk about the syntax is kind of missing the point. To people who have never programmed before, it won't matter--they're learning something new no matter what--and to experienced programmers...well, once you know one language, it's really not that hard to pick up a new one.

I would also like to add that if we try to go and create our own scripting language, rather than using an existing open-source one, it's going to take at the very least twice as long to get it up and running properly, which seems like an incredible waste of time to me.

#274 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 13 July 2010 - 11:31 PM

I personally dislike the fact that Lua uses the prototyping object model. It's great if you're a big Javascript user, but I don't like js either for the same reason. I'm a big fan of actual classes.

IMO, the most important feature for a programming language is exception handling. Saves so much time and effort on error checking.

#275 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 July 2010 - 07:24 AM

I'm a big fan of classes too. I'd also like to see inheritance as a part of the scripting language. There should also be switch statements, a full compliment of bitwise operators, and it needs to be fast. Suppose you design a huge structure around an immovable object, and shortly after you realize the ground is not stable enough to support your awesome new house, so you need to move the house to sturdy ground. Problem is, you can't. It's designed around something that just won't move. To me, in code terms, this is either lots of un-optimizable code sections or big APIs. ZC for example suffers from the second one in two ways: It's never going to use anything other than DX3 and Allegro and it's just plain stuck with it, and, well, I don't need to tell you the second.

So for scripting languages: I'ts been narrowed down to three for a while now. These are Lua, AngelScript, and Python. Here's what to expect in terms of a 'pick two' scenario:

Fast * Angelscript. Lua.
Can use classes and higher level objects * Python. AngelScript.
Dynamically typed * Lua. Python.

In addition to those, Angelscript uses C/C++ syntax with tons of features, Lua is great because it's tiny in terms of size and really fast, and Python is more complete and easier to use than Lua for the dynamic typed scripting languages.


(ps: If anyone suggests "Ruby" I will kill you) icon_biggrin.gif

#276 lonegraywolf

lonegraywolf

    Doyen(ne)

  • Members
  • Location:Minneapolis, MN

Posted 14 July 2010 - 07:57 AM

I haven't used Ruby yet, so I can't suggest it. I've used a bit of Lua and Python before, but not AngelScript. Still...

I want the "fast" part clarified. Will Python end up being so slow that some scripts can't complete what is needed within a single frame? If the answer to that is yes, I will have to suggest we no longer consider it. If the answer to that is no, then it is still in the running, and is therefore my pick.

#277 LinktheMaster

LinktheMaster

    Hey Listen, Kid

  • Members
  • Real Name:Matt
  • Location:United States

Posted 14 July 2010 - 08:02 AM

The problem is, Wolfman, at this stage, we really have no clue. icon_frown.gif As far as we know, the speed differences could be negligible. Or it could be that the slower languages are completely unusable. There's really no way of knowing for sure until we actually utilize it in a program. icon_frown.gif

Personally, I don't think Python will be so slow that you can't do everything within a single frame. To be honest, for most users, I doubt the difference would even be noticeable. It may just be that with Angelscript or Lua, the creator can just do a lot more in their scripts per frame. How much more? That's hard to say.

#278 Cameron

Cameron

    Illustrious

  • Members
  • Real Name:Matt
  • Location:South Jersey

Posted 14 July 2010 - 10:21 AM

QUOTE(Wolfman2000 @ Jul 14 2010, 08:57 AM) View Post

I want the "fast" part clarified. Will Python end up being so slow that some scripts can't complete what is needed within a single frame? If the answer to that is yes, I will have to suggest we no longer consider it. If the answer to that is no, then it is still in the running, and is therefore my pick.


I just want to point out that Blender allows for input of Python code when making animations or games. I think if it's fast enough for a massive 3D rendering program, it's probably fast enough for us.

Edited by XxGamasterxX, 14 July 2010 - 10:21 AM.


#279 Koopa

Koopa

    The child behind the turtle

  • Members
  • Location:Switzerland

Posted 14 July 2010 - 12:35 PM

If you program an infinite loop in your script, no matter what language it's in it won't complete in a single frame. And if you write horribly inefficient code, the language won't help you that much either.

I'd guess the average ZC enemy won't be too much for any scripting language. However, experience tells me that whatever we do, people will push it to its limits. That's not a bad thing, but it means the higher those limits are the more quest makers can achieve.

As performance goes, a language that can be compiled into bytecode in advance will always beat one interpreted on the fly, but I think all candidates under consideration are ok there.

Just a little warning to anyone getting over-excited: ZM won't be done tomorrow, and scripting may not be the first thing on the list (it must definitely come after the main game engine).

@Gleeok: How about LISP? *runs*

#280 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 14 July 2010 - 02:32 PM

Python's actually pretty fast. It compiles at runtime and can also be compiled into bytecode in advance. In benchmark tests it's only about 99x slower than C, which is better than Ruby. And it has a really gentle learning curve. If you use PyPy to pre-compile it, apparently it's also a little faster.

#281 lucas92

lucas92

    Defender

  • Members

Posted 14 July 2010 - 06:29 PM

There's also the Pawn scripting language.
http://en.wikipedia....mming_language)

Very close to C syntax.

#282 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 14 July 2010 - 11:48 PM

Pawn doesn't support classes though. icon_frown.gif

From the sound of it, everyone sort of agees on an object based scripting system. This means many scripts being run per frame, potentially one per game object. People will in fact want to abuse this feature (And why not? I will too.) so speed really does matter.

Something else to take into account is how each script language allocates/handles memory for these objects, since many objects are created and destroyed each frame. If script 'handles' are wasteful (or bloaty if you will) here the CPU is going to take a major hit in performance from this.


I guess I have a "plan for the worst, hope for the best" way of thinking on this. The only way to know for sure though is to test them the way we will be using them and profile the results.

Edited by Gleeok, 15 July 2010 - 05:39 AM.


#283 Snarwin

Snarwin

    Still Lazy After All These Years

  • Members
  • Real Name:Paul
  • Location:New York

Posted 15 July 2010 - 09:03 AM

@Beefster: I'm pretty sure that both Lua and Angelscript also compile to bytecode.

@Gleeok: You can do classes and inheritance in Lua; it's just not built into the core language.

(And I am actually a huge fan of Ruby, in general, but I agree that using it as an embedded scripting language would be a horrible idea.) icon_biggrin.gif

#284 lonegraywolf

lonegraywolf

    Doyen(ne)

  • Members
  • Location:Minneapolis, MN

Posted 15 July 2010 - 09:47 AM

QUOTE(Snarwin @ Jul 15 2010, 10:03 AM) View Post
@Gleeok: You can do classes and inheritance in Lua; it's just not built into the core language.


I'd think built-in classes would be better. I guess that leaves AS and Python as the remaining contenders.

#285 Snarwin

Snarwin

    Still Lazy After All These Years

  • Members
  • Real Name:Paul
  • Location:New York

Posted 15 July 2010 - 10:49 AM

QUOTE(Wolfman2000 @ Jul 15 2010, 10:47 AM) View Post

I'd think built-in classes would be better.
Why, pray tell? It's not like they function any differently; you just use different syntax to set them up.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users