Jump to content
  • entries
    62
  • comments
    118
  • views
    8137

SLOS - Slavery Player Framework current status and lessons learned


Nonseen

481 views

Dear Readers!

 

This writing i try to write down my last expereince with Slavers Of Skyrim new part: Slavery Player and why i need basicly re write a 4k+line of code, re test lot of things.

I do it in hopes other mod makers not make the same mistake i made and may avoid the truble i go trought.

 

The problems:

The cause of problem that forced me re od month worth of work is the fallowings:

-the system i work on it multiple moving parts

-when started coding i made the wrong architecutre. so agin the problem is here not the lack of knowlage how to code something to do the thing i want. the problem is how to organize the code it self.

-Multiple moving elements beaked together, un seperatable way.

 

Let me explain this things in detail:

The original concept is this: player got captured, a story quest starts, story quest uses at least 1 master, story quest start tasks this quests that tell player what to do... or not to do if player chose.

if player fail to do certin things in time limit bead things going to happen.

if palyer do things as asked... well bead things going to happen in a non expected way... ower time player become a mindles slave that is not a good thing ( most cases ).

 

player can and econreged to try escape. escaping has own set of requirements if all meet player considered free man.

The frame work scripts job is to provide support for this game play.

 

The  architectural fail points:

i made a script system that used 1 gigantic script for evrything. then realised this is not going to work well... 4k lines in one file not fun to look for and find problems in it.

plus the code it self acted as 1 giant monolith that has many inter connected inner workings. if i take 1 part out the thing fall like dominos.

My first attempt to fix it braking the giant monolith parts that are separate.

At first look this looked like okay. but in reality i just made 1 giant script to multiple mini script that part of the giant one.

in other worlds i get script A , B , C , D. all called each other directly. if i changed anything in script B, its effected all other script. some cases if a compiler error made in script A script D reported it...

 

fixing this code is not easy expanding it legendary difficulty challened/near impossible.

 

The solution:

 

My solution to brake the frame work real independent pices. this pices act in own mini world and do exactly one type of things.

for example one script code to handle player mind and slavery effect on player mind.

 

This one independently exist, other parts of the frame work only send indirectly orders/request to it.

To archive this par i use the extend functionality of papyrus script:

make a script let Say Script A.

this one has function dothingA

then i make a real working script let say script A working, this one extend script A

all other part of my module only call Script A not directly script A working.

 

this way the code separation archived. 

 

Secund rule i apply my architecture is this:

obly realtive few script allowed to call other scripts this way. This done to limit the places that effected any change of function headers.

This "caller" script a mini commander scripts that give order other scripts, and recive reports.

many of this commander scripts work together to make the frame work function.

 

final big change: the API.

or Application Inter Face.

the orignal version used 1 single api script that sound simple if you wish acces the frame work just call this and you have full acces.

this is a good idea in paper bead in pratice:

becuse the api script not only fowarded information to the frame work parts but recived reports from the frame work parts made all the sub parts one big one mess.

 

Right now for all functionalitys i use separate api script to acces different parts of the mod. 

 

the Down sides:

 

as one can imgaine i dubbled, some cases tripled the number of script file i use:

1 script that do the job, 1 script file to order the script that going to do the job, some cases added 1 more script file to recived information or events from other parts.

basicly i need manage lot of script files.

this means more point of failure.

 

plus from external point of view at first harder to understand how this things works( or even why possible this thing works ).

 

curently i working to re make all what is lost. Starting story quest curently possible, player mind can be broken down, or fixed, escaping from slavery possible, player can be ordered move here or stay here, but masters and punishemnt system missing.... this 2 needed to realise a playeble version of the mod.

 

to make not only playeble but enojable i need add some story quests to... but first i hope this time not turns out i chose the wrong aproach agin how to organize the code.

0 Comments


Recommended Comments

There are no comments to display.

×
×
  • Create New...