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

Fix demand at News Events not being used #5859

Merged

Conversation

impaktor
Copy link
Member

@impaktor impaktor commented Jul 9, 2024

Demand mechanics was never ported into News Event module, thus when there's a large demand for something at a station, the demand could still be very low, preventing player from selling. Also, we don't want to accumulate price/stock/demand at each "OnDock" event.

EDIT: I'll open this as WIP, for feedback, the first and last commits, that both attempt to fix the above bug should be squashed, as first does it wrongly, I believe.

Also I've added a debug tab, which allows generating (random) news. Usually news only spawn +6 months into the game, and only when jumping / in hyperspace.
2024-07-09-212655_1536x960_scrot

We now have something different in the game core called "demand".
News Event's "demand" was simply a multiplication factor
For Ctrl+i debug screen now also includes a "News" tab, for spawning,
and viewing active news events.
When a news event causes a commodity to have 0 in stock,
and price multiplied, it should also boost demand. When stock
is in surplus, demand should be 0.

Demand linearly returns to "normal" as the hidden deadline for the event
approaches

Changes to market is applied when docking, and restored when un-docking
@impaktor impaktor force-pushed the commodity-demand-news-event-fix branch from 92f954d to 2b610b7 Compare July 10, 2024 07:43
@impaktor impaktor marked this pull request as ready for review July 10, 2024 07:44
@impaktor
Copy link
Member Author

impaktor commented Jul 10, 2024

I've tried it with both "sold out" and "surplus" event, and note price/stock/demand is modified when docking, and reset when undocking.

Demand is linearly returning to normal as the event closes it's (hidden) deadline. That is one way to solve a problem that has been bothering me: how does the player know when to stop filling up cargo with X and fly to "event system"? This gives a clue. (Perhaps price & stock should also linearly return to normal.... oh well)

I've also tested it with illegal goods. (I realize news event is a good at finding where to buy illegal goods. if the event is for e.g. battle weapons, it will cause a shortage in some system where those are a legal commodity. I had forgotten that was how it worked)

...then I did a rebase. That should not have messed up anything.

@Web-eWorks Web-eWorks merged commit 7737892 into pioneerspacesim:master Jul 10, 2024
@impaktor impaktor deleted the commodity-demand-news-event-fix branch July 10, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants