Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trading ship buys goods not on its trading list #421

Closed
ralphcook opened this issue Apr 22, 2020 · 7 comments
Closed

Trading ship buys goods not on its trading list #421

ralphcook opened this issue Apr 22, 2020 · 7 comments
Labels
bug original issue from c3 Bug that's also present in the original Caesar 3 wontfix

Comments

@ralphcook
Copy link

ralphcook commented Apr 22, 2020

In Miletus, roughly Jun 210 BC, I had a ship from Athenae dock and purchase 3 oil and 2 weapons. The problem is that Athenae is supposed to buy only oil and fish.

Corinthus buys weapons, and I do have oil and weapons set for export. But it was my understanding that the game did not allow trading cities to buy (or sell) things outside their stated lists.

This would be difficult to reproduce; the game has been running for a few months over 10 (game) years, and I have no idea what conditions might be necessary for this to happen. Has anyone else seen it?

I'll attach a screen shot in case that's interesting to someone.
Athanae buying weapons

@ralphcook ralphcook added the bug label Apr 22, 2020
@crudelios
Copy link
Collaborator

crudelios commented Apr 22, 2020

Hi, can you also attach the savefile please?

@ralphcook
Copy link
Author

I should have thought of that -- Here it is.
Miletus 7 03.zip

This starts in, I think, February; in late March or April, a ship comes from Corinthus, then the ship in question shows up from Athenae and waits for the dock. After the first ship buys its 9 weapons and departs, the Athenae ship takes the dock and buys oil and weapons.

@bvschaik
Copy link
Owner

Thanks, I'll have a look.

@bvschaik bvschaik added the original issue from c3 Bug that's also present in the original Caesar 3 label Apr 22, 2020
@bvschaik
Copy link
Owner

I've had a look: this also happens in Caesar 3. Athenae does not actually buy weapons. What happens is the following:

  1. Ship from Corinthus arrives at the dock
  2. Dockworkers go to the warehouse to buy weapons. As soon as they pick the weapons up from the warehouse, the money is in your account and added to the Corinthus numbers.
  3. Dockworkers walk back to the dock, and deposit the weapons in the ship. Only then will the ship register that it has weapons.
  4. Step 2 and 3 continue until the ship is full. Once the 12th docker picks up the last weapon at the warehouse, the ship sees "ah, I've bought 12 weapons" and sails off, while the docker has not returned to the dock yet.
  5. The waiting ship from Athenae sails into the dock
  6. The dockworkers return to the dock with the weapons meant for Corinthus, and load it into the wrong ship.

Yes, it's a bug, but the cities trade the right resources and you get the money OK.

Since it also happens in Caesar 3, I'm not going to fix it.

@jdmillard
Copy link
Contributor

bugs.md documents known C3 bugs, maybe the issue author can create PR proposing an addition to that file?

@ralphcook
Copy link
Author

I did an analysis of the movements, etc., of the ships and carts, and came up with the following. It's too detailed for bugs.md, but I think putting something there is a good idea. I'll work on something for that.

--

Each trading partner for a city has a list of goods which it buys and sells; under certain conditions, a ship will show that it has bought goods that are not on the list for its city. In this case, those goods will occupy available room for cargo, and the ship might be unable to purchase the number of units of goods it is actually supposed to purchase. It is also possible that the game will fail to limit properly the total of one good allowed to be purchased by a trading city.

When a ship is both delivering and picking up, assuming that there are available goods and that total trading has not been reached, this is the sequence followed:

  1. after a few game 'ticks', a cart loaded with goods to sell departs the dock for a warehouse. (after a few more game ticks, a second cart would depart, etc.)
  2. the cart arrives at the warehouse and delivers its load; the purchase price is deducted from the treasury.
  3. the cart travels to a warehouse to pick up goods being purchased.
  4. the cart arrives at the warehouse and picks up its load; the treasury is credited with the purchase price.
  5. the cart delivers the load to the ship, which then registers that the load is on the ship.

Of course, this all assumes that the ship has goods to sell, that the warehouses have room to receive or goods to sell, and that trading limits have not been reached. And ships are limited to 12 units of goods total at a time, and docks have three carts that it uses for deliveries.

The problem was noticed in Miletus, which trades with Athens and Corinth. Corinth sells clay and buys weapons, Athens buys oil but not weapons. Within one calendar year, I saw a sequence starting with the arrival of a ship from Corinth, and very shortly afterwards a ship from Athens. The Corinthian ship started the sequence above with the three dock carts, selling clay and purchasing weapons.

When the 12th unit of clay arrived at its warehouse (step 2 above), the ship evidently decided that its work was done and departed. The ship has 9 units of weapons at that point; all three dock carts are still on their way to pick up weapons that would have completed the ship's load of 12. Each cart completes complete steps 3 and 4. When the first cart arrives at the dock, the Athenian ship is still getting into place, and that load of weapons just disappears. When the second and third carts arrive, the ship in the dock is Athenian, and it takes on the weapons even though Athens doesn't buy weapons from Miletus.

The carts then proceed to buy oil for Athens; when they've purchased 10 units of oil, the ship determines that it is full (10 oil, 2 weapons), and departs. Miletus loses out on 2 units of oil it might have sold to Athens at that time.

Also, the empire map shows that 9 units of weapons have been sold to Corinth, even though Miletus was paid for and loaded carts for 12. A later ship from Corinth buys 7 more weapons, so in that year Miletus gets paid for 19 units of weapons even though Corinth is limited to 16 units per year.

@jdmillard
Copy link
Contributor

I agree with you that bugs.md doesn't need all the details. You could simply state that under certain sets of conditions that involve merchants from multiple cities, ship traders don't purchase their assigned goods. (or something like that - you clearly understand it better than I do).

bvschaik added a commit that referenced this issue Apr 29, 2020
crudelios added a commit to crudelios/julius that referenced this issue Jun 18, 2021
* Recalculate image ids on city load - allows new assets to be freely changed without breaking savegame compatibility
* Move building image calculation to own file - allows massive code reorganization and eases addition of new building assets
* Remove 256 image limit per xml
* Remove the "author" tag from the new assets
* Remove useless image information from the savefile and bump the savegame version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug original issue from c3 Bug that's also present in the original Caesar 3 wontfix
Projects
None yet
Development

No branches or pull requests

4 participants