StrangeLoopGames / EcoIssues

131 stars 21 forks source link

Law Question/Confustion - Action in district after district changed? #8841

Open Deantwo opened 6 years ago

Deantwo commented 6 years ago

Law question/confusion. Maybe you can answer this @MarjieAVolk.

When we use the action place item where (in district test1), at what point is the action considered to be in the district? On time of the action or the time of the law check?

For example if i make a periodic law that tax people for the amount of store objects they have in a district (placed - picked up), are stores that were placed before the district was defined counted? What if the district is resized and now some stores are outside the district, are they still counted?

I guess the question borrows down to, is the district it is preformed in saved in the action? Or is the location saved and then the location checked if it is inside a district upon query?

Same questions likely work for "on own property" and similar where conditions.

Deantwo commented 6 years ago

A suggestion on the matter.

It might be a lot more useful to add a way to count the number of something a player owns, rather than rely on the number of actions a player has preformed. The number of actions preformed by a player can easily become unreliable, for example by: district or property changes, other players helping, admin intervention, and so on.

If we had an option for "amount of on players property", and add a "where" condition for districts or specific properties. Then there is less confusion and more accuracy to the laws we make.

I get that it would likely make some complicated/slow SQL queries though...

MarjieAVolk commented 6 years ago

Whether each action took place in a district is based on the situation at the time of the action. As you say, the district and/or deed is saved, and not the actual position. So you're right, if you define a district and start taxing based on stores placed, stores that had already been there will not be counted.

If I were to add some values that determine present numbers of owned objects, etc, I don't believe it would be possible currently to do that through stats (that is to say, the methods you already have of using stats are basically all stats can do in that regard currently). I think the two main options then are either: calculate that stuff directly from the game state; or provide two options for 'in district'/'on property' type queries - one for the district at the time of the action, and one for the district now based on the position of the action.

Deantwo commented 6 years ago

Yeah I figured the action stats were stored like that. Adding two separate options, one for "time of action" and one for "current location status" would be useful. Not totally error-proof, but better.

Can the action also maybe have a "owner at time of action" and "current owner"? Or is a reference to the object not saved with the stat action?

This whole thing was most of all just a theory/question I had, so both happy and sad that I was correct.

MarjieAVolk commented 6 years ago

Okay, well I will think about it more. I'm not sure how to word those 2 options clearly.

For world objects, the actual object is tracked in the action. But if the object has been picked up from the world, it will no longer be able to find it, so it won't necessarily have a 'current owner'. I'm not sure what kind of laws you would want to make with this, or how it would fit in.

D3nnis3n commented 5 years ago

I agree with Deantwo. It would be nice to have options to define if you want the actions to be counted based on their location in the district with no regards to if that district existed when it was made or based on the time (e.g. when the district has been created).

Deantwo commented 5 years ago

Counting everything in actions just has so many possibilities for errors. But I do understand that checking the world database every time a law is triggered could cause issues. So not sure about the best way to fix any of this.

Especially admin intervention will ruin a lot of the action counting laws.

D3nnis3n commented 5 years ago

This should not be the case, though. Admin intervention can help out to reach some goals pretty good as long as elected officials have very limited powers. There are several existing and new commands i would like to give to elected officials like i suggested in another issue.

WeaselDog commented 3 years ago

@IcedForge Can you check if this is still an issue?

IcedForge commented 3 years ago

Not entirely sure what would be the issue?

Laws cannot check if an object of any type is contained in a cell, only apply effect though an action /interaction from a player.

F.ex you cant tax based on how many bison mounts a player owns but you could based on how many he has plased down in total.

Same for conditions, you cannot explicit request how many objects has been placed down in x district but you can check if he places one down. @WeaselDog

Deantwo commented 3 years ago

Not entirely sure what would be the issue?

Laws cannot check if an object of any type is contained in a cell, only apply effect though an action /interaction from a player.

F.ex you cant tax based on how many bison mounts a player owns but you could based on how many he has plased down in total.

Same for conditions, you cannot explicit request how many objects has been placed down in x district but you can check if he places one down.

This was a question and confusion about how and when an action is counted as being in a district or on a property (claim). It has nothing to do with counting.

The question is/was about how action stats are saved in the database, and rather the "in district" and "on property" check is done when the action stat is recorded or when the action stats are queried.

If I place a bison mount on my property, then place another bison mount not on my property, and then claim the land that second bison mount was on. When I do a database query for how many bison mounts I have placed on my property, will the result be 1 or 2? That is the confusion.

The answer that was given is that the property and districts are saved with the action stat at the time of action being recorded. In short, the answer is 1 bison mount. So this issue can be closed I guess. But maybe this is something that should be detailed somewhere, so people can get the answer when they fall over this confusion. Could simply add this information to the wiki or mention it more specifically in the tooltips of the law creation UI.

Actually what does tooltip of the "in district" or "on property" options say? Are they still confusing in this manner?