Jump to content

A Tiny Defeat


Lupine00

7651 views

As a follow-up to the Lupine Manifesto post, I thought I'd repost a slightly edited version of a message I wrote talking about a design for a Defeat-style mod.

 

The idea is to create a very small, extremely minimal defeat handler, with outcomes as plugins that can be added by other mods.

 

 

Basically, to take ALL the consequence handling out of the core defeat mod and provide a way to register arbitrary defeat handlers.

 

The most basic defeat handler is thus, nothing. You die.

That's the final fallback outcome if all else fails.

 

 

The base mod would come with some simple handlers, and some library functionality to do common tasks.

Other mods can then register into it via an API.

 

When defeat occurs, the core mod detects it, and contrives for the handlers to deal with it.

 

Handlers are all given a chance to prioritize themselves, and then they are given a chance to handle - though not all handlers may get a chance to handle, all get a chance to establish their priority, situationally, based on the conditions of the defeat.

 

 

Each handler decides for itself if it will handle the situation.

The handle/don't-handle logic is not part of the defeat mod, it just tries them in priority order, and the priorities are also calculated.

 

If we imagine it at an abstract level...

 

We have a DefeatState, which is the known state of defeat, including all the actors in play, and what side we think they're on (ally, neutral, enemy).

 

We pass that DefeatState to all registered handlers in no particular order, and they return a priority - this is their "bid" to handle the defeat.

 

We then refresh the DefeatState and test each handler in priority order, and ask it if it will *actually* handle the defeat. 

The handlers check the DefeatState and make a final call on whether they will run.

If a handler runs, it can then terminate the defeat or let other handlers continue it, or it can re-open the bidding process and let handlers re-bid.

 

If the active handler allows continuation, lower bidding handlers may ALSO run, but they will not get a chance to do so until the current active handler is done.

Again, they will be handed a refreshed DefeatState at that point, and decide whether to skip, handle and terminate or handle and continue.

 

External mods can call a well defined API to register handlers, but the assumption is that you will quickly develop a reasonable set of handlers to do the basic stuff, like rapes, teleports, robberies etc.

 

For example, a handler might calm everything, giving you time to make a run for it. That handler would have a cooldown, so if you're defeated again, you fall back down the chain and get ... death.

 

And of course, there might be a rape handler, or several...

 

 

 

So, a given run might look something like this:

Spoiler

 

Defeat detected...

Enemies: draugr, draugr, draugr overlord, current healths 150, 250, 750 respectively.

Neutral: none

Allies: Lydia - current health 150

Cause: 0 player health

 

This then polls the handler list for priorities, passing in the defeat state...

 

The handler list, in this case is:

 

Death - PC is killed. Reload.

Bleedout - PC goes in bleedout. Enemies do not pacify if any combatants stand.

Robbery - PC's gear is taken.

PortToInn - PC is ported to a random nearby inn.

EnemyRape - PC is raped by enemies.

Imprisonment - PC is imprisoned at length and must escape or be released.

SecondWind - PC recovers full health and can restart the fight.

 

Given the conditions, each makes the following bids:

Death - always bids 0

Bleedout - bids 100

Robbery - bids 50

PortToInn - bids 40

EnemyRape - bids 90

Imprisonment - bids 50

SecondWind - bids 150

 

SecondWind wins and gets first chance to handle. It bid high because a follower was still standing.

Bleedout lost, though arguably it would be appropriate. Because the player explicitly enabled SecondWind, it does what it does.

 

SecondWind runs, restores the player health, and the event is over. Defeat is done...

 

 

Then 45 seconds later, defeat runs again, the player is down again, and this time so is Lydia.

 

Defeat detected...

Enemies: draugr, draugr, draugr overlord, current healths 150, 250, 750 respectively.

Neutral: none

Allies: Lydia - current health 0

Cause: 0 player health

 

Bids occur again:

 

Death - always bids 0

Bleedout - bids 100

Robbery - bids 50

PortToInn - bids 40

EnemyRape - bids 90

Imprisonment - bids 50

SecondWind - bids -1 (basically saying "will not handle")

 

Not only is SecondWind in cooldown, and cannot run, it sees Lydia is down. It returns -1 as its priority, it's not in the game, Death will always beat it.

 

Bleedout wins, and handles first.

 

When it's called again to see if it really will handle, it says yes.

Bleedout always bids high, and always says yes. Why? Because it is the initial pacify manager.

 

However, the core pacification functionality is in the defeat mod core. Any handler can (and should) use it.

 

 

Bleedout sees no active allies, it pacifies Lydia and the enemies and it spins.

If an enemy or ally wanders into range while it's spinning, it will pacify them.

After a few seconds delay, bleedout completes and CONTINUES. The next handler can run.

The next highest bid is EnemyRape.

 

EnemyRape checks to see if it can run, and it sees a bunch of pacified enemies with health, and a downed PC and follower.

It goes "great, set me up the rapes!"

It starts two sex scenes, one for the PC and one for Lydia.

 

While it's running, the PC's other follower wanders into range.

The main defeat handler catches this, and hands the event to the current active handler (EnemyRape).

 

EnemyRape has no enemies to rape the new follower, so it gives them a flee in panic package and forgets about them for now.

 

Once the rape is done, enemy rape terminates and continues.

 

Robbery and Imprisonment both bid 50 and are both candidates.

The defeat mod picks one at random to go first.

 

Robbery is picked. The player and follower's gear is taken.

Robbery CONTINUES almost instantly.

 

Imprisonment runs...

 

But let's imagine Imprisonment was picked first.

In this case, imprisonment may see the PC has not been robbed, and may start by calling Robbery itself, because it knows that handler is part of core and always exists.

It simply passes in the existing state and sees if robbery will run. It will, and so it can perform a robbery without having to duplicate any code.

Robbery - as we already know - finishes and continues almost immediately.

 

Imprisonment starts up the main imprisonment quest, nails dying Lydia to a cross near Valtheim Halls, and puts the PC in a cage.

Imprisonment terminates after starting up the quests and porting the player to their cell. 

 

 

At the Papyrus level, how do you register a handler? How are they called?

 

Handlers are quests that share a common extension script.

The specific handler overrides the methods in this script.

 

To register, you cast your quest to the common extension type, and hand your quest object to the defeat mod. It puts you in a list, and can call the defined methods on the quest any time. It can also check if your quest is running or not. If your quest isn't running, it's always skipped. This allows handlers to be enabled/disabled in their own MCMs easily.

 

 

How do you detect defeat? Isn't that a complex problem?


Yes. And defeat detection also needs to work with plugins to some extent.

 

There are two ways to go about this.

In one case, the detection is entirely in another mod, and it simply calls a mod event to inform the defeat mod of it.

The more interesting case is where the defeat mod collects information about the ongoing combat and passes it to the registered defeat handlers to see if they think a defeat is in progress.

This is nothing more than another Function defined on the base quest type, that returns one of a defined set of defeat types, the first of which is "no defeat in progress".

 

The data used to detect defeats looks uncannily like the data used to handle them. It's the exact same defeat state, but without a cause: we have actor lists organised by disposition, and a curious mod can traverse these lists and decide whether to trigger a defeat, or possibly modify the actors somehow.

 

A mod that doesn't care about detecting defeats can simply return, which of course is what the base class implementation does.

38 Comments


Recommended Comments



Inte

Posted

23 hours ago, Nymra said:

I think Zaz and ZAP is used quite as a synonym in this board. At least everybody knows what is meant :D

Perhaps, but why not use the correct nomenclature and eliminate all doubt? Doing that will also help when searching the website. 

 

OsmelMC

Posted

Ok here is my WIP idea until now.

Right now is mostly the copy of many mod ideas in one, just few functions are really working the rest is just to keep in mind.

 

1. First I take the structure of SexLab mostly because the update scripts in there are the most adaptable.

 

2. I use the idea of the thread in SexLab for the Animation and apply it to control the scenes between Master/Aggressor and Slave/Victim of course the relation between them don't need to be Master-Slave but the idea is give the possibility of eventually end like that, and a easy way to control it.

 

3. For the outcome I take the Event system of DDi and make few small changes like add it a Tag system. This way will allow link outcome events from any Mod, even those already existing.

 

4. I take the defeat detection system from SexLab Defeat because I think is the most completed until now of course need to be reworked because his system is not the most adaptable but at least set the path to follow.

 

What I try to do with that? 

The idea is the defeat system set the status of the actor (Knockout, bleedout, fatigue, defeated, surrendered, escaping, ...)

Then execute the corresponding outcome events using the Tag system to make the corresponding event list. The tags will be the status allowed for the event and the type of actors allowed (NPC, Followers, PC as Victim, Creatures, ...) 

 

WARNING: I shared the files for those with programmer skills and just to get feedback and maybe some help. I want get this ready in the less time possible.

Devious World.7z

Nymra

Posted

22 minutes ago, osmelmc said:

Ok here is my WIP idea until now.

Right now is mostly the copy of many mod ideas in one, just few functions are really working the rest is just to keep in mind.

 

1. First I take the structure of SexLab mostly because the update scripts in there are the most adaptable.

 

2. I use the idea of the thread in SexLab for the Animation and apply it to control the scenes between Master/Aggressor and Slave/Victim of course the relation between them don't need to be Master-Slave but the idea is give the possibility of eventually end like that, and a easy way to control it.

 

3. For the outcome I take the Event system of DDi and make few small changes like add it a Tag system. This way will allow link outcome events from any Mod, even those already existing.

 

4. I take the defeat detection system from SexLab Defeat because I think is the most completed until now of course need to be reworked because his system is not the most adaptable but at least set the path to follow.

 

What I try to do with that? 

The idea is the defeat system set the status of the actor (Knockout, bleedout, fatigue, defeated, surrendered, escaping, ...)

Then execute the corresponding outcome events using the Tag system to make the corresponding event list. The tags will be the status allowed for the event and the type of actors allowed (NPC, Followers, PC as Victim, Creatures, ...) 

 

WARNING: I shared the files for those with programmer skills and just to get feedback and maybe some help. I want get this ready in the less time possible.

Devious World.7z 168.51 kB · 0 downloads

What exactly does it do at the moment?
Is it virtually a self sufficient Defeat mod right now? 
 

OsmelMC

Posted

1 hour ago, Nymra said:

What exactly does it do at the moment?
Is it virtually a self sufficient Defeat mod right now? 
 

Right now mostly give the idea and place some ZaZ Furnitures on the map. The Event system is almost ready but need the Defeat system to be triggered and almost none of the Defeat functions are working. Also right now for test include one dialogue to place a random Furniture on the target Position.

 

Should be safe install it, because right now don't interfere with any of the other Defeat related Mod.

Nymra

Posted

On 5/25/2020 at 8:47 PM, osmelmc said:

Right now mostly give the idea and place some ZaZ Furnitures on the map. The Event system is almost ready but need the Defeat system to be triggered and almost none of the Defeat functions are working. Also right now for test include one dialogue to place a random Furniture on the target Position.

 

Should be safe install it, because right now don't interfere with any of the other Defeat related Mod.

defeat system means Defeat as a mod? 
I will never install that again, its just trash :(
I honestly wonder why it is still used. 


 

 

OsmelMC

Posted

2 minutes ago, Nymra said:

defeat system means Defeat as a mod? 

Of course not. The Defeat system I talking about is self sufficient. To be more specific is my vision for the Tiny Defeat Framework. More or less. That's way I shared it here and not in my Tweaks.

 

The first time you talk about the furniture escaping tweak I also think make it in "Naked Dungeon" similar to what you did. Is good solution but "Naked Dungeon" have his own issues to solve and right now the idea of @Lupine00 seems the best way to really expand the possibilities of all the Mods detecting defeat type events (not related to Defeat Mod) like "Naked Dungeon".

 

Nymra

Posted

16 minutes ago, osmelmc said:

Of course not. The Defeat system I talking about is self sufficient. To be more specific is my vision for the Tiny Defeat Framework. More or less. That's way I shared it here and not in my Tweaks.

 

The first time you talk about the furniture escaping tweak I also think make it in "Naked Dungeon" similar to what you did. Is good solution but "Naked Dungeon" have his own issues to solve and right now the idea of @Lupine00 seems the best way to really expand the possibilities of all the Mods detecting defeat type events (not related to Defeat Mod) like "Naked Dungeon".

 

Yeah!

I mean it would be cool if somebody would make a furniture "module" for tiny defeat utilizing the escape system I made. 
I will do it myself it the code is manageable. I also have ideas of adding more stuff and outcomes. 

OsmelMC

Posted

32 minutes ago, Nymra said:

 
The escape game is in the "ndun_captivequest_qf_scr"
if anybody wants to use it in a defeat scenario, would be cool. 

I think include something like that on the framework. In fact already made the Event outcome and the Aggressor/Victim (Control quest's) system to deal with it. The part I don't made yet is the defeat system to call the event outcome.

For example:

When the actor (Player, NPC, Creature) enter in bleeding state the Defeat system should apply the Idles and calming effects and then start one of the control quest with the Victim and the Aggressor and once done should call the corresponding Event outcome list filtered using the Tag system. In this case supposing the victim actor is the player then the event Tag should have the "Player, Bleedout" Tag's.

 

------------------------------------

 

Returning to the Naked Dungeon Mod and your Tweak. I don't really tested you tweak yet but testing the Naked Dungeon I get trapped on a spider web cocoon and don't find any natural way to release my self because the system keep telling me "I was tired" I ended disabling that and removing the cocoon using the console. 

 

That part really need the escaping game you made.

OsmelMC

Posted

2 hours ago, Nymra said:

Yeah!

I mean it would be cool if somebody would make a furniture "module" for tiny defeat utilizing the escape system I made. 
I will do it myself it the code is manageable. I also have ideas of adding more stuff and outcomes. 

The Event system include in DDi is really easy to use, that Event system  is the one I copy to make this. With few small lined of code is possible make new external outcome events and also easy migrate those from the existing Mods like Naked Dungeon or SexLab Adventure.

 

You can see the example Event script for Rape or Furniture Restraint. Those examples have just few lines of code and with just that and the right configuration of the "Devious Would" MCM the furniture escape system , Slavery, robbery, Start you own Quest and anything else can be done. Also the tag system allow the final users decided if want one specific Event outcome happen for one or few Actos Type ("PC, NPC, Creature, Follower") and  one or few Actors Situations ("Bleedout, Knockout, Sleep, Restrained")

Nymra

Posted

On 5/26/2020 at 2:01 AM, osmelmc said:

 

I had a look at the Devious World. 
Still think I dont understand exactly what it is meant to be, here some impressions:

 

1. Content
It is a bit confusing because at this point alot of it looks just like a Sexlab Clone. I understand this will probably overwrite sexlab, but why make everything twice? 
I would have to adjust all controls twice, once in sexlab and once in this mod when I want them to be the same for sex started by other mods and one that starts with Devious Skyrim?
Is there a certain reason for that script wise?
Because I think it would be an uneccessary step. 

2. Defeat conditions.
at least in my install I could not get the mod to trigger any defeat scenario. There is no surrender key and when the PC dies there is nothing happening -> (except some CTDs with runtime error :P)

So I cant quite give any feedback yet by just looking at the code. I m a practical person, I need to see something in action and then see the code behind to understand maybe. Sorry if I cannot help more. 

I was hoping that this topic would be a bit more active, but it seems not :(
I was thinking about some kind of crowdfunding even for a project like this. We need a defeat framework that can bring all the good stuff together. 
And I am honest, I dont think this should have coding as the primary source of concept. 
we need a good concept and then make the code happen for it. 

 

With pamas execution for example there is a perfect mod for scenarios, but no mod to pick up on stuff like that. 

 

 

 

OsmelMC

Posted

@Nymra I shared the unfinished scripts just to see if someone wants to help.

 

The Mod was thinking to be a framework so even if I include few outcomes to test the main idea is allowed others add his own outcomes or links his Mods without the need of modify the framework and don't even required a hard dependency.

 

That's the 50% of the Mod and seems to be done. The other 50% is the Defeat detection and is tagged as TODO because like always I try to take as example the already existing mods and in this case none of them bring me a good idea of what is really needed. The most complete Mod I see on the Defeat detection part is SexLab Defeat but his scripts are too messy to be taken.

By now I have better idea of what to do in the Defeat detection part but I waiting for release the current SexLab Utility versions to take the Defeat project again.

 

Looks like the SexLab because I copy most of the SexLab structure to reduce my work time. But is completely independent.

 

If you have any conflict with the SexLab is probably because this release still have the free camera scripts. I already remove that part but if still is present on that version you can change or disable the Devious Would Key option for the Free Camera.

 

Test the Furniture is completely safe because already included one option to remove all the Furnitures added.

 

Nymra

Posted

20 minutes ago, osmelmc said:

@Nymra I shared the unfinished scripts just to see if someone wants to help.

 

The Mod was thinking to be a framework so even if I include few outcomes to test the main idea is allowed others add his own outcomes or links his Mods without the need of modify the framework and don't even required a hard dependency.

 

That's the 50% of the Mod and seems to be done. The other 50% is the Defeat detection and is tagged as TODO because like always I try to take as example the already existing mods and in this case none of them bring me a good idea of what is really needed. The most complete Mod I see on the Defeat detection part is SexLab Defeat but his scripts are too messy to be taken.

By now I have better idea of what to do in the Defeat detection part but I waiting for release the current SexLab Utility versions to take the Defeat project again.

 

Looks like the SexLab because I copy most of the SexLab structure to reduce my work time. But is completely independent.

 

If you have any conflict with the SexLab is probably because this release still have the free camera scripts. I already remove that part but if still is present on that version you can change or disable the Devious Would Key option for the Free Camera.

 

Test the Furniture is completely safe because already included one option to remove all the Furnitures added.

 


I tried to summarize all content and functionality that would be required in this thread:
 

I dont know if this will ever take speed. I think mod authors would require to make a team of some sort for this to work. Or in the end it will require one modder to do the majority :(

 

Lupine00

Posted

I don't consider this idea totally dead. I do have other things I should do first.

 

Peril could be a basis for this mod, even though it has chosen to build in outcomes, there's still a possibility that it can be extended.

 

I don't see this approach as being less necessary in SE. The blocker for me moving to SE remains the poor ENB support, and there is little chance that will improve much, but the graphics for SE are tolerable now so I will be looking at moving over sometime this year. It's not a done deal, but I'll see how it goes.

 

 

 


×
×
  • Create New...