[Freeciv-Dev] [patch #1936] limit the number of units a city can support
Follow-up Comment #13, patch #1936 (project freeciv): I was thinking trade after... well trade (routes) happened ;). That is still limited but has different dynamics then either pop limit or shield limit. Each city has a certain amount of trade, so the amount of resources that can _locally_ be used by a city is limited (yet higher then the amount of gold by workers. But I think either limit makes sense and my offer is just that, an alternative : ___ Reply to this item at: http://gna.org/patch/?1936 ___ 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 #1962] Expand the commentary for RESULT_IS_KNOWN
URL: http://gna.org/patch/?1962 Summary: Expand the commentary for RESULT_IS_KNOWN Project: Freeciv Submitted by: nixeagle Submitted on: Monday 09/13/2010 at 00:14 Category: ai Priority: 1 - Later Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: ___ Details: Explains what RESULT_IS_ENOUGH is used for and how the value it is compared against is computed. Original comment about saving CPU is preserved. I styled the code comment for this #define after the surrounding comments on preprocessor definitions. If this is not correct, just let me know. ___ File Attachments: --- Date: Monday 09/13/2010 at 00:14 Name: 0001-Expand-the-commentary-for-RESULT_IS_ENOUGH.patch Size: 1kB By: nixeagle Code commentary http://gna.org/patch/download.php?file_id=10333 ___ Reply to this item at: http://gna.org/patch/?1962 ___ 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 #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Follow-up Comment #4, patch #1942 (project freeciv): Alright, new patch attached fixing comment header length to 77 chars. I copied from the header for ai_airlift which is 75. I left the empty line on line 127 as it separates the variable initialization for that block from the use of it. This fits with how ai_airlift has it laid out. If this is enough of a problem to block applying the patch I can submit a 4th revision. (file #10294) ___ Additional Item Attachment: File name: 0003-refactor-first-portion-of-ai_airlift-into-find_needi.patch Size:3 KB ___ Reply to this item at: http://gna.org/patch/?1942 ___ 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 #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Follow-up Comment #5, patch #1942 (project freeciv): Bah, the empty line had spaces in it, removed those 4 in this patch. I read that as empty line. ;) (file #10296) ___ Additional Item Attachment: File name: 0004-refactor-first-portion-of-ai_airlift-into-find_needi.patch Size:3 KB ___ Reply to this item at: http://gna.org/patch/?1942 ___ 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 #1948] Remove unit_att_rating_sq, replace only use with pow.
URL: http://gna.org/patch/?1948 Summary: Remove unit_att_rating_sq, replace only use with pow. Project: Freeciv Submitted by: nixeagle Submitted on: Friday 09/10/2010 at 22:37 Category: ai Priority: 1 - Later Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: ___ Details: There is only one current use of this function and this function does the same thing as pow(stuff, 2). Might as well just use pow() instead of having a whole second function for it that I had to look up what it meant. There are other functions like this as well, but I have not checked how much they are used yet. ___ File Attachments: --- Date: Friday 09/10/2010 at 22:37 Name: 0001-Remove-unit_att_rating_sq-replace-only-use-with-pow.patch Size: 2kB By: nixeagle http://gna.org/patch/download.php?file_id=10301 ___ Reply to this item at: http://gna.org/patch/?1948 ___ 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 #1948] Remove unit_att_rating_sq, replace only use with pow.
Follow-up Comment #1, patch #1948 (project freeciv): I ran M-x rgrep RET _sq( RET on the working directory and found that the vast majority of functions doing nothing but squaring something lie in aiunit.c. The one replacement with pow() does not exist in a loop and thus really should not be a major performance hit. If the use of pow() is unacceptable, I can do two things. I could define a static inline square() function for just aiunit.c which can be used to replace the 3 or 4 functions that basically square their inputs. Otherwise I could just inline the squaring bit at the call site for this function as it is used only once. At a very minimum, the commentary for unit_att_rating_sq should be adjusted to reflect its very special purpose role of squaring the result of unit_att_rating. ___ Reply to this item at: http://gna.org/patch/?1948 ___ 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 #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
Follow-up Comment #2, patch #1942 (project freeciv): Thanks for the input, consistant style is important. Both are easy enough to fix. - I changed my emacs code template for C functions to have a new line before that '{' brace. No clue why I missed that detail, the rest of the functions follow it! Regardless I can go back to not thinking about that particular detail ;). - I'll have to work on remembering to associate the '*' with the variable and not with the type. This is mostly a C++ habit I'll have to remember to drop for this ;). I'll do my best, if I slip again please prod me ^-^. Current patch is: 0002-refactor-first-portion-of-ai_airlift-into-find_needi.patch I plan to submit more patches like this one as I get to know the ai code. As I read and document what is already here I'm gathering some questions about the current behavior of the AI as well as some ideas to make it smarter. I will do this as time permits, I just got a brand new cochlear implant turned on today, and I must spend time learning how to hear with it ;). (file #10273) ___ Additional Item Attachment: File name: 0002-refactor-first-portion-of-ai_airlift-into-find_needi.patch Size:3 KB ___ Reply to this item at: http://gna.org/patch/?1942 ___ 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 #1942] refactor first portion of ai_airlift into find_neediest_airlift_city
URL: http://gna.org/patch/?1942 Summary: refactor first portion of ai_airlift into find_neediest_airlift_city Project: Freeciv Submitted by: nixeagle Submitted on: Thursday 09/09/2010 at 03:58 Category: ai Priority: 1 - Later Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: ___ Details: New function combines original two loops into one loop and returns the city with the greatest need of an airlift. Resulting code does the same exact thing as before, but reading and understanding what the code does is much easier for this one portion of the function. -- Above is the commit summery I made to my local git repository. A little more detail, this is my first ever patch to this project. I'm interested in hacking on and improving the game ai portions. To start I thought I'd start reading through the code and fixing up what I can while I work on groking the code base. Please note that this patch is not strongly tested. I've checked that it does not obviously break the ai, but I'm not setup yet for proper regression tests. I will be by this weekend. I've tried my best to adhere to the coding standards. However I don't yet have a project specific emacs configuration, so please poke me if something is not quite right. Finally while I know the coding style wants no variable initializations at the same time as the declarations... I'm really not sure how that is to be done in find_neediest_airlift_city, and I see some other areas disregard this particular rule. I'm all ears though :). ___ File Attachments: --- Date: Thursday 09/09/2010 at 03:58 Name: 0001-refactor-first-portion-of-ai_airlift-into-find_needi.patch Size: 3kB By: nixeagle simple refactor. http://gna.org/patch/download.php?file_id=10260 ___ Reply to this item at: http://gna.org/patch/?1942 ___ 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] Emacs configurations
Hi, I'm looking into getting involved with freeciv development. I finally finished my git svn clone a few minutes ago (the process takes _days_). I have read the wiki about the style guide and such which is something I usually leave up to emacs to get right. Does anyone have GNU/Emacs configurations relevant to this project I can steal? I don't care if it is incomplete or half baked, I can fix it. For example I have written http://github.com/nixeagle/ooc-mode which _correctly_ handles syntax and code styling issues for the ooc language (It has far more complex rules then C, but is very C like). As emacs already supports C I'm hoping someone already did the project specific tweaks and I can just 'steal' them ;). In a day or two with luck I'll be getting my first patches on the patch tracker! : -- James Spahlinger user nixeagle on gna.org ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [patch #1893] [metaticket] Help updates for 2.3.0
Follow-up Comment #5, patch #1893 (project freeciv): The word 'terraform' has been used to mean changing land in a few other games. Alpha Centauri is one I can think of off the top of my head. The word 'transform' goes more readily with person changing. For example 'Transformers' the toy/film: http://en.wikipedia.org/wiki/Transformers. Of course freeciv is already using transform to mean land changes, which might bar changing what 'transform' means in freeciv and limit us to naming only person changes. For that I really have no new input. P.S. When I say person changes I mean changes to a living thing or something built by living things. I really can't think of a better term for this at this hour. ___ Reply to this item at: http://gna.org/patch/?1893 ___ 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 #1928] remove save_ppm and -P option
Follow-up Comment #1, patch #1928 (project freeciv): Why does this need removed? What is it being replaced with, or is the option simply no longer needed? If there has already been discussion, just poke me at it :). I don't object or anything like that, I'm just curious. ___ Reply to this item at: http://gna.org/patch/?1928 ___ 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] [bug #16630] Copyleft notices for contributions
Follow-up Comment #1, bug #16630 (project freeciv): Any particular ones/examples? I looked at your link and from a quick glance they all seem to mention the GNU GPL, v2 or v3. Is there somewhere else the notices have to be? Or am I missing something (I'm very new to this project)? ___ Reply to this item at: http://gna.org/bugs/?16630 ___ 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 #1936] limit the number of units a city can support
Follow-up Comment #7, patch #1936 (project freeciv): Just to add a little more on the trade idea: A well balanced game would treat gold(trade) upkeep very similar to shield upkeep. As the game stands it is not hard to have cities produce massive numbers of shields but very little trade. What limits those industrial cities from making infinite military units is the unhappy citizens. Using trade really is no different, a unit's home city has to pay for it in gold and in citizen moral. Because each city has a set amount of trade resources; no one city can be the home city to an infinite unit count. Plus remember cities have to use gold to pay for their improvements as well. Paying for those probably should happen before paying for military units (not real sure on this). From a player standpoint a limit on unitcount based on trade makes more intuitive sense then a limit based on how many people the city has. You have to pay for these units, richer cities are going to be able to afford more then poorer cities. Even if the units were built(trained) in an industrial/shield city then based at a rich city; there still is a natural constraint based on city resources. Building things at a factory and using the output to defend a nation's wealth has been done by nations all throughout history. ___ Reply to this item at: http://gna.org/patch/?1936 ___ 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] [bug #15628] server crashed.
Follow-up Comment #2, bug #15628 (project freeciv): I'm browsing through the bugs while I wait for my git clone of the svn repository to finish up (I'm up to r17852). This bug should probably be closed. It has been over 5 months since the request for more information. I doubt any is forthcoming. ___ Reply to this item at: http://gna.org/bugs/?15628 ___ 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 #1936] limit the number of units a city can support
Follow-up Comment #3, patch #1936 (project freeciv): I don't know if this has been proposed or is currently done as I'm still new to both the game and the code. Instead of limiting the number of units a city can support under gold upkeep rules, perhaps limit what gold can be used for the unit upkeep. Units under shield upkeep are limited by the number of shields a city produces. The equivalent for gold upkeep could be the amount of trade a city has. ___ Reply to this item at: http://gna.org/patch/?1936 ___ 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] [bug #16623] netintf.c gcc warnings in net_lookup_service
URL: http://gna.org/bugs/?16623 Summary: netintf.c gcc warnings in net_lookup_service Project: Freeciv Submitted by: nixeagle Submitted on: Friday 09/03/2010 at 20:48 Category: general Severity: 2 - Minor Priority: 5 - Normal Status: None Assigned to: None Originator Email: Open/Closed: Open Release: r17914 Discussion Lock: Any Operating System: Microsoft Windows Planned Release: ___ Details: This bug is largely a copy paste of bug #16614 excluding all irrelevant parts to the gcc warnings. Configured with: : ./autogen.sh --disable-make-data --disable-nls --enable debug=yes : make Using: - gcc (GCC) 4.3.4 20090804 (release) 1 - Cygwin 6.8.99.903(260) - Windows XP SP2, (cygwin/bash has OS=Windows_NT) (intel 32bit) - automake (GNU automake) 1.8.5 - autoconf (GNU Autoconf) 2.65 - autoheader (GNU Autoconf) 2.65 - aclocal (GNU automake) 1.8.5 - GNU Make 3.81 - libtoolize (GNU libtool 1.3140 2009-12-30) 2.2.7a After taking a while to figure windows/cygwin/various deps and autotools issues out (I'm new to the first two, on a netbook at the moment), please be advised that I had to run export CFLAGS='\-Wall -Wpointer-arith -Wcast-align -g -O2' to tell gcc to treat errors as only warnings. Turning --enable-debug (I'm planning on hacking on this thing after all!) on seems to also turn on -Werror which causes the build to fail on utils/netinit.c. I could not locate the human generated source of it, but I did come across FC_CFLAGS in config.h with -Werror set. : netintf.c: In function ‘net_lookup_service’: : netintf.c:333: warning: implicit declaration of function ‘gethostbyname2’ : netintf.c:333: warning: assignment makes pointer from integer without a cast : netintf.c:352: warning: assignment makes pointer from integer without a cast Please let me know if more information is required. ___ Reply to this item at: http://gna.org/bugs/?16623 ___ 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] [bug #16614] nimiipuu.ruleset:
URL: http://gna.org/bugs/?16614 Summary: nimiipuu.ruleset: Project: Freeciv Submitted by: nixeagle Submitted on: Thursday 09/02/2010 at 13:35 Category: rulesets Severity: 2 - Minor Priority: 5 - Normal Status: None Assigned to: None Originator Email: Open/Closed: Open Release: r17914 Discussion Lock: Any Operating System: Microsoft Windows Planned Release: ___ Details: Configured with: : ./autogen.sh --disable-make-data --disable-nls --enable-debug=yes : make Using: - gcc (GCC) 4.3.4 20090804 (release) 1 - Cygwin 6.8.99.903(260) - Windows XP SP2, (cygwin/bash has OS=Windows_NT) (intel 32bit) - automake (GNU automake) 1.8.5 - autoconf (GNU Autoconf) 2.65 - autoheader (GNU Autoconf) 2.65 - aclocal (GNU automake) 1.8.5 - GNU Make 3.81 - libtoolize (GNU libtool 1.3140 2009-12-30) 2.2.7a SVN Revision: : On r17914 | dmarks | 2010-09-01 21:36:05 -0400 (Wed, 01 Sep 2010) | 1 line Ran the following: : server/freeciv-server.exe Got this immediately after hitting RET: 2: Missing end of i18n string marking file data/nation/nimiipuu.ruleset, line 18, pos 56 looking at: '' processing string starting at line 12 included from file data/default/nations.ruleset, line 232 1: in check_strlen() [shared.c::672]: assertion 'strlen(str) len' failed. 1: Name Francisco Hern�dez de C�doba too long; truncating. 1: Please report this message at https://gna.org/projects/freeciv/ === After taking a while to figure windows/cygwin/various deps and autotools issues out (I'm new to the first two, on a netbook at the moment), please be advised that I had to run export CFLAGS='\-Wall -Wpointer-arith -Wcast-align -g -O2' to tell gcc to treat errors as only warnings. Turning --enable-debug (I'm planning on hacking on this thing after all!) on seems to also turn on -Werror which causes the build to fail on utils/netinit.c. I could not locate the _human_ generated source of it, but I did come across FC_CFLAGS in config.h with -Werror set. Below are the warnings (they were errors, but I lost those in the scrollback and these lines are exactly the same regardless. netintf.c: In function ‘net_lookup_service’: netintf.c:333: warning: implicit declaration of function ‘gethostbyname2’ netintf.c:333: warning: assignment makes pointer from integer without a cast netintf.c:352: warning: assignment makes pointer from integer without a cast If you guys want this last bit as a second bug, just say the word and I'll make it happen ;). ___ Reply to this item at: http://gna.org/bugs/?16614 ___ 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] [bug #16614] nimiipuu.ruleset:
Follow-up Comment #1, bug #16614 (project freeciv): I'd love to change the title to what I originally intended but somehow forgot ;). If possible update it to: nimiipuu.ruleset: Missing end of i18n string marking ___ Reply to this item at: http://gna.org/bugs/?16614 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev