patchFreeciv - Patches: patch #1494, [Metaticket] merge longturn into...

Show feedback again

patch #1494: [Metaticket] merge longturn into mainline

Submitted by:  Matthias Pfafferodt <syntron>
Submitted on:  Sun Feb 28 16:31:04 2010  
Category: generalPriority: 1 - Later
Status: DonePrivacy: Public
Assigned to: Matthias Pfafferodt <syntron>Open/Closed: Closed
Planned Release: 2.4.0Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


(Jump to the original submission Jump to the original submission)

Fri Oct 28 22:15:09 2011, comment #11:

all of the subtickets are done and longturn was restarted with freeciv 2.3. There are new differences which will be handled in new tickets.

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Mon Jan 17 15:14:23 2011, comment #10:

Most of it is done ... (but there are still differences and, thus, this ticket is still open)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sun Jan 2 21:35:30 2011, comment #9:

change planned release to 2.4.0

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sun Jul 4 19:01:44 2010, comment #8:

I did a check the longturn code base and did a cleanup. Doing this I tried to uses as many code from trunk as possible. Looking at the patches it is clearly visible, what needs to be done till longturn can use the mainline freeciv version. The list of patches includes:

longturn c++ files (newcommers and postgres authentication):
5966b21... [c++] newcommers
dfcc14c... [c++] longturn authentication (postgres)
57b2062... [cleanup for c++] fix color in featured_text
eee70dd... [cleanup for c++] do not use 'class'
b09c016... [cleanup for c++] some magic in specenum
eff3ed1... [cleanup for c++] move struct cf_sequence into c file

longturn 'specials':
69fa738... longturn command level
0d4cbef... start positions
b66d242... rename command
95321a6... player placement hacks
e5c6687... first find unused team

backports from trunk:
3fa4f9d... [backport for S2_2] possibility to lose a tech if it is transfered
0780f01... [backport for S2_2] different checks if a tech is lost
4e35044... [backport for S2_2] Settings to disable the trade of gold, cities and technologies ported from warclient.
acd42fe... [backport for S2_2] Added 'killunhomed' setting.
8ed6618... [backport for S2_2] Added unitwaittime setting.
aa60b72... [backport for S2_2] Added convenience function for formatting a time string.

(file #9426)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Wed Mar 31 19:32:59 2010, comment #7:

I don't know any lua so I will focus on the c part. I think it should be something like /newplayer. This command should create a new player on a empty slot or (re)use the slot of a dead player.

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Tue Mar 30 23:48:05 2010, comment #6:

Maybe my original message was not as clear on C vs. lua as I thought, I'm sorry.

Rough idea might be:

1. /reap server command -- implement in C
2. server command or server function to create a new player during the game, without giving the player anything. Implement in C. Make the function available in the lua API so scenarios and rulesets can use it.
3. Make many more functions available in lua so that the wanted calcluations can be carried out

If you look in the patch, it is basically the higher level mechanisms there that we really want in lua, the rest in various places in C. In Lua we want to be free to change: selecting the starting tile, giving the player initial units and giving the player initial gold and tech.

I think new functions we need in lua are things like:

Get player gold
Get player civilization score (not the same as full score)
Create units in boat(?)
Check if units can exist on a tile (for trireme on ocean etc)
Get unit list for tile
city closest to a tile

One open question is what to do with the Newcomer "strength" percentage server option that was in longturn. If giving units to a new player is controlled from lua, then a server option for that doesn't make much sense. The ruleset can of course be reconfigured much more easily in lua than in C. The ruleset may even choose to expose the strength percent directly in the functions it defines for creating newcomers.

Engla <englabenny>
Project Member
Tue Mar 30 23:05:36 2010, comment #5:

The C version can lets us see what we move to lua easily and what not. But my previous message already has a proposed "plan of attack" which mentions which parts could be implemented in lua and which not.

If maho himself has any input it'd great as well of course. I guess everyone would prefer to make the oft-configured stuff (unit/resource allocation) easily configured in lua.

Engla <englabenny>
Project Member
Tue Mar 30 22:00:21 2010, comment #4:

> Here is a port of Maho's newcomers code to C. In C, we can finally read and understand it :-) It is a diff against trunk rev 17191

I will check it. It should be the current version as there are nearly no commits in the longturn branch.

Do you plan to do this in lua or is an implementation directly in the server the better approach?

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Tue Mar 30 13:34:08 2010, comment #3:

Here is a port of Maho's newcomers code to C. In C, we can finally read and understand it :-) It is a diff against trunk rev 17191

It seems to work well now. The critical parts come when the player list is already full and dead players have to be replaced.

The process consists mainly of two parts:

1. Creating a new player, possibly taking a dead slot. Reset everything (map, diplomacy, etc)
2. Creating new units according to the strength of the average player. So it looks at civ score etc.

A possible plan of attack might be:

1. A /reap server command to make a dead player's slot and nation free
2. A server command to create a new player during the game, without giving the player anything (or put this in lua)
3. A lua trigger or lua activation method where the script will give the player its starting units.

To port this to lua lot of accessors are needed.

Of course, it could be interesting to be able to create new players from a scenario or ruleset script, so that action can be made available. But I guess the specific /reap server action has to be a ALLOW_ADMIN command to be carried out from the server.

The code I ported was taken from a svn clone of longturn, and I hope it corresponds to the latest code.. I haven't compared with your diff.

(file #8738)

Engla <englabenny>
Project Member
Sat Mar 20 16:39:10 2010, comment #2:

> (c++) adding new player and changes to ./server/generator/startpos.c

this could possible be done in lua; see bug #15644

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Mon Mar 1 23:02:46 2010, comment #1:

I added some patches; leftovers:

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sun Feb 28 16:31:04 2010, original submission:

I did a diff between longturn (master) and freeciv 2.1.8. The diff file cleaned by unimportant changes is attached (ca. 100kB).

changes added to longturn (TODO list):

  • setting: unitwaittime by book
  • setting: (slowly) kill unhomed units
  • setting: techloosing (patch available)
  • setting: citytrading
  • command: rename
  • longturn command level (equal to info?)
  • (c++) adding new player

changes to ./server/generator/startpos.c

  • (c++) updated mysql connection

ported changes (done):

  • setting: foggedborders
  • setting: trademindist

I think the hardest part would be the c++ files.

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.


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

Attach File(s):

Attached Files
file #9426:  S2_2-longturn.tar.bz2 added by syntron (29kB - application/x-tbz)
file #8326:  lt.diff added by syntron (97kB - text/x-diff)


   bug dependencies, patch dependencies.

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by englabenny (Updated the item)
  • -unavailable- added by englabenny
  • -unavailable- added by syntron (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.


    Error: not logged in



    Follow 25 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Oct 28 22:15:09 2011syntronStatusIn Progress=>Done
    Fri Jan 14 12:11:28 2011syntronDependencies-=>Depends on patch #2276
      Dependencies-=>Depends on patch #2275
      Dependencies-=>Depends on patch #2273
      Dependencies-=>Depends on patch #2272
      Dependencies-=>Depends on patch #2121
    Sun Jan 2 21:35:30 2011syntronPlanned Release2.3.0=>2.4.0
    Sun Jul 4 19:01:44 2010syntronAttached File-=>Added S2_2-longturn.tar.bz2, #9426
      StatusNone=>In Progress
      Assigned toNone=>syntron
    Wed Apr 14 20:56:09 2010englabennyDependencies-=>Depends on patch #1601
    Thu Apr 8 20:35:30 2010syntronDependencies-=>Depends on bugs #13643
    Sat Apr 3 23:10:21 2010syntronDependencies-=>Depends on patch #1506
    Wed Mar 31 21:54:50 2010syntronDependencies-=>Depends on patch #1574
    Tue Mar 30 13:34:08 2010englabennyAttached File-=>Added newcomers_trunk_r17191.diff, #8738
      Carbon-Copy-=>Added englabenny
    Sat Mar 6 00:12:13 2010syntronDependencies-=>Depends on patch #1504
    Mon Mar 1 23:00:53 2010syntronDependencies-=>Depends on patch #1263
    Mon Mar 1 22:59:33 2010syntronDependencies-=>Depends on patch #1501
    Mon Mar 1 22:57:41 2010syntronDependencies-=>Depends on patch #1500
    Mon Mar 1 22:56:09 2010syntronDependencies-=>Depends on patch #1499
    Mon Mar 1 21:36:12 2010syntronDependencies-=>Depends on patch #1258
    Mon Mar 1 21:33:58 2010syntronDependencies-=>Depends on patch #1201
    Sun Feb 28 16:31:04 2010syntronAttached File-=>Added lt.diff, #8326
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup