smoother change-over from unit to wreck

smoother change-over from unit to wreck

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

smoother change-over from unit to wreck

Post by manolo_ »

dunno if it asked before, but atmo there is an abrupt change-over from the unitmodell to the wreckmodell when the unit dies, this change-over is mostly hidden within an explosion/smoke. so couldnt there be a better solution - something like morphing?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: smoother change-over from unit to wreck

Post by zwzsg »

Write your own transition in the Killed function of the script.
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: smoother change-over from unit to wreck

Post by manolo_ »

so its mod-side and not engine-related?
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: smoother change-over from unit to wreck

Post by Master-Athmos »

The unit always simply will be replaced by a wreck. You can make the model do a breakdance if you want to before it's exchanged by the wreck model but that's it - you currently cannot morph or deform it so the shape will be the same as the one of the wreck...
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: smoother change-over from unit to wreck

Post by Pxtl »

Master-Athmos wrote:The unit always simply will be replaced by a wreck. You can make the model do a breakdance if you want to before it's exchanged by the wreck model but that's it - you currently cannot morph or deform it so the shape will be the same as the one of the wreck...
Well, you could if you made sure that the wreck was a form that you could contort the model into using unit-script... but texture would still be a problem, since you want the wreck's skin to be noticably different from the unit skin, and that sudden jump would be hard.

But yes, not enough mods properly mask the transition with explosions.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: smoother change-over from unit to wreck

Post by zwzsg »

You could write the morphing animation yourself. Place the pieces in the same position as the wreck, and use one the lua function to draw unit with a given texture to smoothly grey it. Sure, that would require some work, but so would implementing it a engine level.
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: smoother change-over from unit to wreck

Post by Master-Athmos »

So there now is a working command for changing a unit's texture or are you talking of replacing the unit by a dummy one and doing so several times to get an animation effect?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: smoother change-over from unit to wreck

Post by aegis »

couldn't you shade it without swapping the texture?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: smoother change-over from unit to wreck

Post by zwzsg »

I don't know which way and which command would be best exactly, but I know you can draw the same unit, with pieces placed the same way, with different color, texture, size,...

For instance KDR_11k surrounded units by a green striped texture as KP's firewall graphical effect. Or just take one of trepan's highlight's widget and make it more and more solid.
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: smoother change-over from unit to wreck

Post by Master-Athmos »

I only can recall a discussion about texture swapping with the result being that this isn't really possible. It was meant to e.g. swap between textures showing a different damage level. If there recently have been added new functions making this feasible please say so...
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: smoother change-over from unit to wreck

Post by zwzsg »

It's not texture swapping, it's redrawing over with another texture. Here is for instance an unit going progressivly grey:

Image
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: smoother change-over from unit to wreck

Post by manolo_ »

zwzsg wrote:It's not texture swapping, it's redrawing over with another texture. Here is for instance an unit going progressivly grey:

Image
that may work, but wouldnt it be easier to implement a command to the engine for that, i mean nearly all mods would benefit from that
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: smoother change-over from unit to wreck

Post by hoijui »

a generic algorithm that takes as input a model and a wreck model, and creates a nice morph animation from one to the other seems practically impossible to me. if the algorithm only takes the model, and creates a transition animation plus a resulting wreck model (at runtime or at "compile"-time, by the modder), it could be possible, but i guess that would be a really hard thing still.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: smoother change-over from unit to wreck

Post by zwzsg »

that may work, but wouldnt it be easier to implement a command to the engine for that, i mean nearly all mods would benefit from that
It would be easier for you, because you would not have to do it, but harder for the engine dev, because they would have to do it, and harder for the other mod dev, because they would have to jump through hoop to disable or tweak the automatic system to their need.

In fact it would be harder to do at engine level, because the engine would need a generic solution, working for every kind of unit and wreck. It would have to magically invent the transition, the effect, the texture, and in a way that never bugs and always look good no matter how special the unit is.

When done at mod level, you have the liberty to create custom models, add some pieces, modify and supply textures, suited to your units.

If it was done at a mod level, and other modders liked it, they could still copy'n'paste the gadgets and scripts.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: smoother change-over from unit to wreck

Post by Das Bruce »

Clarification, we have death scripts now?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: smoother change-over from unit to wreck

Post by zwzsg »

Total Annihilation had a death script in the form of the Killed() function in .bos. However, it had one major limitation: it had to be instant. You could not have animation in it because the unit would be removed the next frame anyway.

In Spring, Killed can use wait-for and sleep, the engine will wait for Killed to finish to effectively remove the unit.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: smoother change-over from unit to wreck

Post by Das Bruce »

And wrecks are still one piece? Ie no opertunity to turn a turret to match it's pre death facing?
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: smoother change-over from unit to wreck

Post by Master-Athmos »

Well you most certainly can make a wreck consisting of several pieces but you'll have problems to do anything with them as wrecks have no script and no unit-id afaik so I think even Lua might not help here...
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: smoother change-over from unit to wreck

Post by aegis »

you could drop multiple wrecks
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: smoother change-over from unit to wreck

Post by yuritch »

Currently only overall unit heading and speed are inherited to the wrecks, not individual piece positions.

What the engine could do (and what isn't possible lua side now afaik) is inherit piece rotation from the unit and set wreck pieces to the same angles (provided unit and wreck pieces have the same names). Texture transition can be hidden somehow (explosions/smoke/other vfx), but the fact all the wrecks have the same piece positions is quite visible.
Post Reply

Return to “Feature Requests”