Automatic wreck generation system

Automatic wreck generation system

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
MidKnight
Posts: 2652
Joined: 10 Sep 2008, 03:11

Automatic wreck generation system

Post by MidKnight »

Alright, I'm really tired right now and nothing makes sense. Sorry if this makes no sense.

Alright, so in my sleepless daze, I had an idea for automatic wreck generation. It's simple: specify specific vertices (possibly with constraints for motion) in the model and set a flag in the unit def. Then, once the unit dies (post-death anim, etc), the script deforms the specified vertices by random values (possible, see Kloot/jK's code and beherith's wiggling trees) to create a wrecked mesh. For the texture, I think it would be best to add a Luacob function to overlay a texture with other images and desaturate.


Did any of that make sense?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Automatic wreck generation system

Post by knorke »

the script deforms the specified vertices by random values
if that is possible, why not have it for alive units too!
(possible, see Kloot/jK's code and beherith's wiggling trees)
wtf link?
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: Automatic wreck generation system

Post by KaiserJ »

it does make sense

i can see the following issues:
- you would have to be careful with which verts you selected, might end up strange if you stretched a quad and it ended up being larger than the original
- stuff like wheels/barrels that "explode" away from the unit ATM when its destroyed would have to be accounted for.... it would be peculiar to see a wheel bounce away from an exploding vehicle and then to see it suddenly reappear on the wrecked mesh
-would selecting verts for deformation take a longer time than reskinning/distorting a model to make a wreck in the classical sense? im not sure; this would have to be examined for viability (because it all falls apart if this method actually takes longer to implement for the artist)

however the strong points related to this obv are the texture-swapping on damaged units as demonstrated and the pseudo-random nature of generated wrecks, so its defenitely an idea with merit

personally this makes me think of possibly running a macro within a 3d editor; something to load up a model, "relax" some of the vertices and make them sag downwards on the vertical axis, replace the skin, and then by hand possibly adjust some of the finer details like fallen-off tires and pipes etc... this way at least would avoid uvmap distortion

just my thoughts on the matter :P
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Automatic wreck generation system

Post by knorke »

no no non ononono. do not build a wreckage generator into the engine.
instead allow Lua to deform vertices. Then when somebody asks "can i haz randomly broken wreckage?" you go "trolololo lua it!"
And then somebody makes a gadget and everybody copies it into his game and there was much joy.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Automatic wreck generation system

Post by Beherith »

You cant put shaders on features yet. Worked for units though:
BaNa wrote:yeah thats pretty nice i guess

BUT WAIT

WHAT IF MODEL GOT DAMAGED TOO?

Image
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Automatic wreck generation system

Post by knorke »

i remember that from random wip.
so is it released? guide? i would use it or at least would like to look at it.

and what about that wiggling shark http://springrts.com/phpbb/viewtopic.ph ... =shark.gif
i downloaded it but the shark does not wiggle. i put him in water and [x] enable luashaders support but no wiggling. :?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Automatic wreck generation system

Post by smoth »

Beherith wrote:You cant put shaders on features yet. Worked for units though:
Spring.UnitRendering.SetFeatureLuaDraw (enables the LuaRules' DrawFeature callin)

( number featureID, boolean enabled ) -> nil
was added not too long ago...

is this not what we needed?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Automatic wreck generation system

Post by Beherith »

Sorry for the offtopic, MK.

Smoth, is this in master yet?

Knorke, ill try to dig it up, but you may have to ask BaNa for it.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Automatic wreck generation system

Post by smoth »

IIRC it should have been in last release.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Automatic wreck generation system

Post by Forboding Angel »

Beherith wrote:You cant put shaders on features yet. Worked for units though:
BaNa wrote:yeah thats pretty nice i guess

BUT WAIT

WHAT IF MODEL GOT DAMAGED TOO?

Image
Btw, I added all that stuff to evo, but the only thing I couldn't get working was the unit damage stuff. Could you maybe have a look and see if you can figure out what I fucked up?
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Automatic wreck generation system

Post by Jazcash »

Looks like Photoshop's plastic texture filter. Makes sense though, to ruin a unit, you just apply as many filters as you can to it till it becomes a wreck :P
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Automatic wreck generation system

Post by Beherith »

Smartassery only works if you get it right: Craquelure.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Automatic wreck generation system

Post by jK »

Licho and me had a brainstorming about this topic ~2years ago.
We came to the result that the best way is:
  • to transform the model into voxels
  • apply destructive operations on it (explosion, gravity, melting, ...)
  • transform the voxels back to polygons (-> MarchingCubes etc.)
In theory it should be very easy to code this (except the marching cube algo., but there is code for that on the inet).
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Automatic wreck generation system

Post by Neddie »

Are voxels really the best way? I think Zerg and I talked about them briefly several years ago, but it was my understanding that the lack of acceleration was prohibitive and given the low hardware specifications many players work with, very few operations using voxels could be performed at once. Of course, if this is client-side and can be toggled, then it becomes more reasonable.

Anyway, I know little about OGL and the modern situation regarding voxels, so I'd like to learn more if you have the time to elaborate. I personally feel that hand generated wrecks will always be best, but given the tools many are using, they aren't convenient.
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: Automatic wreck generation system

Post by Satirik »

jK wrote:Licho and me had a brainstorming about this topic ~2years ago.
We came to the result that the best way is:
  • to transform the model into voxels
  • apply destructive operations on it (explosion, gravity, melting, ...)
  • transform the voxels back to polygons (-> MarchingCubes etc.)
In theory it should be very easy to code this (except the marching cube algo., but there is code for that on the inet).
unless your units are made of plasticine i don't think it would make something nice but GOGO
Last edited by Satirik on 12 Apr 2011, 20:45, edited 1 time in total.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Automatic wreck generation system

Post by jK »

Neddie wrote:Are voxels really the best way? I think Zerg and I talked about them briefly several years ago, but it was my understanding that the lack of acceleration was prohibitive and given the low hardware specifications many players work with, very few operations using voxels could be performed at once.
jK wrote:
  • transform the voxels back to polygons (-> MarchingCubes etc.)
No voxels are rendered, they are just needed for natural transformations of the mesh.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Automatic wreck generation system

Post by Neddie »

Ah, that makes sense, particularly since the death effects will mask the switch over so there is no need to render the process. Thanks for clarifying.
Post Reply

Return to “Feature Requests”