Giter Club home page Giter Club logo

sandcastle's Introduction

Sandcastle: 3D Printed Bases

Real-world references

https://www.youtube.com/watch?v=yp_Xz6r2Aso
https://room.eu.com/article/How_to_3Dprint_a_habitat_on_Mars
https://www.nasa.gov/directorates/spacetech/centennial_challenges/3DPHab/index.html

---INSTALLATION---

Simply copy all the files into your GameData folder. When done, it should look like:

GameData
	WildBlueIndustries
		Sandcastle
		WildBlueCore

Changes

- The Sandcaster 3D Printer can now recycle vessels, just like the Konstruction Manipulator.
- Fixed issue where Sandcastle wouldn't show parts in the print shop window when Sandcastle was added to Pathfinder templates.
- Fixed issue where the game would crash when deploying the Survey Cone from the Survey Cone Dispenser.
- Fixed odd coloration on deployed survey cones.
- Fixed issue where resources were pulled from the entire vessel instead of stage priority flow.

---LICENSE---
Near Future Props by Nertea, licensed under CC-BY-NC-SA-4.0

Art Assets, including .mu, .png, and .dds files are copyright 2021 by Michael Billard, All Rights Reserved.

Wild Blue Industries is trademarked by Michael Billard. All rights reserved.
Note that Wild Blue Industries is a ficticious entity 
created for entertainment purposes. It is in no way meant to represent a real entity.
Any similarity to a real entity is purely coincidental.

Source code copyright 2021 by Michael Billard (Angel-125)

    This source code is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

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

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

EXC spawning cause game crush on newest version of sandcastle.

[EXC 00:14:05.093] NullReferenceException: Object reference not set to an instance of an object
Sandcastle.Inventory.InventoryUtils.AddItem (Vessel vessel, AvailablePart availablePart, System.Int32 variantIndex, ModuleInventoryPart preferredInventory, System.Boolean removeResources) (at :0)
Sandcastle.PrintShop.WBIPrintShop.handlePrintJob (System.Double elapsedTime) (at :0)
Sandcastle.PrintShop.WBIPrintShop.processPrintQueue () (at :0)
Sandcastle.PrintShop.WBIPrintShop.FixedUpdate () (at :0)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

KSP.log

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.

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 ?

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

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.

Print Shop/Recycler not functioning on reload

Whenever I reload a Sandcastle module the print shop and recyclers quit functioning. More specifically, the UI all remains completely functional, but it will only ever idle and not fabricate/recycle cargo. This only happens on reload, they work fine when first launching the modules.

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.

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

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.