Rain should wash away blood stains outside.

Started by Sion, April 03, 2014, 01:17:14 PM

Previous topic - Next topic


Ah. you mean "global". Procedural just means "from an algorithm".

Anyway, there is no totally global code in C#, everything exists in an object. However, manager objects like the BreakdownManager are held by the Map object, of which there is only one. So basically I need to allow you guys to make special managers that attach to the Map. Right now I have a long list of them but there is no way for modders to add to that.

Incidentally, here are the map components:

//Components - Early-made
public MapInfo info = new MapInfo();

//Components - Late-made
public TickManager tickManager;
public ListerThings listerThings;
public ListerBuildings listerBuildings;
public GameEnder gameEnder;
public ThingGrid grids;
public CoverGrid coverGrid;
public BuildingGrid buildingGrid;
public ThingDrawManager drawManager;
public MapDrawer mapDrawer;
public FogGrid fogGrid;
public RoomManager roomManager;
public ResearchManager researchManager;
public PawnDestinationManager pawnDestinationManager;
public TooltipGiverList tooltipGiverList;
public BreakdownManager breakdownManager;
public ReservationManager reservationManager;
public DesignationManager designationManager;
public SquadBrainManager aiSquadBrainManager;
public PassingShipManager visitorManager;
public Storyteller storyteller;
public TutorNoteManager tutorNoteManager;
public SlotGroupManager slotGroupManager;
public Autosaver autosaver;
public ReachabilityRegions reachabilityRegions;
public DebugDrawer debugDrawer;
public ColonyInfo colonyInfo;
public LetterStack letterStack;
public GlowGrid glowGrid;
public TerrainGrid terrainGrid;
public PathGrid pathGrid;
public RoofGrid roofGrid;
public MapConditionManager mapConditionManager;
public BoolGrid homeRegionGrid;
public BoolGrid noRoofRegionGrid;
public FertilityGrid fertilityGrid;
public WeatherManager weatherManager;
public PlaySettings playSettings;
public ZoneManager zoneManager;
public ConceptTracker conceptTracker;
public ResourceCounter resourceCounter;
public AmbientSound ambientSound;
public MusicManager musicManager;
public World world;

//Components - unused
public HistoricalPawns historicalPawns;
Tynan Sylvester - @TynanSylvester - Tynan's Blog


I was thinking that some sort of Tickable interface would be useful here...

i.e. Something along these lines:
public interface Tickable
TickerType tickerType;
void Tick();
void TickRare();

Not so sure on the next steps... Would it be possible for you to find all static classes that implement the Tickable interface via reflection and automatically register them with the tick manager?

Essentially we'd be hooking into a component of the map instead of directly into the map itself.


Static classes can't have interfaces, so that's a no-no :P

But yes, I could accomplish a similar thing. However, I wouldn't do it with statics because they'll retain their state after the map is shut down or you load another map. It's a bug nightmare. I'll more likely create a way to make map components, which are always reset when the game loads a new map.
Tynan Sylvester - @TynanSylvester - Tynan's Blog


Quote from: Tynan on April 04, 2014, 03:02:43 PM
You're right, I'll put this in now.

I had wanted the blood to tell the story of past battles, but after a while it just becomes a flood. Maybe it'd be better to clear the ancient battles so you can see the remnants of the recent ones.

I kind of like the idea of telling the story of battles but what if it was done in a somewhat different way.

What about a journal of some sorts that is a collection of tales from the colonists themselves. Say for example Joe dies by being mauled by 50 boomrats and someone saw it it would describe the event. When / if fog of war comes into effect when you discover a corpse of someone you know it will say something like Joe was found dead, evidence suggests it was multiple small creatures or in the case of raiders gunshot and / or a beating. If the person is unknown (random passerby) it will say a male corpse was found or seen killed.