[Freeciv-Dev] [patch #3345] View units in foreign cities
Additional Item Attachment, patch #3345 (project freeciv): File name: see_city_units.patch Size:3 KB ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Update of patch #3345 (project freeciv): Category:None = general Status:None = In Progress Assigned to:None = sveinung Planned Release: = 2.6.0 ___ Additional Item Attachment: File name: see_city_units.patch Size:3 KB ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Additional Item Attachment, patch #3345 (project freeciv): File name: see_city_units.patch Size:5 KB ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #8, patch #3345 (project freeciv): New version. Tests: * Compiles using ./autogen.sh --enable-debug make * Auto game when map and game seed is the same (the effect isn't active): same as trunk (except time) * Auto game when map and game seed is the same (the effect is active on a new wonder): same as trunk (except time and things like building vector) * Not able to look into foreign city before effect is on: yes * Look into city when having wonder giving the effect: yes * Not able to look into foreign city when another player has the effect: yes (file #15959) ___ Additional Item Attachment: File name: see_city_units.patch Size:1 KB ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #9, patch #3345 (project freeciv): Found a bug in my patch (unless its a consequence of me using the editor to test various scenarios): after invading a city containing a wonder granting this effect foreign cities not under fog of war at the time of the invasion appear empty. Cities that become visible later the same turn are shown with their units. ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #10, patch #3345 (project freeciv): To prevent cheating clients on multiplayer games server sends units to client only when player is supposed to see them. If your effect is not active at the time server decides whether to send units inside particular city during turn change, units are not sent. Nothing in your patch would cause server to suddenly send the units when effect is activated. I think that appearance of the bug is also subject to the order of in which players and their cities are handled during turn change - ones handled before one that finishes the wonder had no effect activated, ones handled after wonder city had effect active. This is impossible to fix in general case of any kind of requirement getting fulfilled and effect thus activating. In similar situations we have either made it a rule that effect is checked in turn change only (you could make server to check if the effect is active at turn change and save the result to be used rest of the turn) or making only some requirements (building, tech) to work correctly and just documenting other requirement types unsupported for the effect. In this case I would prefer former as I can see perfectly sane custom rulesets using many different requirement types for this. ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #1, patch #3345 (project freeciv): Rename and base on current trunk. (file #15924) ___ Additional Item Attachment: File name: see_city_units.patch Size:1 KB ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #2, patch #3345 (project freeciv): It mitght be good idea to check if effect value 0 instead of only checking if it's not NULL. That would make it easier to implement one effect that enables vision (value: +1) and counter-effect that disables it (value: -1). If only latter is active (or multiple counter-effects are active) total value would be negative. ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #3, patch #3345 (project freeciv): Thank you for the tip. I'll send an updated patch after I have tested it. ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #4, patch #3345 (project freeciv): Well, I'm a bit ashamed that I just the other day made similar boolean check effect (Gov_Center) myself. I guess someone should go through all such effects and change them from != 0 to 0. ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #5, patch #3345 (project freeciv): I still have only read the patch - not even tried to compile, but a couple of more points: - Does it compile without warnings? When ever I add new effects, I get warning from ai code that case for new effect value is missing from switch in building evaluation. - I think that strictly speaking this does not change network protocol, so no need to change capstr. Server may send more unit packets than previously, but I don't see how that would break old client. ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #6, patch #3345 (project freeciv): Good catch. I looked at the compilation output again and found the mentioned warning now. I overlooked it among the information from make, translations, etc. (I don't have much experience concerning developing in C.) Seems like I (re)read the testing tips a bit to fast. (The AI vs AI games I ran tested no effect, the effect activated by nationality and activated by a wonder I gave using the editor) I'll use --enable-debug from now on. (CFLAGS=-Werror ./autogen.sh make stops before it reaches aicity.c) As far as I understand the function if aicity.c is an utility function for effects. Would something like the number of known foreign cities not hidden by a fog of war (perhaps divided by the number of player cities) weighted to be reasonable be an appropriate measure here? Is this function called often enough that its really important to be fast vs accurate? Are the built in AI's still so omniscient (as the other comments indicate) that the function still is about pretending its valuable? I misunderstood what qualifies as a change to the network protocol. It will be removed. My bias had me consider the problem from an angle closer to will it make it quick and easy for software to know things are different assuming the other party isn't lying than to will it let human players see if they can play without installing a new client. ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
Follow-up Comment #7, patch #3345 (project freeciv): Classic AI is omniscient enough to see units anyway, so this effect has no value for it. One could argue that having negative value applied to its cities (countering positive effects some human opponents may have) would have some value for the AI, but I think it's ok just to always consider value of this effect zero. That's simply less code to maintain (especially code of which we don't know if we got it right in the first place - overvalue here could cause X-rays-through-city-walls to be built instead of something that is *really* needed) But for completeness sake to answer you question about performance: First of all there must be such an effect for it to be evaluated. Current rulesets without such effects would never trigger the evaluation. Second, this is about evaluating building value (though I sometimes wonder if it should be used for evaluating other things in the future). So the effect in question must have requirement of type Building. Function gets called once for each such effect (even if player is not able to build building in question yet - evaluated value of such buildings is further used to evaluate value of the tech to allow it) for each city in every turn change. ___ Reply to this item at: http://gna.org/patch/?3345 ___ 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 #3345] View units in foreign cities
URL: http://gna.org/patch/?3345 Summary: View units in foreign cities Project: Freeciv Submitted by: sveinung Submitted on: Tue 26 Jun 2012 10:44:01 PM GMT Category: None Priority: 5 - Normal Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: ___ Details: Effect to give the same view of units in foreign cities as if the player owning the city were an allied. Without any other change to the C code this can be used for: * A way of giving less experienced players and external AI's access to extra information. (A quick hack to add this to a game is to add an effect of this type with the nation of the player as a requirement) * An Innocent consumer item factory wonder, an extra effect on the tech Espionage, etc ___ File Attachments: --- Date: Tue 26 Jun 2012 10:44:01 PM GMT Name: see_city_units.patch Size: 2kB By: sveinung see_city_units.patch http://gna.org/patch/download.php?file_id=15898 ___ Reply to this item at: http://gna.org/patch/?3345 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev