[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2014-08-12 Thread Marko Lindqvist
Update of patch #2143 (project freeciv):

 Planned Release:   2.5.0 =>


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2013-01-30 Thread Matthias Pfafferodt
Follow-up Comment #8, patch #2143 (project freeciv):

I will have to see if the old patches are still useable ...

> This cannot work correctly. (Well, it does as long as you use 
> all parts of default ai, and don't reimplement any part 
> yourself). 

Therefore my old patches for the lua ai included a complete copy of the
default ai ...

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2013-01-19 Thread Marko Lindqvist
Follow-up Comment #7, patch #2143 (project freeciv):

> Most notable problem is that default ai code depends heavily on
> pointer to its own ai type (default_ai_get_self() calls). So
> default ai functions you call are not using data stored for your
> lua ai, but for default ai.

This has been since changed so that default ai does not use
default_ai_get_self() but uses pointer passed to it from the upper level.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2011-10-28 Thread Matthias Pfafferodt

Update of patch #2143 (project freeciv):

 Planned Release:   2.4.0 => 2.5.0  


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2011-03-01 Thread Marko Lindqvist

Follow-up Comment #6, patch #2143 (project freeciv):

> starts a lua ai (default ai called via a lua instance) 

This cannot work correctly. (Well, it does as long as you use *all* parts of
default ai, and don't reimplement any part yourself).
Most notable problem is that default ai code depends heavily on pointer to
its own ai type (default_ai_get_self() calls). So default ai functions you
call are not using data stored for you lua ai, but for default ai.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2011-02-22 Thread Matthias Pfafferodt

Follow-up Comment #5, patch #2143 (project freeciv):

move file #12399 (comment #4) to patch #2554

___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2011-02-22 Thread Matthias Pfafferodt

Update of patch #2143 (project freeciv):

  Depends on: => patch #2554


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2011-02-11 Thread Matthias Pfafferodt

Update of patch #2143 (project freeciv):

  Depends on: => patch #2417


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2011-02-11 Thread Matthias Pfafferodt

Update of patch #2143 (project freeciv):

  Depends on: => patch #2520


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2011-02-11 Thread Matthias Pfafferodt

Follow-up Comment #4, patch #2143 (project freeciv):

see also patch #2520; attached is a stub lua ai interface ...

(file #12399)
___

Additional Item Attachment:

File name: 20110211-add-stub-for-lua-ai.patch Size:4 KB


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2011-02-09 Thread Matthias Pfafferodt

Update of patch #2143 (project freeciv):

Priority:   1 - Later => 5 - Normal 
  Status:None => In Progress
 Assigned to:None => syntron
 Planned Release: => 2.4.0  

___

Follow-up Comment #3:

I did started this ...

The attached big patch file does:

* a rewrite of the lua module
* split it in a common (common/scriptcore) and server (server/scripting)
part
* clean up lua functions (use for fcdb) and signal handling (server)
* adds client lua script (client/luascript) with possibilities of signals
like in the server
* add a client lua console (only gtk client)
* starts a lua ai (default ai called via a lua instance)

The patch needs some cleanup & work wrt the lua ai but the module can be
loaded. All other parts are working.

I will splitt it into smaller parts when it is finished.

(file #12364)
___

Additional Item Attachment:

File name: script.diff.bz2Size:50 KB


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2010-11-03 Thread Matthias Pfafferodt

Update of patch #2143 (project freeciv):

  Depends on: => patch #1785


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2010-10-30 Thread Matthias Pfafferodt

Follow-up Comment #2, patch #2143 (project freeciv):

> It sounds a good idea. But, we probably need to decide about
> what we want to do: AI at server side in C, AI at server side > lua
scripted or AI client side. As I understand patch #1785 or
> patch #1846, we were going to a server side AI... 

I do not consider client side AI an option. As discussed somethere (I did not
find the source), the AI is coupled to the knowledge of the server which will
not be available in the client. Thus, a client side AI would never be as good
as a server side AI.

Furthermore, there should be distinguished between AI and advisors. The AI
belongs into the server but advisors for the player (as in 'small helper
script') could be part of the client. They would use only the players
knowledge.

About the language to use for server side AI, this ticket is the place to
discuss it. A lua implementation would allow to (easily?) save the AI state
similar as done for the server lua script.

patch #1785 is at the moment on hold. I have to revise the patches to the
current state of trunk.

patch #1846 would be of interest to speed up the AI. I think, one lua state
for each AI would help here (i.e. one lua state could be assigned to one
thread?).

Short summary of some comments to this toppic I found using google:

> The second problem is that, provided the AI feature is
> client-side in a client-server game, those who have the better
> AI scripts or AI code will gain a substantial advantage. This
> is particularly the case in multiplayer games that use a
> timeout timer to end turns. The unofficial Freeciv 'warclient'
> gives players mass control over units and is a substantial aid
> in timeout games. While some may find this (writing their own
> AI-aid code) a challenge on its own, it is inherently unfair
> and detracts focus from the core game concepts.
[http://freeciv.wikia.com/wiki/4x_Design]

"Why client-side AI could be a Bad Thing" (nice read!):
[http://thread.gmane.org/gmane.games.freeciv.devel/6545/focus=6560]

Discussion of client-side AI and AI using lua:
[https://mail.gna.org/public/freeciv-dev/2010-05/msg00118.html]

Discussion of client side AI in the freeciv forum:
[http://forum.freeciv.org/viewtopic.php?t=757]

Using function pointers for the AI functions and a comment by Per to the
complexity of the AI:
[http://forum.freeciv.org/viewtopic.php?t=1386]

Why the AI is in the server (again comment by Per):
[http://forum.freeciv.org/viewtopic.php?t=52]

Old try on client side AI (puppeteer):
[http://blog.gmane.org/gmane.games.freeciv.ai/month=20040301]
[http://download.gna.org/freeciv/incoming/puppeteer.patch.cvs-Sep-09_0.006.diff.gz]

A good summary of the problems with the AI by Per:
[http://permalink.gmane.org/gmane.games.freeciv.ai/1454]


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2010-10-29 Thread pepeto

Follow-up Comment #1, patch #2143 (project freeciv):

It sounds a good idea. But, we probably need to decide about what we want to
do: AI at server side in C, AI at server side lua scripted or AI client side.
As I understand patch #1785 or patch #1846, we were going to a server side
AI...


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2143] [RFC] AI interface using lua

2010-10-29 Thread Matthias Pfafferodt

URL:
  

 Summary: [RFC] AI interface using lua
 Project: Freeciv
Submitted by: syntron
Submitted on: Samstag 30.10.2010 um 00:26
Category: ai
Priority: 1 - Later
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: 

___

Details:

I did implement the authentication system in lua using luasql. Doing this I
through about the current AI implementation:

At the moment the AI interface is defined via ./common/ai.(ch),
./server/aiiiface.(ch) and ./ai/defaultai.(ch). Only this interface should be
used to access the AI. To create an independent AI implementation work is done
to remove all dependencies of ./server on files of the AI (./ai). Therefore,
the advisors are separated into ./server/advisors.

Considering the frequently expressed request to create a scriptable AI, this
interface can be change to an lua interface. For each AI player a lua state
is created and, in the beginning, the above discussed functions are defined
as entry points from freeciv to the lua. This functions in turn only call
back to the AI definitions in ./ai. In time, the some lua function can be
implemented, doing some general AI work, while the main part (or the work
load) is still be done in c.

Pro:
- scripting of the AI
- different AI's

Contra:
- speed
- indirective calls (c => lua => c)
- yet another interface, why not finish the current?

This is nothing I will work on at the moment but is a nice idea what could be
done with the current lua implementation.

Comments?





___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev