Gmz1013@Posted: Mon May 19, 2008 2:52 am :
Something just popped into my head. Could doom 3 Take on the command and conquer games? not in the sense of a RTS, but in the sense of the Tiberium in the games. Would it be possible to make a crystal that spreads through out a designated area in a map?



rich_is_bored@Posted: Mon May 19, 2008 6:20 am :
Sure. The general idea would be to create a new entity that used a custom script object to spawn new instances of itself. The challenge is in how you keep the entity count from exceeding 4096 and how you determine where to spawn each entity.

I'm not sure how to keep it from exceeding the entity cap unless you give each crystal a set lifetime but it's not a pressing issue that you can't revist later.

The more challenging issue is determining where to spawn each crystal. I think the best way to do that would be to launch a projectile with a small amount of force and perform a trace to wherever it detonates. Keep in mind this projectile doesn't have to be something visible.

Because your not using a lot of force to launch the projectile, you can be certain that it's going to hit something closeby. And you can use the information supplied by a trace to determine if it hit "worldspawn" which would be map geometry and the surface normal which would be the direction the crystal should face when growing outward.

Keeping it isolated to a designated area might prove difficult but you may be able to stop it from spreading by using a clipping texture to catch stray projectiles.

Then there are a lot of artistic issues to work out. How do you want to handle "growing"? Do you want them to emit green light? Each of these questions could pose new technical problems.

Of course, keep in mind I'm just brainstorming here. These aren't instructions so you'll need to perform extensive testing just to see if the idea would work in practice.



The Happy Friar@Posted: Mon May 19, 2008 6:58 am :
what if it's done with an already made 3d mesh & a texture that "grows" from transparent to visible? if you want something bad to happen when you touch it you can have a trigger_hurt grow with it.

if you want to customize the crystal for each map & use rich's way, an easy way to avoid the entity limit is it make the whole crystal in a 3d app then break it down to smaller sections. then as it grows you remove tiny sections & replace whole patches of crystals with a bigger model. Then bigger, etc. until the entire thing is one big crystal.

rich's way would allow dynamic crystal growth though. In fact, if you can make a func_static out of a group of func_static's then you could dynamically spawn them like rich said & use a script to re-make them in to one big entity.

to make them spawn: growing off rich's idea, you could make a new entity but instead of it shooting it "rains" down on the ground. where it touches it spawns a random crystal. how do you know if it touches? that's the hard part... you could check it's Y velocity every frame, when it's under a threshold, spawn crystal & remove. don't collide with anything but a clip brush.

But I include another issue: getting a "rain cloud" that grows like you want. could be done 100% by scripting but I'd prefer some random ability to it myself.

again, going off rich's idea, if it's in a script a while loop can be used to control how long it grows for. if you want it for X time.



just1n@Posted: Sun Aug 24, 2008 8:09 pm :
Hm, I actually like this idea a lot.

I am going to attempt it and see what I can get out of it.



Gmz1013@Posted: Sun Aug 24, 2008 8:12 pm :
i'm still working on making the crystals for this (i suck at 3d programs)



Gmz1013@Posted: Mon May 19, 2008 2:52 am :
Something just popped into my head. Could doom 3 Take on the command and conquer games? not in the sense of a RTS, but in the sense of the Tiberium in the games. Would it be possible to make a crystal that spreads through out a designated area in a map?



rich_is_bored@Posted: Mon May 19, 2008 6:20 am :
Sure. The general idea would be to create a new entity that used a custom script object to spawn new instances of itself. The challenge is in how you keep the entity count from exceeding 4096 and how you determine where to spawn each entity.

I'm not sure how to keep it from exceeding the entity cap unless you give each crystal a set lifetime but it's not a pressing issue that you can't revist later.

The more challenging issue is determining where to spawn each crystal. I think the best way to do that would be to launch a projectile with a small amount of force and perform a trace to wherever it detonates. Keep in mind this projectile doesn't have to be something visible.

Because your not using a lot of force to launch the projectile, you can be certain that it's going to hit something closeby. And you can use the information supplied by a trace to determine if it hit "worldspawn" which would be map geometry and the surface normal which would be the direction the crystal should face when growing outward.

Keeping it isolated to a designated area might prove difficult but you may be able to stop it from spreading by using a clipping texture to catch stray projectiles.

Then there are a lot of artistic issues to work out. How do you want to handle "growing"? Do you want them to emit green light? Each of these questions could pose new technical problems.

Of course, keep in mind I'm just brainstorming here. These aren't instructions so you'll need to perform extensive testing just to see if the idea would work in practice.



The Happy Friar@Posted: Mon May 19, 2008 6:58 am :
what if it's done with an already made 3d mesh & a texture that "grows" from transparent to visible? if you want something bad to happen when you touch it you can have a trigger_hurt grow with it.

if you want to customize the crystal for each map & use rich's way, an easy way to avoid the entity limit is it make the whole crystal in a 3d app then break it down to smaller sections. then as it grows you remove tiny sections & replace whole patches of crystals with a bigger model. Then bigger, etc. until the entire thing is one big crystal.

rich's way would allow dynamic crystal growth though. In fact, if you can make a func_static out of a group of func_static's then you could dynamically spawn them like rich said & use a script to re-make them in to one big entity.

to make them spawn: growing off rich's idea, you could make a new entity but instead of it shooting it "rains" down on the ground. where it touches it spawns a random crystal. how do you know if it touches? that's the hard part... you could check it's Y velocity every frame, when it's under a threshold, spawn crystal & remove. don't collide with anything but a clip brush.

But I include another issue: getting a "rain cloud" that grows like you want. could be done 100% by scripting but I'd prefer some random ability to it myself.

again, going off rich's idea, if it's in a script a while loop can be used to control how long it grows for. if you want it for X time.



just1n@Posted: Sun Aug 24, 2008 8:09 pm :
Hm, I actually like this idea a lot.

I am going to attempt it and see what I can get out of it.



Gmz1013@Posted: Sun Aug 24, 2008 8:12 pm :
i'm still working on making the crystals for this (i suck at 3d programs)



Gmz1013@Posted: Mon May 19, 2008 2:52 am :
Something just popped into my head. Could doom 3 Take on the command and conquer games? not in the sense of a RTS, but in the sense of the Tiberium in the games. Would it be possible to make a crystal that spreads through out a designated area in a map?



rich_is_bored@Posted: Mon May 19, 2008 6:20 am :
Sure. The general idea would be to create a new entity that used a custom script object to spawn new instances of itself. The challenge is in how you keep the entity count from exceeding 4096 and how you determine where to spawn each entity.

I'm not sure how to keep it from exceeding the entity cap unless you give each crystal a set lifetime but it's not a pressing issue that you can't revist later.

The more challenging issue is determining where to spawn each crystal. I think the best way to do that would be to launch a projectile with a small amount of force and perform a trace to wherever it detonates. Keep in mind this projectile doesn't have to be something visible.

Because your not using a lot of force to launch the projectile, you can be certain that it's going to hit something closeby. And you can use the information supplied by a trace to determine if it hit "worldspawn" which would be map geometry and the surface normal which would be the direction the crystal should face when growing outward.

Keeping it isolated to a designated area might prove difficult but you may be able to stop it from spreading by using a clipping texture to catch stray projectiles.

Then there are a lot of artistic issues to work out. How do you want to handle "growing"? Do you want them to emit green light? Each of these questions could pose new technical problems.

Of course, keep in mind I'm just brainstorming here. These aren't instructions so you'll need to perform extensive testing just to see if the idea would work in practice.



The Happy Friar@Posted: Mon May 19, 2008 6:58 am :
what if it's done with an already made 3d mesh & a texture that "grows" from transparent to visible? if you want something bad to happen when you touch it you can have a trigger_hurt grow with it.

if you want to customize the crystal for each map & use rich's way, an easy way to avoid the entity limit is it make the whole crystal in a 3d app then break it down to smaller sections. then as it grows you remove tiny sections & replace whole patches of crystals with a bigger model. Then bigger, etc. until the entire thing is one big crystal.

rich's way would allow dynamic crystal growth though. In fact, if you can make a func_static out of a group of func_static's then you could dynamically spawn them like rich said & use a script to re-make them in to one big entity.

to make them spawn: growing off rich's idea, you could make a new entity but instead of it shooting it "rains" down on the ground. where it touches it spawns a random crystal. how do you know if it touches? that's the hard part... you could check it's Y velocity every frame, when it's under a threshold, spawn crystal & remove. don't collide with anything but a clip brush.

But I include another issue: getting a "rain cloud" that grows like you want. could be done 100% by scripting but I'd prefer some random ability to it myself.

again, going off rich's idea, if it's in a script a while loop can be used to control how long it grows for. if you want it for X time.



just1n@Posted: Sun Aug 24, 2008 8:09 pm :
Hm, I actually like this idea a lot.

I am going to attempt it and see what I can get out of it.



Gmz1013@Posted: Sun Aug 24, 2008 8:12 pm :
i'm still working on making the crystals for this (i suck at 3d programs)