Page 1 of 2

[Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 09:08
by Forboding Angel
Basically the gadget would find spring default trees, and remove them, then replace in those locations, features from a list.

I wanted to do this myself, but tbh I don't really know how. Anyone wanna do it?

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 11:46
by knorke
kind of similar:
http://code.google.com/p/conflictterra/ ... ner.lua#96
(replace metalrich features with mineable resources)

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 12:15
by Forboding Angel
Thanks. That should give me a starting point. I don't actually need this, but I just thought it would be neat to have.

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 14:50
by Jools
It's a nice idea, but there are many problems with outsourcing the tree development like this.

First, the behaviour of 3rd party features needs to be completed. I'm thinking mostly of fires and ability of units to demolish them.

Secondly, I think 3rd party features lack the ability of simplifying the structure when seen at large distance, thereby minimising lag. Having 7000 3rd party trees and bushes on a map causes a lot of lag on many systems.

So, in the end, a better solution would be to improve the default handling of trees in the engine. And in general, the correct way to develop the engine in general should be to in-source as much as possible, not to lua it. Why? Because things should be handled by the part that handles it best. Flexibility is overrated.

Well, that's my opinion. Go ahead and disagree.

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 14:57
by smoth
Jools wrote:Translation:
You should not use features as the engine trees have lod.
tons of other games have tons of trees and handle them better. It would be better to investigate WHY the features are expensive, how we can get lod on them and move on.

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 15:31
by Jools
smoth wrote: other games are expensive
I agree.

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 15:52
by smoth
Jools wrote:
smoth wrote: other games are expensive
I agree.
?

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 16:11
by Jools
It was just a response to the fact that you used a direct citation style and didn't reproduce my text in verbatim. You got the meaning of what I wrote right, but if you alter the contents you should use indirect style of citation.

Nothing personal, it seems to be a spring forum style that I'm unacquainted with, so I had to respond with my own miscitation.

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 16:14
by smoth

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 17:40
by bobthedinosaur
lod possibly? dont those "other games" use levels of polies based on LOD?

Re: [Gadget] Replace spring default trees with random feature

Posted: 27 Nov 2011, 17:47
by jK
You don't need a gadget for that.
I already told you once you can just override the featuredefs and replace them with models.
And that I already did that for ZK, but never commited it cause the FPS-drop is just too huge currently (tested with trees with 300-500 triangles).

Re: [Gadget] Replace spring default trees with random feature

Posted: 28 Nov 2011, 20:03
by Forboding Angel
I already tried that JK, but I didn't have any luck. Moreover, I would like to replace the engine trees with a slew of randomized trees instead of a single model.

@jools, you need to have another look at this: http://code.google.com/p/spring-feature ... 2Ffeatures

Re: [Gadget] Replace spring default trees with random feature

Posted: 29 Nov 2011, 00:12
by Jools
Cool, a repository of 3rd party features to use. That's all nice, but I'm already using those AD0 trees.

I needed to work a lot more with them though, mainly scale them better and make their hitspheres cylindrical (cylY). I also added a featuredead tag and made them non-blocking.

So what's missing still is the fire gadget and an animation when they are demolished (but I guess that's not so important). I'm still working on the fire gadget.

My concern, and this was what I meant with my previous post, is that if we take a feature that's not a tree and make a tree of it, then spring doesn't anymore know that it's a tree, and all those things have to be made from scratch.

Re: [Gadget] Replace spring default trees with random feature

Posted: 29 Nov 2011, 00:18
by jK
Forboding Angel wrote:Moreover, I would like to replace the engine trees with a slew of randomized trees instead of a single model.
There are like 20 different treedefs, you can give each one a diff model.

Re: [Gadget] Replace spring default trees with random feature

Posted: 29 Nov 2011, 00:41
by Forboding Angel
Yes, but all of them are so similar (there are only 2 distinct types) that most of us just picked one and used that one all over the entire map.

Re: [Gadget] Replace spring default trees with random feature

Posted: 29 Nov 2011, 00:43
by smoth
Much of that belongs in game logic(as in ba or whatever) not thrust upon all projects

Re: [Gadget] Replace spring default trees with random feature

Posted: 29 Nov 2011, 02:35
by Forboding Angel
smoth wrote:Much of that belongs in game logic(as in ba or whatever) not thrust upon all projects
Well... duh. :roll:

It's worth noting that your trees (the ones I used in riverdale) would make nice low poly replacements.

@jk, is there any chance you could point me towards the feature names for these 20 or so engine trees?

Re: [Gadget] Replace spring default trees with random feature

Posted: 29 Nov 2011, 02:59
by jK

Code: Select all

-- $Id$

local DRAWTYPE = { NONE = -1, MODEL = 0, TREE = 1 }

local treeDefs = {}

local function CreateTreeDef(type)
  treeDefs["treetype" .. type] = {
     description = [[Tree]],
     blocking    = true,
     burnable    = true,
     reclaimable = true,
     energy      = 25,
     damage      = 5,
     metal       = 0,
     reclaimTime = 25,
     mass        = 20,
     drawType    = DRAWTYPE.MODEL,
     object      = ((type%4<1)and('tree0.s3o'))or((type%4<2)and('tree1.s3o'))or((type%4<3)and('tree2.s3o'))or('pine.s3o'),
     footprintX  = 2,
     footprintZ  = 2,
     collisionVolumeTest = 0,

     customParams = {
       mod = true,
     },
  }
end

for i=0,20 do
  CreateTreeDef(i)
end

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

return lowerkeys( treeDefs )

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

Re: [Gadget] Replace spring default trees with random feature

Posted: 29 Nov 2011, 06:35
by MidKnight
*golf clap*

Re: [Gadget] Replace spring default trees with random feature

Posted: 29 Nov 2011, 12:23
by Jools
So no matter which tree is chosen, they have same parameters with regard to:

Code: Select all

height
mass
damage
featureDead
collisionVolumeScales
Some of these trees are bigger, some are small shrubbery. Those paramewters need to be set based on which tree is placed imo.