Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Games Entertainment

Scripting Language for CIV 36

doomy writes "SLIC the scripting lanugage for Civilization : Call to Power has been released. All all game scripters rejoice and learn this language before the game is out. "
This discussion has been archived. No new comments can be posted.

Scripting Language for CIV

Comments Filter:
  • by Anonymous Coward
    When will people start learning that writing their own mini scripting language is bogus? There are plenty of options out there right now that work just great, like Python, Tcl, Scheme, Perl, even javascript. Why not use one of these perfectly fine languages instead of creating the whole thing from scratch? Tcl, infact, was invented for this very reason - many people don't seem to care for the language itself, but its C API is a lot of fun to work with, and I highly recommend it. Python's C API also seems pleasant - I'm not quite so sure I like Perl's, and I think it's harder to make a restricted interpreter, but I'm sure it can be done.

    Ciao
  • I also don't know enough about Guile specifically - how easy is it to interface with code written in other languages?

    Guile is an implementation of Scheme designed to be an extension language--- you can link it to your application, and code custom primitives in C.

    The documentation was not quite there last time I checked, though.

    BTW there is another, non-GNU Scheme extension language: Elk.

    ---

  • Posted by FascDot Killed My Previous Use:

    Why not Guile like FreeCiv is doing?

  • That is an...err.. interesting approach to functions. I tend to agree that it would have been better to use an existing language, if only as the basis. Strip down Perl a bit (regexp is probaly not a requirement, for example)...

  • This sounds like it could be a fun feature of a (I hope) great game. The only way I can think of it is in terms of CIV. I would try to set it up so that I had an early warning system. Whenever one of my units saw an enemy, and I forgot about them, I'd get pissed. Then I'd miss my chance to fight. I think also a good application would be automated production. A dialog could pop up when a city gets a new unit, and allow you to continue pumping out units, automagically.

    Man do I want this game.
  • > No autosave

    The linux beta at least does have autosave.
    You just have to manually move the save file to
    use it.
  • Gift horse? Gift horse?

    I didn't realize this game was a quadruped mammal. How interesting...
  • I love Perl, but it's a little too eclectic, and string-oriented, for doing game scripting in. It's also kind of big; library size is important for console games. Ideally you want something that can be stripped down to just math libraries, then you can add in all other functionality yourself.

    Javascript turns out to be really suitable. It's easy to pare down, has a good native interface, can compile to bytecode at runtime, and supports multiple contexts.

    BTW, also worth a look are tinyscheme [altera.gr] (which is a nice small embeddable Scheme), Python [python.org], Lua [puc-rio.br], and the fairly obscure ICI [zeta.org.au]. ICI is a very nifty C dialect for scripting but it doesn't seem to be intended for embedded applications.

    Nothing wrong with rolling your own, though. Especially if you've got a lot of scripters to support. I'm interested in seeing how Q3A [planetquake.com]'s plans for scripting in ANSI C (using lcc [princeton.edu]) turns out.


  • The beta does indeed autosave.
  • It still beats CivII's very limited event-oriented "scripting" - be happy for small favours, don't look a gift horse in the mouth, etc. :-)

    Plus, it seems from postings to csipgs that there is a "rushed" feel to it overall - perhaps there was no time to merge a "proper" scripting language with it.
  • A few reasons to write one's own language:
    1. domain specific languages can be very expressive
    2. implementing a new scripting language, and learning a new language, is lightweight to many of us. it requires no effort.
    3. existing languages probably have licensing restrictions.
    4. not-invented-here

  • another reason to create a new language: efficient execution of the script. the game should execute smoothly and in real time. the language subsystem should require little of the cpu, and more importantly should have a small memory footprint and minor cache effects. which probably explains all of their compromises. lack of local variables: only one hash table is necessary for lookups. integers don't require forward declarations, but the other types do: cuts down on ambiguity (but why not also require declaration of ints?). no functions: one less language construct to handle.

    many past and current languages were designed without regard to implementation. this language could very well be the opposite: concern more for implementation rather than feature bloat and syntax purity.
  • I like this comment and am very interested in the answer. Do me a favor and post this on http://natas.kfa.cx/~natas/wwwboard/wwwboard.html
    The Lokisoft guys come in there alot and answer questions. And this is a very nice one :)
    Natas
  • Hahhah. Go hit the SLIC link and then say this. That shit is the worst "scripting" language I've ever seen. It reminds me of ObjectPAL from Paradox. NO FUNCTIONS! THERE ARE NO FUNCTIONS! NOT EVEN A GOSUB/RETURN!

    Contrast that to something like Object Domain (http://www.objectdomain.com), a CASE tool that has TCL embedded. I was able to write an SQL generator in under 30 minutes that saved me 3 hours of work. If they'd done something like SLIC it probably would have taken several hours.

    Writing your own languages is a good idea if you're an expert. Whoever created SLIC should have thought a little longer about their options.

    -sunking
  • by jrs ( 27486 )
    Well i got civ3 for *cough* windows, its a really good game, although i miss my city screen from civ2. There are also a few bugs and a lot of unbalancing in the game, but i'm sure that will all be fixed with patches.

  • Gift horse? Gift horse?

    I didn't realize they were giving the game away. How interesting...

    --

  • I agree. Although I think it is strange that you have not mentioned any lisp dialect here. Guile had been perfect.

    And BTW, you don't really mean that you prefer writing AI in C?

  • Why not in assembly? Or even better, "typing" the "scripts" directly on a floppy with a magnetic needle?

    Personally, I can't see a single reason for using C as a scripting language, except "I'm going to commit suicide next week, and need to get in the mood".

  • Yeah, call me when the Linux port comes out.

    IMHO, I think Activision took a big risk by letting Loki release the Linux version two weeks after the Windows one came out. I mean, I would have bought it off the shelf at Best Buy the day it came out -- sheer force of the reputation of the previous two games. Now, I'll have to see if it sucks or not by talking to my non-Linux-using "friends".

    Of course, I'll probably still buy it. I've been playing Civ2 for so long I'm starting to get retinal burn-in of the city screen...

    ----

  • I agree. Although I think it is strange that you have not mentioned any lisp dialect here. Guile had been perfect.

    I'll agree in theory - although I personally am not a comp sci major and haven't been forced to wrap my brain around functional programming. The idea of say, summing a list via recursion instead of a loop just doesn't feel natural.

    I also don't know enough about Guile specifically - how easy is it to interface with code written in other languages?

    And BTW, you don't really mean that you prefer writing AI in C?

    Just an example, just a theoretical example... but one point I was trying to make is that if you can link to C code, it's possible to write wrappers as a "gateway" to just about any language out there for people who really hate your particular scripting choice.
  • As a programmer who is currently writing a *very* powerful scripting language that straddles the line between a scripting language and a programming language, SLIC is pathetic. No user-defined functions, no local variables, no objects, no parameter passing, no class inheritance, etc. SLIC makes Perl look great.

    SLIC sucks - Activision must have really underpaid programmers working on this game who don't know how to write scripting languages!
  • I'm curious how well the patches will be propagated to Linux. The best we can hope for is that Activision will have LokiSoft do all the patches. But is there any possibility that some patches won't be propagated?

    For instance, if Activision has to shell out $$$ to LokiSoft every time an update needs to be done, they probably won't be very enthusiastic about it. Does anyone know what their contract calls for in terms of patches/updates?
  • Yet Another Scripting Language, that is.

    And not a good one either - what were they thinking? While SLIC does not directly support user defined functions, there is a workaround. I'm sorry; I'll get by without object oriented programming fine, but at least give us functions to work with. I can't even imagine writing a script longer than a couple hundred lines in this. Not to mention the undeclared variables (what do you mean there's a typo in my script? There was no parsing error!), and the lack of locally scoped variables, structures, pointers/references, or many other features of every useful language created in the last 30 years.

    They would have had less programmer work, probably earned greater performance, and definitely made the game infinitely more extensible, if they'd added a Perl, Python, or even Tcl interpreter instead of creating this travesty. (Hell, Java, Javascript, etc. would work too if the licensing was OK.)

    They also would have tapped in to the vast mountain of existing code out there. Imagine a python script that, at the end of every turn, updates a web page with a summary of the game. Imagine a perl script with the Gimp module, allowing you to make animated GIFs of the battles when you press a button. Imagine writing (and compiling) your own AI in C, then hooking it up to libtcl, perl XS, or whatever...

    Not that this is all bad - I mean even crippled user extensible scripts are definitely preferable to no user extensibility at all... but they hit on an idea that could have been as revolutionary to strategy games as QuakeC was to 3D shooters, and it hurts to see they missed the target.
  • by Anonymous Shepherd ( 17338 ) on Sunday April 11, 1999 @12:54PM (#1939858) Homepage
    Good news and all, but I'm worried about the negative issues [gamecenter.com] I've seen about CtP on www.gamecenter.com. While the review in general was overall saying good things about CtP, there are some points it brings up:

    No autosave
    (Which can actually can be addressed with an Aborted() messagebox with a contained SaveGame(...) function... check out the SLIC)

    Difficulty in identifying units on the map
    (There may be something doable with the SLIC as well, by using a permanent or popup box which labels every unit you select or click on...)

    Lack of explore/patrol
    (Hmmm... looks like SLIC may be able to do something with this as well, though my be just a bit clunky)

    I also wonder if the SLIC allows for the creation of Wonders and new effects...

    I guess actually trying the game with some SLIC script would be the only way to find out.

    I wonder what CmdrTaco(he does have the Linux port beta, doesn't he?) or other beta testers think of the review and these 'problems'.
    AS

Without life, Biology itself would be impossible.

Working...