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

Galactic Event system rewrite #719

Open
BottledByte opened this issue Jan 4, 2024 · 3 comments
Open

Galactic Event system rewrite #719

BottledByte opened this issue Jan 4, 2024 · 3 comments
Milestone

Comments

@BottledByte
Copy link
Contributor

Current "Karma" Galactic Event system is only event system that can create and execute events without prior player action (compared to planetary events, which are triggered by colonization / away team).

There should be other event systems that require no direct player interaction, but rather trigger on new turn under certain conditions. This is needed for i.e. events planned at game generation, periodic events (like climate changes on climate-unstable planets), etc.

Such generic event systems could be used to check for preconditions in "global game scope" (StarMap).
This could be, in turn, used for creation of (crude!) basic "story" system or as a worthy complement to such theoretical system.

Conditions could be like "has human player planet A under control for 5 turns?", and when condition gets fulfilled, it could alter galaxy somehow (like spawning anomalies in some system), after some time. And then queue the new condition-event pair, so that something new may happen when the anomalies are investigated.

In the proposed design, "Karma" event system is just one of 0..N event systems, that may be used in one game (StarMap). All such event systems would just run at turn start, scheduling and executing "their" events. Karma system could punish most technologically superior realm with tech loss, while periodic event system could alter climates on some planets and planned event system could struck one solar system with critical radiation and temperature increase (as a part of "story") - all of this during one turn.

The event systems would run sequentially and in-order. Systems handling more dramatic/higher-priority events would run first. Although edge-cases may happen, system ordering and prioritization should minimize them.
Ordering example: Planned (Story), Periodic, Karma


The current "Karma" event system is badly written, violating many principles of Object-Oriented Programming (like a lot of code in this project 😐 ). As such it is apt for a rewrite. All existing "karma" events will likely have to be removed, as their bad implementation would likely take more effort to refactor than rewrite from scratch. Additionally, rewritten events could then leverage new systems, like Planetary Statuses.

@tuomount
Copy link
Owner

tuomount commented Jan 4, 2024

"Karma" is for internal name where bad galactic events happens for those who are leading and good events for those who are behind. There is possibility to configure that events can happen for any realm.

There are no sequential events and yes this all sounds really good.

I would say that we should focus on creating that space race and maybe even try to have space race editor/customization. I would place this to version 0.27.0.

Also these galactic events should be defined with JSON files. Maybe think if there could be some kind of interaction for realms when galactic event happens/occurs. Some thing that player would/could do some choices. For example if climate changes on planet, they could improve sheltering which would cost credits but gain more happiness or just ignore to population and lose some of the population.

@tuomount
Copy link
Owner

tuomount commented Jan 4, 2024

For example meteor hit I kind of tried to do interaction, if planet has planetary turret that bad event can be turn into good, instead of destroying of buildings and population, planet gains more metal. Also if planet is large and mostly just unpopulated changes for meteor hits are smaller.

Same thing is for Deadly Virus, it practically kills all but one planet's population unless space race was Robotic race(Originally there was a bug that only Mechion was safe). Also that realm gains the virus which can be used in espionage mission or it can also accidental escape/spread if there are trade fleet travelling between other realms.

What I am trying to say, some kind of interaction might be good. Now current ones feel bit like just clued on.

@BottledByte
Copy link
Contributor Author

I would say that we should focus on creating that space race and maybe even try to have space race editor/customization. I would place this to version 0.27.0.

Yes, let's move this to 0.27.
But before that, I will send a PR which does initial "cleanup" of event system 😏. It leaves most things untouched, it only reorganizes code internals a little, so there is better encapsulation -> easier refactor in the future.

Also these galactic events should be defined with JSON files.

👍

What I am trying to say, some kind of interaction might be good. Now current ones feel bit like just clued on.

That's something definitely worth designing support for. 👍

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

No branches or pull requests

2 participants