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

CC Pyramid Run (in dev)

Started by Kaikaku, 26 April 2015 - 06:12 PM
Kaikaku #1
Posted 26 April 2015 - 08:12 PM


CC PYRAMID RUN

Hi there!
I'm working already for a while on a command computer based game.
Since the beta of command computers I was facinated by the possibilities and wanted to do something, that you really cannot do with command blocks.
One thing difficult in Vanilla is randomizing lots of command blocks. That's an easy one for computers ;)/> so I came up with this idea.


About the game:
Spoiler
You have to complete/survive 5 levels, each located in a pyramid. Each level is larger and more difficult than the previous. Each level consists of a room grid, starting with 3x3 up to 5x5.

There are atm about 25 different room types. In each level you have to loot all chests to craft a gold block, that opens the exit door (toss it into the hopper).
Beside single player mode I plan multi player for a second player. Spectators will be able to watch your success or failure from above.
The generated levels are highly randomized using command computers. The game uses a prebuild map and a modpack.

Status:
  • submitted to FTB'S Jampacked II
  • so far single player only
  • so far no pack download available
  • video to show concept
  • pastebin of builder
Current video:
(That's the one from "media".)
[media]http://youtu.be/ddM66PziBdA[/media]

About the programs / computers:
  • not ready for pastebin yet
  • builder.lua, pastebin v1.00:The main program for reseting levels. It includes atm the room data as well, but I'll put this in a seperate file.
  • Ppastebin seems to not recognise the closing ]]– and messes up the display.
  • interiorData.lua, pastebin v1.00: This is the data file used by builder. It contains all the room interior data for generation.
  • orchestrator.lua., v1.00: Controller that manages signals form other computers and displays current level times and top 5 on main monitor.
  • Several small programs on further computers that teleport spectators, prepare the player for start, send time messages to the Controller, send progress signals, etc.
How you can try out (atm):
Spoiler
  • I've released the pack for FTB's Jampacked II. This will result in an unlisted pack end of June (?), well…
  • So I will apply for an offical unlisted third party pack to make it available via FTB.
  • I'm also considering a download as Multi MC instance, but then I have to satisfy all the mod permission requirements on my own.
  • I started that, but don't know when this will be ready. On second thought, this won't happen.
  • How to check out the builder.lua in action:
  • 1) generate a (void) world where you can freely build (e.g. on y=60 and go to 0,60,0) 2) make sure to have the required mods installed (see mods) 3) put down a command computer, download builder.lua and interiorData.lua
    4) put a wireless modem on top and a monitor on its right side
    5) enter: build.lua 40 69 -42 3 3 1 ( x y z rooms-x rooms-z level)
    => Here are some
    additional info to set it up by Bomb Bloke

Mods:
Spoiler

For testing the programs you will need the (*) marked mods
  • Carpenter's Blocks
  • ChickenChunks
  • Chisel 2 (*)
  • CodeChickenCore
  • ComputerCraft (*)
  • extrautilities (*)
  • fastcraft
  • Lockdown
  • NotEnoughItems
  • ObsidiPlates
  • OpenBlocks (*)
  • OpenModsLib
  • PerfectSpawn
  • SquidAPI
  • SquidUtils
  • Ztones (*)

Next steps:
Spoiler
  • done: finalize map (spawn area, teleporters, hide computers,…) for beta release
  • done: top 10 5 display and top level times with save file
  • done (but huge lag whlie generation): implement that task limit thing (parallel.waitForAny) I learned from Bomb Bloke
  • done: room data file
  • somewhat done: make mob spawning more level dependant
  • add level dependant room details (e.g., additional holes in the floor for level 5?)
  • clean up the code
  • turn remaining 'say' and 'tell' commands into 'tellraw'
  • iplement some kind of logging for easier bug fixing
  • detection of time outs while generation + continue at last finished pyramid
  • never ending: code more rooms

Ideas for later:
Spoiler
  • multi player
  • two player mode (first only different pyramids, later the same (1.8 commands would really help there!!))
  • at some remote period: include user made rooms (describe room coding, impement syntax checker, use room data from disk drive)

Bugs:
Spoiler
  • fix a bug that occurs because of a short cut I took in programming (water from previous level may destroy in some cases redstone when reseting levels)
  • in rare cases the redstone of one room blocks access to next room
  • take care of generation issues
  • after revival the wooden sword doesn't get to the player


I will keep this first post up to date.
Any comments, suggestions, what so ever are very welcome! :)/>


Edit 2015-05-15: complete update, spoilers and added 2 pastebins, 2015-05-16+24
Edited on 24 May 2015 - 09:02 AM
Lyqyd #2
Posted 26 April 2015 - 08:42 PM
The Programs section and its subsections are for released code. Please report your topic when you have code to post so we can unlock it for you.
Cranium #3
Posted 15 May 2015 - 02:38 PM
Unlocked to provide code.
Kaikaku #4
Posted 15 May 2015 - 02:43 PM
Unlocked to provide code.
Thanks, I'm on it done! :)/>

Submitted to FTB's Jampacked II and updated the first post.

Oh, my gosh, this project is much more complex and time consuming than I thought.
In most cases I know what effort is involved with the "normal" programs, but on top of that:
1) all the new possibilities (and issues) of the command blocks
2) learning and having troubles with the utility mods
3) trying to make the map somewhat cheat resistant
4) about 13 computers that communicate with others
5) unexpected program derping by myself (e.g. atm I've the impression that monitors with modems don't act as they should)

I probably slow down a bit for now (well, I intend to make the game available).
Edited on 15 May 2015 - 02:13 PM
Bomb Bloke #5
Posted 16 May 2015 - 08:26 AM
Without too much digging, it appears FTB currently offers no suitable packs; though their documentation is terrible, so appearances may be deceiving. Resonant Rise through ATLauncher seems to work. It's missing Lockdown, ObsidiPlates, PerfectSpawn, SquidAPI and SquidUtils, but has all the others (such as your *-marked mods). Most (including ComputerCraft) must be ticked from the "optional" list when downloading the pack from within the launcher.

To create the world, set the game mode to creative, hit "more world options", and change the world type to "superflat". /tp yourself to 0 70 0 when you enter.

On a Command Computer with a modem on top and with an advanced monitor to the right (a small one seems to work fine):

pastebin get qapgmdFu build.lua
pastebin get h2URG0mE interiorData.lua
build.lua 40 69 -42 3 3 1

A progress read-out will display on the monitor. Once that's done, the maze should be visible nearby. Bash your way in via the iron door, give yourself a wooden sword, and switch gamemode to 2 (adventure). Re-run the last command on the computer for new mazes, change the numbers to choose the position / size.

What I've played seems to work well, but I do notice that some rooms take dramatically less time to clear than others (eg, a room may contain ladders that you have to navigate, or… just a few flowers, that you can ignore). Dunno if you're already doing this, but it may pay to weight the odds of certain rooms appearing, or outright ensure all players get even amounts of "easy" and "hard" rooms per maze.
Kaikaku #6
Posted 16 May 2015 - 12:04 PM
Many thanks for findinding a suitable mod pack and the details to help people try it out! :)/>

Create all 5 pyramids:

pastebin get qapgmdFu build.lua
pastebin get h2URG0mE interiorData.lua
build.lua 40 69 -42 3 3 1
You can use this set-up up also to generate the other 4 pyramids.
In game I use different coordinates to not overwrite the pyramids, but for testing you can use:

build.lua 40 69 -42 4 3 2 -- for pyramid 2
build.lua 40 69 -42 4 4 3 -- for pyramid 3
build.lua 40 69 -42 5 4 4 -- for pyramid 4
build.lua 40 69 -42 5 5 5 -- for pyramid 5
However, in the later pyramids, you should give you also some protection like leather armor.
In game the ceiling glass and the sandstone is unbreakable. So in the test set-up TNT might destroy a bit too much.

Balancing:

What I've played seems to work well, but I do notice that some rooms take dramatically less time to clear than others (eg, a room may contain ladders that you have to navigate, or… just a few flowers, that you can ignore). Dunno if you're already doing this, but it may pay to weight the odds of certain rooms appearing, or outright ensure all players get even amounts of "easy" and "hard" rooms per maze.
Absolutely true. This is still on my to do list, but I had to postpone it to meet the deadline (was not the only thing ;)/>). In all 5 pyramids together there are atm 82 rooms, so to some degree it will balance it out.

Probably more an issue for fair balancing is the random door set-up. In some cases there are really nasty constellations. This is especially true for the higher levels, where there are two new room types ("jukebox" and "sand-TNT"). Both need you to find an item before you can pass.
Actually, I find it hard for myself to not loose orientation on level 5 :lol:/>

Format used in interiorData.lua:
As the format of the interiorData is now relativley stable I sould do a detailed description of it. For now here are some basic infos, for those who would like to play around with it a little bit.
Example "teleport" room:

{"interiors",{name="teleporter",maxCount={0,0,1,2,2},noExit=true,noEntrance=true}}
  -- floor
  {"base",{y=0,mat="chisel:woolen_clay",dmg=15}}
  -- tank walls
  {"base",{x1=2,x2=8,y1=1,y2=2,z=2,mat="OpenBlocks:tank"}}
  {"base",{x1=2,x2=8,y1=1,y2=2,z=8,mat="OpenBlocks:tank"}}
  -- ...
  -- teleporters
  -- -- left to bottom (white)
  {"blocks",{x=2,y= 0,z=1,mat="chisel:woolen_clay",dmg=0}}
  {"blocks",{x=2,y=-1,z=1,mat="minecraft:command_block",extra="{Command:/tp @p ~-1 ~2 ~4 }",absolute=true}}
  {"blocks",{x=2,y= 1,z=1,mat="ObsidiPlates:ObsidianPressurePlate"}}
  {"blocks",{x=1,y= 0,z=5,mat="chisel:woolen_clay",dmg=0}}
  -- top to left (orange)
  -- ...
  -- chests
  {"blocks",{x=5,y=3,z=5,mat="minecraft:trapped_chest",dmg={2,3,4,5}}}
  -- ...
  -- randomization access to chest
  {"subinterior",{name={"teleporter1","teleporter2","teleporter3","teleporter4"}}}

{"interior", …}
- starts a new room definiton
- maxCount={0,0,1,2,2}: how often may this design be used in level 1, 2, 3, 4, 5.
- The example room "teleporter" is a level 3+ room and may occure twice on level 4 and 5. It is neither allowed to be in the entrance nor in the exit room, as it would mess up the redstone.
{"blocks", …}
- sets one block
- {x,y,z,material,damageValue,extras}: If you set "x=3" this will set the block always there. You can also define an array "x={1,2,3,4,5}", then one of the options will be choosen randomly. This concept applies also to many other options (but not all).
{"summon", …}
- summons one entity (quite complicated NBT-syntax)
{"base", …}
- makes a base/wall/cube from one block type. You may either give a fixed value for x/y/z or you define a range, e.g. "x1=3, x2=7"
{"subinterior", …}
- applies a further interior definition to the same room.
- In the example only one of the 4 sub-interiors will be applied. This randomizes the 4 differnet access ways to the chest.

Edit: Ups, just realized that the teleporter needs ObsidiPlates installed…
Edited on 16 May 2015 - 10:21 AM
Kaikaku #7
Posted 24 May 2015 - 10:34 AM

Format used in interiorData.lua:

Just linked this thread and want to add some information to avoid problems, in case you want to play around with room designs:

You want to put new room designs before this part of code (shows lines 1039 to 1072) and sub-interiors after it:

{"set_cRoomInteriorMaxExit"}
---------------------------------------
---- SUB-INTERIOR DEFINITIONS --------
---------------------------------------

{"interiors",{name="exitmechanism",maxCount={1,1,1,1,1}}}
  {"blocks",{x= 9,y= 0,z=5,mat="minecraft:hopper",dmg=0,extra="{Items:[:{Count:1,Slot:0,id:41}]}"}}
  {"blocks",{x= 9,y=-1,z=5,mat="minecraft:hopper",dmg=0,extra="{Items:[:{Count:17,Slot:0,id:41},{Count:1,Slot:1,id:41},{Count:1,Slot:2,id:41},{Count:1,Slot:3,id:41},{Count:1,Slot:4,id:41}]}"}}
  {"blocks",{x= 9,y=-2,z=4,mat="minecraft:sandstone",dmg=0}}--cRoomMaterial
  -- ...
  -- door
  {"blocks",{x=11,y= 1,z=5,mat="minecraft:iron_door",dmg=7}}
  {"blocks",{x=11,y= 2,z=5,mat="minecraft:iron_door",dmg=8}}


I keep all room and sub-room designs in the array interiors[]. All before cRoomInteriorExit are considered a full room design and may show up in the pyramids.
The sub-interior for the exit mechanism is always interiors[cRoomInteriorExit] and everything after this is only a sub-interior, that may alter a full room design.