[spoiler]Sirentropy and I are combining our mods into one to get the best of both worlds. Both of our mods are similarly coded, so it shouldn't be too difficult to merge them. On top of that, we have a new member joining the team, Shereis, who also has experience with moveable block-chunks modding of the kind sirentropy and I have used.
Advantages/Disadvantages of merge:
[spoiler]
Benefits:
-Debugs: As I understand it, he's already worked out many of the rendering bugs on his end, which will save me time on my end. I've already worked out ship collision algorithms on my end, which I'm sure would save him plenty of time as well. etc. etc.
-Features: Everything you like from each mod gets bundled into one package.
-Compatibility: His is Forge. Mine is Vanillacraft. We might be able to take advantage of this to create multiple versions for different compatibility scenarios. If you're using Forge, we'd have a version for that. If you weren't, you wouldn't have to install it. I'd be maintaining the vanilla-modded version. Plus, I believe Skydaz can create an installer that will check what version of Minecraft you're running, and install the correct version of the mod accordingly. Even simpler.
-Faster development: Working in teams can actually slow things down, if team members are disorganized or aren't thinking along similar lines. However, since sirentropy and I clearly have similar ambitions, and I've already confirmed we have similar code designs for moveable blocks, I think it will only speed things up, and considerably I hope.
Disadvantages:
-I don't care! I want to speed up development on this sucker! I have so many things planned, and I don't see how I'm gonna be able to do it on my own. I know I have the ability and necessary knowledge of physics to pull it off, I just need time or a team.
-If you have any comments for against though, please post.
[/spoiler]
Names Poll:
We're trying to decide a new name for the mod. A crucial idea of the mod is to allow players to create both small-scale and large-scale inventions based off of moveable blocks or other items (i.e. my ropes, axels, cloth, etc. for ship mechanics based off of newtonian mechanics for instance (if I can finally get back to coding a few critical aspects of those), or just the general ability to build ships. Ultimately, we hope to create a set of tools with diverse uses that have unpredictable outcomes, depending on how creative players are. This kind of led us toward "MacGyver", a character known for his inventiveness, ingenuity, and resourcefulness. You can look him up. He's an icon.
[/spoiler]
Basic Description:
PhysicsCraft is a Minecraft moveable blocks mod that implements physics for force, torque, pressure, drag, and everything else you would need to build ships along with an assortment of other things (I'm hoping players will even come up with new uses for it). It is similar to the Ships and Boats Mod or Zeppelin mod, but the physics is more in-depth, and the overall purpose of the mod is much more broad.
Instructions:
[spoiler]
(Most recent version instructions. Each version's instructions are included in the downloads)
Note: MUST PLACE BLOCKS AT SEA LEVEL: All buoyancy calculations assume sea level water (at the moment. Water hydraulics should fix that in the future.) Weird crazy things may happen if you place them elsewhere.
Now back to the instructions:
[spoiler]
To place the first moveable block in minecraft:
1. Find some water a few blocks deep (keep it at sea level, or strange things may happen).
2. Right click with whatever block in hand to place your first blocks.
3. Add more blocks, or to start on a new ship. Place a new block on the water away from your last ship.
4. Also can place blocks on ropes in Creative Mode.
Controls:
NOTE: These keyboard controls are temporary features of the mod. I plan to have ships completely controlled by physics in the future, once I've sufficiently developed ropes, axles, and friction, so that anchoring and rudder steering are well within the players means. I may also develop a cloth mod on similar principles as the rope mod for sail building.
If you have multiple ships, you can choose which to control just by simply looking at it at close range (specifically, putting your target reticle over it close enough such that you could place a block on it.) Whichever set of moveable blocks you were in block-placing range and aim of last is the set of blocks you currently control.
To move the blocks around:
Easy Controls(Default)
1. i and j keys to move forward and backward.
2. j and l keys to turn left or right.
Advanced Controls (Enabled and disabled by clicking c):
Disable/enable gravity: Press x
(must be in advanced controls to activate/deactivate this.
Will remain activated when switching to easy controls, though.)
To move in world coordinates:
1. i and k for world z axis
2. j and l for world x axis
3. u and o for world y axis (moving up and down).
3. f and h keys to rotate about x axis
4. g and v keys to rotate about z axis
5. r and y keys to rotate about y axis
6. p to stop the moving blocks entirely
To move in local coordinates:
Hold down alt while using any of the keys listed above.
This allows you to rotate about the moving blocks x axis instead of the world x axis, etc.
[/spoiler]
Rope Instructions (Includes video.)
[spoiler]
This video has now audio, but I hope it helps show you how to rope is placed, extended etc. I'll try to post the time in the vid that relates to each of the following instructions (EDIT: scratch that. Maybe later. Too much to post right now.)
Instructions that will be in the download:
Note: Can only use ropes in Creative Mode currently. I need to make a recipe for survival mode.
TO PLACE A ROPE:
-Find the rope item in item menu (the icon needs work, I know)
-Hover over block
-right click to place
When you first place, you'll be grabbing one end of the rope.
-right click again to "unravel" more rope (make it longer.)
-left click to let go.
If you have already placed a rope, you can select certain points along the rope (places it can bend.) When targeting one of these "nodes", you will see a yellow selection box highlighting it.
-Left click to grab the node.
-Left click to release again.
-Note: Cannot grab a node within two nodes of a "fixed" node, (a node tied to a block for instance. Any node that won't move. Use swords to "un-fix" nodes, (and cut already not-fixed nodes.)
-While holding a node, right click any block to "tie" the node to that block.
TO EXTEND ROPE AFTER CREATION
-If you have grabbed the end of a rope and have the rope item equipped, and are NOT targeting a block, right clicking will extend the rope (just like when you first placed it.)
TO CUT A ROPE:
-Equip a sword.
-Left click at the node where you want to cut (unless it's at the end of the rope, or a tied or fixed position, .)
-To "untie" a rope, use sword to "cut" the tie (NOTE: in these cases, will not cut the rope in two.)
Rope Bugs to look out for. Check info on youtube video page for more details:
[
[/spoiler]
[/spoiler]
Installation Instruction: Installation instructions are in the downloads! Just check the .txt files. Mac Users: I've been told the directory for the minecraft.jar file on a Mac is: library > Application support > minecraft >bin. Although apparently several users right now are experiencing an issue that makes the mod inoperable. I will try to fix this as soon as possible.
NOTE: This mod is in a VERY early stage of development. There may a few glaring bugs, plus some core components not added yet. Check back frequently for updates.
DOWNLOADS
Water Breaking Bug Fix : <<<<< Just put ki.class in minecraft.jar, same as the rest of the files. WARNING: I no longer have Minecraft 1.2.5 (just the eclipse MCP work environment) so I wasn't able to test putting this in minecraft.jar, but it should work.New "Compatibility" Version (0.19) (Note: this version is not necessarily compatible with forge or modloader, but the code has been rewritten such that only 4 class files in the base code are edited. Of those, two files only have one line of coded added each. This should greatly facilitate my ability to make versions of the mod compatible with various different mods. But I haven't done any other mod compatibility testing yet.)
PhysicsCraft_0.19
Another note regarding rope collisions: The algorithms for rope-collisions are only half-implemented in this version. Also, I have not worked out cloth placing, so you won't have that yet. Time for me to start on fluid dynamics so that I can put cloth more to work with winds. After that, I'll get to the cloth placing.
(0.18) (Ropes just added for Creative Mode. Does not include SMP or water displacement feature of the earliest version, but those should be added soon)
PhysicsCraft_0.18
Note on File System For This Version:
[Spoiler]The file system is different for 0.15 and 0.18. If you were working with a previous version, and you would like to update your files for this one, it should be a simple matter of changing directories. Before, all moving blocks data was stored under saves > yourworldsavefile > SUB. Now, it's under saves> yourworldsavefile > Physics > SUB0 for the first ship, SUB1 for the second, SUB2 for the third, etc. etc.
I haven't tried this myself, but if you put your old SUB file in a Physics folder, and rename it SUB0 (or SUB followed by any integer for that matter,) it should work i think. Nothing else about the saved data was changed.[/Spoiler]
Earliest released version (Potentially slow, especially after adding several blocks. Processing speed has been considerably optimized since this version. It is SMP and SSP enabled. No rotations, torque, etc. but DOES contain water displacement):
http://adf.ly/9m2mL
BLOCK MASS LIST:
[spoiler]
This is the code for block masses. The masses are in kilograms. Most things that I could check density for (metals for instance, but not flowers) I used to determine the right number. For example, iron is 6980 kilograms per cubic meter. I assume these blocks are a cubic meter size. So the steel block is set at 6980 (I figure pure iron can't be that much different than steel in density.) If you think about it, most of these values are HUGE (average person probably ways about 70 kilograms), but a cubic meter is pretty huge. Will just have to assume Minecraft people have enormous strength.
blockMasses.put(0, 1.14);
blockMasses.put(Block.stone.blockID, 2400.0);
blockMasses.put(Block.grass.blockID, 50.0);
blockMasses.put(Block.dirt.blockID, 1000.0);
blockMasses.put(Block.cobblestone.blockID, 2400.0);
blockMasses.put(Block.planks.blockID, 200.0);
blockMasses.put(Block.sapling.blockID, 100.0);
blockMasses.put(Block.bedrock.blockID, 2400.0);
blockMasses.put(Block.waterMoving.blockID, 1000.0);
blockMasses.put(Block.waterStill.blockID, 1000.0);
blockMasses.put(Block.lavaMoving.blockID, 2400.0);
blockMasses.put(Block.lavaStill.blockID, 2400.0);
blockMasses.put(Block.sand.blockID, 1200.0);
blockMasses.put(Block.gravel.blockID, 1200.0);
blockMasses.put(Block.oreGold.blockID, 4000.0);
blockMasses.put(Block.oreIron.blockID, 3000.0);
blockMasses.put(Block.oreCoal.blockID, 1500.0);
blockMasses.put(Block.wood.blockID, 800.0);
blockMasses.put(Block.leaves.blockID, 50.0);
blockMasses.put(Block.sponge.blockID, 20.0);
blockMasses.put(Block.glass.blockID, 300.0);
blockMasses.put(Block.oreLapis.blockID, 2500.0);
blockMasses.put(Block.blockLapis.blockID, 2700.0);
blockMasses.put(Block.dispenser.blockID, 1200.0);
blockMasses.put(Block.sandStone.blockID, 1200.0);
blockMasses.put(Block.music.blockID, 1000.0);
blockMasses.put(Block.bed.blockID, 500.0);
blockMasses.put(Block.railPowered.blockID, 1000.0);
blockMasses.put(Block.railDetector.blockID, 500.0);
blockMasses.put(Block.pistonStickyBase.blockID, 1000.0);
blockMasses.put(Block.web.blockID, 10.0);
blockMasses.put(Block.tallGrass.blockID, 20.0);
blockMasses.put(Block.deadBush.blockID, 20.0);
blockMasses.put(Block.pistonBase.blockID, 2000.0);
blockMasses.put(Block.pistonExtension.blockID, 2000.0);
blockMasses.put(Block.cloth.blockID, 1300.0);
blockMasses.put(Block.pistonMoving.blockID, 1000.0);
blockMasses.put(Block.plantYellow.blockID, 5.0);
blockMasses.put(Block.plantRed.blockID, 5.0);
blockMasses.put(Block.mushroomBrown.blockID, 5.0);
blockMasses.put(Block.mushroomRed.blockID, 5.0);
blockMasses.put(Block.blockGold.blockID, 19300.0);
blockMasses.put(Block.blockSteel.blockID, 6980.0);
blockMasses.put(Block.stairDouble.blockID, 600.0);
blockMasses.put(Block.stairSingle.blockID, 600.0);
blockMasses.put(Block.brick.blockID, 2000.0);
blockMasses.put(Block.tnt.blockID, 1000.0);
blockMasses.put(Block.bookShelf.blockID, 500.0);
blockMasses.put(Block.cobblestoneMossy.blockID, 2400.0);
blockMasses.put(Block.obsidian.blockID, 2700.0);
blockMasses.put(Block.torchWood.blockID, 7.5);
blockMasses.put(Block.fire.blockID, 0.0);
blockMasses.put(Block.mobSpawner.blockID, 2000.0);
blockMasses.put(Block.stairCompactPlanks.blockID, 100.0);
blockMasses.put(Block.chest.blockID, 1000.0);
blockMasses.put(Block.redstoneWire.blockID, 10.0);
blockMasses.put(Block.oreDiamond.blockID, 2500.0);
blockMasses.put(Block.blockDiamond.blockID, 3500.0);
blockMasses.put(Block.workbench.blockID, 500.0);
blockMasses.put(Block.crops.blockID, 50.0);
blockMasses.put(Block.tilledField.blockID, 1000.0);
blockMasses.put(Block.stoneOvenIdle.blockID, 1000.0);
blockMasses.put(Block.stoneOvenActive.blockID, 1000.0);
blockMasses.put(Block.signPost.blockID, 20.0);
blockMasses.put(Block.doorWood.blockID, 50.0);
blockMasses.put(Block.ladder.blockID, 20.0);
blockMasses.put(Block.rail.blockID, 250.0);
blockMasses.put(Block.stairCompactCobblestone.blockID, 600.0);
blockMasses.put(Block.signWall.blockID, 15.0);
blockMasses.put(Block.lever.blockID, 7.5);
blockMasses.put(Block.pressurePlateStone.blockID, 200.0);
blockMasses.put(Block.doorSteel.blockID, 300.0);
blockMasses.put(Block.pressurePlatePlanks.blockID, 50.0);
blockMasses.put(Block.oreRedstone.blockID, 1000.0);
blockMasses.put(Block.oreRedstoneGlowing.blockID, 1000.0);
blockMasses.put(Block.torchRedstoneIdle.blockID, 7.5);
blockMasses.put(Block.torchRedstoneActive.blockID, 7.5);
blockMasses.put(Block.button.blockID, 7.5);
blockMasses.put(Block.snow.blockID, 11.0);
blockMasses.put(Block.ice.blockID, 910.0);
blockMasses.put(Block.blockSnow.blockID, 100.0);
blockMasses.put(Block.cactus.blockID, 40.0);
blockMasses.put(Block.blockClay.blockID, 1000.0);
blockMasses.put(Block.reed.blockID, 20.0);
blockMasses.put(Block.jukebox.blockID, 100.0);
blockMasses.put(Block.fence.blockID, 50.0);
blockMasses.put(Block.pumpkin.blockID, 10.0);
blockMasses.put(Block.netherrack.blockID, 1000.0);
blockMasses.put(Block.slowSand.blockID, 1000.0);
blockMasses.put(Block.glowStone.blockID, 1000.0);
blockMasses.put(Block.portal.blockID, 0.0);
blockMasses.put(Block.pumpkinLantern.blockID, 25.0);
blockMasses.put(Block.cake.blockID, 15.0);
blockMasses.put(Block.redstoneRepeaterIdle.blockID, 50.0);
blockMasses.put(Block.redstoneRepeaterActive.blockID, 50.0);
blockMasses.put(Block.lockedChest.blockID, 1000.0);
blockMasses.put(Block.trapdoor.blockID, 25.0);
blockMasses.put(Block.silverfish.blockID, 5.0);
blockMasses.put(Block.stoneBrick.blockID, 2400.0);
blockMasses.put(Block.mushroomCapBrown.blockID, 5.0);
blockMasses.put(Block.mushroomCapRed.blockID, 5.0);
blockMasses.put(Block.fenceIron.blockID, 50.0);
blockMasses.put(Block.thinGlass.blockID, 25.0);
blockMasses.put(Block.melon.blockID, 10.0);
blockMasses.put(Block.pumpkinStem.blockID, 5.0);
blockMasses.put(Block.melonStem.blockID, 10.0);
blockMasses.put(Block.vine.blockID, 10.0);
blockMasses.put(Block.fenceGate.blockID, 30.0);
blockMasses.put(Block.stairsBrick.blockID, 600.0);
blockMasses.put(Block.stairsStoneBrickSmooth.blockID, 600.0);
blockMasses.put(Block.mycelium.blockID, 1000.0);
blockMasses.put(Block.waterlily.blockID, 10.0);
blockMasses.put(Block.netherBrick.blockID, 2000.0);
blockMasses.put(Block.netherFence.blockID, 100.0);
blockMasses.put(Block.stairsNetherBrick.blockID, 400.0);
blockMasses.put(Block.netherStalk.blockID, 50.0);
blockMasses.put(Block.enchantmentTable.blockID, 70.0);
blockMasses.put(Block.brewingStand.blockID, 70.0);
blockMasses.put(Block.cauldron.blockID, 100.0);
blockMasses.put(Block.endPortal.blockID, 0.0);
blockMasses.put(Block.endPortalFrame.blockID, 9000.0);
blockMasses.put(Block.whiteStone.blockID, 1000.0);
blockMasses.put(Block.dragonEgg.blockID, 30.0);
blockMasses.put(Block.redstoneLampIdle.blockID, 20.0);
blockMasses.put(Block.redstoneLampActive.blockID, 20.0);
[/spoiler]
Videos: (Check youtube comments for more info. I've decided to stop posting everything here aaaall the time)
Cloth and rope collisions info (along with other plans info):
[spoiler]
Forge, modloader, and other compatibility: I'm talking back and forth with SkyDaz about developing an installer that will streamline compatibility with modloader, vanillacraft, forge, and possibly other mods simultaneously (a lofty endeavor. May be far more difficult than I think. But fingers crossed.)
Hydraulics: Hydraulics will require more editing of the base Minecraft code, so I'm waiting on the Minecraft 1.3 update on that one.
Cloth and rope require very little base-code editing, so I'm not concerned about continued development on them currently in 1.2.5. Hence why I started on cloth. I also started on cloth because it might inform some of my decisions on developing rope collisions, rigid rope, and chains. The cloth algorithm is a variant of an algorithm I tried for ropes early on, but ditched due to certain breakdowns in the algorithm under certain cases. However, given the success of this algorithm version with the cloth mod, I'm planning to revisit it for chains.
Planned 0.2 Updates:
-Cloth placement, cutting, stitching.
-Cloth-rope attachement (for raising and lowering sails, for instance. Probably need axels for this, but that's why I'm working on rope-to-block collisions.)
-Wind currents (might as well enable them if I have cloth now.)
-Rope recipe for survival mode
-Ropes more stable when tight (done)
-Ropes collide with blocks (in process)
-Chains and rigid ropes (thinkin' 'bout it)
-Axels and server-type commands? (Waiting on the axels 'til I get a reply from someone. I'm thinking of blending my moveable block system with the more conventional Entity Block system used by other modders (use my system for large structures. Use Entity blocks for small things, like small axels, or collision/explosion-induced "block shrapnel") Been talking to Pheenixm about it for the past week or so, but I haven't heard from him in a few days. If he contacts me soon, I'll be able to get this part started.)
[/spoiler]
Cloth Physics and rope collisions (not released yet):
Rickety Bridge Experiment
Large scale moveable structures (Could have probably made it much larger, if I didn't run into the rendering bug)
Rope and Resizeable Blocks Vid (resizing not released yet: gotta make a sensible implementation. Block scaling is near END of video (not EXACT end, but shortly before.):
IPodMail Video
GameChap and Berty Video
Rotations and Torque Physics First Vid:
Archived Vids:
[spoiler]
Second Update Vid (shows some early water displacement features I'm waiting to re-implement until I can come up with something more advanced.)
Multiple Ships Vid:
[/spoiler]
Comments on various plans for the mod (not comprehensive. I have many more besides):
[spoiler]
Comments on rope and resizeable blocks:
[spoiler]
The block scaling only came up recently after I realized it could solve my keel building and boat internal-mechanics size issues. It had been in the back of my mind for a while, when I realized the linear algebra for scaling would be a breeze after already implementing the math for rotation and translation. But since it wasn't directly related to my intentions, I ignored it until it occurred to me it could be useful. The creator of the LittleBlocks mod had similar reasoning: smaller blocks make more complex circuitry practical. The same should apply for ship mechanics.
I figure the way I'll implement it for player use is similar to the hammer method I saw on an old mod (not sure if it was LittleBlocks) only instead of a crafting menu, you hold an actual hammer, and smash things with it. Also may be a "ninja chop" mode for axes that slice blocks in half. In any case, I'll try to get it incorporated sensibly in the future.
But for now, ROPE! I need to work out the items and crafting recipes for it, as well as placing it, tying ropes together, etc. before I can release a version of the mod with the ropes feature.
Then you should be able to build anchors, swinging chandeliers, rickety bridges and maybe even lassos (if you're feeling Indiana-Jonesy).
[/spoiler]
Earlier comments on ropes and axles:
[Spoiler]I also hope to eventually add ropes and axles to this mod. Rope would be made of segments that could be tied or wrapped around blocks. The segments would move together according to the inverse kinematics CCD algorithm (scratch that, segments move through spring force between the nodes between segments). Axles, along with rope, would allow you to do a lot of stuff. (lift and drop anchors, sails, alter rudders, make wind vanes and swinging chandeliers, and I hope, with the hot air mod, allow you to transfer rising hot air into rotational energy as a fuel source, sort of like a steam engine. That was basically the fuel mod for this that I've suggested earlier. I'd probably disable netherrack endless flames and add some sort of ignitable compressed coal block.)[/Spoiler]
Comments on course plan and overall purpose of the mod (related to players working with the physical mechanics):
[Spoiler]I'm adding a few basic tools (ropes and, soon, axles) that can be used for engineering purposes related to the physics. Moveable blocks are currently controlled by keys, but I eventually want it to be completely controlled by physics also. I also want the nature of how stable ships are and how they move to be completely up to the player. Basically, you create the nuts and bolts of how everything operates in a ship using very basic items. For example, with just ropes and axles, you could create a set of moving blocks from a steering location at the top front of a ship, to a rudder at the bottom base. And that rudder controls the ship directly through actually drag forces already calculated for each exposed face to each block. How that mechanism weaves through the belly of your ship, is up to you.
To an extent this may be more appropriately titled Engineers Craft in the future. I'm not implementing advanced physics just to watch awesome physics simulations. I want the player to be able to bend the physics to their will in creative fashion, possibly in ways I won't even think while coding this mod. But right now I'm still getting all the physics features worked out. And I need to re-implement SMP.[/spoiler]
Comments on SMP:
[Spoiler] After i realized Minecraft has an update just a few weeks off that will completely alter programming for SMP, I decided to wait on re-implementing SMP until then. For now, I'll work on features of the mod that shouldn't require too much change for the update.[/Spoiler]
[/spoiler]
Updates, in reverse order:
[spoiler]
Changes made in multiple ships update:
[spoiler]
-You can now make multiple ships! (duh)
-Rendering optimization. Before this update, every time the game created the first moveable block, it geared up to basically render thousands of new blocks as far as the eye can see (derp.) I tailored Minecraft's current rendering system to only set up to render those moveable block chunks that contain moving blocks (like 4 or so at the start, not 4000.) It should be somewhat faster now. Note: the moveable block chunks are NOT the same as the world chunks that the moving blocks may be in. Don't think I destroyed the Minecraft world rendering engine. It should be just fine.
-Resolved some particle effect issues with breaking blocks, although now there's a new one. When a block is destroyed, the particles come out black. Their textures aren't applied for some reason.
new bugs:
-Not really a bug, but something I haven't implemented yet: boat to boat collisions. They'll just go right through each other. They should still collide with the rest of the world though.
[/spoiler]
Changes made in rotations preview:
[spoiler]
-Pretty much re-wrote the code. Works off of principles of momentum and angular momentum now. Also had to create the methods and objects for affine matrix transformations.
-Changed a couple of data structures that were making physics calculations slow.
-Drag is now calculate individually for each face, as well as the associated torque to that drag.
-Torque is always about the center of mass. Speaking of which, it now calculates the center of mass, about which everything rotates.
-Buoyancy is not calculated directly, but rather water and air pressure on each block face (and associated torque). This will useful later for the hot air mod. And when I get a hydraulics system of sorts working, this might be used to simulate other phenomenon, like a block being pushed out of a tube by a column of water.
-Collisions are also calculated by a new algorithm, that right now assumes collisions are inelastic, but it can easily be updated for elastic collisions.
-Added a more complex weighting system
One interesting thing to note is the implementation of a moment of inertia matrix tensor (you can google it.) If you'll notice near the end of the rotations preview vid, every time I try to rotate a rod of blocks about a different axis, it aligns with that axis. This is a consequence of a physical mechanics phenomenon, related to the Principle Axis Theorem and the moment of inertia tensor. Basically, any rotating body only has certain axes that it can rotate around stably. If it rotates around any other, that rotation will eventually deteriorate into a principle axis rotation, which in this case, happens to be along the rod of blocks, since that is the easiest direction about which they can rotate. Just a nifty side-note.
[/spoiler]
Second update:
[Spoiler]
As shown in following video, this is filmed in SMP.
Sorry for video glitchiness. After filming it once, I didn't wanted to film it all over again with better framerate settings. This is the SECOND update in my minecraft ship mod. See my first video for preliminary details. For this one, added block collisions, buoyancy, drag, and water "carving" for enclosures (so that water isn't mysteriously pouring through a solid wall.) It first checks to see if the enclosure is fully enclosed below sea level though. Later I will update buoyancy and other physics so this can run in other settings not at sea level (lakes in caves (there's a mod for that right?), the Nether lava lakes, etc.)
As you can see, buoyancy counterbalances newly implemented weights, which are different for different blocks (honestly though, those gold blocks should probably STILL be a lot heavier.
Unfortunately I was in a swamp and couldn't fully submerge the raft after enclosed to show that it was submarine ready, but it is.
Note, block movement is a LOT smoother than it appears. It's the video glitchiness.
Also
Fixes (just started this list)
-Fixed Modloader incompatibility (I think... I've checked it with regular modloader. Haven't checked ModloaderMP)
Bugs (I'll start updating this list soon.)
[/spoiler]
First Update:
[spoiler]Update: Block collision added. I'll upload a new video when I can, but for now, don't be fooled by the first video. Passing through the blocks was just an early bug to be ironed out. To all newcomers, I'm currently setting up an SMP server with this. Transferring the mod over to server form actually turned out to be easy this early in the stage. I'll be working on the SMP and SSP versions in parallel. No concerns there. If any of you would like to test this now please post, and I can provide a link to the jar files (I'll have to soon anyway just so I can get some friends to test the server for bugs.)[/spoiler]
[/spoiler]
Original Description:
[spoiler]
I wasn't sure how to describe this in a title, but the following video should show it all:
This idea in simplest terms is the following: Have you ever seen one of those giant ships that people sometime build? Like this guy's (or girl's)? Have you ever wished they could actually move? Well, my goal is to make that possible.
I came up with the idea about a half a year ago, did some snooping around the minecraft coder pack then, but didn't get started on it for real until about 3 weeks ago. You can check the youtube video description for more detail, or the following spoiler, from a help thread I posted way back when (Note: Youtube description is a LOT more concise. Also the same description is in the Minecraft Videos section.)
[spoiler]And I quote (myself):
Until then, I'll let you all in on what I'm trying to accomplish, in case you have any smart ideas on how to do what I'm trying to do simply, since I'm still puzzled how to accomplish it. I was thinking a while back about how of all the awesome new world and biome settings, Twilight Forest for example, I didn't see any aimed towards oceans. That's understandable, to add to oceans the scale and detail seen in trees in Twilight Forest and have it be important would require several add-ons:
A: More interesting islands (maybe each may have one of several unique ores, villages, structures, plants, etc.)
B: More interesting water (I'm thinking water that ebbs and flows, maybe a simple addition to code that causes still water in ocean biomes to populate block locations above and around it and also disappear in a wave like fasion.
C: More transportation options
It's part C that I'm particularly focusing on, and I'm working off an idea that I thought of before this one while I was doing piston experiments. I don't want to create recipes for different type of sailboats. I know some people have no problem with the idea that you can make sherman tank off a crafting table (I'll admit, it's awesome, but improbable.) I want to be able to build my ship just like any of the buildings you would create in minecraft. I need a set of blocks moving in unison off the global world grid and axis that follow laws of physics (working out buoyancy, wind drag, and water currents is something I plan to do in the future, but that's not my focus right now). Here's how I'd like to do this:
Each ship, or whatever else you decide to make off-grid, will exist within it's own "local" grid with a local boundary box(that may have to be something other than cubed shape). This grid will have a set of axes and an origin that will move and rotating according to gravity, buoyancy, and whatever else I set up. The blocks on a specific local grid will move in unison with the origin and axes, and will be placed relative to it, that way the physic and unified motion only has to be calculated for the entire grid as an object, rather than each individual block. This is a start to streamlining this for performance. Players will be able to stand on blocks in this local grid, add blocks to the local grid (expanding it's boundary box) and remove blocks just like on the regular world grid.
So, say, you could have a ship, floating on water. You can add and remove anything from it like in the regular world. You can live in it, have your bed. If you've appropriately structured it to take advantage of wind drag and ocean currents (this mod may have ONE added block type: a cloth block, with tons of wind drag (I also plan to give blocks a wind drag property and give the world a wind speed and direction setting.) Cloth can be spread out or crumpled to fill a varying number of block spaces. With enough of it, you can make a sail) you can travel from place to place in the awesome new ocean biome doing whatever it is you do as a captain of the ship you built yourself, of whatever size and shape, as long as it's not too heavy (or more specifically dense) that it will sink.
(Yes, when I say work out bouyancy I mean something like that. I want to add weights to blocks, including air, and do buoyancy calculations for these local grids to determine if they have less weight than their displaced world grid blocks, to see if they will float. Air will also have a weight, and I would also like to make a hot air mod of sorts, that way you could build air ships of any shape and size.)
I'd also like to see the guy who did the Tales of Kingdoms mod make a Tales of Captains mod, and the guy who did the millenaire village mod do the part A) more interesting island villages mod. Anyone interested in making the ocean biomes, that would be great.
Now back to MY problem: How the heck I make these local grids, is something I'm trying to find out while making minimal adjustments to the code. Object-oriented Java fails me here, because so many class in Minecraft.jar rely on the assumption that blocks are on the world axis and grid. Even setting blocks relies on that, and that's the part I'm trying to tackle first. If anyone has ANY bright ideas for a simple change to the code that will pull this off let me know. I want to work within the framework of the code as much as possible and not have to create a whole set of classes to do exactly what the main classes do, just with one addition. That would be loads of pain, and I would be losing tons of debugging that's been done to the main minecraft code. I also don't want to work off the entity framework. I did some experiments with falling sand for the physics, and it worked nicely, but the Entity class will NOT be optimized for this at all.
Obviously I've resolved that last problem.
I'd be willing to provide the source code, for anyone who would like to contribute to this project.
[/spoiler]
Current programming itinerary:
-Finish Ropes and axels (Ropes first. Axels next)
-Add solid block to block friction and elastic collisions (currently have inelastic collisions. Adding elastic shouldn't be a stretch, no pun intended.)
-Set up new water hydraulics that should assist me in making a much cleaner water displacement algorithm (will postpone for a while)
-Test hydraulics for draining and filling spaces (for submarines mainly. If I got the hydraulics working, pistons would do the rest for me, opening and closing compartments. I hope minecrafters will find multiple uses for this though.)
-Re-implement everything missing from the most recent version that was in the earlier version (including SMP). I'll improve SMP lag issues in the process of the code re-write.
-Weight systems for entities (Entity is almost anything that isn't a block and moves in some way: players, animals, exp orbs, items like beef and broken blocks hovering on the ground, etc.) Player's weight will include what they're carrying.
-When I get chests working again (I'll probably wait on the debug until the new Minecraft version roles around in August), I'll set up weight systems for those too based on how much they're carrying.
Other :
-A cloth mod? (Not a far cry implementation from the rope physics implementation. Would make for much better sails (especially ones you could unravel, like in a real ship.)
-Add hot air physics.
-And at some point, get all the blocks that currently don't work on a set of moveable blocks working.
1
2
It's not just the chunk with spawn. It's 16x16 chunks around the spawn.
1
1
2
When water breaks the torch (or maybe when first piston moves), this code executes:
It sets the block id, updates adjacent blocks, sets metadata, and updates adjacent blocks again.
But the first block update updates a piston, that executes this code:
So in the end you get block id2:meta1.
2
I had very similar idea. But in my solution if you leave the world and then re-enter it immediately minecraft.jar wouldn't be reloaded. It's too late here, so I'll describe it tomorrow.
Also, it's possible to make main menu a separate java app that is "between" launcher and minecraft.jar. Similarly to this mod: http://www.minecraftforum.net/topic/819387-mod-manager
1
1) He promised API to be in 1.5... now it's 1.0.0 and still no API.
2) It's a bit different.
1
1
Have you put c.class into minecraft.jar? It's the same as rp.class in 1.8.1.
1
@Mineraleer: It's 1.0. You searched what the other guy was talking about, but it didn't prevent you from looking dumb.