bugFreeciv - Bugs: bug #20877, fcgui cannot handle --LoadAI

 
 
Show feedback again

bug #20877: fcgui cannot handle --LoadAI

Submitted by:  Micke <mss_8734>
Submitted on:  Sun 09 Jun 2013 04:36:02 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: None
Assigned to: NoneOpen/Closed: Open
Release: Probably all with AI modulesOperating System: None
Planned Release: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 09 Jun 2013 06:22:03 PM UTC, comment #3:

> cloning the classic module and making no other changes than
> renaming all its wrapper functions... with the same result.


That would be expected if you leave it to access classic ai data instead of its own.

Which version you are using? 2.4 is not prepared for use-case of reusing default ai, but only for making completely new ai module. In 2.5 you could check how threaded ai reuses default ai (tai_init_self() and tai_get_self() instead of classic's classic_ai_set_self() and classic_ai_get_self() )

Marko Lindqvist <cazfi>
Project Administrator
Sun 09 Jun 2013 06:11:31 PM UTC, comment #2:

The result is that playing a local single-player game with AI modules is needlessly cumbersome, but I made the comment about being able to play too soon anyway; the server crashes whenever I try to start a game. At first it crashed after starting the game, so I thought it was because I was calling dai functions from mssai functions. I then copied and renamed those, but the result was the server crashing immediately after reading the default ruleset, before the client could connect. I then began anew, cloning the classic module and making no other changes than renaming all its wrapper functions... with the same result.
I'm beginning to think it will be less trouble to just hack the default AI directly and patch it locally whenever I upgrade.

Micke <mss_8734>
Sun 09 Jun 2013 04:21:20 PM UTC, comment #1:

Client is not supposed to have --LoadAI commandline parameter, nor many other parameters server-side has. See --help.

> Unfortunately, if I then run fcgui with that server running it
> spawns another server without loading any dynamic modules...


Do you "Connect to network game" (existing server), or do you "Start new game" (new server). If you get new server spawned in the formewr case, that's a bug.

> fcgui -a -s localhost


That's connecting to network game (on localhost) automatically.

Marko Lindqvist <cazfi>
Project Administrator
Sun 09 Jun 2013 04:36:02 AM UTC, original submission:

$ fcgui --LoadAI mss
Unable to find client executable: freeciv
Searching for freeciv clients ...
... using ./client/freeciv-gtk2
Running ./client/freeciv-gtk2
Encodings: Data=UTF-8, Local=UTF-8, Internal=UTF-8
Unrecognised option: "--LoadAI"

The server, however, does recognise it:

$ fcser --LoadAI mss
Encodings: Data=UTF-8, Local=UTF-8, Internal=UTF-8
This is the server for Freeciv version 2.5.99-dev
You can learn a lot about Freeciv at http://www.freeciv.org/
2: Loading rulesets.
2: AI*1 has been added as Easy level AI-controlled player (classic).
2: AI*2 has been added as Easy level AI-controlled player (classic).
2: AI*3 has been added as Easy level AI-controlled player (classic).
2: AI*4 has been added as Easy level AI-controlled player (classic).
2: AI*5 has been added as Easy level AI-controlled player (classic).
2: Now accepting new client connections.

For introductory help, type 'help'.

> create test mss

test replacing AI*1 as an AI-controlled player.

> list

List of players:
------------------------------------------------------------------------------
Test [#ff0000]: Team 0, user Unassigned
AI, mssai, difficulty level Easy
AI*2 [#ffff00]: Team 1, user Unassigned
AI, classic, difficulty level Easy
AI*3 [#00ffff]: Team 2, user Unassigned
AI, classic, difficulty level Easy
AI*4 [#8a2be2]: Team 3, user Unassigned
AI, classic, difficulty level Easy
AI*5 [#ffa500]: Team 4, user Unassigned
AI, classic, difficulty level Easy
------------------------------------------------------------------------------

Unfortunately, if I then run fcgui with that server running it spawns another server without loading any dynamic modules...
$ ps -A|grep freeciv
26719 pts/5 00:00:00 lt-freeciv-serv
26738 ? 00:00:02 lt-freeciv-gtk2
26759 ? 00:00:00 freeciv-server

Luckily I can overcome this with "fcgui -a -s localhost", so I can actually play with dynamic AI modules.

Micke <mss_8734>

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by mss_8734 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup