These are chat archives for PrismarineJS/prismarine-server

23rd
Apr 2015
demipixel
@demipixel
Apr 23 2015 00:31
Do we have any plans for this? I would love to see this go through, but of course we're all working on mineflayer ATM
Robin Lambertz
@roblabla
Apr 23 2015 00:35
I think once mineflayer has had its first couple of competitions, I'll shift my focus back to Prismarine Server
demipixel
@demipixel
Apr 23 2015 00:35
I'm really excited for both :P
Robin Lambertz
@roblabla
Apr 23 2015 00:35
Same here :P
demipixel
@demipixel
Apr 23 2015 00:35
I tried writing plugins in java/bukkit, but...
It's java :/
Robin Lambertz
@roblabla
Apr 23 2015 00:36
You could write bukkit plugins in JS
demipixel
@demipixel
Apr 23 2015 00:36
Wait, what
You mean, like, somebody makes a bukkit-js
Robin Lambertz
@roblabla
Apr 23 2015 00:36
demipixel
@demipixel
Apr 23 2015 00:36
Except it wouldn't be called bukkit because that's stupid :D
Thats a module that runs javascript in java with bukkit
Doesn't run bukkit on js
Robin Lambertz
@roblabla
Apr 23 2015 00:37
It wraps the bukkit API as well
you can do most of what a bukkig plugin can do
And then, if that's not enough
you can look at narwhal's JS engine
demipixel
@demipixel
Apr 23 2015 00:39
How much is gonna be built into prismarine-server?
Is it gonna be as easy as mineflayer for bots?
Because if so, we won't need a bukkit
Robin Lambertz
@roblabla
Apr 23 2015 00:39
Prismarine-Server should, once finished, behave 1:1 the same as a normal minecraft server
demipixel
@demipixel
Apr 23 2015 00:40
That's not what I mean
Like
Will it have server.on('player_spawn', function(player) {})
Robin Lambertz
@roblabla
Apr 23 2015 00:40
I suppose so
demipixel
@demipixel
Apr 23 2015 00:40
I'm talking about control over it, not just functionality
Robin Lambertz
@roblabla
Apr 23 2015 00:40
There will be a plugin system
Fairly high-level
demipixel
@demipixel
Apr 23 2015 00:40
or will it have enums like COLOR.RED
I guess that goes in the plugin system
Here, lemme ask this
Let's imagine pris-server is done
How hard is it to make an advanced plugin?
Do entities/players have the same format as they do in mineflayer?
Same for blocks?
Robin Lambertz
@roblabla
Apr 23 2015 00:41
Well, that's a different issue
it might not be exactly the same as mineflayer
but it should have the same functionality
more or less
Killing a player would be server.getPlayerByName("roblabla").setHealth(0);
Setting a block would be server.getWorld("nether").setBlock(/ some block /, { x: 0, y: 0, z: 0 });
etc...
demipixel
@demipixel
Apr 23 2015 00:43
What about bungee
Is it gonna support those?
Robin Lambertz
@roblabla
Apr 23 2015 00:43
bungee is fairly implementation-agnostic
demipixel
@demipixel
Apr 23 2015 00:43
AKA multiple worlds
Well, it wouldn't just be getWorld('nether') now
Robin Lambertz
@roblabla
Apr 23 2015 00:43
That's completely different
demipixel
@demipixel
Apr 23 2015 00:43
It'd be getWorld('name').getDimension('nether')
or something
Robin Lambertz
@roblabla
Apr 23 2015 00:43
nononono
A dimension is a world
That'd have to be a completely separate program really
demipixel
@demipixel
Apr 23 2015 00:44
Separate program?
Or could it be a plugin?
Robin Lambertz
@roblabla
Apr 23 2015 00:44
Well, let me explain
By default, in prismarine-server, every world (or dimension) has its own thread
so they run independently of each-other
demipixel
@demipixel
Apr 23 2015 00:45
Okay
Robin Lambertz
@roblabla
Apr 23 2015 00:45
Now, what you're describing here would mean we make each world being able to run on its own separate physical server
that's not impossible per se, but it'd be incredibly hard to keep them communicating consistently
Generally speaking, what you want to do (have multiple servers talk to each-other) has traditionally been solved by using a pub/sub server
So every minecraft server connects to the pub/sub server and communicate through that
(You can think of a pub/sub server as a chatroom, except for softwares to talk to eachother :P)
demipixel
@demipixel
Apr 23 2015 00:47
What about this
Can't each one run as a separate server?
Robin Lambertz
@roblabla
Apr 23 2015 00:47
each world ? no.
demipixel
@demipixel
Apr 23 2015 00:47
no
I mean on a bungee server
You make a new prismarine server and run that
Can you send players to a new server?
Because then you just have an array "servers" which is a list of servers
You can communicate between them inside of your node.js program
Robin Lambertz
@roblabla
Apr 23 2015 00:48
BungeeCord has an API servers can use to move players around
it's a bit of a hack really
demipixel
@demipixel
Apr 23 2015 00:48
No, I mean
lol
Can you say "send player X to here"
"send player X to server with ip"
Robin Lambertz
@roblabla
Apr 23 2015 00:49
ok, here's the deal
what if bungeecord has 0 players connected to it
well no, bad example
demipixel
@demipixel
Apr 23 2015 00:49
lol
Robin Lambertz
@roblabla
Apr 23 2015 00:49
what if bungee has 1 player on server X
demipixel
@demipixel
Apr 23 2015 00:49
okay
Robin Lambertz
@roblabla
Apr 23 2015 00:49
and server Y asks bungee to move player on server X to server Z
(god knows why)
That's impossible because server Y has no way to communicate with bungee
and that's a long-standing problem with no solution
demipixel
@demipixel
Apr 23 2015 00:50
My point is there are multiple prismarine-servers running
Robin Lambertz
@roblabla
Apr 23 2015 00:50
I got that
demipixel
@demipixel
Apr 23 2015 00:50
Okay, so
Robin Lambertz
@roblabla
Apr 23 2015 00:50
but they can't talk to bungee unless there's a player connected to them
That's just the way the bungee API works
demipixel
@demipixel
Apr 23 2015 00:50
wait, what?
I just want a single function that does sendPlayerToIP(player, ip)
The rest would work
*would have to include port lol
Robin Lambertz
@roblabla
Apr 23 2015 00:50
Urg
demipixel
@demipixel
Apr 23 2015 00:51
Because then
Let's say we get a message from server Y
Now that's in my node program
And I can do servers[23] and servers[25] for X and Z
Robin Lambertz
@roblabla
Apr 23 2015 00:51
  1. It's impossible
  2. Even if it was, it'd be up to the plugins to do it
  3. Probably possible to do as a plugin
oh
demipixel
@demipixel
Apr 23 2015 00:51
All servers run in the same node program
So they can communicate whatever the hell they want
Robin Lambertz
@roblabla
Apr 23 2015 00:52
wut ?
why would you be using bungee then
like, just use one node progrm with many worlds
demipixel
@demipixel
Apr 23 2015 00:52
Well, like
Have you played on a minigame server?
Robin Lambertz
@roblabla
Apr 23 2015 00:52
i've run a minigame server.
demipixel
@demipixel
Apr 23 2015 00:52
Okay, so
When you go to the lobby, that's a separate "server" (the player list only contains players in the lobby)
And when running a game, that is also kind of a separate server
Robin Lambertz
@roblabla
Apr 23 2015 00:53
and because bukkit sucks
Yes, because minecraft_server sucks
you don't have that kind of problem with Prismarine
Because we don't suck
demipixel
@demipixel
Apr 23 2015 00:53
Okay, so
Do you agree with me?
Robin Lambertz
@roblabla
Apr 23 2015 00:53
so you don't need to use separate server
demipixel
@demipixel
Apr 23 2015 00:53
oh
How would you do it, then?
Robin Lambertz
@roblabla
Apr 23 2015 00:53
One server, each world lives in its own private thread
no problem.
demipixel
@demipixel
Apr 23 2015 00:53
Multiple worlds other than the nether?
Robin Lambertz
@roblabla
Apr 23 2015 00:54
If you need different servers on different machines, THEN you use bungee
And you have all the usual problems bungee bring
People using bungee and 3 servers on one physical machine are just asking for trouble.
@demipixel what are you talking about
Bukkit has supported multiple servers for YEARS
demipixel
@demipixel
Apr 23 2015 00:54
lol
Robin Lambertz
@roblabla
Apr 23 2015 00:54
minecraft_server supports it too now
urg
I mean multiple worlds
demipixel
@demipixel
Apr 23 2015 00:54
I don't want to add a cheap conversion of bukkit into js
Robin Lambertz
@roblabla
Apr 23 2015 00:55
what conversion
demipixel
@demipixel
Apr 23 2015 00:55
idk
Robin Lambertz
@roblabla
Apr 23 2015 00:55
There won't be a Prismarine-BukkitBridge
demipixel
@demipixel
Apr 23 2015 00:55
I just don't want to run bukkit unless there's something we really really need
Robin Lambertz
@roblabla
Apr 23 2015 00:55
well, actually I plan on doing one
but that'll be a plugin :P
demipixel
@demipixel
Apr 23 2015 00:55
Don't call it bukkit though :P
Robin Lambertz
@roblabla
Apr 23 2015 00:55
But prismarine will support arbitrary amounts of worlds, just like bukkit
Of any type
demipixel
@demipixel
Apr 23 2015 00:56
look
Robin Lambertz
@roblabla
Apr 23 2015 00:56
You're not just stuck with the 3 worlds minecraft_server gives you
demipixel
@demipixel
Apr 23 2015 00:56
Idealy you have enough people using this thing that throwing around "bukkit" would confuse people as to which bukkit
Robin Lambertz
@roblabla
Apr 23 2015 00:56
that's not going to happen aaaanytime soon.
demipixel
@demipixel
Apr 23 2015 00:56
@roblabla Multiple worlds = Still see players in player-list
Robin Lambertz
@roblabla
Apr 23 2015 00:57
OK, did I ever mention everything was a module ?
that includes playerlist
demipixel
@demipixel
Apr 23 2015 00:57
Everything?
Robin Lambertz
@roblabla
Apr 23 2015 00:57
by default, sure, playerlist is every players on the server
don't like that ? swap it out with another playerlist module
boom, no more trouble
demipixel
@demipixel
Apr 23 2015 00:57
wat
Robin Lambertz
@roblabla
Apr 23 2015 00:57
yes, everything, down to chunk storage.
demipixel
@demipixel
Apr 23 2015 00:57
Why
Robin Lambertz
@roblabla
Apr 23 2015 00:57
Because that's what we're striving for
A ridiculously, over-the-top modular system
demipixel
@demipixel
Apr 23 2015 00:58
That's like blocks being in a separate mineflayer module from physics
Robin Lambertz
@roblabla
Apr 23 2015 00:58
At its core, prismarine-server just has prismarine-core
demipixel
@demipixel
Apr 23 2015 00:58
Or chests
Robin Lambertz
@roblabla
Apr 23 2015 00:58
which defines a bunch of interfaces which modules hook into
demipixel
@demipixel
Apr 23 2015 00:58
Separating chat from inventory management in mineflayer
Robin Lambertz
@roblabla
Apr 23 2015 00:58
then there's the default world implementation that hooks into it
demipixel
@demipixel
Apr 23 2015 00:58
How does that make sense?
It belongs as one
Robin Lambertz
@roblabla
Apr 23 2015 00:58
Because that's how we want it ?
demipixel
@demipixel
Apr 23 2015 00:58
I can understand world generation
But chunks?
Robin Lambertz
@roblabla
Apr 23 2015 00:58
I want chunks in mysql database
now I can
I'm happy
demipixel
@demipixel
Apr 23 2015 00:59
lol
You can control what chunks you send
Robin Lambertz
@roblabla
Apr 23 2015 00:59
hmm ?
demipixel
@demipixel
Apr 23 2015 00:59
But that doesn't mean you should need to rewrite how chunks are sent every time
Robin Lambertz
@roblabla
Apr 23 2015 00:59
wut ?
demipixel
@demipixel
Apr 23 2015 01:00
Here's the problem
Chunks are NEEDED
Robin Lambertz
@roblabla
Apr 23 2015 01:00
yes; they are
but it doen't mean a specific implementation is needed
demipixel
@demipixel
Apr 23 2015 01:00
prismarinejs needs to run without modules perfectly
Robin Lambertz
@roblabla
Apr 23 2015 01:00
wrong
it needs modules
there will be defaults
which will be ours
demipixel
@demipixel
Apr 23 2015 01:00
mineflayer needs mineflayer-travel to be useful but that doesn't make it impossible to use
Robin Lambertz
@roblabla
Apr 23 2015 01:00
but anyone can write his replacement
demipixel
@demipixel
Apr 23 2015 01:00
Just less useful
Robin Lambertz
@roblabla
Apr 23 2015 01:01
well, prismarine-core depends on a bunch of default implementations
but anyone can specify his alternative impl if he wishes
demipixel
@demipixel
Apr 23 2015 01:01
Think of it this way
Are you gonna have a separate players module?
Robin Lambertz
@roblabla
Apr 23 2015 01:01
probably separate player storage
demipixel
@demipixel
Apr 23 2015 01:01
Okay, so
Robin Lambertz
@roblabla
Apr 23 2015 01:01
just like we're going to have a separate world storage
demipixel
@demipixel
Apr 23 2015 01:01
I need to know when a player goes through a nether portal to send it new chunks
How does the chunks module communicate that, and same with players?
Robin Lambertz
@roblabla
Apr 23 2015 01:02
player.send(world.getChunkProvider().getChunk({ x, y }).asChunkPacket());
demipixel
@demipixel
Apr 23 2015 01:02
You have to figure out what portal they're coming out
Robin Lambertz
@roblabla
Apr 23 2015 01:02
that'd be an event.
demipixel
@demipixel
Apr 23 2015 01:03
You have to have chunks get from the players module – which might be a custom one
Robin Lambertz
@roblabla
Apr 23 2015 01:03
nope
demipixel
@demipixel
Apr 23 2015 01:03
You might have to generate your own damn portal
Robin Lambertz
@roblabla
Apr 23 2015 01:03
what the fuck are you even talking about
those are non-problems
Every module has to answer to the same interface as the default one
demipixel
@demipixel
Apr 23 2015 01:03
If you have a custom chunk module
Don't you handle the worlds?
Robin Lambertz
@roblabla
Apr 23 2015 01:04
world storage are a module
demipixel
@demipixel
Apr 23 2015 01:04
Okay, whatever, world storage
Robin Lambertz
@roblabla
Apr 23 2015 01:04
world handling will probably be in core tho
demipixel
@demipixel
Apr 23 2015 01:04
lol
Robin Lambertz
@roblabla
Apr 23 2015 01:04
depending on what you call "handling"
demipixel
@demipixel
Apr 23 2015 01:04
So, how much effort is it to keep everything the same but it doesn't generate a nether portal when you arrive?
I don't want to rewrite the whole module without nether portals
Robin Lambertz
@roblabla
Apr 23 2015 01:04
that wouldn't be a world module though
that'd just be a simple plugin
on("generate_nether_portal", function(ev) { ev.cancel(); });
Modules allow you to hack the very internals of prismarine-server
It has two purposes :
  1. it allows us to very quickly test new implementations of crazy things
  2. It allows others to create more performant modules to replace the crazy mojang stuff
By default, we'll support everything the same way mojang does
but there are thing in minecraft_server which are simply not optimizable without breaking backward compat
demipixel
@demipixel
Apr 23 2015 01:06
and the event would have "worldstorage.placeBlocks({ pos: asdf, block: asdf, nbt: asdf}, {...}, {...})"
Robin Lambertz
@roblabla
Apr 23 2015 01:06
by making everything a module, we break out of that problem
demipixel
@demipixel
Apr 23 2015 01:07
For the nether portal or whatever?
Robin Lambertz
@roblabla
Apr 23 2015 01:08
if (emitEvent("generate_nether_portal", /* some info about the event */))
  placeTheDamnBlocks();
demipixel
@demipixel
Apr 23 2015 01:08
Any block that has solid blocks on every side, display as a stone for the player(s)
Robin Lambertz
@roblabla
Apr 23 2015 01:08
this is obviously all made up btw
we have no api right now, so i'm just making those up as I go >.>
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:08
speaking of
rob do you want to write up what the api should look like?
I’d like to do that sooner than later
Robin Lambertz
@roblabla
Apr 23 2015 01:09
agreed
demipixel
@demipixel
Apr 23 2015 01:09
I'm just asking for another example
"Any ore that has solid blocks on every side, display as a stone for the player(s)"
server.on('send_block') ??
Robin Lambertz
@roblabla
Apr 23 2015 01:10
most efficient for this is to drop down to packet level I guess
demipixel
@demipixel
Apr 23 2015 01:10
*send_chunk I guess
And then it gives you the chunk to edit
Robin Lambertz
@roblabla
Apr 23 2015 01:10
We'll probably have a server.on("send_packet") and "receive_packet"
which you'll be able to temper.
demipixel
@demipixel
Apr 23 2015 01:10
I don't want to do that lol
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:10
then how would you suggest we do it?
Robin Lambertz
@roblabla
Apr 23 2015 01:11
a send_chunk you can temper is possible
but we want to keep the API simple
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:11
the problem of hiding ores is an inherantly difficult problem
Robin Lambertz
@roblabla
Apr 23 2015 01:11
and not bloat it with a gazillion ways of doing stuff
Hiding ores doesn't even fix the basic problem : too much shit is sent
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:11
lol yeah
Robin Lambertz
@roblabla
Apr 23 2015 01:11
A much better solution is to not send the underground packets unless the player is actually in the cave
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:12
wayyy too much
Robin Lambertz
@roblabla
Apr 23 2015 01:12
I have no idea why nobody did it like this
it'd be MUCH MUCH MUCH less ressource intensive
work well enough for most servers
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:12
I think the concern is that if there’s a hole looking down, then the player would see the void
Robin Lambertz
@roblabla
Apr 23 2015 01:12
Add a block logger so you can see the people who get diam too fast and you're done :D
@wtfaremyinitials calculate line-of-sight
if there's a hole, just send him the damn packets
it's the same for oreb
instead of seeing void, he sees stone
which "magically" transforms into ore
it's not really that big a deal
demipixel
@demipixel
Apr 23 2015 01:14
Why not
server.on('send_chunk', function(evt, chunk) {
  chunk.forEach(function(x, y, z) {
    var faces = // Array of faces
    var covered = true;
    for (var f = 0; f < faces.length; f++) {
      if (chunk.blockAt(vec3(x, y, z).add(faces[f]))).boundingBox != 'solid') { covered = false; break; }
    }
    if (covered) {
      chunk.blockAt(x, y, z).setBlock(1, 0); // Stone, meta 0
    }
  });
});
Robin Lambertz
@roblabla
Apr 23 2015 01:14
But yeah, this is an inherently difficult problem @demipixel
demipixel
@demipixel
Apr 23 2015 01:14
Finally finished typing that
Robin Lambertz
@roblabla
Apr 23 2015 01:14
Because bloating is bad.
Theorically, this is perfectly possible
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:14
@roblabla Isn’t calculating line-of-sight difficult? I’ve never done it
Robin Lambertz
@roblabla
Apr 23 2015 01:14
@wtfaremyinitials it's a child's game
mojang does it for a lot of things
arrows, buckets, for instance
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:15
mind tossing me some pseudocode?
I’ve never fully understood how it’s done
demipixel
@demipixel
Apr 23 2015 01:15
(look at code, that's what I would do for setting any block that is surrounded by solid blocks to stone)
Then you need to update it if they break any of the solid blocks surrounding it :P
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:16
thx
Robin Lambertz
@roblabla
Apr 23 2015 01:16
anyway g2g to sleep
demipixel
@demipixel
Apr 23 2015 01:16
NOOO
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:16
bye rob
demipixel
@demipixel
Apr 23 2015 01:17
Did you look at my fake code? :(
Robin Lambertz
@roblabla
Apr 23 2015 01:17
yes
and I said it's theorically possible
Like I said, it's a matter of "how much we put in the API"
this project is going to be orders of magnitude bigger than mineflayer as it is
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:17
^
demipixel
@demipixel
Apr 23 2015 01:17
Really?
I mean
Robin Lambertz
@roblabla
Apr 23 2015 01:17
what goes into the API and what doesn't will depend on what's the most needed things
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:17
yes
demipixel
@demipixel
Apr 23 2015 01:17
We don't need to handle physics or what not
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:17
for sure
Robin Lambertz
@roblabla
Apr 23 2015 01:17
yes we do
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:18
of course we do!
demipixel
@demipixel
Apr 23 2015 01:18
Oh, for other entities
derp nvm
Robin Lambertz
@roblabla
Apr 23 2015 01:18
we don't want people to start cheating
and for the AIs
demipixel
@demipixel
Apr 23 2015 01:18
nah, anti-cheat is just a plugin
Robin Lambertz
@roblabla
Apr 23 2015 01:18
Redstone handling
World generation
AIs
demipixel
@demipixel
Apr 23 2015 01:18
If I wrote a redstone simulator
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:18
block interaction/physics
Robin Lambertz
@roblabla
Apr 23 2015 01:18
I mean, there's a hellujia shitbunch of work in there
demipixel
@demipixel
Apr 23 2015 01:18
Could that be plugged into prismarine-server?
Robin Lambertz
@roblabla
Apr 23 2015 01:18
probably ? IDK where redstone fits
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:18
theoretically
Robin Lambertz
@roblabla
Apr 23 2015 01:20
i think I'll have "isEnd" working tomorrow @demipixel
for lpastar
demipixel
@demipixel
Apr 23 2015 01:20
kk
Robin Lambertz
@roblabla
Apr 23 2015 01:20
I did some testing, and it def looks like it'll be possible.
demipixel
@demipixel
Apr 23 2015 01:20
Now I need to figure out astar
And of course, even we're working on p-server, we'll still occasionally fix up mineflayer or what not, right? ;D
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:21
of course
Robin Lambertz
@roblabla
Apr 23 2015 01:21
of course
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:21
hahaha
demipixel
@demipixel
Apr 23 2015 01:22
Well, then
I have no clue what any of these timeframes are gonna be
Robin Lambertz
@roblabla
Apr 23 2015 01:43
secure us some funding, then timefranes will be much more real :P
Will Franzen
@wtfaremyinitials
Apr 23 2015 01:43
lol pretty much
i want to be working on it right now, but I’m busy with contract web development
demipixel
@demipixel
Apr 23 2015 02:31
Unless you made it private soon, I really doubt anybody would fund a kickstarter for a public project :P
or indie gogo or anything
Romain Beaumont
@rom1504
Apr 23 2015 09:24
(I did that for line of sight in js https://github.com/rom1504/rbot/blob/master/lib/nearest.js#L17 long ago)
(was needed for shooting arrows only at mobs you can see)
cool that minecraft-data will be used
I think if we can have module that both mineflayer and prismarine-server use that's nice. Less work, easier to maintain.
Robin Lambertz
@roblabla
Apr 23 2015 09:32
@demipixel I've seen many OSS projects get kickstarted
Hell, I've even seen open hardware projects get kickstarted
Romain Beaumont
@rom1504
Apr 23 2015 09:37
I'd think people would better fund an open source project than a closed source one
Robin Lambertz
@roblabla
Apr 23 2015 09:37
Depends on the marketing department :P
But anyway, I'm not serious about this. At least not right now :P