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

Taken - A programming oriented puzzle game

Started by SquidDev, 28 March 2016 - 03:03 PM
SquidDev #1
Posted 28 March 2016 - 05:03 PM
Taken
A while back I found this great Javascript game called Untrusted. I thought this would work really well in Minecraft using command computers.

However 1.7.10 was missing fill which resulted very slow generation times. Now that 1.8.9 1.12.2 is out, this is actually feasible.

Taken is a puzzle game. Each level is generated by a program, which you have to edit in order to get to the finish. However, you can only edit some of the program, meaning you have to think of clever ways to get around it.

PlayingPlease note, this is still a work in progress. I'm uploading this to see if you guys like the concept.

Screenshots
SpoilerThe first level. Not much here

The second level

The second level's code

The second level's solution

Result of the above code
Features, Credits, etc…
  • This uses a fork of GravityScore's LuaIDE (basically adds read-only sections and fancy buttons)
  • Spectator mode: have a look around the level before continuing play.
  • OP zombies, lava, computers!
Planned features
  • Turtles: I'd love to integrate these somehow
  • Teleporters: teleport you to another block. Teleportation mazes would be cool.
Edited on 22 November 2017 - 07:37 PM
LoganDark #2
Posted 28 March 2016 - 07:46 PM
Seems interesting. :P/>
Bomb Bloke #3
Posted 29 March 2016 - 06:49 AM
Here's a link for an immediately playable Untrusted.

The pocket computer interface would be much less painful to work with if you could eg right-click-and-drag to move the view around. Text selection via mouse would be great too, though that might be asking too much…

Scrolling breaks the keyword highlighting (though you've probably noticed that for yourself), and clicking on the line numbers that run down the left edge of the editor does weird stuff.

I crashed upon entering the beacon after Moving That Wall:

startup:137: Already a block at 24, 12

Put myself back into creative, smashed through some walls, and restarted. Was fine the second time around.

Level -1's too hard, though. :(/>

Block placement speed in MC 1.7.10 isn't too bad. I can manage somewhere over a couple of thousand per second, though I'll admit that's a lot less than it sounds; like ten layers of a chunk. My main problem was a certain bug that Dan fixed for MC 1.8.

I wouldn't worry about a story, as such - Untrusted didn't have one to speak of, and your main source of "interesting material" here is in the puzzles, anyway. Lua's a whole different language to Javascript, it's really flexible, so you can really string out the game of encouraging one workaround one level, then blocking it off for the next. You might consider using different terrain every now and then (it gives a nice sense of progression), but that's about it.

Edit:

Player state: blocks which kill you when you aren't a particular colour.

… racist blocks??
Edited on 29 March 2016 - 04:51 AM
SquidDev #4
Posted 29 March 2016 - 08:06 AM
The pocket computer interface would be much less painful to work with if you could eg right-click-and-drag to move the view around. Text selection via mouse would be great too, though that might be asking too much…

Scrolling breaks the keyword highlighting (though you've probably noticed that for yourself), and clicking on the line numbers that run down the left edge of the editor does weird stuff.
I'd never clicked on the line numbers before. That is weird… The editor needs a lot of work. Text selection would be nice, I'll have a look about how feasible it is to add. Everything else should be pretty easy to fix. Pocket computers are a pain but I can't think of a better way.

I crashed upon entering the beacon after Moving That Wall:
startup:137: Already a block at 24, 12
Put myself back into creative, smashed through some walls, and restarted. Was fine the second time around.
That is really odd. I'll have a look, but I'm not sure how that happened.

Block placement speed in MC 1.7.10 isn't too bad. I can manage somewhere over a couple of thousand per second, though I'll admit that's a lot less than it sounds; like ten layers of a chunk.
Truth be told the old code was rather sub-optimal in placing blocks, but 1.8.9 commands did make it much easier. Also armour stands!

Lua's a whole different language to Javascript, it's really flexible, so you can really string out the game of encouraging one workaround one level, then blocking it off for the next. You might consider using different terrain every now and then (it gives a nice sense of progression), but that's about it.
Hmmm, that gives me some ideas for metatable tricks. I'd love to have a wider variety in terrain, I did what I did because it was easier to generate/build :)/>.

Player state: blocks which kill you when you aren't a particular colour.
… racist blocks??
You guys can make anything sound bad :(/>.

Thanks for the feedback!
Edited on 29 March 2016 - 06:06 AM
Bomb Bloke #5
Posted 29 March 2016 - 08:45 AM
Pocket computers are a pain but I can't think of a better way.

Weeeelllll, you could always just spawn regular computers on or under the position you start the player at. Yeah, there needs to be a mobile interface for resetting if players somehow get themselves trapped in a pit or something, but that doesn't need to be the same interface they do their coding through.

Bonus points if you make the Command Computer run two scripts (through multishell), one to handle the pocket computer, one to handle the regular computer. If one crashes than the other can be used to reset.

I'd love to have a wider variety in terrain, I did what I did because it was easier to generate/build :)/>

Oh, I'm just talking colour and whatnot. Five stages in the "metal world", then five stages in the "grass world", then five in the "wood world", and so on. Point is, you don't need to get too complex when it comes to marking progress through a puzzle game - a story beyond "go defeat evil Dr Whoever!" and "you defeated evil Dr Whoever!" is overkill.
Edited on 29 March 2016 - 06:48 AM
LoganDark #6
Posted 29 March 2016 - 02:00 PM
Player state: blocks which kill you when you aren't a particular colour.

… racist blocks??
LMAO. I got a good laugh out of that one! :P/>
SquidDev #7
Posted 30 March 2016 - 12:55 PM
There is an update! This is mostly adding features rather than improving existing ones (changelog below).

I'd love to see your solutions to various levels: either PM me or put them in this topic (in a spoiler). Some levels probably have solutions that are easier than they should be so I'd like to catch these - the later levels are meant to be at least a bit hard. Level #8 is horrible so I'd like to see any solution you have. As always, if you have any suggestions do say!

Screenshots
Spoiler

Changelog
  • Fix several editor bugs
  • Add world.decorate: this is important for several levels!
  • Add invisible mines and colour-coded mines
  • Add biome/environment system: normal lab, plains, more coming soon!
  • 4 new levels
Planned for next release
  • Turtles!
  • Documentation. Do you guys have ideas about the best way to do this?
  • Use computer to edit instead.
  • Save progress and give option to resume or start anew.
Lupus590 #8
Posted 30 March 2016 - 01:32 PM
  • Documentation. Do you guys have ideas about the best way to do this?

http://readthedocs.org/
SquidDev #9
Posted 30 March 2016 - 01:44 PM
I'd rather have something integrated into the game. Otherwise I'd just use GitHub's wiki functionality. I'm probably just going to have a help screen with some basic documentation of the various objects.
Bomb Bloke #10
Posted 31 March 2016 - 12:00 AM
To explain new objects / mechanics, you could always just spawn signposts. It would be nice to have key strings / functions added to a "database" of some sort as you encounter them, though.

Maybe worth moving the exit for chapter five (with the mines) so that the player has to cover more ground to get there.

The scoreboard pronounces the state of "ThatVeggie" in addition to myself. Great way of handling the colour thing, by the way.

My solution to #8:

SpoilerPlace an exit directly next to the start location, then override assert.eq with an "empty" function.

I've found that clicking around within the IDE on #-1 glitches it out and gives me extra lines. I can't type into them, but the negative numbered ones can be used to crash the editor.
SquidDev #11
Posted 31 March 2016 - 08:12 AM
To explain new objects / mechanics, you could always just spawn signposts. It would be nice to have key strings / functions added to a "database" of some sort as you encounter them, though.
Only showing features you have encountered so far would be nice. That way no one will be overwhelmed with features starting off. Thanks!

Maybe worth moving the exit for chapter five (with the mines) so that the player has to cover more ground to get there
Yeah, I noticed sometimes you can run it without dying. I'll change that

The scoreboard pronounces the state of "ThatVeggie" in addition to myself. Great way of handling the colour thing, by the way.
Hmm. I forgot to clear the scoreboard. -_-/>

My solution to #8:
SpoilerPlace an exit directly next to the start location, then override assert.eq with an "empty" function.
That is evil. I'm probably going to change that as it allows you to override any validation though. Sorry :(/>.

I've found that clicking around within the IDE on #-1 glitches it out and gives me extra lines. I can't type into them, but the negative numbered ones can be used to crash the editor.
Thanks. I'll fix that now.
Edited on 31 March 2016 - 06:12 AM
Antelux #12
Posted 01 April 2016 - 12:28 AM
I like the idea of this. I'm sure it can become something really awesome. +1
HDeffo #13
Posted 15 May 2016 - 03:50 PM
Pretty sure you need to update the download link again with the rollback that happened
SquidDev #14
Posted 15 May 2016 - 05:33 PM
Pretty sure you need to update the download link again with the rollback that happened

Thanks, totally forgot. Hoping to get an update out later today fixing the things you and Bomb Bloke reported.
Bomb Bloke #15
Posted 16 May 2016 - 12:41 AM
I'm hoping you get another update out later today, too. ;)/>

Moar levels!
Saldor010 #16
Posted 16 May 2016 - 02:29 AM
Just an idea, since this is an actual world download instead of just code, it might not be a bad idea to make a technic pack for people who would otherwise be too lazy to download it.
SquidDev #17
Posted 16 May 2016 - 07:58 AM
I'm hoping you get another update out later today, too. ;)/>/>
Moar levels!

I've pushed the update but no new levels, just fixes for your sneaking tricks. Sorry :(/>.

Just an idea, since this is an actual world download instead of just code, it might not be a bad idea to make a technic pack for people who would otherwise be too lazy to download it.
I'm probably going to put the world download on Curse when I'm happy with it. Does Technic allow including worlds within a pack?
Edited on 16 May 2016 - 05:59 AM
Saldor010 #18
Posted 16 May 2016 - 02:31 PM
I'm probably going to put the world download on Curse when I'm happy with it. Does Technic allow including worlds within a pack?

If by allow, you mean that it's not against some rule somewhere? I have no idea.
If by allow, you mean that it's possible to do it? Yeah, I've seen people do it before.
Bomb Bloke #19
Posted 17 May 2016 - 11:24 AM
Grr. Throwing fake errors on perfectly valid code is cheating.

I notice that scrolling the editor to the right and then holding backspace causes the cursor to move into the margin on the left. Doing this after scrolling down as far as possible causes some gibberish about an "Offset" to appear. If I scroll to the bottom and remove lines using the delete key instead, phantom lines appear below the final line of code. Clicking these gets the same Offset message and removes them; alternatively, scrolling down into them crashes the editor.

I'm probably going to put the world download on Curse when I'm happy with it.

Would it not be easier to distribute as a single script file? The chambers should be easy to construct on the fly via a few fill commands, and it likewise wouldn't be too complex to program the pocket computer using the command computer.

Speaking of "stuff I was assuming you just hadn't gotten around to coding yet but maybe you really haven't thought of it", it's possible for the player to permanently lose their pocket computer by eg throwing it into lava, and there's also the matter of starvation.
SquidDev #20
Posted 17 May 2016 - 11:55 AM
Grr. Throwing fake errors on perfectly valid code is cheating.
I know: I don't really like it either. Though if I don't have it you can bypass every script by overriding the generate function and then returning before the validation function is created. This kinda bypasses the point of the game. Short of putting everything in separate files I'm not sure of another way to prevent this.

I notice that scrolling the editor to the right and then holding backspace causes the cursor to move into the margin on the left. Doing this after scrolling down as far as possible causes some gibberish about an "Offset" to appear. If I scroll to the bottom and remove lines using the delete key instead, phantom lines appear below the final line of code. Clicking these gets the same Offset message and removes them; alternatively, scrolling down into them crashes the editor.
Ugghr, editor bugs. I'll have a look at it: thanks!

Would it not be easier to distribute as a single script file? The chambers should be easy to construct on the fly via a few fill commands, and it likewise wouldn't be too complex to program the pocket computer using the command computer.
True. Currently some locations are hard coded, but could easily be made variables. This would make distribution much easier.

Speaking of "stuff I was assuming you just hadn't gotten around to coding yet but maybe you really haven't thought of it", it's possible for the player to permanently lose their pocket computer by eg throwing it into lava, and there's also the matter of starvation.
Yeah, its been in the back of my mind, I just haven't got round to fixing it.

Thanks for all the feedback :)/>.
Edited on 17 May 2016 - 09:56 AM
Bomb Bloke #21
Posted 18 May 2016 - 03:54 AM
Seems it's still quite possible to complete the jumping course without code (I'm unclear on whether that's intentional), and it's also likewise still possible to run between the corners of the coloured lines (obviously not intentional).

SpoilerChapter 5 is presumably best solved with world.decorate() (my initial solution was to spam mines on the far side of the map and then return before the rest of the random ones could be placed), but to discover the usage of that function I had to peek into the command computer's source as none of the level scripts give it away (and you haven't fully implemented your documentation system yet).

Chapter 8 has turned into a bit of a stumper. I'm getting the impression you've put it there as a debug level - no intended solution, so anything which solves it needs to be fixed! :P/>

SpoilerI eventually discovered that I could call world.distribute() in the setup function, which somehow fails to trigger the "block already at location" errors I got when calling it in the generate function. This let me spam dye panels most everywhere, producing a safe path to the exit.

Short of putting everything in separate files I'm not sure of another way to prevent this.

That's also all I can come up with.
Edited on 18 May 2016 - 02:02 AM
SquidDev #22
Posted 18 May 2016 - 12:07 PM
Seems it's still quite possible to complete the jumping course without code (I'm unclear on whether that's intentional), and it's also likewise still possible to run between the corners of the coloured lines (obviously not intentional).
Yeah, it should be possible to complete that level without code. I think if you move slowly across the corners it should trigger but I guess if you are running fast enough it won't. I'm currently trying +-0.05m of either side of the player so I could always increase that threshold. If I increase it too much though it will trigger when it shouldn't.

chapter 5 solution
Yeah, I'm working on documentation. That is the intended solution though.

chapter 8 solution
There is a solution but that sounds like a bug. I'll allow it though :)/>.
SpoilerI've been using math.randomseed to set a constant seed in the setup function, then use the same seed to decorate the blocks. I'm sure there are simpler solutions though.
Edited on 18 May 2016 - 10:07 AM
Bomb Bloke #23
Posted 19 May 2016 - 02:32 AM
chapter 8 solution

SpoilerI can't quite get that to work, short of typing out a custom version of the distribute() function into the pocket computer (one that calls decorate() instead of world.setBlock())… but surely you don't expect people to have to read the Command Computer's source to get by?? :wacko:/>

(world.setBlock() can place dyes, but anything (eg mines) may overwrite them - as in, removing them. Trying to overwrite pretty much anything else with setBlock() (eg mines with dyes) leads to a crash, unlike when calling decorate(). So the only solution I can see is to place dyes everywhere before allowing the mines to be distributed, effectively decorating everything but the mines; but even that relies on the somewhat un-hinted knowledge that dyes can be overwritten.)

You know what'd be handy? If the Command Computer tracked how many levels a given player has cleared, and had a selector menu allowing you to jump to a any you've reached in the past.
Edited on 19 May 2016 - 12:34 AM
SquidDev #24
Posted 19 May 2016 - 08:41 AM
-more chapter 8 stuff-
SpoilerYou can always override the setBlock function instead. Using dyes (or any over-writable block) is a sneaky trick: should have thought of that.

You know what'd be handy? If the Command Computer tracked how many levels a given player has cleared, and had a selector menu allowing you to jump to a any you've reached in the past.
Its on my todo list. I'm part way through exams so can't spend as much time as I'd like to on this :(/>.
Edited on 19 May 2016 - 06:42 AM
Creator #25
Posted 22 May 2016 - 04:35 PM
Just spent 1-2 hours on this.

My only complaint is the lack of documentation. Everything else is great.
SquidDev #26
Posted 20 June 2016 - 09:48 PM
Slowly making progress on this. I've manage to get everything building correctly without overwriting the command computer. It also handles rotations which is kinda fancy: the arena goes in the direction the computer is facing. I've got some documentation prototype stuff together so there should be another release soon. For the time being have some amusing images as a result of testing:

Edited on 20 June 2016 - 07:48 PM
Sewbacca #27
Posted 07 February 2017 - 10:29 PM
Am I stupid?
I ran into the beacon and just two times i were teleported into the next chapter. (current: hordes of zombies)
Please help me, i wanna beat the game.
:(/> :(/> :(/>
Edited on 07 February 2017 - 09:35 PM
SquidDev #28
Posted 07 February 2017 - 10:36 PM
Am I stupid?
I ran into the beacon and just two times i were teleported into the next chapter. (current: hordes of zombies)
Please help me, i wanna beat the game.
:(/> :(/> :(/>
Sorry, I'm slightly confused about what you're describing. Did it make you skip a level?
Sewbacca #29
Posted 07 February 2017 - 11:31 PM
Am I stupid?
I ran into the beacon and just two times i were teleported into the next chapter. (current: hordes of zombies)
Please help me, i wanna beat the game.
:(/> :(/> :(/>
Sorry, I'm slightly confused about what you're describing. Did it make you skip a level?
I mean, if i run into the exit (beacon), often nothing happens and in chapter 'hordes of zombies', the exit completly didn't worked.
Edited on 07 February 2017 - 10:34 PM
Bomb Bloke #30
Posted 08 February 2017 - 10:05 AM
If the exit didn't teleport you, then that means something has crashed. If you don't see an error on your Pocket Computer, then the next step would be to enable creative mode and locate the nearby Command Computer.
Sewbacca #31
Posted 08 February 2017 - 11:23 PM
Hmm, couldn't reproduce the error today. Maybe it occurs again, hopefully it won't.
Sorry guys.
Edited on 08 February 2017 - 11:07 PM
SquidDev #32
Posted 22 November 2017 - 08:46 PM
Well, it's been a long time, but here's another update. There's no new content (sorry) but there are plenty of other changes:
  • Update to Minecraft 1.12.x. Due to various naming changes, this version is required. It may work on older versions of Minecraft (probably down to 1.10.2) but I offer no guarantees.
  • Automatically generate the arena. Just placing down a command computer and running the init script will setup the arena, place the modem and more! No more faffing around with world downloads.
  • Improve location detection. We use armour stands to track the player's location, removing the occasional rubber-banding.
  • Save progress. On completing a level, current progress will be stored. A decent level selection system will be implemented soonTM.
Whilst I've tested this, I'm sure there will be lots of weird bugs due to the large number of internal changes so watch out! I'm aware that none of the really annoying issues (accidentally dropping pocket computers, low screen resolution) are fixed, but rest assured I'm working on it.

If people have ideas for levels, obstacles, etc… I'd love to hear them. I've a couple of ideas, but there's a limit to my creativity :)/>.
Bomb Bloke #33
Posted 02 December 2017 - 01:14 PM
Really I'd be happy with the resolution if I could just right/middle drag to scroll.

The script could stand to call "gamerule commandBlockOutput false" during the initial setup process, and it doesn't seem possible to revert from Look mode short of exiting the world (clicking [Resume] in chat throws an "Invalid trigger name taken_gm" error).

I still can't for the life of me see how I'm supposed to solve chapter 8. :(/>
SquidDev #34
Posted 02 December 2017 - 02:35 PM
Really I'd be happy with the resolution if I could just right/middle drag to scroll.
Hrmrmr, this isn't behaviour I've seen in an editor before but I guess it'd be possible to implement. Honestly I should probably scrap the current editor and custom-build something for Taken. I kind of want to avoid going down that rabbit hole, but the current editor is just a bit buggy and I'm not sufficiently familiar enough with the code to fix all of it.

The script could stand to call "gamerule commandBlockOutput false" during the initial setup process, and it doesn't seem possible to revert from Look mode short of exiting the world (clicking [Resume] in chat throws an "Invalid trigger name taken_gm" error).
Fixed. Serves me right for not testing in a fresh world before uploading.

I still can't for the life of me see how I'm supposed to solve chapter 8. :(/>
I've mentioned my solution here, but I won't blame you if you don't want to peek!

I'll admit I'm not proud of this chapter. It relies more on "cleverness" rather than intelligence or actual problem solving skills. It'll probably end up getting pushed further back as I add more puzzles.
Bomb Bloke #35
Posted 03 December 2017 - 12:42 AM
Hrmrmr, this isn't behaviour I've seen in an editor before

Really? Try middle-clicking in the one you type your reply into. ;)/>

Honestly I should probably scrap the current editor and custom-build something for Taken. I kind of want to avoid going down that rabbit hole, but the current editor is just a bit buggy and I'm not sufficiently familiar enough with the code to fix all of it.

You've solved all the bugs I've been able to spot thus far, other than the text-colouring bug where it only bothers to parse parts of a line. That's just cosmetic, though.

I've mentioned my solution here, but I won't blame you if you don't want to peek!

I'd already peeked, but I still couldn't see an elegant method of solving it!

But I've figured it out at last: I'd been re-writing "setBlock" within "setup", which doesn't work. I can see why it shouldn't, and if an in-game function documentation ever gets set up (explaining the nature of some of your "safeguards", in addition to the arguments and behaviours of the functions the user gets to call), I think the puzzle would feel fair just as it is. :)/>
byPhins #36
Posted 25 February 2018 - 05:54 PM
Tried it but was too easy to exploit.


world.setBlock(2, 2, "wall")
world.setBlock(x, y, "entrance")

Finished it in 2 min.
SquidDev #37
Posted 26 February 2018 - 09:19 AM
Tried it but was too easy to exploit.

world.setBlock(2, 2, "wall")
world.setBlock(x, y, "entrance")
Finished it in 2 min.
Good catch. It appears I broke the overwrite detection in the previous release: it should be fixed now.
danieldigital #38
Posted 08 May 2018 - 08:30 PM
I made a pastebin installer for it.
pastebin run LPP6Wphb
Bomb Bloke #39
Posted 09 May 2018 - 05:55 AM
Yikes. Why not just have it shell.run() the two lines actually needed to fire up the regular installer?
danieldigital #40
Posted 09 May 2018 - 01:09 PM
<_</> idk why I don't think about that.
pastebin run RBS9tYVE
Sorry.
Edited on 09 May 2018 - 11:10 AM
Luca_S #41
Posted 09 May 2018 - 03:48 PM
This will fail if a script called install already exists. I would suggest the following:

local r = http.get("https://raw.githubusercontent.com/SquidDev-CC/Taken-Map/master/install.lua")
if not r then
  error("Error while downloading installer!")
end
local f = loadstring(r.readAll())
r.close()
if not f then
  error("Error while trying to load installer!")
end
f()