Developer Preview: NanoBlobs 0.50b (link added)

Developer Preview: NanoBlobs 0.50b (link added)

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Developer Preview: NanoBlobs 0.50b (link added)

Post by Argh »

Spring Developers, Mod Teams:

This is the current build of NanoBlobs: 0.50b. Included in this release are new template files for building Armorclasses in a simple way, custom Explosion Generators using the current (to-be-replaced-soon) code, and (most importantly to Spring developers) all units have been "Epic-sized", and all of the smaller types have had their Death Events removed, so that only the Custom Explosion events occur.

Please do not bother me about game-balance, etc. This is not meant to be a polished release at this time- it's mainly a demonstration of a few points which will hopefully lead to improvement of the game engine's fundamentals. Some of the following whining/complaints are fairly sharp, but please don't take it personally, devs... I've built this version of the mod pretty much for you guys to see some things that are less clear with other game designs. This version's still compatible with NTAI.

FPS DROP / LAG

1. Previous controversial posts have gone back and forth about the speed of rendering S3O objects, and many players have complained about NanoBlobs and lag. My final test results indicate that sheer drawing speeds are not the main cause of lag. Instead, there are several notable causes that playing this release side-by-side with the previous official release will amply demonstrate:

A. EXPLODE events are a very noticable cause of lag. This is, in large part, because the default Spring explosions, smoke FX, etc., are not very well optimized, and also I strongly suspect there's a bug in the physics code somewhere. Taking them out helped to stablelize NanoBlobs framerate. The biggest culprits are FALL events. Those that generate smoke are also quite lag-inducing. As my custom Explosions should show, it is simply unnecessary to have 30+ particles per event and still look pretty good. Hopefully we will soon have the ability to name custom Explosions from COB/BOS soon somehow (maybe by invoking the BITMAP1, BITMAP2, etc. variables).

B. Pathfinding is a major part of lag. As Smoth and others have pointed out, the ability of units to "nudge" one another out of the way causes quite a few needless path re-calculations.

C. Having explosions that do not reach their targets immediately is both laggy and an entirely unnecessary bit of extra chrome. It makes high Rate-Of-Fire weapons less practical, but really does nothing very useful for large-area-effect weapons, except to make them less effective. I would have to vote that this part of Spring's code be permanently removed, now that EdgeEffectiveness is being put in.

D. Beamlasers have very bizarre performance characteristics. I would like to know how many times per second they actually fire, since it's now quite clear that they do not actually fire on a continuous basis, nor does the depicted position of the beam actually match the impact events. Moreover, the multiple impacts are each assigned their own explosion events, which increases lag. My vote on this is that Beamlasers be just a visual effect- let modders determine the true rate of fire, accuracy, etc. As it is, we get the worst of all worlds- we get a visual effect that has certain hard-coded parameters with implications for both lag and gameplay.

E. Guided weapons cause a surprisingly large amount of lag. One of the major causes (and a personal pet peeve) is that you cannot have a guided weapon without Smoketrail=1 :P Please remove that arbitrary limitation... Guided=1 and Turnrate=!0 should be more than enough. Smoketrails are special effects... they should not be mandatory.

F. Lastly, there is something out there that is still causing the game to lag more and more at endgame, even with CPU loads under 60% (the highest CPU load I have ever seen, with NTAI playing against me and 600+ units). My guess is a very large part of this is the fact that unit death explosions STILL CAUSE CRATERS, which even on maps with near-infinite Hardness... still results in microscopic changes to the map's true coordinates. Guys... Explosions with an ImpulseFactor of 0 should not cause any cratering, period, no matter what the source! It's pretty vital to engineering game designs involving hundreds of actors without causing big pathfinding problems and lots and lots of lag. If I want something to cause a crater, I should have that choice- and vice-versa.

However, I suspect there's something else out there that is causing a problem. I can't put my finger on it, though, so maybe I'm just chasing phantoms. But after Epic-sizing everthing to make pathfinding much less laggy, I was pretty underwhelmed with the final results, which were much less impressive than I'd hoped. In theory, according to what I've read in the sourcecode, what I did (I resized every unit by 1/2 or 1/4, and scaled their Footprints to the nearest 1) should have resulted in pathfinding improvements of almost an order of magnitude. Sadly, this is not the case, at all. While making the Footprints of a large percentage of the units 1/1 did reduce the number of outright collisions quite a bit, it didn't result in nearly the improvement I was hoping for.


Other Test Results / Oddities

1. Setting a Tolerance of 0 for a weapon results in a weapon that never finishes aiming. Ever. Even if the weapon can turn so quickly that it should get a "lock" result during the same frame that the firing event is checked. This seems a bit problematic, but is mainly just an oddity.

2. Setting anything but the Base / first Parent object as the Sweetspot for a unit does not work correctly. This seems to make Spring create a new hitsphere for the selected Sweetspot object on-the-fly, which is usually tiny, instead of having the weapon aimed at the Sweetspot but still using the S3O's main hit-detection sphere. Very odd, and it makes "spoofing" units with Sweetspot-moving code, which was a popular trick with OTA units, impossible.

3. Using areaeffects under 16 units often results in hits not really being registered correctly. I strongly suspect this is because of the "delayed-effect explosion" code. As I have stated above, I would strongly prefer that it was removed entirely- it is a significant cause of lag without strong gameplay benefits of any kind.

4. The volume/distance of weapon sounds is ENTIRELY determined by the default damage value. This makes zero sense, but it was easily worked around. For the first time since 0.62, NanoBlobs actually has sounds that work correctly... until the next version breaks it again, no doubt ;)

5. No setting I tried had any effect on the size of the Flamethrower projectile. This is too bad, but based on what I've been reading on SVN, it doesn't matter-we're about to see a quantum leap forward in the graphical quality of projectiles :)

6. Flying units move to the centerpoint of the S3O from which they are built, when they take off after being constructed, instead of obeying their Cruisealt values. This looks like some sort've dirty-and-fast workaround, should be easily fixed.

7. Setting every unit with a MyGravity of 10 entirely removes the infamous "floating but untouchable units" phenomenon that I have seen with NanoBlobs since the beginning.

Umm... I think that's about it for now... more results after I've looked into some other things.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

/me wants to see the list of changes for the new version, too see the quantum leap in projectile graphics.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

<shrugs> check the SVN and see what's in there... I am very eagerly awaiting the chance to get my hands on a compiled version that includes the new projectile code.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Argh, go into the mapping forum and download jelmers binary for testing the new map format, its not a binary showing the new map format it's the latest svn build with the new map format

beam lasers have flares at their exit points
bolt lasers have a glowing centre

Among other things.
Last edited by AF on 29 Jul 2006, 20:57, edited 1 time in total.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

I need to figure out how to compile SVN :P

Can I compile that with MS Visual Studio 6.0?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

No, you need visual studio express
And it's a very long road :)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Jelmer already ahs a compiled binary in the mapping forum.

Just download extract and run.


And Visual studio 6 wont work, you should really uninstall it and upgrade as it lacks the template support that most mdoern compilers have.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

@JC: I've been down all the other long roads around here at this point ;) At least I'd be able to keep up with commits and actually be able to build content as features come into play. It seems kind've silly waiting for months before then having to rush at the last second to look at content-creation problems, and the things in this next release are very, very important to Project Two.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Well get visual studio express 2005 anyways, that year of being available with a free licence is going to end soon, and when combined with windows platform sdk and directx9 sdk it's as useful as a full version of VS 2005 Pro
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Gcc (or derivatives) won't work?
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Argh wrote:the things in this next release are very, very important to Project Two.
And there was me thinking it were dead. I still have those models by the way
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

No, it's not at all dead. I went on vacation last week, and got a lot of the concept sketches done, actually. It's just been slow going, and I've been wanting to see if certain engine features would get done, too.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Feel free to send the odd concept my way. Just one or two though, I've got work with BFF to do
User avatar
FireCrack
Posts: 676
Joined: 19 Jul 2005, 09:33

Post by FireCrack »

C. Having explosions that do not reach their targets immediately is both laggy and an entirely unnecessary bit of extra chrome. It makes high Rate-Of-Fire weapons less practical, but really does nothing very useful for large-area-effect weapons, except to make them less effective. I would have to vote that this part of Spring's code be permanently removed, now that EdgeEffectiveness is being put in.
I'd rathe have it definable on a per-weapon basis, for very large explosions it can make them seem alot better.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

<shrugs> if it's optional, I'd be fine with it. I'm fine with almost anything, so long as it's optional ;)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

@argh, check joor pms.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Did, many thanks 8)
Yeha
Posts: 96
Joined: 13 Aug 2004, 19:12

Post by Yeha »

Some comments on a few points.

A. Large smoke clouds can generate a lot of overdraw and cause slowdown if you don't have a lot of fillrate. You can use the max particle count setting to reduce particles or replace the default effects with something from the explosiongenerator.

B. Nudging doesn't make the unit recalculate the path.

C. Having expanding explosions shouldn't generate any extra lag, if anything they spread out the load during multiple frames.

F. There are other things that can generate slowdowns without the cpu load showing high values. Large graphical effect that slows down the GPU, or maybe the AI is using some cpu cycles. You can use the B button to see what spring code is using most CPU.

1. Having a tolerance of 0 would require a weapon with infinit accuracy to lock on to a target, and there is no such thing.

2. Setting any sweetspot object is from what i know not suported in spring and should have no effect.

3. Weapons with area of effect below 16 should register correctly if its a direct hit, it is a very small area though so units receiving area damage might not hapen often.

4. This is indeed true, next version will have soundstartvolume and soundhitvolume tags.

5. Next version will have a size tag.

6. As far as i can tell units dont behave anything diferently when finished builded, can you explain in some more detail what happens?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

F. There are other things that can generate slowdowns without the cpu load showing high values. Large graphical effect that slows down the GPU, or maybe the AI is using some cpu cycles. You can use the B button to see what spring code is using most CPU.
As you will very quickly see if you fire up this NanoBlobs version and play against NTAI in SpringSP (my standard test setup) Sim Time is the chief thing eating up processor time. What's very weird is that I don't see processor use go over 55% or so, yet see lots of spiking slowdowns on the FPS end. Even under early game conditions (which, this being NanoBlobs, may involve 5-10 things on each side, duking it out, constantly) I'll see significant FPS swoops, suggesting that something is taking a big bite out've processor time. Previous to working on this build for the last two weeks, I would've told you guys that it was "pathfinding" or "S3O drawing performance", but these statements are clearly wrong, which is why I cleaned up this build enough for you guys to see for yourselves.

As for GPU vs. CPU... well, here's my current result with a GeForce 7800 (AGP) with 500 units, at 1600/1200, pretty minimal settings (although Unit and Terrain LOD are at max, 3D Trees and reflections are all on) and (obviously) max zoom. I don't even wanna think about how many (nearly invisible) polygons must be rendering here:

Image

And yes, the units in this screen are still pathfinding, moving, animating... etc. The big lag occurs when combat is going on. What's very interesting is that it's now that I've eliminated the causes of the default explosions and the general overkill on particle effects (which did help quite a bit) I'm still left with a lot've lag. Guided weapons are one definate cause. I don't think that scripted aiming behavior is causing much slowdown. Beamweapons seem to cause some lag, but not a lot. Multifire weapons, like flamethrowers, which you'd think would be painfully slow because of the RGB shift stuff... really don't seem to faze Spring at all. Therefore I'm left with very few things that could be culprits, because as the screenshot above should show everybody, its NOT sheer unit-count. While that does matter... it's not as crippling as one would think.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Yeha wrote:C. Having expanding explosions shouldn't generate any extra lag, if anything they spread out the load during multiple frames.
It's not faster to check which points are inside a hollow circle than which are in a filled circle, both will require ||unit_position - explosion_position||, except one only checks if it's smaller than the radius while the other also checks if it's larger than the inner radius. You still do a distance check per frame. Never mind that expanding explosions keep damaging the units inside.
3. Weapons with area of effect below 16 should register correctly if its a direct hit, it is a very small area though so units receiving area damage might not hapen often.
Should, yes. Does, no. I've had problems in CvC with drone missiles hitting other drones and not doing damage. This was the most prominent with friendly fire, i.e. friendly drones running in front of the missile drones and "catching" the missiles.
Post Reply

Return to “Engine”