Suspension script - Page 2

Suspension script

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

You should be able to approximate atan(s1, N) with s1/N for small s1.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

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.


The script is unquestionably awesome, however.
I agree 100%.

p.s. ZOMG NEMO IS BACK! :-)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

good stuff zpock, would you mind adding this into the moder resource thread so it is there for all content developers in the future?
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

What about on jeeps and tracked vehicles?
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

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.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

if its otpimised i reckon it'll be alright, its not like theres ever that many tanks ingame at once in 1944 (at least in the alpha)
[KnoX]ElementalGizmo
XTA Developer
Posts: 266
Joined: 24 Aug 2006, 01:33

Post by [KnoX]ElementalGizmo »

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 :mrgreen:
User avatar
Boirunner
Kernel Panic Co-Developer
Posts: 811
Joined: 05 Feb 2007, 14:24

Post by Boirunner »

This is ridiculously cool. Quantum, you know what to do. I want bouncing Jeffies!
User avatar
rcdraco
Posts: 781
Joined: 22 Nov 2006, 02:50

hmm

Post by rcdraco »

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.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Re: hmm

Post by Zpock »

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.
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.

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.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

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.
Aren't repulsorlifts hovers anyway? Surely they'll follow the terrain if you set UPRIGHT to 0;
User avatar
rcdraco
Posts: 781
Joined: 22 Nov 2006, 02:50

Post by rcdraco »

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:
Zpock wrote:I tries putting in 100 units at the same time or so and noticed no more lag then usual.
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.
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

Post by Felix the Cat »

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:
Zpock wrote:I tries putting in 100 units at the same time or so and noticed no more lag then usual.
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.
The point is, if it takes too much CPU it will neither look nor run good, and people will care.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

i think his point was that
a) it isnt actually that bad on cpu as it is
b) its still to be optimized
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

Post by Felix the Cat »

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.
User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Post by yuritch »

Zpock wrote:...But the problem here is that the number of pieces start getting too high. I think theres a 31 piece limit even.
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.
User avatar
Boirunner
Kernel Panic Co-Developer
Posts: 811
Joined: 05 Feb 2007, 14:24

Post by Boirunner »

Felix the Cat wrote: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.
Yes, this makes perfect sense.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

say what?
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

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.
Post Reply

Return to “Game Development”