Jump to content

Option for custom resources to be "granular" & transferrable in discrete quantities


Recommended Posts

An exceptionally minor suggestion, but one which may be useful in the future:

Currently, most resources in KSP are defined as fluids (liquids/gases) that can be transferred via pumps. What I'd also like to see someday is the ability to specify resources that are transferred in cardinal amounts per unit time.

For instance:

RESOURCE_DEFINITION
{
name = SomeLifeSupportMod_CrewProvisions
density = 0.5
flowMode = STACK_PRIORITY_SEARCH
transfer = [B]DISCRETE // New option for existing "transfer = " parameter; DISCRETE means to transfer at the fixed rate specified in "transferRate = "
transferRate = 5[/B] [B]//[/B] [B]New[/B][B] parameter; units of resource to transfer per secound (i.e. 5 SomeLifeSupportMod_CrewProvisions[/B] [B]will be[/B][B] transferred per second)[/B]
}

or

RESOURCE_DEFINITION
{
name = SomeScienceMod_RockSamples
density = 0.125
flowMode = STACK_PRIORITY_SEARCH
transfer = [B]DISCRETE // You can't have 3.14 rock samples, for instance
transferRate = 8[/B] [B]//[/B] [B]8 rock samples transferred per second[/B]
}

Link to comment
Share on other sites

The current resource system doesn't lend itself well to discretization because everything is done in timesteps determined by the caller, not the resource system itself. I can imagine a few schemes that would be trivial for Squad to implement, but they're unlikely to work well with existing modules that produce or consume resources. You'd need to build a new set of modules that make resource requests in batches instead of the typical calling every frame with a TimeWarp.fixedDeltaTime factor on the request amount.

In other words, I think discrete resources would be fantastic, but the solution requires additional thought.

Link to comment
Share on other sites

The current resource system doesn't lend itself well to discretization because everything is done in timesteps determined by the caller, not the resource system itself. I can imagine a few schemes that would be trivial for Squad to implement, but they're unlikely to work well with existing modules that produce or consume resources. You'd need to build a new set of modules that make resource requests in batches instead of the typical calling every frame with a TimeWarp.fixedDeltaTime factor on the request amount.

In other words, I think discrete resources would be fantastic, but the solution requires additional thought.

Wise words indeed.

Incidentally, is such a feature feasible in add-ons, or would I be dependent on SQUAD to implement this in the core code?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...