Create

Create

86M Downloads

[Suggestion] Contraption Nesting/Full Contraptions on Minecarts

eMorph opened this issue · 7 comments

commented

Making efficient farms in Create tends to mean one of two things: using some sort of constant build which is expensive to make and requires far more blocks than it's worth, or using a rail contraption which is difficult to control. As it is, rail contraptions seem to abide by a different set of rules than other creations. Rotational power is given automatically depending on the speed of the contraption; storage within the contraption is automatic and centralized; rail contraptions cannot interface with others without a PSI.

I feel like some further integration/centralization is necessary between the two types of contraption. Allowing contraptions within contraptions would be exremely helpful for item sorting on rails, rail-powered item collection, et cetera. You could have cart contraptions with engines powering them, automatically moving the components and powering them as well. This would be especially helpful with mechanical belts and multiple storage containers.

To go even further with this, perhaps with this in place the current system of cart-contraption power wouldn't even be needed, instead following the rules of the rest of the mod. Minecarts would need force to move, unless the rail is powered, in which case only the minecart would be moving. Any and all components of the contraption besides the cart would need an engine to run, unless the minecart is directly linked to them via shafts, cogs, and the like. Stress and speed rules would, in this case, apply to minecarts, just like all other power sources. This way, the speed of the components could be constant and controllable, increasing the potential of the system.

commented

A while back I was told of a mod called MetaWorlds, which essentially allowed smaller coordinate planes to be created with their own separate blocks, and which could then be moved around. Maybe this idea could be used here?

commented

A while back I was told of a mod called MetaWorlds, which essentially allowed smaller coordinate planes to be created with their own separate blocks, and which could then be moved around. Maybe this idea could be used here?

That's essentially what I was talking about! Good to know such idea has already been implemented before. :3

commented

The main problem is that minecart contraptions are entities, so you're quite limited to doing things such as interacting with non contraption blocks, animated models, functioning TE's, etc.

commented

The main problem is that minecart contraptions are entities, so you're quite limited to doing things such as interacting with non contraption blocks, animated models, functioning TE's, etc.

Hm. Just a shot in the dark here, but do they have to be entities? What's to stop them from being represented by regular tile entities, which position and visual offsets & angles are recalculated every tick to "keep up" with the minecart to create the illusion of hard attachment?

commented

Or maybe the code used with the interface blocks could be added into things like Shafts, Pistons, and power sources in order to transfer power between entities. But I wasn't even really asking for cart contraptions that could be powered by external shafts; that was just a stretch idea going along with the original thing. I was just thinking it would be nice to have self-contained separate contraptions work when within other contraptions. For example, you could have a minecart move an item sorter which is constantly vacuuming up items, in order to have the items all sort into different crates on the minecart, and have everything be powered by an encased fan which is also on the contraption. There's no need for any interaction between a contraption and the world in this case; just having blocks function normally when on a contraption instead of being defined by any separate rules.

commented

Or maybe the code used with the interface blocks could be added into things like Shafts, Pistons, and power sources in order to transfer power between entities. But I wasn't even really asking for cart contraptions that could be powered by external shafts; that was just a stretch idea going along with the original thing. I was just thinking it would be nice to have self-contained separate contraptions work when within other contraptions. For example, you could have a minecart move an item sorter which is constantly vacuuming up items, in order to have the items all sort into different crates on the minecart, and have everything be powered by an encased fan which is also on the contraption. There's no need for any interaction between a contraption and the world in this case; just having blocks function normally when on a contraption instead of being defined by any separate rules.

I like this idea, but there are a few thoughts I'd like to add on the matter.

Implementing sorting within the contraption would be a pain, since that would require displaying all the belts/chutes/etc correctly with all the items going through and on them - and skipping displaying of those entirely would appear quite immersion-breaking.

I might be stating the obvious here, but it's still worth mentioning explicitly - the blocks added by other mods won't work in this fashion. In order for a block to function properly while on a minecart contraption, it must have separate code written for this case, since generic handling code for all blocks assumes that they are, well, blocks in the true Minecraft definition of this word - that is, that they have fixed integer coordinates within the world's block volumetric grid, that each "cell" on that grid is occupied by exactly one block (possibly air), that they are perfectly aligned to XYZ axis, et cetera, et cetera. Doable for blocks added by Create and vanilla, though, which is more than enough for these purposes. Heck, with generic handlers for buttons and levers we could actually have the controls embedded within the moving contraption - as an elevator builder, I fully endorse the idea. Also, in theory, moving contraptions of all kinds can be implemented by moving the entire thing into a separate dimension and wrapping it in a mesh of immersive portals to create an illusion of it being "there" while allowing all blocks - even the modded ones - to function perfectly well with their existing code, since they actually will be just regular blocks on the grid. There are other problems with this "portals", idea, though, mostly performance-related, but let me know if I should elaborate further.

Power transmission within the contraption would be an issue, as well, since if you use gears or shafts, those need to be animated, as well - which, as @SpottyTheTurtle said, is an issue by itself. As for power generation... Windmill generators, for obvious reasons, can't be used in moving contraptions in exact the same way as they are used for static ones - I'll touch a bit later on it, though. Encased fans raise some immersive-realism issues, since powering those requires either fire or lava - fire is a bit problematic to animate, Lava would probably work okay, though it'll need to be "encased" in some sort of a container, which, again, adds to the contraption's bulkiness. A furnace generator or a separate flywheel accumulator would work best, I believe.

Some thoughts on power transmission for minecart-based contraptions:

  • Power transmission can be implemented "as is" - with gears and shafts and so on. This would keep truest to the spirit of the mod, though they would prove quite problematic to animate. Animation can be skipped altogether for the time being, though;
  • It can be omitted entirely, with the assumption that power transmits equally from the select generator(s)/accumulator(s) to all consumers - it would strain the immersion a little, but it's the easiest solution to implement and it would work fine for simple contraptions that don't require different gear speeds;
  • The transmission can be implemented through gearbox blocks only, no shafts/gears/belts - quite elegant and can be easily explained away by the in-game documentation with something like "minecart movements create unpredictable, erratic motion momentums that strain and break bare shafts forced to transmit rotation - gearboxes are built to handle this, though";
  • And it could be theoretically implemented with separate blocks that handle transmission specifically on moving contraptions - something like "encased shafts" that don't display motion and thus don't need to be animated at all. I don't like this idea, to be honest - a block that fully duplicates the functionality of another and designed with the sole purpose of stripping away those stunning Create visuals? No thank you.

As for power generation... I'd like to propose merging the current behavior - contraptions are "powered" entirely by minecart movement - with the existing generators in the following ways:

  • Windmill generators and Encased fans are powered, in the end, by moving streams of air - and minecarts create moving streams of air around them as they move. So the natural solution to propose here is to allow these generators to produce power, but only when the contraption is moving along the axis of their placement - possibly slowing the minecart in the process! Energy conservation law is a thing, after all. Encased fans are compact and easy, though they won't produce much power - good solution for the simplest, low-demand contraptions. Windmill generators generate significally more energy, but take a while to spin up and need a lot of space for the spinning sail - good choice if your contraption needs a lot of free energy, and your minecart has lots of space with long, steady tracks.
  • Furnace generators can be made to feed off the minecart itself, assuming it's a furnace minecart - it will simply be consuming more fuel as a result. Simple, elegant, compact and cheap, though you will need to periodically resupply the minecart with fuel - and building a refueling depot with automated fuel delivery is a fine engineering problem by itself!
  • If accumulators of rotational power - separate flywheels or something else entirely - are to be someday implemented, one can be easily placed onto the minecart contraption. Compact, cheap, rotation is not an issue, but you'll need to periodically stop your contraption and "spin it up" again.
  • And even if these separate generators are implemented to function as described - well, minecart wheels are already rotating, aren't they? Surely it's not a stretch to say that rotation can be explicitly - say, with a special "wheels/contraption" relay block - allowed to fuel the contraption, as well? This kind of power would be practically free, with the cost being very low power output and significant slowdown proportionate to the power used, meaning the actual implicit cost will be the infrastructure investment needed - powered tracks and so forth. Expanding on this idea, there should be an option to reverse the function of this relay - allowing the other generators present on the contraption to supply the driving momentum to the minecart instead! Hey-ho, I've just invented a car. ^w^

So, what do you think?)

commented

Java and OGL allow the nesting of animations, eg rotating a translating object. Maybe this improvement could be somewhat made easier by requiring that Minecraft be run in OpenGL mode.