Ticket #45072

Sandbox: Demonstrate counters

Open Date: 2022-07-09 05:19 Last Update: 2023-04-16 20:31

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
6

Details

sandbox ruleset should have a demonstration of using counters.

Ticket History (3/32 Histories)

2022-07-09 05:19 Updated by: cazfi
  • New Ticket "Sandbox: Demonstrate counters" created
2022-08-01 21:15 Updated by: lachu
Comment

I copy example from some patch example ruleset's changes.

But I decided to add one more thing - reduce production for conquered cities.

I set def value to 6, checkpoint to 5, so If player create city, there;s no production penalty. But server sets the counter's value to 0, when city was conquered. Taking above in mind, each city's tile should get food penalty, when city is conquered, but no when founded.

But something do not work.

2022-08-02 01:11 Updated by: ihnatus
Comment

Yup, currently "OWNED" counters are zeroed any time a city gets an owner and for complicated effects we must have a control of the reason why it happens (like the "reason" parameter in "transfer_city" callback). But now for new cities we may turn the effect off by "Age" requirement.

2022-08-02 03:27 Updated by: lachu
Comment

Reply To ihnatus

Yup, currently "OWNED" counters are zeroed any time a city gets an owner and for complicated effects we must have a control of the reason why it happens (like the "reason" parameter in "transfer_city" callback). But now for new cities we may turn the effect off by "Age" requirement.

The reason may be good, but currently we have default value. When city is built, it counters get the default values. When conquered, OWNED are zeroed. I check in the code twice.

2022-08-02 06:53 Updated by: ihnatus
Comment

Reply To lachu

The reason may be good, but currently we have default value. When city is built, it counters get the default values. When conquered, OWNED are zeroed. I check in the code twice.

Hm yes, looked at it, likely some inconsistency but that's an early realization any way. As a wild guess, some underflow in tile output value?

2022-08-02 23:24 Updated by: lachu
Comment

It looks like client do not update tile information on minimap. But I update ruleset too.

2022-08-06 14:30 Updated by: cazfi
Comment

Reply To lachu

... client do not update ...

You've not implemented #41123. Likely we need also another network protocol change ticket before the client side really begins to work.

2022-10-23 15:06 Updated by: cazfi
Comment

- Add note about the counters to README.sandbox
- The unhappiness happen also when one builds a new city, not only when one is conquered from the enemy, doesn't it?
- Collect those counter names for translation ( use _() ), give them more descriptive names from the point of view of the player
- Place counters after their documentation in game.ruleset. Now they seem to be after team names
- Why are you making those effects 'quiet'?
- There's no "range" for counters in the ruleset format. Remove attempts to set it

2022-10-23 18:53 Updated by: lachu
Comment

Reply To cazfi

- Add note about the counters to README.sandbox
- The unhappiness happen also when one builds a new city, not only when one is conquered from the enemy, doesn't it?

I must check. I used default value to makes it working. Have you tested sandbox with my patch?

- Collect those counter names for translation ( use _() ), give them more descriptive names from the point of view of the player
- Place counters after their documentation in game.ruleset. Now they seem to be after team names
- Why are you making those effects 'quiet'?
- There's no "range" for counters in the ruleset format. Remove attempts to set it

2022-10-25 21:16 Updated by: None
Comment

Reply To [comment:12505:45072:64637

- The unhappiness happen also when one builds a new city, not only when one is conquered from the enemy, doesn't it?

Counter do not work for new cities (do not meet condition). New city are not additional unhappy, because counters. I test two times. You must place city with size 5/6 and producing good amount of food to keep citizens alive. There are unahappy citizens due to city's size, but after 10 turns nothing changes.

2022-10-26 22:36 Updated by: lachu
Comment

Reply To cazfi

- Add note about the counters to README.sandbox
- The unhappiness happen also when one builds a new city, not only when one is conquered from the enemy, doesn't it?
- Collect those counter names for translation ( use _() ), give them more descriptive names from the point of view of the player
- Place counters after their documentation in game.ruleset. Now they seem to be after team names
- Why are you making those effects 'quiet'?
- There's no "range" for counters in the ruleset format. Remove attempts to set it

0001-OSDN-45072-S-awomir-Lach-slawek-lach.art.pl.patch(3KB)

Documentation, allow translations, parts of game.ruleset relocated, remove junks, QUIET is FALSE now
2022-11-20 01:58 Updated by: lachu
Comment

Reply To (Anonymous)

Reply To [comment:12505:45072:64637

- The unhappiness happen also when one builds a new city, not only when one is conquered from the enemy, doesn't it?

Counter do not work for new cities (do not meet condition). New city are not additional unhappy, because counters. I test two times. You must place city with size 5/6 and producing good amount of food to keep citizens alive. There are unahappy citizens due to city's size, but after 10 turns nothing changes.

This was my post, sorry.

2022-12-19 12:52 Updated by: cazfi
Comment

This one has been on hold as I want to think how it's supposed to work. Currently it seems like taking advantage of a bug or at least confusing semantics.

2023-02-16 04:04 Updated by: cazfi
Comment

I think we'll change this to use #47366, once it exist.

2023-03-14 23:38 Updated by: lachu
Comment

Reply To cazfi

I think we'll change this to use #47366, once it exist.

Sorry for asking, but does anybody remember, what works wrong? I test again to check if file 11835 in ticket 45889 repair the issue. But it seems everything worked. Maybe there exist corner cases, where it does not work. I read calculating tile output on city mini-map does not worked, but it worked now.

2023-03-17 02:01 Updated by: lachu
Comment

Reply To cazfi

This one has been on hold as I want to think how it's supposed to work. Currently it seems like taking advantage of a bug or at least confusing semantics.

Maybe it now works thanks to #41123? I will clone main branch and revert this merge to test if it is related.

2023-03-26 19:54 Updated by: cazfi
Comment

Reply To lachu

Reply To cazfi

I think we'll change this to use #47366, once it exist.

Sorry for asking, but does anybody remember, what works wrong?

Implementation based on #47366 would be cleaner (or more proper way to do it), I think.

2023-03-31 18:00 Updated by: lachu
Comment

I think adding implementation from celebration counter example should do the trick. Or do you prefer if we add example for each kind of counter? Edit: owned counter could be used to increase city defense after some turns of owned. Additional condition could be existence of city walls Another example could be existence of cultural building and owned value to produce culture.

(Edited, 2023-03-31 18:05 Updated by: lachu)
2023-04-02 21:17 Updated by: lachu
Comment

Reply To cazfi

Reply To lachu

Reply To cazfi

I think we'll change this to use #47366, once it exist.

Sorry for asking, but does anybody remember, what works wrong?

Implementation based on #47366 would be cleaner (or more proper way to do it), I think.

0001-OSDN-45072-S-awomir-Lach-slawek-lach.art.pl.patch(2KB)
Reducing production on disorder and produces culture for old city, which celebrating
2023-04-08 18:50 Updated by: cazfi
Comment

Can you also add something to the README.sandbox, as this a difference between civ2civ3 and sandbox?

2023-04-10 17:52 Updated by: lachu
Comment

Reply To cazfi

Can you also add something to the README.sandbox, as this a difference between civ2civ3 and sandbox?

0001-OSDN-45072-S-awomir-Lach-slawek-lach.art.pl.patch(1KB)
Documentation.

Keep as separate patch.

2023-04-10 18:19 Updated by: cazfi
Comment

Loading ruleset with --warnings:

sandbox/game.ruleset: unused entry: counter_owned1.target
sandbox/game.ruleset: unused entry: counter_owned2.target
sandbox/game.ruleset: unused entry: counter_celebrating1.target
sandbox/game.ruleset: unused entry: counter_disorder1.target

Ruleset format has no 'target' property for counters.

2023-04-12 03:31 Updated by: lachu
Comment

Reply To cazfi

Loading ruleset with --warnings: {{{ sandbox/game.ruleset: unused entry: counter_owned1.target sandbox/game.ruleset: unused entry: counter_owned2.target sandbox/game.ruleset: unused entry: counter_celebrating1.target sandbox/game.ruleset: unused entry: counter_disorder1.target }}} Ruleset format has no 'target' property for counters.

0001-OSDN-45072-S-awomir-Lach-slawek-lach.art.pl.patch(2KB)
<counter>.target fields removed
2023-04-14 11:27 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
Comment

So, I'm taking files 12159 and 12145, in that order?

2023-04-14 15:25 Updated by: lachu
Comment

Reply To cazfi

So, I'm taking files 12159 and 12145, in that order?

Apply files you mentioned in random order. These patches do not touch the same files.

2023-04-16 20:31 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Attachment File List

Edit

Please login to add comment to this ticket » Login