POLITICS!! + Debugging Hell v2
I mean I guess it is? Not too sure.
Event Manager completely overhauled. Double events now no longer have the chance of repeating the same event.
Created a new GameEffects script which just takes a bunch of simple code away from EventManager and plays the basic functions such as the “tax revenue increases” which you see below.
This was quite a headache to create, and I severely underestimated how much time this would take. I have 2 extra nested classes inside of EventManager for Political Question and Political Scenario.
[... inside EventManager.cs ...]
public class PoliticalQuestion
{
public string Question;
public TaskCompletionSource<bool> TaskCompletionSource = new TaskCompletionSource<bool>();
public Action onAccept;
public PoliticalQuestion(string question, Action onAccept)
{
Question = question;
this.onAccept = onAccept;
}
}
public class PoliticalScenario
{
public string description;
public Action runnable;
public PoliticalScenario(string featureDescription, Action functionality)
{
description = featureDescription;
runnable = functionality;
}
}
[Header("Political Question Variables")]
public List<PoliticalQuestion> PendingQuestions = new List<PoliticalQuestion>();
public event Action onQueueChanged;
private PoliticalScenario[] goodFeatures;
private PoliticalScenario[] badFeatures;
The political question is sent off to the UI manager, which displays it as shown below. Then it handles user input pressing Y/Enter or N/Esc to accept the user choice, and returns it back to the Event Manager. Seems simple enough, yet there are many ways to do it but I think that the above implementation works the best out of all the ones that I tried. I attempted to use Game Manager as a middleman but that did not work out - so I resorted to passing an entire class.
The political scenario allows for the string to actually do something, so that the game knows what to process and what the user agreed to without creating a bunch of variables, and can allow for stacked political question events which is nice.
Game’s looking really neat, and the multipliers and stuff can make the game go very crazy very quickly.
Too much of a good thing is a bad thing!!
Debugged the entire system for like a solid 3 hours it was actually bad.
Came first in the UK tho!! I’m back after those 6 exams are done.
Yes I know the UI looks pretty bad but it’s good enough for pre-beta testing.
Oh yeah, speaking of UI everything is more bold. Figured out how to do that.
Comments 5
Great work on cleaning up the Event Manager code and introducing the Political Question and Scenario features. I’m a bit curious about the UI updates, though, what design style are you aiming for? This remind of me of cities Skylines
@firancly not too sure honestly, but I did just update the UI and it’s kind of like you cycle through everything? I find that to be the best fit of speed but also not memorising all the numbers and stuff. Also makes it so this game is almost completely playable with the keyboard if I bind left/right click to something else.
It’s crazy that something as complicated as politics can be implemented into games, this is really cool!
@wilson_brunner I wish it was more detailed though! Honestly this implementation isn’t that advanced. Open to suggestions, as always
This is gonna be PEAK :3
Sign in to join the conversation.