Minecraft Maps / Redstone Device

Random Map Generation With Command Blocks

  • 664 views, 1 today
  • 4
  • 1
River Forge Games's Avatar River Forge Games
Level 24 : Expert Dragon
18
What I really like about minecraft 1.7.1 is that it has added so many new commands that can be executed by command blocks. I've been playing with all of these redstone functions a lot.

The creation that I really want to show you is something that could be used for map generation. Specifically, I designed it to regenerate a mine (kind of like some mods do in prison servers). At the press of a button, the system creates stone, dirt, or coal_ore in the empty spaces I designated.

Get the Map Here

The example system I will show you is designed for a horizontal 3x3 section. Below is the part of the wiring that creates the new blocks. You can see nine copies of the same redstone circuit - one for each block coordinate to be altered.

A pulse is sent through this system until you press the off button. It will run through each of the nine circuits.



Here is what the circuits do:
1. test for an objective value used to store an x, y, or z value
2. extend a piston if the tested value is true
3. If all values are true, send a signal through the blocks above the pistons
4. test for an entity type (there is a loop that changes the entity type every split second)
5. place that entity type in the space that was tested for
6. change the objective value of x, y, or z so that a new circuit will be active and the next designated area will be filled with a block of a random type (stone, dirt, or coal_ore)



ec-c--aaa-dd_zps





While the machine has two pulsers which may cause a mild lag for some people, the pulsers are only active while it is placing the blocks. This is done by connecting the on/off button to t flops that power comparator pulsers. I chose to use the comparator for the pulser because it makes the system much faster, and you can easily turn the pulses off or on without adjusting pulse length.

Below, you can see two pulsers. The smaller one on the left controls the large machine that you can see above. The two pistons to its right control whether or not it is on or off. The larger pulser on the right changes the objective value for the entity type. This makes the block placements effectively random because the two pulsers are offset by a certain amount of ticks and the pulse length of the right pulser is longer.

fdff-cc-bb-b-cbfa_zps


ac-f-f-b-fec_zps


This is an example of the result of the program.



There are three buttons currently involved in operating this complex redstone machine. I will list them in the order that they should be used.

1. The calibration button. This will reset the testfor entity command block outputs so that if they encounter the same value when you turn the machine on again, they won't skip the setblock function. It does this by setting the objective entity value to something that isn't tested for, and then running through the 9 setblock circuits again. This is designed to only adjust the tflop for the pulser on the left. If you were to turn the other pulser on, then the entity values would change constantly and the calibration would fail. The calibration does not happen instantly, but I set it up to flash a lamp at you when it is done and turn off automatically.

2. The reset button. This will reset important objective values like entity, x, y, and z.

3. The on/off button. This is hooked up to two t-flops which turn on pulsers. For the pulser on the left, it sends a constant signal into the back of a comparator which runs into itself on subtraction mode. The pulser on the right works differently. It sends a controlled length pulse that is longer than the comparator pulse through a piston that is extended by the t-flop. Use this button to set the blocks. Once the area is full, press it again, then calibrate and reset.

ff-aa-e-ba-ecde_zpsaff-e-f--debaa_zpsfbf-f-bd-ad-dabb_zps

This is not a very compact design, but rather set apart so it won't be confusing for other people to dissect. What do you guys think of it?
Progress100% complete
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome