Homepage Forum Spanking Art Gallery Oekaki Drawing Board Art Contests Roleplaying Forums Spanking Video Games Spanking Stories and Fiction Spanking Video Downloads of Animes Social Groups Register an account Rules Frequently Asked Questions

  
Go Back   AnimeOTK > Spanking Video Game Development > Spanking Video Games Discussion

Spanking Video Games Discussion Chat about Spanking Computer Games, Spanking Video Games and Spanking RPG's that you have developed or are making. Tutorials, Q&A and Discussions.

Want to get rid of the annoying adverts? The answer is simple. There are 4 levels of advertising on AnimeOTK:

Level 1: (Your Level, guests and members with 0-9 posts) has maximum advertising.
Level 2: (A user with 10 or more posts who has been a member over two weeks) have vastly reduced advertising (including removal of the large full screen closable adverts)
Level 3: (A member who has been registered over a month and has over 50 posts, or has a special account like "artist" or "writer" sees minimal advertising.
Level 4: (VIP Donators) receive no advertising.
All donators of $10 or more will never see an advert on our site again!
Reply
 
Thread Tools

How would I make a contrition system in Twine?
Old December 24th, 2021, 07:17 AM   #1
Tableleg0
Member
 
Tableleg0 is offline
Join Date: Jun 2017
Posts: 84
Default How would I make a contrition system in Twine?

I’m trying to get back into twine, and I’m trying to figure out how you would make a system where an NPC would have a list of behaviors that are marked as acceptable or unacceptable based off of punishments/rewards the npc had received. If anyone who knows how to use twine could give me a rundown of how this would work it would be greatly appreciated!
  Reply With Quote

Old December 30th, 2021, 04:06 PM   #2
Eurus
Senior Member
 
Eurus is offline
Join Date: Oct 2009
Posts: 104
Default

Well, there's a lot of ways to do it depending on how advanced your game is getting. Also, specific examples of code depends on what story format/language you're using, so I'll try to be general -- I'm more used to Harlowe, which has documentation that works pretty well for explaining how to do things to code-illiterate dummies like me, but I think a lot of people use SugarCube which is a bit different.

(Fair warning: I am in no way a programmer, so I apologize if anyone who actually knows what they're talking about reads this and flinches right out of their chair because I said something wrong.)

In general, I would say the simplest way would be to have an object that stores the information you need. In Harlowe, I would use a datamap. This is basically like a bunch of variables bundled together in one. For storing a character's attributes, where each attribute has a unique name and a value and you don't care what specific order those attributes are stored in, a datamap works fine. For example, let's say I have a datamap named NPCBehaviors. I can then add a value with a unique name to that datamap for each behavior I want to track. So we end up with something like...

NPCBehaviors
"lying" = 0
"stealing" = 0
"cleaning" = 0


If you're using SugarCube, I think you might have to set up a generic object for this? I don't recall if SugarCube has maps baked in, but you can definitely get an object that works like one.

Then you can have your punishments and rewards update the value of one of those behaviors. Maybe you want to set it up so that each punishment reduces the value by 1, and each reward raises the value by 1. So you punish your NPC twice for lying and once for stealing, then reward them for cleaning, and you have:

NPCBehaviors
"lying" = -2
"stealing" = -1
"cleaning" = 1

Then, when you're determining how the NPC behaves, you can look at those values. Maybe the random chance of the NPC choosing to engage in lying behaviors is reduced based on the "lying" value in NPCBehaviors, or maybe you just want them to completely avoid any behavior they've been punished for in the past.

There are a ton of other ways you could do this. You could track rewards and punishments with different maps, you could use a different kind of object entirely, you could have much more complicated ways to adjust the values associated with each behavior (maybe you want minor punishments to have a chance to push the behavior value back toward zero instead of driving it lower, as the NPC decides it's "worth it"?). But that's the very general answer I can give you, I hope it helped at least a little.
  Reply With Quote

Old January 4th, 2022, 05:27 PM   #3
00Spank
Member
 
00Spank is offline
Join Date: Mar 2019
Posts: 83
Default

Quote:
Originally Posted by Eurus View Post
Well, there's a lot of ways to do it depending on how advanced your game is getting. Also, specific examples of code depends on what story format/language you're using, so I'll try to be general -- I'm more used to Harlowe, which has documentation that works pretty well for explaining how to do things to code-illiterate dummies like me, but I think a lot of people use SugarCube which is a bit different.

(Fair warning: I am in no way a programmer, so I apologize if anyone who actually knows what they're talking about reads this and flinches right out of their chair because I said something wrong.)

In general, I would say the simplest way would be to have an object that stores the information you need. In Harlowe, I would use a datamap. This is basically like a bunch of variables bundled together in one. For storing a character's attributes, where each attribute has a unique name and a value and you don't care what specific order those attributes are stored in, a datamap works fine. For example, let's say I have a datamap named NPCBehaviors. I can then add a value with a unique name to that datamap for each behavior I want to track. So we end up with something like...

NPCBehaviors
"lying" = 0
"stealing" = 0
"cleaning" = 0


If you're using SugarCube, I think you might have to set up a generic object for this? I don't recall if SugarCube has maps baked in, but you can definitely get an object that works like one.

Then you can have your punishments and rewards update the value of one of those behaviors. Maybe you want to set it up so that each punishment reduces the value by 1, and each reward raises the value by 1. So you punish your NPC twice for lying and once for stealing, then reward them for cleaning, and you have:

NPCBehaviors
"lying" = -2
"stealing" = -1
"cleaning" = 1

Then, when you're determining how the NPC behaves, you can look at those values. Maybe the random chance of the NPC choosing to engage in lying behaviors is reduced based on the "lying" value in NPCBehaviors, or maybe you just want them to completely avoid any behavior they've been punished for in the past.

There are a ton of other ways you could do this. You could track rewards and punishments with different maps, you could use a different kind of object entirely, you could have much more complicated ways to adjust the values associated with each behavior (maybe you want minor punishments to have a chance to push the behavior value back toward zero instead of driving it lower, as the NPC decides it's "worth it"?). But that's the very general answer I can give you, I hope it helped at least a little.
This is exactly how you would do it, and to confirm you can do character mapping with SugarCube 2 in twine.

So your character may have a trait mapped in such as:

<<set $npc = {
"name" : "Lucy",
"behavior" : {
"lying" : 0,
"stealing" : 0,
"cleaning" : 0,
},
}>>

Then you would just have to write some code to interact with these stats after a punishment such as having them punished for lying and then

<<set $npc.behavior.lying -= 1>>

I would use a widget here that would check what she was punished for and alter stats accordingly so you can just use the same code over and over.
  Reply With Quote

Old January 7th, 2022, 07:46 PM   #4
javajava
Member
 
javajava is offline
Join Date: Apr 2007
Posts: 50
Default

Unscripted Twine games involves complex relations that we want to automate.
However creating realistic automated behavior.
The games lack the real world interactivity we have with real people.

Contrition, Repentance and more generally a response to being spanked would be a good thing to model, as well as the good or bad decisions the NPC makes after being spanked.
Any model that even remotely feels realistic is going to be complex.
And while in some games we just want a black box (we see the NPC's responses but we don't know why), in many games we want to provide the player with some helpful clues about why the NPC responded this way
However it must not have too complex feedback, or expect too complex a response from the player.
I suggest the player should have a maximum of 6 plausible choices, 6 relevant variables s/he is able to adjust and 6 relevant feedback variables that are displayed.
I would expect the NPC to have between 3 and 10 possible responses in a given situation, calculated as a function of these inputs (and perhaps a bit of chance).
The model may have any number of hidden variables.
These hidden variables should keep the game functional/playable.
Getting the desired response - or at least moving the feedback variables in the right direction should not be too trivial, but it must not be too difficult either.
The hidden variables should not obscure the relationship between the inputs and the NPC's response - the variables should make sense and mean something.

So for example if our inputs include
the player's choices
the history of spanking an NPC
feedback variables such as
Self-control
Greed/Selfishness
Relationship with player
Rebelliousness
etc
the NPC choices and reactions can be modeled as a function of these variables.

In general the NPCs choice, from a scripted list of possible responses, would be determined by one or more hidden variables that were functions of the feedback variables, the situation/history and the player's current/recent choices.
The NPC's feedback variables would gradually change over time - often in response to being spanked, the player's choices or the NPC's choices etc.
  Reply With Quote
Reply

Tags
contrition, make, twine


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Total page views: , page views today: 0
All times are GMT. The time now is 06:47 PM.


Powered By vBulletin®
©AnimeOTK.com 2007-2021