Discrete nanoparticles

Discrete nanoparticles

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

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Discrete nanoparticles

Post by KDR_11k »

I'm not sure if everybody knows this already but here it goes:

Spring thinks it runs at 32 frames per second (actually 30 but that's another discussion). The minimum interval between two consecutive events is 1 frame or 1/32 of a Spring second. Nanospray is spawned once per frame if sudfficient ressources are available. A nanoparticle always costs the same to make for a construction and always contributes the same to the construction. That means if the buildtime of a unit is not an integral multiple of the builder's workertime divided by 32 the construction costs more than the fbi says it does. For many mods that rounding error is of no consequence but for some it could be important (e.g. if you have a fixed ressource allocation for a given time and want to make sure that allocation covers exactly a set of built units).

This means that if you need there to be zero overpaying you should set your workertimes to integral multiples (or fractions) of 32 and similarily set the build times. If you want something to be built in one frame (i.e. instantly) make sure it takes exactly 1/32 of the workertime to build, using e.g. 1/100 would mean it costs a lot more than it should. If something needs less than one nanoparticle to be finished (whether that's the whole construction or just the last bit of it) you still pay for the whole nanoparticle.
bwansy
Posts: 385
Joined: 02 May 2006, 05:21

Post by bwansy »

Does it mean that the nano-particles are not merely visual effects, and that the resouces are not transfered directly to the nano-cloud, but instead, the resource is used for making nano-particles, and the nano-cloud receives the resource when being hit by the nano-particles?
chlue
Posts: 101
Joined: 28 Dec 2005, 20:48

Post by chlue »

Fly with a damaged plane over a nanotower on patrol. They plane will get the repair instant and the particleflow is only a visual effect.

I understand KDR_11k is saying, that the generated amout is quantized. The effect will still apply instant.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

bwansy wrote:Does it mean that the nano-particles are not merely visual effects, and that the resouces are not transfered directly to the nano-cloud, but instead, the resource is used for making nano-particles, and the nano-cloud receives the resource when being hit by the nano-particles?
no, in gundam units are built by the whitebase before particles ever arive.
User avatar
Decimator
Posts: 1118
Joined: 24 Jul 2005, 04:15

Post by Decimator »

The construction appears to be applied when the nanoparticle is created. If you want to see it in action, try forcing a stall and then building something with the commander.
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

You know, i was using multiples of 32 for everything when i first started messing with mods. Force of habit. Then i just started using rounded numbers since i figured there wasnt any point. I guess i should have stuck to old habits.
the nano-cloud receives the resource when being hit by the nano-particles?
No. The nanoparticles themselves dont do anything. Resources are received instantly by the nanoframe. Just happens that nanoparticles correspond to the rate at which the 'packets' of resources are sent. Its really these instantly recieved packets which KDR is talking about.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

Decimator wrote:The construction appears to be applied when the nanoparticle is created. If you want to see it in action, try forcing a stall and then building something with the commander.
I would say that is true but what about factories with multiple nanolathes? For example the federation level1 has 2 and the zeon level1 has one. However, this gives no construction speed boost. I personal know it is just a graphical effect as I have disabled them in the past.

I think what kdk is trying to say is just the emission rate. I am not sure what in particular he is getting at.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Mostly the rounding errors, I've been wondering in the past how much of the ressources a builder drains go into each chunk and why some units cost 51 instead of 50 as they should, etc.

Aren't multiple nanolathes just one beam that gets emitted from a different piece each frame?
bwansy
Posts: 385
Joined: 02 May 2006, 05:21

Post by bwansy »

I see. Thanks everyone for telling me about it. I haven't played Spring for quite some time.
About the problem, is it like you buy something for, say, $3.56, no change, but you only have 1 dollar bills so that you are forced to pay $4? And does this rounding error happen at the end of the construction or does it happen every second?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

I think it only happens at the end but if you're using numbers that are hard to divide you may end up with a large accumulated error due to float accuracy, too.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

When resources are taken away a nanoparticle is emmitted. The nanoparticle doesnt cost anything, but rather its showing that the transaction took place.

And since nanoparicle speed is regardlesss of how quickly you build, buildings will finish before the particles reach them.
User avatar
Yatta
Posts: 55
Joined: 13 Aug 2006, 17:18

Post by Yatta »

Im doing a mod where units are instantly built for a certain ammount of metal.

Ive met a problem with the settings of the factory building those units.
If you set the factory WorkerTime to a high value, and the unit to be built dont cost much, the "nano chunks" sent will cost more metal than used for the unit.

I could somewhat attenuate this effect by tweaking workertime of the factory and Buildtime of the units, but theres still some metal spent.

Also, when you're out of metal, and its slowly refilling, the builder/factory wont continue building until the "minimum metal ammount to spray nanolathe" is reached. I guess workertime and this "minimal ressources ammount" are linked.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

As I said, the minimum amount is the size of one chunk and one chunk is 1/32 of the workertime. Dozerz has instant building and by using a workertime of 32 with a buildtime of 1 it charges exactly the right amount.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Interesting. I'll have to incorporate that fix into NanoBlobs, among other things. Now that I think about it, it's probably one of the things causing the economic sim to behave so bizarrely... hmm...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

also, if your factory builds the untis at a rate of 1 per secondand you add a builder ot assist, that builder will till consume resources and the unit will not build faster.

A unit is built every 32 frames. Any more builders you add will be a waste of time and resources.

For proof, use .nocost and look at the build speed, they popout and second intervals, when they have zero buildtime and cost.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Is that one second interval really between beginning of constructions or between the end of one and the beginning of the next construction? Also what about the time to clear the factory yard?
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

Most OTA constructors have a 'unpacking' time anyway. They waste ages getting their nano thingy out and dont start consuming resources until they do.

Surely if you assisted instant construction with an OTA based con, he wouldnt even open up in time to help.
Post Reply

Return to “Game Development”