Story of Designing and making: Local Lord Entity functionalitys
In this blog post i document how the Local Lord Entity Future desigined and made, and how its works mostly... i wish point out its far from final and definitly need lot of testing before cosndiered final as probably contain bugs + design element that may need to be changed.
_______________________
The original design idea:
-----------------------
Local lords aka jarls or other autoritiys need represented some how in the slavers of skyrim. As slavery is very illegal in skyrim as most part of Tamriel. ( In Morrowind its okay but we are not in Morrowind! )
For this reason the locals ower time recive the slaver activity signs if slavery realted activity constantly high the locals start allarmed more and start investigation this represented by a actor.
Then if the actor succsed in investigation strike sent to the slaver who found guilty or the slaver base.
This idea turned out flawed multiple points:
1 - A investigator actor may get killed, may get black mailed etc sounds intresting but from player point of view? its a npc if i kill it my problem gone.
2 - in theory evry hold own investigator may multiple investigation running aginst the player or player related slavery activitys at the same time. this mod ment to do things about slavery not avoiding the law.
3 - orignal plan included shady figure who give out information about the investigation started and they suspect player or its intrest. this investigation start one week, if certin requirement meets.
Player not aware the investigation in progress unless evry week spend x ammunt of gold on shady to get knowlage about investigation status. and this information apply only 1 slaver region.... we have multiple holds/slaver regions...
4 - very very complicated to make it work, need lot of resources. compered what gives to player experience simply not worth it.
5 - what is important from player point of view what player see/experince effect its the player or its character. the investigation stuff only effect the player if recive a quest from slaver guild to do a thing about it, or when get informed the slaver base what player conquered from slaver guild get raided by local jarl forces and destroyed evrything.
of corse player can work on to preverent this but this require player to watch what day of week right now and when need check things. most cases i as player not even know what day of week i in and dont care. probably most of us dont care and want care.
_______________________
The new idea - aproach:
-----------------------
REduce the work need to done this thing work and player interaction around it need make more simple.
First big change is define what considered evidence and what need counted as event that need registered:
Originaly all capture considered and weakly limit on each region how many slave capture is okay. Then the supression effect taken cosideration from slaver guild ( bribe on guards ect... )
in other word how many slavery get ignored by locals.
now the new system more simple: only player slavery related action counted. if player not do anything aginst the slaver guild OR not capture any slave. well nothing happen.
The Slaver guild not send fake or real report on player to local guards, ect.
if player capture slaves the region where the capture happened or more importantly where the slave landed recive evidence aginst the player.
in case this evidence level higher or same as the " start strike evidence level" then a strike team dispaced to deal with the player.
Same happening for the slaver organizations:
-Slaver Guild
-Ring of Zenithar
-Player owened slaver bases
This organizations has slaver bases if the evidence aginst any of the base to high in a slaver region, the strike team sent aginst a randomly chosen base that belong to any of this organization. This strike team make free all slave on the location, kill all slavers. Of corse the strike force members can be captured! ( not to self: need add them to the sense victim spell potential targets so player can follow them
)
Player can send report fake or real with evidence aginst slaver guild or ring of zenithar. this give player trust level in local lord. this trust important aginst accusations aginst slaver guild and ring of zenithar. as they may use the local entity as a way to attack the player if player trust toward them very low ( or player taken a base from any of them, and they fail to recpature it... ) {this things very work in progress need to worked out how exaxtly going to work... }.
in sort if player give evidence to locals this give a defense aginst fals accusation from slaver guild and ring of zenithar unless they dig out something very damaging thing that case is when trust level lower then the evidence level. that case the evidence accepted and added evidence aginst player...
_______________________
The execution:
-----------------------
The curent written un tested code around 1,5-2k lines of code total.
The system is the most complicated so far with multiple moving parts. It is my first time do this complex thing and learned a lot from doing it.
The problem in this case not the scripting or discovering how littile things works in pratice. Nope in detail evrything is relative simple.
The hard part is organize the whole thing.
This cahpter i explain how things organized right now and what things i learned from it so it may help others!
The Requirements:
A - need easy to scale up , i mean adding new regions or anything new
B - adding new slaver region can be done only using SSE Edit nothing more, no need for ck!
C - the system very robust on start up need run safety checks its expected other than me do edits add new regions, to preverent any failure or damage on start up need run a check and stop if something not okay.
D - The system need detect player actions, and procces it, using the internal "event" system
E - Nothing hard coded in the script: all parameter that used to chose how things work out need to be changed from out side witout changing the source code
F - Other mod sub modules can send report about player activity, or other entity activity and system capble detect that type of activity and handle that, witout radical re writing of the source code
The general layout:
Data stored on a quest called SLOS Local Lord Entity
This quest has a script that SLOS Data Local Lord Entity
its contains all information about all region. the region locations, the evidence level, the player trust level, strike aginst slaver base in region in progress or not.
Another important Quest is the event proccesing quest called: SLOS Event Local Lord Entity.
This quest is a Event type quest that part of the internal event proccesing system. This sub system used to foward "events" to specific quests to procces it.
The buity of this: the event information sender script not know anything specific the reciver script they are independent from each other.
This is important as makes lot more easy to code the mod. Any sub modul can send event about anything to any Event proccesing script.
they are not depend on each other, this means i can change anything on the code not effect the other scripts directly.
so this event script recives reports from new evidence turn in, capture of slaves by player and in future maybe report from base capture by player.
( this incase evidence aginst the player of corse...)
Here is where shady figure report on player slavery deals lands... and shady get payed by gold for its informations....
This script orders the strike on player or any slaver base if enught evidence collected on it.
Neadles to say this event quest depend on the data stored on SLOS Local Lord Entity... and changes the data stored here.
Nest stop is the strike quests:
we have 2 type of them: Strike on player quest and Strike on Slaver base
well strike on player quest only 1 exist and going to exist so only 1 entity can send strike team aginst the player any given time...
but this not mean only one entity has reason to send strike team aginst player at the same time always... ohh nooo they are waiting in patince to next possible moment.... when strike on player quest free to used.
Strike on slaver base can be run one per active slaver region. This strike teams go aginst local slaver base...
fallowing true to all strike quest:
-all strike quest use adventurers ( mercanarys to be honest... )
-all strike quest actors belong to local hold guard faction and act as local guards ( before you ask: its using one quest for all type of holds! only the data the system using changed based on what hold the strike is running from! yes bit hard to explain how this exactly works )
-all strike quest stops if all of its member get killed or captured or both
-all strike member get removed from game word if the quest complited ( player get arrested or slaver base striked ).
after the strike quest finished running a call made to a event proccesing quest:
SLOS Event Local Lord Strike
yes its a different event proccesing quest. Simple reason:
the first one job to deal reports on player activity and slaver realted activity.
this one deal only the result of strike team activitys. this way the code is separate each other and can be changed independently.
in other words: if i mess up something in the reporting event part not going to effect the strike report part ( at least not directly
).
More robust and realible.
_______________________
The hard parts:
-----------------------
Most difficult part for me is this: as you can see here is the fallowing independent moving parts:
-Slaver related event reporting sub modules( like capture slave modul )
-Local Lord Entity
-Event Slaver Activity report reciver
-Strike on player/slaver base
-Strike result proccesing
This 5 thing form a pipe line. When the first thing effected its go trought all the sub modules and provide a end result.
So far most of the things i worked use 2 or maybe 3 independently moving parts.
Capture player good example:
uses the capture magic effect, this realise player captured, realize its capture can be done.
Select a vible capture player quest, if possible start it.
Then call the revelant capture quest and give the control the capture quest.
Or player bus slaves from shady figure, that one a complex beast too:
1 - dialoge with shady figure
2 - loading data from slaver guild bases
3 - representing data to player and proccesing player answer
This problem requires different aproach. i made a mistake and started build up the system from the first element of pype line: Event reciving element of the pipe line and the Local Lord entity.
Then build up from there.
Problem with it is this:
i need produce certing informations to the next part of the pipe line, but i dont know what information needed! as i not built up the next part of the pipe line only theorys what going to be needed.
Usualy in a 2 or 3 part system it is not a big issue as i can in head know what needed and where. Here is no way i can keep track all moving parts as simply too many of them.
The solution is this:
Working from the final element backward!
The Strke quest and strike result make it first the end result and work backward. This way i going to know what data i need to get the exact result.
From here to work backward to the report reciver and data storage, then the reporting functions.
Agin this things new to me, as i not get trained on how to organize this things how to think about it. Maybe one day i look for books that contain infromation how to think about this systems and how to design them.
_______________________
Most complex part:
-----------------------
probably the Slavery event reciver named: SLOS Event Local Lord Entity
The script on this quest that procceses the incoming reports.
this one around 800 or more lines.
But its not tell the true scale of complexity or its inner workings.
This one do lot of things, the most complex giving out starting a strike aginst a slaver base.
At first many may thing its simple: need a target, need actors that go there and do the job.
Well yes... need a actor base form that tells the quest what type of npcs need spawned, need to know how many of them need to spawned and where to send them.
But this is not enught! The system need to know Where they need to spawn!
Evry single Slaver region need to haw own uniqe strike force spawn location....
This information stored on the Local Lord entity data storage by the way.
To send out a strike team the system need to acces fallowing mini data bases:
1 -Local Lord Entity data ( this stores: where the strike force need to spawn each region, each slaver region belong what hold location, all evidence and trust information on all organizations, strike is running on slaver region) in our case provide information about where to strike and we can start strike or not as its strike running in the speicific hold or not.
2 -Form List based data base: what hold location uses what adventurers to execute the strike, rememebr eachy hold use own guards so need ot use own uniqe actor base to conduct the strike!
3 -Strike quest list: the lsit that store the strike quests and active strike quests, if no un used strike quest avibe strike cannot be started
4 -SLOSCoreScript - interface: few propertys here used to store information abut what the strike team need to do, and where, if interface is in use need wait...
5 -Active Slaver Base data storage: evry slaver base represented by a uniqe quest. the system need to knwo what slaver base active and based on this can chose where to strike, of corse the system need check what hold is where the slaver base placed in it, if not part of the hold where the strike team going out need to be skipped and only work on slaver bases that inside the revelant hold where the strike team come from...
so yes a bit complex
and all of this data bases need checked any problem with any data base means strike quest cannot be started.
the system meet the requirement new region can be added by the way...
but for that one need edit the Local Lord Entity data quest, add new strike team actor. Plus pass a start up test on Local Lord entity data quest.
if this start up test fails the local lord entity system refuse to work... and letting player to know not working evry time any report recived by the event proccesing quest.
_______________________
hidden but in place parts:
-----------------------
i added functionality to procces slaver guild and ring of zenithar reports on player. but this functionalitys not yet put in use by any part of the mod... so far.
next step is the harder nut to crack:
make a sub modul that represents the Slaver guild and or Ring Of Zenithar organization aginst the player.
Send fake or real reports to this system, send own Retaliation/kill/punish teams aginst player or its intrests. in general make player life more intresting if player dare to cross any of this organization plans at any point.
2 Comments
Recommended Comments