powerof3 / BaseObjectSwapper

MIT License
13 stars 5 forks source link

Feature request/Idea #3

Open speaker-60 opened 2 years ago

speaker-60 commented 2 years ago

Didnt know where would be best to note this, sorry if this is the wrong place I wondered if A new 'Distance' to player condition could be added so an object is only swapped when the player is close enough

I have an idea to have all moveable statics, misc items, weapons ect swapped to static objects versions, then have them turn back into the movable versions when the player is actually close enough. Hoping it would have a nice plus to performance by removing as many 'physics' objects as possible and only converting them into physics objects when actually needed I would setup one _SWAP.ini to swap when the is far enough to static and another _SWAP.ini to swap when the player is close enough to swap back to movable

Another feature would be good is to spawn new instead of swapping, something like it clones a duplicate object then swaps the duplicate. Leaving you with the original object and a duplicate that got the swap, it would allow us to technically spawn things at the location of a object without replacing the object.

And the last feature idea is to allow us to add more then one swap reference where it will randomly pick one of them. Something like [Forms] origBaseFormOrEditorID|swapBaseFormOrEditorID|swapBaseFormOrEditorID|swapBaseFormOrEditorID|transformOverrides [References] origRefFormOrEditorID|swapBaseFormOrEditorID|swapBaseFormOrEditorID|swapBaseFormOrEditorID|transformOverrides

So here it would swap the base object with 1 of 3 objects

Another [Forms] origBaseFormOrEditorID|swapBaseFormOrEditorID| |transformOverrides [References] origRefFormOrEditorID|swapBaseFormOrEditorID| |transformOverrides

Having a blank entry so now this would randomly pick between something to swap to or nothing If it selects nothing then it dosnt make the swap, so with this we can now make a 50/50 chance it swaps a base object or not

alandtse commented 2 years ago

I'd suggest asking powerof3 on his repo since I'm just porting or doing VR only edits now. He would have a better idea of what is possible.

EDIT: My bad, for some reason I thought I was on my repo. Please ignore.

powerof3 commented 2 years ago

Distance check is interesting, the current setup doesn't allow for this but I'll see what can be done.

Random swaps are doable, but this should be disabled for statics, there's no way to sync up LOD.

speaker-60 commented 2 years ago

the distance idea to swap movable with statics, most movable objects dont have/use lod(although they can if you set dydolod to do it) I just thought if all movable(aka objects producing physics collisions) was turned to static from game load or atleast the second you load the cell/world chunk then it could help reduce performance cost and only have these objects produce physics then the player is actually close enough to them. visually speaking it would be a like for like swap

Also it could be used to control how much object swapper swaps at once by adding a distance check requirement, a mod like dynamic things that now uses object swapper can be set to only swap an object when its actually relevant to do so optimizing what the mod is doing atleast by a little bit

As for random swaps of statics i think sheon can do something there, we have chatted before and he has helped me with a mini project before we spoke about a few things, changing lods was one of them. through scripting its currently possible to have moveable objects have lod where the lod moved with the object(like the dragon lod in vanilla) changing the lod is no more difficult then that

LOD wouldnt be a problem for object swapper anyway

What about duplicate spawning? by duplicating a object then swapping the duplicate it allows us to 'spawn' as new wile keeping the original object in the scene. This could be used for all sorts of things depending on limitations

speaker-60 commented 2 years ago

Spoke with sheson(creator of dyndolod) about the random swap feature, he said: "That will only work with dynamic LOD. It basically means adding all the possible combinations as new references with IsFullLOD flag and the dynamic LOD part of DynDOLOD enables/disables them as needed."

So random swaps is doable with lod if using dyndoload

speaker-60 commented 1 year ago

Was doing random swaps ever looked into, i see it was added in the new animobject swapper(awesome addition btw) Dyndolod is capable of showing whatever lod its need