Wreckage Shortcut [texture overlays]

Wreckage Shortcut [texture overlays]

Requests for features in the spring code.

Moderator: Moderators

Post Reply
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Wreckage Shortcut [texture overlays]

Post by Warlord Zsinj »

Well, I'm in the middle of the process of creating the wreckages for SWS.

It really is a pretty awful job, having to make multiple-stage wreckages for every unit you have produced.

In order to speed up the process, I've worked out a means of using a number of premade 'scarred' layers, opacity and blending options to very quickly give premade textures a 'shelled out' look.

One thing I was wondering was whether it would be possible to make this process procedural-based within the Spring engine.

What this would mean would be to have textures overlayed (with a certain amount of alpha) on other textures when a certain event occured. This would work vaguely similarly to how groundscars are currently used on maps.

The result of this would allow me to make a handful of 'wreckage overlays', and then when units die, simply have the wreckage model load the original unit texture, and then overlay the specified 'wreckage overlay'. This would cut out a significant amount of workload from my end, as well as reducing the processing-hit in terms of simultaneously loaded textures (as the overlays could be reused across multiple units), as well as reducing the filesize of my mod (~5-10 texture files compared to ~100).

An offshoot advantage of something like this would be the ability to have units dynamically show battle damage as the battle wears on. So, say you produce a "battle damage overlay" texture, when a unit/structure is at say, 90% health, the battle damage texture is overlayed on the unit/building at 10% opacity. (Ideally this damage would be optionally reduced/removed during repairs by working in the opposite manner)

That way, you would have a visual cue of how damaged units are, as well as having your battle-weary armies look battle-weary. I'm sure people can think of all sorts of other visual things to do if they have the ability to dynamically change textures according to in-game actions.

Please note that yes, I have investigated the possibilities of doing this in lua, but it seems that while vaguely possible, the efficiency of doing it so would make it unfeasible, making a hard-coded option preferable.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

I don't think the efficiency in Lua would be all that bad, drawing the unit is done completely in C++ anyway and you only change the texture state before drawing it.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Trepans been quoted as saying that lua model rendering can at times be faster than the engine because of the removal of a lot of engine stuff that could get in the way.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

*cries*

Thanks for engaging with what was clearly the most important point of my post...
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

There there, don't cry, you at least got some coders thinking about it.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

Not directly related to the first post, but related to wrecks.
It would also be cool if wreckage 'inherited' relative piece positions and rotations of the base unit model when piece names match. That is, if the tank has a turret piece and the wreck also has a piece named turret, then wreck's turret should be turned to the same degree a unit's turret was when it died.
Post Reply

Return to “Feature Requests”