Suspension script
Moderator: Moderators
I have an idea for making the tracks themselves animated as well. The basic idea is to split the track in segments between the wheels. But the problem here is that the number of pieces start getting too high. I think theres a 31 piece limit even. Then there's also the problem to combine this with doing hide/show displaced UV:s...
To solve this, I think can be done this way:
1:Combine one wheel with one segment of track.
2:Make these pieces switch sides every frame.
3:Displace the UV:s so it looks like the wheels are turning and the track is moving, as left and right side switch around.
4:Make the wheel+track turn to make it adjust to slopes, this requires an ATAN. However, I think it might be possible to optimize by checking if the angle is big, and if it's not, just make an approximation.
Hopefully I can get this idea to work and we'll have really amazing tank tracks.
To solve this, I think can be done this way:
1:Combine one wheel with one segment of track.
2:Make these pieces switch sides every frame.
3:Displace the UV:s so it looks like the wheels are turning and the track is moving, as left and right side switch around.
4:Make the wheel+track turn to make it adjust to slopes, this requires an ATAN. However, I think it might be possible to optimize by checking if the angle is big, and if it's not, just make an approximation.
Hopefully I can get this idea to work and we'll have really amazing tank tracks.
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
-
- XTA Developer
- Posts: 266
- Joined: 24 Aug 2006, 01:33
Beautiful dude, i always envied the suspension of the C&C Generals game on some of there units. It really does breath life into the animation, its nice to see units interact with the terrain bar speed for a change
Even if this script is so expensive CPU wise it would be worth it to see it used on just a small number of units, like the Jeffy in XTA, there not used that much but due to attention drawn to them by micro ur work would be highly appreciated

Even if this script is so expensive CPU wise it would be worth it to see it used on just a small number of units, like the Jeffy in XTA, there not used that much but due to attention drawn to them by micro ur work would be highly appreciated

hmm
Would it be o.k. for me to borrow this per say, is that what your putting across? This would be neat in a few units I'm working on, just to mess around with.
Guess what, we officially beat Supreme Commander, this script is just awesome. Spring doesn't have the best graphics, but heck this is just awesome.
Guess what, we officially beat Supreme Commander, this script is just awesome. Spring doesn't have the best graphics, but heck this is just awesome.
Re: hmm
In light of recent legal analism around here, yes this is to be considered public domain or whatever, free for all. Hopefully I can put up something more refined soon.rcdraco wrote:Would it be o.k. for me to borrow this per say, is that what your putting across? This would be neat in a few units I'm working on, just to mess around with.
Guess what, we officially beat Supreme Commander, this script is just awesome. Spring doesn't have the best graphics, but heck this is just awesome.
As for graphics and supcom, we are many working on that, to name a few: swta, s44 whatever argh is upto, CA.. all very interesting upcoming things.
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
The way the body of the unit responds to the ground below is quite nifty. I'd imagine you might be able to cut out much of the CPU stress if you put this script on say, a repulsorlift tank in SWS, so that it looks a little more alive when it is moving along the ground by responding to the terrain below, but without the CPU usage that is required to run the wheels.
Aren't repulsorlifts hovers anyway? Surely they'll follow the terrain if you set UPRIGHT to 0;Warlord Zsinj wrote:The way the body of the unit responds to the ground below is quite nifty. I'd imagine you might be able to cut out much of the CPU stress if you put this script on say, a repulsorlift tank in SWS, so that it looks a little more alive when it is moving along the ground by responding to the terrain below, but without the CPU usage that is required to run the wheels.
Nemo wrote:You're welcome to try applying it to a 44 tank, but I don't think we can afford the CPU cost of putting it on all our tanks, so I doubt it'll be used in a release.
Zpock wrote: I did a quick test, spawning 100 guys running around on victoria crater in the middle (no pathing issues) and scripts shows 15% CPU usage. I definitly think that it can be optimized a lot:
Ok, 15% isn't bad saying that I am running at 25% pretty often. As I usually say, I see no issue here, because if it looks cool, 96% of the people won't care how much CPU it takes. If it looks and runs good they don't care.Zpock wrote:I tries putting in 100 units at the same time or so and noticed no more lag then usual.
- Felix the Cat
- Posts: 2383
- Joined: 15 Jun 2005, 17:30
The point is, if it takes too much CPU it will neither look nor run good, and people will care.rcdraco wrote:Nemo wrote:You're welcome to try applying it to a 44 tank, but I don't think we can afford the CPU cost of putting it on all our tanks, so I doubt it'll be used in a release.Zpock wrote: I did a quick test, spawning 100 guys running around on victoria crater in the middle (no pathing issues) and scripts shows 15% CPU usage. I definitly think that it can be optimized a lot:Ok, 15% isn't bad saying that I am running at 25% pretty often. As I usually say, I see no issue here, because if it looks cool, 96% of the people won't care how much CPU it takes. If it looks and runs good they don't care.Zpock wrote:I tries putting in 100 units at the same time or so and noticed no more lag then usual.
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
- Felix the Cat
- Posts: 2383
- Joined: 15 Jun 2005, 17:30
100 guys running around with the script equalling 15% CPU load tells us nothing.
We'd need to know what 100, say, Flashes running around would be.
If 100 Flashes equals 12% CPU load, the script is fine... but if 100 Flashes equals 3% CPU load then there's trouble because the script quintuples CPU load.
That would (roughly) mean that, if 100 Flashes running around yields me a 10% CPU load (not unrealistic), the script would make me lag the game heavily (150% CPU load @ 1.00 speed).
Obviously this isn't an exact science, but you get what I'm saying in a general sense.
We'd need to know what 100, say, Flashes running around would be.
If 100 Flashes equals 12% CPU load, the script is fine... but if 100 Flashes equals 3% CPU load then there's trouble because the script quintuples CPU load.
That would (roughly) mean that, if 100 Flashes running around yields me a 10% CPU load (not unrealistic), the script would make me lag the game heavily (150% CPU load @ 1.00 speed).
Obviously this isn't an exact science, but you get what I'm saying in a general sense.
There certainly isn't. I once made a unit that had 128 pieces (and 128 IS the limit, not of Spring, but of 3DO Builder which I used to assemble that unit), and that unit worked fine in Spring.Zpock wrote:...But the problem here is that the number of pieces start getting too high. I think theres a 31 piece limit even.
It's 15% of the total amount used, not that the CPU is running at 15% of max capability. Press 'b' in spring and you will get what I mean. With the new script I'm working on, it's down to 12%, and that one has 10 wheels (the t-34).
About the piece limit, I got cob runtime errors with 32 pieces, but not with 31, "invalid piecenum" or something like that.
About the piece limit, I got cob runtime errors with 32 pieces, but not with 31, "invalid piecenum" or something like that.