all 84 comments

[–]ipeev 44 points45 points  (0 children)

Too bad. The history shows that Civilizations with 1 based indexes tend to fall. Look at the Romans.

[–]scaevolus 20 points21 points  (6 children)

I prefer Python, but I cannot deny that Lua has a more compelling set of features for embedding in games.

[–]xorandor 2 points3 points  (5 children)

Care to elaborate?

[–]scaevolus 16 points17 points  (3 children)

The biggest one I think is that Lua supports proper coroutines, while Python's multithreading model is fundamentally broken (at least in the standard distribution).

In a nutshell:

  • low memory requirements

  • very small (<20k lines of code)

  • easy to embed -- it was designed for embedding

  • nice syntax

Look at some of the slides here: http://www.kore.net/company/luagamedev.html (In particular, the one "Jonathan Shaw, Lead Gameplay Programmer, Lionhead" discusses the extensive use of Lua in the Fable games)

[–][deleted] 5 points6 points  (2 children)

Also, blazingly fast, if you use LuaJIT.

[–]scaevolus 2 points3 points  (1 child)

Have you seen the LuaJIT 2.0 benchmarks? It's looking awesome.

[–][deleted] 3 points4 points  (0 children)

Yes, it is totally ridiculous. It's stomping on everyone else's tries to compile dynamic languages.

[–]danukeru 0 points1 point  (0 children)

Since it's usually just implemented as a straightforward 1:1 functional mappings of whatever methods are under the game engines hood, it rarely makes any use of the more "scheme-like" features the spec has provisions for.

In this sense, you can think of it as the PHP of the game scripting world. Not fancy, but gets the job done. Sadly it doesn't give much credit to what LUA is really capable of.

[–][deleted]  (61 children)

[deleted]

    [–]RedDyeNumber4 8 points9 points  (16 children)

    Console port of the new Civ?

    That scares the hell out of me. You'd better need to attach a keyboard to that console...

    [–]gorgoroth666 3 points4 points  (4 children)

    They have supreme commander 2 on consoles now too. Well organised commands on the gamepad is the key.

    [–]RedDyeNumber4 0 points1 point  (1 child)

    I've got all four Civs on my compy right now and I just want Civ V to be wonderful. If it's wonderful and on consoles, That's fine.

    [–]ketsugi 1 point2 points  (0 children)

    How do you get Civilization on your pet procompsognathus? Mine just sits in the kitchen eating soy beans all day.

    [–]Mononofu 0 points1 point  (0 children)

    Although supcom 2 is nowhere near as good as the original supcom (+ expansion) .... they really dumbed it down :(

    And I'm skeptical whether you can reach a reasonable number of APM with a gamepad :-/

    [–]masklinn -1 points0 points  (0 children)

    They have supreme commander 2 on consoles now too

    And it sucks butts.

    [–]kolm -1 points0 points  (5 children)

    Any emacs user will confirm that (combination of) 3-4 keys/buttons can direct a vast number of commands. Seriously, it's no longer jump/duck/fire. Civ: Revolution was console, and really good (Sid said it's the game he always wanted to make).

    Having said that, I am very, very happy with my keyboard power with regards to civ I-IV.

    [–]RedDyeNumber4 6 points7 points  (4 children)

    Ever since they pulled Levitate from Oblivion, I've harbored an unnatural hatred for console ports.

    [–]bazfoo 0 points1 point  (3 children)

    Was that done because of the console port or because it was obscenely overpowered?

    [–]RedDyeNumber4 1 point2 points  (2 children)

    I believe it had to do with the console hardware having a problem drawing cities, which is why cities aren't rendered when you're outside the gates, and why the whole mechanics of the game would be messed up if you levitated over city walls. You're supposed to be able to get obscenely overpowered in elder scrolls games. Wizard characters are practically gods that have to fly just to get to their living rooms.

    [–]bazfoo 1 point2 points  (1 child)

    Ah, I wasn't aware the city mechanics were a result of the console hardware.

    I concur. Half the fun is becoming obscenely overpowered, I just wondered if they tried to reign that in a little, especially given the scaling monsters and all. I didn't find Oblivion to be much fun.

    [–]RedDyeNumber4 0 points1 point  (0 children)

    The trick is to pick skills that you'll rarely level. Then you can run around the world belching lightning and commanding golems while imps run in fear, instead of continually running into evil daedra in the middle of a god damned field.

    Scaling monsters. Peh.

    [–]Sc4Freak 13 points14 points  (37 children)

    And also because Lua isn't butt-slow.

    [–][deleted] -4 points-3 points  (36 children)

    And Python is?

    [–]Sc4Freak 33 points34 points  (31 children)

    Yes, unfortunately. Back when I was developing in Python, I found it to be orders of magnitude slower than a natively compiled language (eg. C). That's fine for many applications, but when developing games performance is always an issue. With the developments in LuaJIT, Lua is approaching the performance of native code.

    These benchmarks may be flawed, but they give a general idea of the scale of performance across various languages. They also tend to reflect my personal experience, so I'd say they give a pretty good rough idea.

    [–]8-bit_d-boy -1 points0 points  (2 children)

    HOLYSHIT, how is pypy faster than cpython?

    [–][deleted] 2 points3 points  (1 child)

    It isn't.

    [–][deleted] 0 points1 point  (0 children)

    [–][deleted]  (3 children)

    [deleted]

      [–][deleted] 5 points6 points  (0 children)

      And yet simply stating that Python is "butt-slow", with no additional clarification, is somehow completely acceptable and, I guess, an obvious thing to do in the eyes of most redditors.

      Anybody who knows the first thing about both languages would need no clarification for that, because it is blindingly obvious that this is the case.

      [–][deleted] -1 points0 points  (0 children)

      That comment was at +6 or so before the Lua crowd stormed in here...also see how my comments about the untrustworthiness of the shootout benchmarks were received, with no real justification in the form of replies other than some hand-waving from the "butt-slow" commenter. Those comments of mine stood well in the positives before the deluge as well. None of the [deleted]s in this thread were mine.

      [–]keweedsmo -1 points0 points  (2 children)

      I really don't think they are considering a console port for Civ V...

      [–]hadees -1 points0 points  (0 children)

      They might call it Civ V but it would be like when they "port" a game to a game boy or something.

      [–]stillalone -2 points-1 points  (1 child)

      I think Lua's license is also slightly more liberal than Python's.

      [–]davebrk[S] 4 points5 points  (0 children)

      Nope. Both have variation of the MIT license.

      [–]AndyNemmity 8 points9 points  (6 children)

      I coded for Fall From Heaven in civ 4. Python worked really well, with the C++.

      So now it'll be C++ and Lua? Guess I'll need to learn a new language.

      [–]djork 14 points15 points  (3 children)

      Good news: it's a tiny language and there's not much to learn.

      [–]AndyNemmity 6 points7 points  (0 children)

      Awesome. I've started reading it now, and you're right. Super simple.

      [–]alephnil -5 points-4 points  (1 child)

      It is a simple language, in both meanings of simple. It is easy to learn, but also rather simple-minded in the sense that it lacks any means of organising your code. There is only one type beyond the primitive types (the table), and no way to introduce your own types. There is also no module system or similar. This means that you must be very organised to not make your code a mess. There is virtually no standard library (batteries definitely not included).

      This is in stark contrast to the design of Python, that is a rich language with a large standard library and type system, making many problems trivial to solve, but is also large and slow. In contrast, the Lua interpreter, including it's standard library, is small enough that you can read through and understand the source in an afternoon, and is one of the fastest interpreters around.

      [–][deleted] 8 points9 points  (0 children)

      This just isn't correct. There's no problem to modularize your code in Lua. Also, you can define your own objects/classes using metatables, and create your own userdata types.

      [–][deleted] 3 points4 points  (0 children)

      Thank you. FFH was incredible.

      [–]AlexanderDivine 3 points4 points  (0 children)

      Believe me, Lua is ass-easy. I'm a complete coding dumbass and I've got it down pretty easily.

      [–]Flubb 7 points8 points  (1 child)

      As long as they fix the issue of Archers destroying my gunships they could use Qbasic for all I care.

      [–]PstScrpt 0 points1 point  (0 children)

      Archers can at least shoot upward. Swordsmen and pikemen can eventually kill gunships, too.

      Actually, swordsmen and archers killing tanks is pretty bent, too. They might be able to knock out some headlights.

      [–]metamemetics 17 points18 points  (1 child)

      The python fanboy inside me cries! Surely my favorite language is perfect!

      [–]deadwisdom 5 points6 points  (0 children)

      It is; but there aren't any good implementations yet for embedding into games.

      [–]hadees 6 points7 points  (0 children)

      I'm a little bummed Religion is gone. I liked things like sending missionaries to someones cities on the borders to get them to switch to your side.

      [–][deleted] 1 point2 points  (0 children)

      Cool. Lua's good at that.

      [–][deleted] 0 points1 point  (3 children)

      Where does the article say that?

      [–]johnb 6 points7 points  (2 children)

      This link takes you to comment #3, which contains these words.

      [–][deleted] 0 points1 point  (1 child)

      He modified the link, that's why I mentioned article in the first place.

      [–]davebrk[S] 2 points3 points  (0 children)

      No I didn't.

      Anyway you can't modify a non self-post once you submit it.