This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Kaikaku's profile picture

Concept video: CC Pyramid Run

Started by Kaikaku, 26 April 2015 - 08:27 PM
Kaikaku #1
Posted 26 April 2015 - 10:27 PM
Hi there!

Well, as I won't post relevant code in the next 2 or 3 weeks my topic in games will be locked until then.
As I still want to show you the concept of the game, here is the video.

[media]http://youtu.be/ddM66PziBdA[/media]
Creator #2
Posted 26 April 2015 - 10:55 PM
This is truly waesome. And you've got 500 subs. I think I've already watched you on YouTube Before
Bomb Bloke #3
Posted 27 April 2015 - 01:28 AM
That's outstanding. :)/>

Are there any potential issues with mobs spawning due to lack of light? I'm fairly sure I spotted an extra zombie appearing at some point, and a creeper taking out one of those chests could be catastrophic for the player.

Speaking of which, what happens if the player dies? Do they outright "lose", or is there some sort of respawn-at-a-penalty thing?

I don't fancy myself as terribly imaginative, but I suppose if you wanted an idea for another room, you might make one with colour-coded teleport pads.

Another idea I once toyed with involved blocks of sand held up by other blocks; buttons or switches could be used to remove the supporting blocks, allowing the sand to fall into places where they could be used as "stepping stones".
Kaikaku #4
Posted 27 April 2015 - 08:29 PM
This is truly waesome. And you've got 500 subs. I think I've already watched you on YouTube Before
That's outstanding. :)/>

Thank you :D/>


Are there any potential issues with mobs spawning due to lack of light? I'm fairly sure I spotted an extra zombie appearing at some point, and a creeper taking out one of those chests could be catastrophic for the player.
I turned off natural spawning and I don't dare to spawn creepers.
Had some issues with a TNT redstone contraption destroying next room's door access. Solved it with a work around, but this adds to the restrictions for room set-up. The sandstone is blast resistant. Btw I use adventure mode, so breaking blocks is very limited.


Speaking of which, what happens if the player dies? Do they outright "lose", or is there some sort of respawn-at-a-penalty thing?
That's a very good point, atm the game just ends. You may get a better time for the solved levels, but genereally this is also for me a bit frustrating while testing…
Will be tricky to solve, due to the different ways to lose:
Beside dying or falling into the void,
in one room you may trap yourself in the room (with a suicide hole)
or you mine a block (I won't tell you that I talk about leaves) that you need to jump on
or you removed a redstone that you need.
I could leave the player all gold ingots etc., take away all food and armor and give him instead a one-use pick, one block and a redstone. Hm?



I don't fancy myself as terribly imaginative, but I suppose if you wanted an idea for another room, you might make one with colour-coded teleport pads.

Another idea I once toyed with involved blocks of sand held up by other blocks; buttons or switches could be used to remove the supporting blocks, allowing the sand to fall into places where they could be used as "stepping stones".

Nice! For sure I will do the teleport room.
I also thought about options with falling sand. If the player gets more lives, I must ensure, that he is able to finish after doing something wrong.
Or I use command blocks to generate and destroy the sand…
TechedZombie #5
Posted 27 April 2015 - 10:10 PM
Sweet! Looking Forward to its completion!
Bomb Bloke #6
Posted 28 April 2015 - 03:14 AM
I could leave the player all gold ingots etc., take away all food and armor and give him instead a one-use pick, one block and a redstone. Hm?

I suppose there's also the option of starting each player off with a wireless pocket computer, rigged to offer a single button that 1) teleports them just outside the front of their current pyramid, 2) resets their inventory back to what they started the game with, and 3) rebuilds that current pyramid from scratch. If they get stuck, they push the button. If they die, you run the same code.

If you do rebuild the maze, you'd need to ensure the player doesn't have anywhere to "hide" items (gold in particular). That is to say, once they get past the first pyramid, you'd block its exit off, and you'd also need to ensure they don't somehow bring chests to place onto the catwalk between the two areas (or just delete them if they do).

The same computer could, if you wanted, show them helpful information such as who's winning and perhaps even which rooms still have gold.
Kaikaku #7
Posted 28 April 2015 - 07:06 AM

I suppose there's also the option of starting each player off with a wireless pocket computer, rigged to offer a single button that 1) teleports them just outside the front of their current pyramid, 2) resets their inventory back to what they started the game with, and 3) rebuilds that current pyramid from scratch. If they get stuck, they push the button. If they die, you run the same code.

If you do rebuild the maze, you'd need to ensure the player doesn't have anywhere to "hide" items (gold in particular). That is to say, once they get past the first pyramid, you'd block its exit off, and you'd also need to ensure they don't somehow bring chests to place onto the catwalk between the two areas (or just delete them if they do).

The same computer could, if you wanted, show them helpful information such as who's winning and perhaps even which rooms still have gold.
  • (1) is a nice idea. So far (beside of decorative blocks) the player is only confronted with vanilla blocks in the pyramid. That's a left over design decision, from the time where I thought I could do a simpler version just with command blocks. I still don't want to scare players off with mod specific riddles, but I guess for ComputerCraft I could do an exception. And pocket computer with one touch button is not so sifficult to understood ;)/>
  • Hm, I see there some issues for number (2), that I currently don't know how to solve.
  • In 1.7 you are quite limitted when it comes to check player (or chest) inventories. Think an item detection is not possible, only a deletion of items. I first tried to go with a scoreboard to track gold ingots or gold blocks. Scoreboards can be powerful and are some kind of displayable varibales for command block users (so far I only partly understand how to use them). However I figureed out, that in some cases (e.g. shift cklicking a block out of a crafting bench) a scoreboard is increased by two. So it is not reliable.
  • (3) Atm I don't save the pyramid data. For the competitive mode with same pyramid set-up, I'll probably go for simultaneously building both pyramid sets.
  • However, saving the pyramid data will open possibilities for pre-build (easy/hard/complex/…) set-ups or also to exchange pyramid layouts including changing those data.
Bomb Bloke #8
Posted 28 April 2015 - 09:11 AM
Hm, I see there some issues for number (2), that I currently don't know how to solve.
In 1.7 you are quite limitted when it comes to check player (or chest) inventories. Think an item detection is not possible, only a deletion of items. I first tried to go with a scoreboard to track gold ingots or gold blocks. Scoreboards can be powerful and are some kind of displayable varibales for command block users (so far I only partly understand how to use them). However I figureed out, that in some cases (e.g. shift cklicking a block out of a crafting bench) a scoreboard is increased by two. So it is not reliable.

When rebuilding, you'd first delete all blocks in the area you wish to clear from the top down, forcing any dropped items (and bits of sand / gravel) to fall into the void. In the meantime, the player would be moved to the side and their entire inventory cleared. You would include the walkway leading from the previous pyramid to the current one in the reset.

So that you don't need to reset previously-cleared pyramids, you'd need to prevent players from re-entering them once they're exited. There are obviously many ways to do this; one is to build a bedrock wall, another is to delete part of the walkway…

There's no need to "detect" anything.
Kaikaku #9
Posted 28 April 2015 - 10:07 PM
When rebuilding, …

There's no need to "detect" anything.

That's true, key is to save the pyramid data. I guess I will focus on this (beside playing around with the teleport room).
I will "store" the player while restoring the current pyramid in a save place and teleport him just in front of it, when it's done.
Penalty would be loss of equipment from previous pyramids and one live less (from 3 or so).
This way I don't have to take care of messed up/blocked rooms.

Teleport room:
Atm I'm using relative coordinates to teleport the player (so far I'm too lazy to calculate absolute coordinates).
This restricts the room layout, as the player is usually not in the center of the pressure plate when triggering the redstone.
So he might teleport into a wall.
Hm, idea while writing this: I could put the pressure plates with the underlying teleporter one block lower in the ground.
This would ensure that the player is nicely centered.
Bomb Bloke #10
Posted 29 April 2015 - 12:24 AM
That's true, key is to save the pyramid data.

I think it'd be fair enough (and certainly easier!) to just randomise a new one.

Atm I'm using relative coordinates to teleport the player (so far I'm too lazy to calculate absolute coordinates). This restricts the room layout, as the player is usually not in the center of the pressure plate when triggering the redstone. So he might teleport into a wall. Hm, idea while writing this: I could put the pressure plates with the underlying teleporter one block lower in the ground. This would ensure that the player is nicely centered.

Likely it'd be easier, in the end, to just calculate the absolute co-ords.
Kaikaku #11
Posted 01 May 2015 - 06:05 PM

Atm I'm using relative coordinates to teleport the player (so far I'm too lazy to calculate absolute coordinates). This restricts the room layout, as the player is usually not in the center of the pressure plate when triggering the redstone. So he might teleport into a wall. Hm, idea while writing this: I could put the pressure plates with the underlying teleporter one block lower in the ground. This would ensure that the player is nicely centered.
Likely it'd be easier, in the end, to just calculate the absolute co-ords.

I'll add an option to make the command block command using absolute coordinates.
The only-relative-coords thing is quite limmiting those kinds of room designs.

Edit: Finished the absolut coordinates and the teleport room. Could be much more difficult, but I'm satisfied with it for now :)/>
Edited on 01 May 2015 - 09:16 PM
Bomb Bloke #12
Posted 02 May 2015 - 12:24 AM
Looks good. :)/>
Kaikaku #13
Posted 03 May 2015 - 04:48 PM

Or, for added flexibility (allowing you to perform a command from multiple points within your main work loop, should you so choose):
Spoiler
-- variables
local maxCommands=250
local curCommands=0
local commandComputerCommand=""

-- functions
local function doOneCommand(commandComputerCommand)
  while curCommands >= maxCommands do os.pullEvent("task_complete") end
  commands.execAsync(commandComputerCommand)
  curCommands = curCommands + 1
end

local function pullTaskComplete()
  while true do
		os.pullEvent("task_complete")
		curCommands = curCommands - 1
  end
end

local function doWork()
  while true do
	-- building program stuff, incl.
	-- commandComputerCommand="..."

	doOneCommand(commandComputerCommand)
  end
end

-- main
parallel.waitForAny(pullTaskComplete,doWork)

Just added parallel.waitForAny code to prevent exeeding the task limit and it works nicely :)/>

Building the 5 pyramids in a row takes atm about 17,000 command block commands.
Thereof about 2,000 could be saved as inlying walls are built twice (will fix this).
Kaikaku #14
Posted 15 May 2015 - 04:25 PM
==> The topic in games is now unlocked and updated.