Complete.Org: Mailing Lists: Archives: freeciv: April 2003:
[Freeciv] Re: Technology
Home

[Freeciv] Re: Technology

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv@xxxxxxxxxxx
Subject: [Freeciv] Re: Technology
From: David Paigen <paigen@xxxxxxxxxxx>
Date: Sun, 13 Apr 2003 09:51:46 -0700

Christian Knoke <chrisk@xxxxxxxx> wrote:

> On Sun, Apr 13, 2003 at 04:19:32PM +0200, Thomas Strub wrote:
> > 
> > When Raimar presented the CMA at FUADEC is said to him that CMA is
> > rather useless without that triggers, but he said it would be to
> > complicate to have sizedependend rules. 
> > 
> > A production MA like you describe it would be a big help for playing.
> > Hope someone will code it sometime (For a better AI we need it anyway.)
> 
> Triggers for everything (not only CMA) are a good thing, but I want this
> flexible and scriptable, so the UI is the main problem, and I don't think
> a GUI makes much sense.
> 
> I certainly don't want another CMA option.

How about a scripting interface?  At first I was surprised at the
lack of freeciv robots, but then I realized what that could do to
the human component of the game.  But an api that only allowed
city management and could not access units, their locations, or
see anything, might not upset the balance too much.  Against the
computer I spend 90+% of my time doing city management.  But a lot
of it is rote and could be automated, especially during a conquest
campaign when I start to rack up a lot of citys that I don't care
much about.

What do you think of the following example?

func CMA_loop( city )           // run when cma needed
    do_all_normal_cma_processing()
    if( option.script_filename exists )
        tclshell = fork_tcl_shell()
        set_tcl_variables( tclshell, city )
        run_tcl_script( tclshell, option.script_filename )
        get_tcl_return_values( tclshell )
        close_tcl_shell( tclshell )
    endif
endfunc

Where set_tcl_variables does things like set up the city_tile
matrix, the units_supported array, the improvements and wonders
list, the size, occupants, etc.

To make everything fair, I think the script would have to be run
from the client, and its actions would need to be limited to:
        alter the current worklist
        alter the assigned workers
        set tile improvement priorities for auto settlers

The script should be prevented from:
        Buying things
        setting tax rates       
        moving units
        seeing outside the city limits
        setting tech priorities

On the one hand, it might be easier to whip up a simple control
language rather than a library for the scripting language, but
I want a fully featured language that I can do real programming
in.  So go with the shell.  People could even set the shell to
something other than tcl if the proper libraries were available.

-David Paigen
paigen@xxxxxxxxxxx




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