Complete.Org: Mailing Lists: Archives: freeciv-dev: August 1999:
Re: [Freeciv-Dev] Adding scripting language
Home

Re: [Freeciv-Dev] Adding scripting language

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jules Bean <jmlb2@xxxxxxxxxxxxxxxx>
Cc: Artur Biesiadowski <abies@xxxxxxxxx>, Freeciv Dev <freeciv-dev@xxxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] Adding scripting language
From: Tony Stuckey <stuckey@xxxxxxxxxxxxxxxxx>
Date: Tue, 31 Aug 1999 18:06:53 -0500

On Tue, Aug 31, 1999 at 11:14:35PM +0100, Jules Bean wrote:
> Artur Biesiadowski wrote:
> > As it is note on web site guile seems to be best choice. I personally
> > would prefer java, but it's footprint is way too large for just
> > scripting language (and it needs compiling - more mess than with fully
> > interpreted language).
> 
> IMO, this is not in itself a good enough reason to disqualify java.  I
> don't think a compiling step is a problem.  More worrying about java,
> IMO, is the fairly 'hefty' virtual machine needed - but perhaps a
> cut-down build of kaffe could be used.

        I'd still prefer a targeted scripting language that uses game
concepts.

> > Second big question is how to implement wonders etc - things with global
> > affects. Wonder which establishes embassies with all civs is easy - just
> > run script and forget. But wonder which cuts down shield cost of air
> > units in half is more complicated. You can add build_cost script to air
> > units and add same check for given wonder in each of them, but it's a
> > bit overkill. I do not see easy way to solve this. Maybe some kind of
> > event registry, so for example each time some kind of script is called
> > first global overrules are checked. But with 5 global event listeners
> > for build_cost, every change in city would require evaluation not of 100
> > build_cost scripts, but 600 of them. Any ideas ?
> 
> (Note of English: affects is the verb.  Effects is the noun :-)

        Both are both noun and verb.
        Effect as a verb is to create.  Effect as a noun is a change in
state.
        Affect as a verb is to change or masquerade.  Affect as a noun is
emotional display.

> But then we have horrible code duplication between units, which makes
> the ruleset file hard to work with.  Which is where the compiler comes
> in.  I envisage the compiler meaning that rules files look more like:
> 
> global terrain defence adjustments {
>   mountains=3;
>   forest=2;
>   grassland=1;
> }
> 
> mountaineer terrain defence adjustments {
>   mountains=6;
> }
> 
> unit phalanx { defence=2 }
> unit pikemen { defence=2 }
> unit musketeer { defence=3 }
> unit strange_type { defence=10 adjustments=none }
> unit mountain_ranger { defence=1 adjustments=mountaineer }
> 
> So that the compiler generates the code which applies the standard
> adjustments to all types,  except that strange_type doesn't get any
> adjustments, and mountain_ranger falls into a special class
> 'mountaineer' which gets different adjustments.

        Yow.
-- 
Anthony J. Stuckey                              stuckey@xxxxxxxxxxxxxxxxx
"When I was young, the sky was filled with stars.
 I watched them burn out one by one."  -Warren Zevon

[Prev in Thread] Current Thread [Next in Thread]