Giter Site home page Giter Site logo

sandcastle's People

Contributors

angel-125 avatar hebarusan avatar leonardfactory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sandcastle's Issues

Cone deployment crashes and other issues

There's definitely some general weirdness going on with the cone deployer:
https://user-images.githubusercontent.com/2611674/178139678-fc087a82-239e-4941-bd4f-cc4ed86f8751.mp4

The deployer's volume used doesn't get updated, the craft starts sliding around, and then deploying the 2nd cone just crashes.

this log is from a different instance, but same thing happens (see at 13:19:28):
https://gist.github.com/Rodg88/b54e5ad013bf117263e28becdef57d00

I wonder if it's to do with the stuff gotmachine mentioned in #5 ?

Some issues and code review

While testing Sandcastle together with the stock inventory mod I'm putting together, I noticed a few things, and I figured that would be useful for you :

InventoryUtils.AddItem()

The InventoryUtils.AddItem() method is doing something very wrong, it calls StoreCargoPartAtSlot() with a reference to the part prefab. You simply can't do that. First, this mean you're calling Save()/OnSave() on the prefab, which mean you're executing some code that might alter the pristine prefab state, potentially having wide side effects on the entire game. Second, this will fail to produce a valid persisted state, as saving a non-initialized part is an unsupported scenario. There are multiple stock modules that simply throw an exception while doing so, and the situation will likely be even worse with modules from various plugins. You need to rework that method to first instantiate the part, then call StoreCargoPartAtSlot() with that instance. For the same reason, the StoreCargoPartAtSlot() overload that takes a part name shouldn't be used (and is actually unused by the stock code).

Mass & volume checks

In various InventoryUtils methods, you're relying on the part prefab mass / resource mass to check against the inventory available mass capacity. There is no guarantee that these values will be in line with the part instance real mass due to modules dynamically altering resources and IPartMassModifier modules. I guess this isn't much of an issue in practice since only Kerbal inventories have mass limits, and I guess you're not allowing storing parts there.

In the context of the stock inventory "extension" mod I'm putting together, the same issue would happen with cargo volume, as I'm implementing support for variable volume for mesh switchable / procedural parts.

In both cases, this is a tricky issue to fix, as there is no way to reliably get mass/volume without an actual part instance. My suggestion would be to rework how you're handling things, by creating the cargo part when its construction is requested instead of creating it when it is completed. Then you could have some special handling that "lock" the cargo part in the inventory (preventing it from being removed or interacted with) until its construction is done. But this would be a major rewrite and quite some work to implement.

An easier workaround would be to instantiate a dummy part every time you need to check mass volume, but this would be quite inefficient.

Incorrect Orientation for EL pads

It looks like the transforms for EL vessel spawning got messed up somehow.

The Construction marker spawns vessels 180 degrees from the intended direction, clipping it through the existing vessel:
20220425173151_1
20220425173308_1

And the Construction Manipulator spawns crafts 90 degrees from vertical and clipped into the part, causing them to be launched away when released:
20220425173547_1

Clancythecat on the KSP Forums says this started happening when the new EL update was released.

Inconsistent temperature efficiency ranges between the MiniSmelter and Smelter

The temperature ranges for the two electric smelters that are enabled when Extraplanetary Launchpads is installed differ wildly. While some difference might make sense given the different sizes, it seems unlikely that one is supposed to operate in the -136.575°C to -39.025°C range and the other is supposed to operate in the 0°C to 1599.85°C range.

This seems like a mistake with one of the configs, likely the MiniSmelter one, as EL uses the same temperatures as the large electric Smelter for its non-electric smelters.

Smelter modes for both:

efficiency = 136.575, 0
efficiency = 234.125, 1

efficiency = 273.15, 0
efficiency = 1873, 1

Recycler modes for both:

efficiency = 136.575, 0
efficiency = 234.125, 1

efficiency = 273.15, 0
efficiency = 1873, 1

Compatibility with SimpleConstruction

Hi,
I was trying to replace EPL with SimpleConstruction in my current game but found that it had issues working with SandCastle based on the errors coming from B9PartSwitch. I notice others have had this issue.

I worked out a patch that seems to fix the issues and at least passes a smoke test.

  • It fixed the B9PartSwitch on the RocketParts container to us the SimpleConstruction tank types to get the ratios it uses and the base volume to prevent it working like a Tardis and better match the large holding tank in SimpleConstruction
  • It adds a new EL_ConverterRecipe that uses Ore rather than MetalOre (on a like for like bases) and adjusted the recipe to account for the differenct densities. It will convert the same amount of Ore/LF/EC to Metal as it did MetalOre/LF/EC to Metal in the same time. The conversion rate is slightly less than the SimpleConsrtuction Convert-o-tron but much faster unless you have a 5* engineer on board.
  • Patches the smelter to use the new recipe, switches out the MetalOre resource container for an Ore one and removes the ScrapMetal to Metal conversion

I'm sort of new at his but that patch appears to be okay. I don't know what would happed if you switched EPL to SimpleConsrtuction while having the Smelter or the SandCastle RocketParts container being used within the game.

Please feel free to include it if you find it appropriate.
SimpleConstruction.cfg.txt

(BTW this was against the SimpleConstruction-4.0.99.7-prerelease)

Also, sorry I wasn't paying attention and missed seeing the same issue as issue#3

Unable to manipulate Printshops or Cargo Containers in EVA

I noticed that I couldn't manipulate the Printshops or the Cargo containers while in EVA contruction mode. It looks like this was intended as there is a ModuleCargoPaart with packedVolume = -1 but it comes after the ModuleInventoryPart which is stopping it from working.

I've swapped the order of the modules and tested and am trying to submit a pull request. The affects the two printshops and the three cargo containers

SimpleConstruction! Compatibility

  • When Sandcastle is installed with SimpleConstruction! B9PartSwitcher has a conniption and leaps overboard yelling and screaming taking the entire game with it.

see PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.