Jump to content




[MC 1.7.10][CC 1.74] RandomPeripherals, read NBT data from every item and more

peripheral utility turtle

43 replies to this topic

#21 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 30 August 2015 - 06:46 AM

Excellent! The projectors are now updating reliably, the UIs are picking up their peripherals correctly, and I've got plans for that new event info. :)

And I see wired modems can now attach to projector bases, too! Mwuhahah!

There are a few new bugs, though: getBlock isn't returning anything, setVelocity only applies after the blocks in the hologram are altered in some other way (eg via clear), and setRotation doesn't apply until the chunk reloads (and best I can make out it doesn't entirely work correctly then, either, though getRotation always reports what it "should" do).

But good work, and thanks for updating! :)

Edit: ah, another thing: The projectors seem to break instantly if punched without a tool.

Edited by Bomb Bloke, 30 August 2015 - 10:23 AM.


#22 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 20 September 2015 - 12:03 AM

Seems that placing a projector simply deletes whatever block is above it - regardless as to whether it's dirt, diamond, bedrock, etc...

Edit: I made a slide puzzle out of them. :)

Edited by Bomb Bloke, 26 September 2015 - 12:30 PM.


#23 gollark8

  • Members
  • 207 posts

Posted 27 September 2015 - 12:11 PM

I love the hologram projectors. With some work, they could be used to control construction turtles.

#24 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 27 September 2015 - 12:26 PM

View PostBomb Bloke, on 20 September 2015 - 12:03 AM, said:

Seems that placing a projector simply deletes whatever block is above it - regardless as to whether it's dirt, diamond, bedrock, etc...

Edit: I made a slide puzzle out of them. :)

That gives me fun idea. Treat array of projectors like in your slide puzzle and create terminal object so that you could technically redirect contents of computer terminal onto hologram screen. Would need to builld font library of letters as shapes and use wool blocks for colors. I am correct in assuming that hologramTouch event tells you witch of hologram blocks was pressed? I think this is going onto my todo list :P

#25 gollark8

  • Members
  • 207 posts

Posted 27 September 2015 - 01:09 PM

View Postwojbie, on 27 September 2015 - 12:26 PM, said:

View PostBomb Bloke, on 20 September 2015 - 12:03 AM, said:

Seems that placing a projector simply deletes whatever block is above it - regardless as to whether it's dirt, diamond, bedrock, etc...

Edit: I made a slide puzzle out of them. :)/>/>

That gives me fun idea. Treat array of projectors like in your slide puzzle and create terminal object so that you could technically redirect contents of computer terminal onto hologram screen. Would need to builld font library of letters as shapes and use wool blocks for colors. I am correct in assuming that hologramTouch event tells you witch of hologram blocks was pressed? I think this is going onto my todo list :P/>/>

Stained glass doesn't render properly, and it comes up as a solid color. So while it may not last long, it's the best choice for this stuff right now.

I was considering that sort of redirect, but I was a bit busy hooking up Value Noise to a hologram projector.
In my opinion a term object with 3D capabilites (term.setLayer etc) would be cooler. Imagine a 3D file browser!

Edited by gollark8, 27 September 2015 - 01:10 PM.


#26 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 27 September 2015 - 01:36 PM

View Postgollark8, on 27 September 2015 - 01:09 PM, said:

In my opinion a term object with 3D capabilites (term.setLayer etc) would be cooler. Imagine a 3D file browser!

Thanks for the tip with glass. Will see,
As for layers? You want to make something avesome :P I just want to play worm on hologram :D

Edit: Now i am thinking about it.. 3D Worm.

Edited by wojbie, 27 September 2015 - 01:37 PM.


#27 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 27 September 2015 - 04:04 PM

Putting the background on one layer and the text just above it would be sufficient to make most any script look pretty cool.

The way stained glass renders seems to depend on the angle of your camera... or something. If one visible block becomes opaque, then all do. Most angles result in opaque glass, which is quite handy. The result is a brightly coloured and untextured block.

There's also stained clay, which is darker compared to wool. Heck, you could use the three different shades provided by the three different blocks to provide a shade control to a "display".

Each projector indeed includes its identity in the events they generate (assuming you're on at least RandomPeripherals 1.4c), so it's easy to precisely pinpoint where a click was performed so long as you know where the projectors are. My slide puzzle script has a "calibration" process for gathering positional information (saving a config file when it's done), which I'd been considering splitting into a separate script so that it could be easily used for other multi-projector purposes. I suggest trying that out and using the generated config file for your own purposes - should save some time. Note that hologram rotating is busted in the latest RandomPeripherals build, so you currently need to implement it within your own code instead.

As far as fonts go, the easy method would be to just convert one of the font files MineCraft uses (these being square image files with the 256 characters arranged in a 16x16 pattern), to something that a script can load. You then take the pixel map for each character and store it in a 6x8 array (or apply the relevant maths if the font file is from a high-res texture pack), and hey presto - an array of 39x19 projectors would be able to simulate a 51x19 display. Cursor blinking is the only tricky(ish) part - well, that, and the screen being over two chunks wide. You'd need about four and a half thousand redstone dust to build it legitimately.

You could also load the glyphs at their actual resolution, that being 8x8, which'd make it possible to render the whole code-sheet without cropping any characters (the fact that you can't do this if you load at 6x8 is why we get question marks on regular ComputerCraft terminals). Your display would end up even wider, though...

Once upon a time I drew a low-res font file:

Posted Image

That one offers 4x6 characters, which'd only require a 26x15 array of projectors (about halving the cost to build, and making it somewhat easier to use, to).

The one other hurdle that comes up is that I've found the projector's setBlockMeta() function seems to take a fraction of a second between setting the block ID, and its meta data. If you watched my video you probably noticed how some of the blocks turned white while the slide puzzle panels slid around. I'm fairly certain draw() is immune to this problem, though.

But yeah, a projected terminal would work very well with the MoarPeripherals Keyboard.

Edited by Bomb Bloke, 10 February 2016 - 11:19 PM.


#28 Konlab

  • Members
  • 595 posts
  • LocationKerbin

Posted 27 September 2015 - 04:04 PM

Can I project a Hologram Projector projecting an other projector?

#29 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 27 September 2015 - 04:10 PM

Nah, you can only set the metadata of the blocks projected, not the NBT data that'd be required to make the projected blocks project.

Assuming you can project projectors at all. I found I couldn't project Command Computers, for some reason.

If it counts, at one point I took a screenshot of a projected image, and then projected that. :P

#30 Konlab

  • Members
  • 595 posts
  • LocationKerbin

Posted 27 September 2015 - 04:16 PM

View PostBomb Bloke, on 27 September 2015 - 04:10 PM, said:

Nah, you can only set the metadata of the blocks projected, not the NBT data that'd be required to make the projected blocks project.

Assuming you can project projectors at all. I found I couldn't project Command Computers, for some reason.

If it counts, at one point I took a screenshot of a projected image, and then projected that. :P/>
Maybe you can't project TileEntities...

#31 Konlab

  • Members
  • 595 posts
  • LocationKerbin

Posted 27 September 2015 - 04:22 PM

Bomb Bloke said:

-Very long post-
Imagine playing Miniaturecraft in holo-projectors

#32 negamartin

  • Members
  • 46 posts

Posted 03 October 2015 - 02:07 PM

Wow. Projectors are really awesome.
Maybe to project stuff taller than 8 blocks you could stack projectors?
A stack of projectors would project on the top, but the height limit is increased by 8 by every projector in the stack?
Just a suggestion.
Awesome mod :)

#33 redstoneduck

  • Members
  • 20 posts

Posted 19 November 2015 - 09:20 PM

Update time!

1.4d released
It's just an bugfix update so don't hope for something big(sorry)
The only "feature" is that transparent blocks render now actually transparent when they are projected by a hologram projector

Get it here: https://github.com/R...herals/releases

#34 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 28 November 2015 - 12:35 AM

Thanks for the update. That does seem to fix everything I'd listed. :)

.... but I'm afraid the hologram transparency fix brings a new bug; now blocks which should be rendered as opaque are see-through, unless viewed on obscure angles (where previously, transparent blocks would render as opaque unless viewed on obscure angles).

#35 redstoneduck

  • Members
  • 20 posts

Posted 28 November 2015 - 05:11 PM

I tried most situations with transparency and everything seems to work correctly. The only problem I found was when one hologram projector is viewied through another. This isn't the fault of Random Peripherals, this comes from the deepest levels of the minecraft rendering engine(http://www.opengl-tu...0-transparency/, Minecraft doesn't sorts it's transparent triangles).

Edited by redstoneduck, 28 November 2015 - 05:12 PM.


#36 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 28 November 2015 - 10:58 PM

I'm able to reproduce with a single projector. Here's one after running projector.clear("minecraft:dirt", 0).

Edited by Bomb Bloke, 10 February 2016 - 11:20 PM.


#37 redstoneduck

  • Members
  • 20 posts

Posted 30 November 2015 - 09:13 PM

I tried it by my self and everything works as it should.
Could you describe your setup a little bit better? How many hologram projectors are running beside this one? Does this happen with every hologram projector or only with this one? What kind of GPU are you using?

Edited by redstoneduck, 30 November 2015 - 09:13 PM.


#38 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 01 December 2015 - 01:08 AM

View Postredstoneduck, on 30 November 2015 - 09:13 PM, said:

How many hologram projectors are running beside this one?

Well, in the world where I took that screenshot, somewhere around two and a half thousand projectors have images over them within the nearby loaded chunks.

I stripped things down to just ComputerCraft 1.74 / CoFHCore 3.0.3-303 / RandomPeripherals 1.4d, created a new world, placed a single projector and "dirt cleared" it. Same deal; from some angles it appears correctly, from some angles it does not. The proximity of other blocks to the projector also doesn't seem to matter.

View Postredstoneduck, on 30 November 2015 - 09:13 PM, said:

Does this happen with every hologram projector or only with this one?

Exactly which projectors are affected at any given moment depends on the angle of my character's view relative to the world. I'm able to reproduce with any projector, though some projectors seem more prone to failure than others (changing each time I relaunch the game). It's possible to get all to appear correctly, some to appear correctly, or none to appear correctly. Aiming the camera lower usually seems to affect more projectors. I sometimes found that immediately after loading a world I was not able to reproduce for anywhere up to about ten seconds.

View Postredstoneduck, on 30 November 2015 - 09:13 PM, said:

What kind of GPU are you using?

My laptop has two, an Intel HD Graphics 4600 and a NVIDIA GeForce GT 740M. Switching between these makes no apparent difference other than to my frame rate.

Edit:

It took me a while to cotton on, but this bug is affecting blocks which are supposed to be transparent, too: They turn much brighter when affected.

Edited by Bomb Bloke, 01 December 2015 - 01:51 AM.


#39 redstoneduck

  • Members
  • 20 posts

Posted 02 December 2015 - 06:59 PM

Ok, I don't have a plan how to fix this.
I'm going to release a version which includes the option to turn off the transparency in the config(or maybe I let it turned off by default)

Oh and reader of this post, please try the new version of random peripherals and report if everything works or not and your GPU(thats the only clue I have at the moment, because I have an AMD GPU this could be the problem)

#40 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 02 December 2015 - 10:11 PM

Indeed, some more testers in here would be very helpful.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users