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

Client Side Programs

Started by misson20000, 24 January 2014 - 11:11 PM
misson20000 #1
Posted 25 January 2014 - 12:11 AM
Maybe, there could be some sort of API to launch a program that instead of running on the server runs on the client's computers, so it's not affected by lag, and this client program could for example get keyUp/keyDown events without sending them over the network. The client program could interpret the events, for, if example, you want to do key combinations, and send only the relevant data to the server.
There should be some sort of limit on the data transferred between the client and server, to keep network lag to a minimum, and stuff like redstone interaction/filesystem should have to be server side. What do you think?
theoriginalbit #2
Posted 25 January 2014 - 03:30 AM
nope. infeasible suggestion. the Minecraft server/client architecture does not allow for this.
oeed #3
Posted 25 January 2014 - 03:38 AM
I can see the merits in this, but what if someone else opened the computer while you were using it? What happens when you log off?
theoriginalbit #4
Posted 25 January 2014 - 03:43 AM
I can see the merits in this, but what if someone else opened the computer while you were using it? What happens when you log off?
infeasible suggestion. the Minecraft server/client architecture does not allow for this.
Edited on 25 January 2014 - 02:43 AM
oeed #5
Posted 25 January 2014 - 04:15 AM
I can see the merits in this, but what if someone else opened the computer while you were using it? What happens when you log off?
infeasible suggestion. the Minecraft server/client architecture does not allow for this.
I get that it may be impossible at the moment, but if it were in the future those would be my problems.
theoriginalbit #6
Posted 25 January 2014 - 04:31 AM
I get that it may be impossible at the moment, but if it were in the future those would be my problems.
Minecraft won't be moving away from the current server/client architecture they're using. Nothing that ComputerCraft does will be able to change this architecture, all the client ever does is render blocks and GUIs, and play sounds, the server does everything else… Even SSP runs as a server/client which is why you're able to open your worlds to LAN and play SMP.

This is how it is now possible with OpenPeripheral to install it server-side only and not require it client-side unless you also install OpenPeripheral-Addon which adds blocks.
Edited on 25 January 2014 - 03:33 AM
Lyqyd #7
Posted 25 January 2014 - 06:00 AM
Nope.

Computers only run server-side, period.

Edit: Well, it seems that people are overly interested in discussing this. There's no reason to clutter up General, though.
ElvishJerricco #8
Posted 25 January 2014 - 11:19 AM
So this suggestion thread got locked prematurely in my opinion. The idea is that you could run code on the client side which would then be capable of picking up other types of events like key-up and key-down. The claim against it is that computers run server-side. Period. Also it was claimed that the Minecraft server/client architecture doesn't allow for this.

The idea that this is impossible is ridiculous. When coding a mod, you have to take special care to make sure you're doing the right things on the right side of the network. It's actually not too hard to screw up and accidentally do something client side that was only meant to happen server side. The architecture absolutely allows anything to happen on the client side that you want. You just have to work around the need to communicate all the right things back and forth. It shouldn't be hard to make an API that can leverage the client side of CC. The client has to have LuaJ packaged with it anyway so creating an instance of a Lua VM that can run some code isn't a problem. The question is just what to communicate back and forth. Server side, two things would be needed.
  1. An event to tell the computer when a player opens/closes the GUI and what their username is.
  2. This is necessary to track whether there's even a client to use, and to provide the necessary information to connect to that client.
  3. An API for sending code to run client-side.
  4. The API would either take a function (and use something to the effect of string.dump to serialize it), or just a string of code and send the data to the client to run. The available APIs on the client side would be completely separate from those on the server side, although sharing many features for sure, not allowing client code to use the redstone API, for example.

Here's an example script for detecting key combos and sending them back to the server.


-- client_connect event returns the username of the client
local e, username = os.pullEvent("client_connect")
-- client is an API with any functions needed to send a program to the client to run
-- client.connect sends a string of code to the specified user.
-- When the client picks that up, it runs the code in the client-side Lua VM
client.connect(username, [[
    while true do
        -- Many APIs are the same between client and server, such as os.pullEvent
        -- Although the client gets different events to send
        local e, key = os.pullEvent("key-down")
        -- The client is capable of determining is a key is down
        if key == keys.a and keys.isKeyDown(keys.leftCtrl) then
            server.send("ctrl_a")
        elseif key == keys.q and keys.isKeyDown(keys.leftCtrl) then
            -- The server API provides all the functions needed to send information back to the server
            -- server.send simply sends a string back to the server.
            server.send("client_done")
            -- Breaking the loop causes the code to reach its end and the client stops executing
            break
        end
    end
]])

while true do
    local e, received_username, msg = os.pullEvent("client_message")
    if username == received_username and msg == "ctrl_a" then
        print(username .. " pressed ctrl+a!")
    elseif username == received_username and msg == "client_done" then
        print(username .. " pressed ctrl+q and is done")
        break
    end
end

I personally would greatly enjoy some networked coding and having a set of APIs for the client opens up a lot of doors for the developers in the future. This could actually allow PDAs to have pixel-accurate displays because only one player needs to look at the GUI, meaning a client-side API could exist which manipulates single pixels without bandwidth hogging.

EDIT: To add one more possible feature to the API concept, sending events to the client would be useful, like the client sent to the server.


client.connect(username, [[
    local e, msg = os.pullEvent("server_message")
    if msg == "some_event" then
        ...
    end
]])
client.send(username, "some_event")
Edited on 25 January 2014 - 12:49 PM
Engineer #9
Posted 25 January 2014 - 11:43 AM
It isnt ridicioulous that the server-client architecture doesnt allow us to do it. Because the MineCraft client only renders and opens GUI, nothing more or less!
You are familair with modding, take the IGuiHandler for example. You open the container on the server because you want to save the slots on the server (for instance when creating a chest). Second of all, the server doesnt need the graphical crap that the actual GUI is, it only cares about those containers.

If you want to do special actions when a mouse is somewhere on the GUI, you have to send a packet. This packet only should contain that the mouse was there, again, nothing more or less.

If you just take that as an example, how would you run a Lua VM on the client side? Well, you simply dont. Because it's highly inefficient plus it gives extra lagg to each client if it has to process that code.

If something like this gets implemented, probably not, then the server is going to send packets to the client and process that further on. One problem with that is: never ending loops. They just kill your client.

It will be too much of a hassle to get it implemented, because the payer must be tracked like crazy. I simply agree with Lyqyd. Code is ran server side.
ElvishJerricco #10
Posted 25 January 2014 - 11:48 AM
- snip -

The reason so much is done server-side is for synchronicity's sake, which isn't an issue in this case. It's not that nothing can be done client-side. In fact, lots is done client side. So just pop open a Lua VM, listen for instruction packets from the server, run the code, send some response packets if the code asks to. It's java on both sides so you can do as much as you want. It's not really any more difficult. Redundant at worst, but that's easy to deal with.

EDIT: Also, it's not true that all the client does is rendering and GUIs. When I first attempted some modding, I was confused as to why my tile entity which just printed to the console printed everything twice. Turns out, your SSP game has the world loaded for the server, and again the world loaded for what the client needs. This actually means there's two instances of your tile entity class for each tile. Same with almost everything. There's an entire client version of the world, which is why synchronicity gets confusing; sometimes you do something that seems to work visually, but not physically, because you did it in the client world instead of the server world. Point is, the client does a lot more than graphics. And it certainly does enough to pop open a Lua VM whenever you open a GUI.

If you just take that as an example, how would you run a Lua VM on the client side? Well, you simply dont. Because it's highly inefficient

LuaJ is in the cc zip file on the client. You open a VM just like normal. And it's no less efficient than running the VM on the server side when playing in single player mode. The client is still java and LuaJ is still there. It's literally no worse than any other instance of opening a Lua VM, which happens a lot with CC.

plus it gives extra lagg to each client if it has to process that code.

No. Each client isn't processing all clients' code. Each client is sent code that the programmer asks the computer to send. Specific code is run on specific clients. Adds no lag except what messages the user decides to send between client and server.
Edited on 25 January 2014 - 12:55 PM
robhol #11
Posted 25 January 2014 - 01:07 PM
While this is slightly off-topic… it's nothing new that the Suggestions forum is chock full of entirely unnecessary hostility. I get that repetitive suggestions are annoying, but for god's sake, the way people act in there is ridiculous. I also completely agree that there's no reason to lock every thread, but the main issue is the fact that stubbornness and, to put it bluntly, being an asshat, seems to be condoned on that particular subforum.

I also reacted to that thread. I was tempted to call BS on the architecture thing, but I am after all… not a MC modder. It just seemed weird to me. Then someone jumped the gun (well, the lock button) as usual, and there was suddenly no room for discussion…
Engineer #12
Posted 25 January 2014 - 01:48 PM
No. Each client isn't processing all clients' code. Each client is sent code that the programmer asks the computer to send. Specific code is run on specific clients. Adds no lag except what messages the user decides to send between client and server.
I never stated that the client will process all code of all the clients. It's obvious that the client only runs their code.
The issue is though, the client is not meant to do that. It is only meant for the graphical aspect, except for the position updating then.
The main reason why I dislike this, is how are you going to differ client code between the server code.
Maybe some extra events should be added like 'player x opened the hui' but nothing more. Imagine it to be real life, please don't come with the silly argument that mc is not real life, you cannot run code on a person. Because that seems to me what you are asking for.. the client should not be bothered with running code for some vm, because that is more towards the old mc architecture.

I just don't have no arguments for this, but code should only be ran server side, otherwise a piece of code is ran 100 times the same..

It's complicated, just don't make it more complicated than it is already
ElvishJerricco #13
Posted 25 January 2014 - 01:58 PM
I never stated that the client will process all code of all the clients. It's obvious that the client only runs their code.
The issue is though, the client is not meant to do that. It is only meant for the graphical aspect, except for the position updating then.
The main reason why I dislike this, is how are you going to differ client code between the server code.
Maybe some extra events should be added like 'player x opened the hui' but nothing more. Imagine it to be real life, please don't come with the silly argument that mc is not real life, you cannot run code on a person. Because that seems to me what you are asking for.. the client should not be bothered with running code for some vm, because that is more towards the old mc architecture.

I just don't have no arguments for this, but code should only be ran server side, otherwise a piece of code is ran 100 times the same..

It's complicated, just don't make it more complicated than it is already

Ah you ninja'd me and posted this right before I did my edit so I'll just quote myself

it's not true that all the client does is rendering and GUIs. When I first attempted some modding, I was confused as to why my tile entity which just printed to the console printed everything twice. Turns out, your SSP game has the world loaded for the server, and again the world loaded for what the client needs. This actually means there's two instances of your tile entity class for each tile. Same with almost everything. There's an entire client version of the world, which is why synchronicity gets confusing; sometimes you do something that seems to work visually, but not physically, because you did it in the client world instead of the server world. Point is, the client does a lot more than graphics. And it certainly does enough to pop open a Lua VM whenever you open a GUI.

As for not being able to differentiate between client and server code, did you not read my post at all? I gave a clear example of how the API could work. You send a string representing the program for the client to run and the client runs it. The client code has access to certain APIs and features, and those differ from the APIs and features of the server code. Then the two sides are capable of sending messages to one another.
Engineer #14
Posted 25 January 2014 - 07:11 PM
it's not true that all the client does is rendering and GUIs. When I first attempted some modding, I was confused as to why my tile entity which just printed to the console printed everything twice. Turns out, your SSP game has the world loaded for the server, and again the world loaded for what the client needs. This actually means there's two instances of your tile entity class for each tile. Same with almost everything. There's an entire client version of the world, which is why synchronicity gets confusing; sometimes you do something that seems to work visually, but not physically, because you did it in the client world instead of the server world. Point is, the client does a lot more than graphics. And it certainly does enough to pop open a Lua VM whenever you open a GUI.
This just proves that the client only does the rendering, because if you put a @SideOnly(Side.SERVER), you would never see a lightning bolt if the method gets executed. Sure, there are two version of the tiles, but that doesnt mean that the client is capable of handling such a VM. Because rendering takes already a good amount of portion of the RAM you use.

I get your point, but it doesnt make any sense at all. Why do you want to follow just a player when it is in the GUI? I mean, as Im writing this my brother could hit my keyboard too and the computer doesn't know about it, it just thinks, hey, the user pressed the key.

Sure, it is minecraft, imagine the impossible to be impossible, but thats beyond the point. I rather would like to see better key input as handling rather than sending Strings manually back and forth. It is like your example, you dont have a .keysDown method in our CC Lua, so it would even be impossible to do.

You probably see me as some guy who is f*cking things up, but I really think this is unnecessary. The mod already does a lot of packet handling behind the scenes, and not to mention that more mods use packages. If the system is abused, it sure can cause for a lot of lagg. Plus, it wouldnt be reliable, because if one is sending a shit tonne of messages, it really cause for problems. And for the stability for the mod, I just would shake my head left and right and simply, like Lyqyd did, lock the topic if I could.

And my opinion is that this topic never should have existed.. but yeah, again my opinion.
ElvishJerricco #15
Posted 25 January 2014 - 08:06 PM
- snip -

There is no technical reason to call this difficult or unreasonable. You are right though that there could be some problems with overusing the network. But A ) I've seen modders use the network much more irresponsibly than would be possible with this API on one computer (although many could be a problem), and many people still used and enjoyed those without major problems. And B ) It wouldn't be too difficult to throttle the rate at which data can be sent back and forth, preventing most of the lag issue.

As for unnecessary, so is half of what CC does. And so were half of the features that have been added over the years. Touch screens and colors, anyone? This idea adds for some really entertaining programming and makes many really cool features possible. I think that's enough reason.
Edited on 25 January 2014 - 07:09 PM
Xtansia #16
Posted 25 January 2014 - 09:24 PM
I'm not going to weigh in on the whole architecture argument,
But
1) You would most definitely limit data sent between the server and client
2) The same rules per yielding should apply to client programs, maybe with a shorter non yield timeout because the server should be handling the heavier programs
I think it's an interesting idea, though it may breach the 'no breaking the 4th wall' rule
Bomb Bloke #17
Posted 25 January 2014 - 11:22 PM
I think it's an interesting idea, though it may breach the 'no breaking the 4th wall' rule
In regards to that, the idea only "makes sense" if there's some gameplay-perspective reason for the code to be client-side. From the player's perspective, they themselves should be the only thing that "exists" at their end.

One excuse might be that the code's running on a pair of glasses the player is "wearing". Another might be that the code is executing within some sort of neural interface the player has "installed". A PDA they're carrying. What doesn't make sense is for this to be implemented into regular CC computers, which can be viewed by multiple players at the same time - what they show one player, should be the same for all players. Likewise, they should not treat input from one player as somehow different to input from another.

In fact my first thought on reading the suggestion was "so you want to run CC code, but not on a MineCraft server - so why not just use CCDesk?".

Granted, I can see some benefits to this. For example, a player could have a whizz-bang high-res animating interface to play with that has next to no impact on the server he's playing on… but it can still control other objects that're on that server (by sending events to and fro, so the client side knows eg when a redstone signal just got triggered server side, and so the server knows eg when the client wants to trigger a redstone signal itself).

Can it be done? Sure, anything's possible.

Would it be a lot of work to implement? Indeed it would, as simple or otherwise, there'd be a large amount of code to write and re-write.

Is that work worthwhile? Well, if I were in charge of coding it, I'd say no.

On the other hand, IIRC we're going to be getting laptops or something soon. Those would be the perfect excuse for this sort of thing.
D3matt #18
Posted 26 January 2014 - 01:31 AM
All technical issues aside, wouldn't it completely ruin immersion by abstracting the minecraft client and server like this? It would be very strange to have to run client and server code on the same computer, would it not?
Sebra #19
Posted 26 January 2014 - 03:02 AM
I think it's an interesting idea, though it may breach the 'no breaking the 4th wall' rule
In regards to that, the idea only "makes sense" if there's some gameplay-perspective reason for the code to be client-side. From the player's perspective, they themselves should be the only thing that "exists" at their end.

One excuse might be that the code's running on a pair of glasses the player is "wearing". Another might be that the code is executing within some sort of neural interface the player has "installed". A PDA they're carrying. What doesn't make sense is for this to be implemented into regular CC computers, which can be viewed by multiple players at the same time - what they show one player, should be the same for all players. Likewise, they should not treat input from one player as somehow different to input from another.

IF code would be able to run on item AND item would be in your inventory THEN it would have sense to run on your client side.
But there would be problem to move RUNNING code to/from your inventory.
oeed #20
Posted 26 January 2014 - 03:46 AM
As I mentioned in the original post this would definitely have it's advantages but you run in to issues when your leave or someone else tries to use your computer at the same time.

Some of the posts on this topic are really long too!
robhol #21
Posted 26 January 2014 - 07:29 AM
What issues, though? Wouldn't it be pretty much the same as… different clients using the same computer now and entering conflicting key strokes?

Also, I could be wrong, but I think some people here are taking this the wrong way. Immersion seems irrelevant? Surely, this would be transparent to the user - the server asks the client to, I dunno, do some timing-sensitive drawings, or to listen up for keys being released, or any number of other things that currently aren't feasible purely because of traffic or lag. It would actually be completely out of sight until you decide to use it. Am I right? Drawings might be a bit impractical because of "consistency", but several people interfacing with one computer is fairly rare anyway - and it could always just be "posted" to the server-side computer at a lower rate, while the client(s) are able to see changes immediately.

For obvious reasons, the server would still control what the client-side VMs had access to in terms of functions, and some features should be blocked. For example, HTTP should be a server-side feature. Anything that modifies the world would need to be server-side because of consistency between players.

I think this could be a great way to add things like "extra" keyboard features - polling, modifier keys, up/down events for the keyboard and mouse (or even move events). It would have to be coded "manually" client-side, and it wouldn't waste too much bandwidth because you only need to send this info to the server if you need it in that particular program. Hell, there could even be a traffic limit to prevent people directly "funneling" all the high-frequency events straight through to the server.

As a way of integrating it into the world, it could be a peripheral that forms some sort of bridge between the computer and the user. Deus Ex-style augmentations, anybody? Free neuropozyne here.
Edited on 26 January 2014 - 06:30 AM
theoriginalbit #22
Posted 26 January 2014 - 09:53 AM
It's not that nothing can be done client-side. In fact, lots is done client side.
No! ONLY text translations and rendering is done client-side! based off the rest of your comment you know nothing about neither Minecraft modding nor the basic game design concept of a server client architecture!
SSP runs as a server and as a client, what you see is the client, what actually does stuff in terms of block updates and such is the server! this is why you can open a world to LAN 'cause your server just starts broadcasting out to the network as well as your own client…

There is no technical reason to call this difficult or unreasonable.
There are entire freaking packages from Minecraft missing client-side — just like there are entire server-side packages missing from the client — so yes it is completely within reason to call this difficult or unreasonable!
I think Lyqyd made a mistake merging the general topic with this one and not relocking it!
Minecraft — as well as the architecture of server/client — does not, and should not, allow for this kind of implementation, full-stop, period, what ever you want to call it, anyone who wants to break that should never consider making a mod, nor doing anything with games!

It would have to be coded "manually" client-side, and it wouldn't waste too much bandwidth because you only need to send this info to the server if you need it in that particular program. Hell, there could even be a traffic limit to prevent people directly "funneling" all the high-frequency events straight through to the server.
No! really no! this does not work at all, who deems what should be sent?! no!!!
robhol #23
Posted 26 January 2014 - 12:05 PM
Bit: 1) calm down, please, you're acting like people are debating shooting your dog. 2) if you can't explain why something won't work, your comment isn't helpful. 3) locking a thread is the crappiest way of "resolving" a discussion.

What's missing from the client side, and why is this a stopper for putting a small Lua VM there? Do you have any sources for your claim that it's literally impossible to do anything else than rendering and GUI? Nobody's saying Minecraft isn't a freaking client-server architecture, that much is common knowledge.

People in this subforum really, really need to be less reactionary.

who deems what should be sent

the user does, and the mod itself could limit it.
Edited on 26 January 2014 - 11:06 AM
ElvishJerricco #24
Posted 26 January 2014 - 12:05 PM
- snip -

No I'm fairly sure you're idea of the client part of the client/server architecture is incorrect. No packages are missing. All the same code is on the java class path from the mod's perspective because the same package is loaded for both the server and the client (a feature the forge devs worked very hard to achieve after 1.3 made that so much more realistic). The client isn't some dummy who only has enough code to put stuff on the screen. To say so shows a lack of experience in the area. For example, whenever writing the code for a TileEntitySpecialRenderer, you need to do synchronization between client and server by taking in packets and using those to put some data in the tile entity (which exists on the client side!), which is passed every frame to the special renderer. There is data and logic on the client side, not just graphics. This page talks about the code necessary to keep tiles synchronized, proving further that there is stuff on the client.

Besides, that has virtually nothing to do with the issue anyway. As long as LuaJ is on the class path (and it is, because all CC's classes are loaded, even client-side), CC has the ability to open a new Lua VM whenever and where ever it wants. So when the GUI is opened, it can open a Lua VM. Then whenever the server sends a packet saying "the Lua code over here asked to run some client code, here it is." the client runs that code in the Lua VM. This Lua VM has a small number of APIs built in, one of which instructs java to send a packet to the server, telling it that the client has sent a message to the server. Really not that complicated.


As for the bandwidth problem, it's really not much worse than having a display at all. Every tick, any changes on the screen are sent to the tile on the client side, assuming CC optimizes that (which it might not. It might just be sending all the data to all viewers every single tick). So just changing one character on the screen every sleep(0) is enough cause hoards and hoards of packets to be sent while not falling to the issue of coroutine yielding. Limit this API to one packet per tick and lag problem solved as well as the display's lag problem is.

What's impossible about this? Can you give me a technical reason this doesn't work besides your incorrect assumption that all the client is capable of is rendering, which is based off the fallacy that so much code simply doesn't exist client side?
Edited on 26 January 2014 - 11:13 AM
Symmetryc #25
Posted 26 January 2014 - 01:08 PM
Wait… doesn't OpenComputers already do this? (I think)?
Bomb Bloke #26
Posted 26 January 2014 - 06:24 PM
Also, I could be wrong, but I think some people here are taking this the wrong way. Immersion seems irrelevant? Surely, this would be transparent to the user - the server asks the client to, I dunno, do some timing-sensitive drawings, or to listen up for keys being released, or any number of other things that currently aren't feasible purely because of traffic or lag. It would actually be completely out of sight until you decide to use it. Am I right?
That depends who you consider to be a "user" - I'd say "no", on the basis that anyone using the ComputerCraft mod (be it to run or to write scripts) counts, meaning that if there's a visible API for this accessible on a regular CC machine then the fourth wall has indeed been broken.

Hence a system that is even capable of only running code for a given client only makes sense if that system is only accessible by that client.

Following this logic, the inference is that by assuming that local code can only run on local devices (eg laptops in the player's inventory), you thus don't have to implement a "run this code locally" API at all. The simple fact that you're running a given script on eg a laptop in the player's inventory is enough to tell ComputerCraft to run the whole thing via the client's VM. The only data that gets sent back and forth between the server and client would be eg wireless rednet events.

Thus any changes to APIs would be along the lines of allowing eg the drawing of pixel-thin lines on such laptops, on the basis that bandwidth is a total non-issue when using those systems for that purpose. Of course, then you'd have people posting to the suggestions board that those functions should be available to "regular" Advanced Computers too - after all, shouldn't "desktop" machines be "more powerful"? It's rather difficult to envision an implementation that doesn't break "immersion".

This is all side-stepping the issue of the rather hefty workload involved in implementing all this - again, simple or not, a prohibitive amount of work would need to go into it. Makes for somewhat interesting discussion though.
robhol #27
Posted 27 January 2014 - 02:57 AM
Fourth wall? Huh? What are you even talking about.

I still think you might've misunderstood the point. It's not about laptops, it's just about running code in a different layer. The "peripheral" I mentioned would just be an excuse, pretty much, for why it's possible, AND a way to balance it a bit.
If it didn't work on any kind of computer, there'd be almost no point. PDAs are neat, but they already have their own uses.

Pixel graphics have been shot down, not (just) because of bandwidth cost, but due to issues with "style".
Bomb Bloke #28
Posted 27 January 2014 - 05:08 AM
The fourth wall is the reason why you might want to use an excuse such as your proposed peripheral (as opposed to just granting all ComputerCraft computers these powers by default or worrying about "balance").

In a nutshell, in a given imaginary scene (be it a game, TV show, theatre, whatever), the side of the scene that you look through to observe it is the fourth. To "break" it is to reach out to the viewer through that "wall", by way of which the fiction admits that it's a fiction with a viewer. Granting a ComputerCraft computer the power to magically show one thing to one player and another thing to another player, or differentiate between input from those players, would be admitting that it's not a real computer and so would break the wall.
robhol #29
Posted 27 January 2014 - 05:43 AM
I know what it means. I don't see how it applies. Suspension of disbelief is a better fit, but even then, it's kinda silly for something like Minecraft. I mean, it's implied that Computercraft boxes use redstone for their computational power. How much redstone do you think you would need to make something like this? Because I'll promise you right now, it's a hell of a lot more than one block.

The peripheral I mentioned could have an ID which would let the computer distinguish between clients - or it could just be glossed over and ignored the way keystrokes are now. It's not a new problem, and it's not a good reason to shoot down otherwise valid suggestions, even if that's the go-to maneuver on this subforum.
Bomb Bloke #30
Posted 27 January 2014 - 07:09 AM
Er, no, my point was that there are ways around that particular "issue".

The reason to "shoot the suggestion down", so to speak, is that ComputerCraft would suddenly need to get Lua VMs running in (or alongside) the client threads, and synchronise these with the one running in the server thread. A whole lot of work (both in terms of development and processor time) for relatively little gain - unless one wants to be able to pile a much larger workload onto a given VM (eg, by increasing the display resolution and whatnot). For keystrokes? That seems like overkill to me, to put it lightly. But that's no fun to discuss. Too obvious.

Or so it seems to me. Bear in mind that in terms of whether the suggestion will be heeded, it makes no difference whether I am right about that - Dan need only read the first post of a suggestion to know whether it 1) is feasible 2) interests him, so ultimately any further discussion (for or against) is purely for our own amusement.
ElvishJerricco #31
Posted 27 January 2014 - 07:19 AM
and synchronise these with the one running in the server thread.

Nope. The whole idea is that the client and the server remain independent. You just run code on both sides and are capable of sending messages back and forth, similar to socket.io. No synchronization necessary on CC's part.

Bear in mind that in terms of whether the suggestion will be heeded, it makes no difference whether I am right about that - Dan need only read the first post of a suggestion to know whether it 1) is feasible 2) interests him, so ultimately any further discussion (for or against) is purely for our own amusement.

Nope. Reading the first post only provides an extremely incomplete view of the subject (especially with this particular suggestion), and to judge an idea by the first words about it would be silly.
Edited on 27 January 2014 - 06:28 AM
Cloudy #32
Posted 27 January 2014 - 01:22 PM
I don't get the point. "Why" is my major question.

While it wouldn't be impossible, that isn't to say it wouldn't be a great bit of work - and then there are other things to consider, like what happens in Single Player worlds? We can't simply instance two versions of the Lua VM - one for the "client" side and one for the "server" side.

I honestly haven't seen a good usage case other than "I would just like to do this". Add to this the fact that having the client and server side separate wouldn't make sense in an in game point of view - from Steve?'s perspective, the server computer is all what should exist.

While I'm not a CC dev anymore, I don't think this is something that Dan would have any interest in doing.

I also agree with the fact there is a lot of unnecessary hostility here. I don't see why this is!
Edited on 27 January 2014 - 12:23 PM
robhol #33
Posted 27 January 2014 - 01:48 PM
I don't get the point. "Why" is my major question. I honestly haven't seen a good usage case other than "I would just like to do this".
It would allow a number of features that have otherwise been impractical due to traffic, and it would be a neat way to add some features the community has been clamoring for. Which isn't a bad reason in and of itself, subforum culture notwithstanding… :P/>

While it wouldn't be impossible, that isn't to say it wouldn't be a great bit of work - and then there are other things to consider, like what happens in Single Player worlds? We can't simply instance two versions of the Lua VM - one for the "client" side and one for the "server" side.

I sort of… didn't think it'd work that way? The server and client are still "separate" when playing singleplayer, surely? They just happen to run on the same computer. Otherwise, what was the point from Mojang's perspective in making Minecraft "entirely" client-server?

Add to this the fact that having the client and server side separate wouldn't make sense in an in game point of view - from Steve?'s perspective, the server computer is all what should exist.
Steve doesn't care. :P/>
As I was saying earlier - the gameplay impact would be small or non-existent. The only reason it'd have ANY impact would be something like a peripheral being added, purely to explain why these added features are now possible, and as a way to balance them. If that's not a good idea, it could just be ignored. Either way, the feature wouldn't affect existing scripts in any way, and would hardly affect gameplay. About all it'd be doing is to offload certain fairly specific tasks (drawing? better input handling?) to the client, removing network lag and traffic from the list of potential problems.

While I'm not a CC dev anymore, I don't think this is something that Dan would have any interest in doing.
Well, only one person can really answer whether he'd be interested…

I also agree with the fact there is a lot of unnecessary hostility here. I don't see why this is!
I personally think it stems from certain members of the "staff", habit-forming refusal of ideas (to be fair, a lot of them are crap) and natural toadying. Force of habit and peer pressure.
Cloudy #34
Posted 02 February 2014 - 02:34 PM
The Client/Server share the same memory space. They communicate via shared memory space using a queue in Single Player. Only one Java VM is running.

I still maintain that it just doesn't make sense from an in-world point of view.

Vague "it will allow to implement features" doesn't constitute a selling point for this feature.
D3matt #35
Posted 15 February 2014 - 03:08 PM
Steve doesn't care. :P/>
As I was saying earlier - the gameplay impact would be small or non-existent. The only reason it'd have ANY impact would be something like a peripheral being added, purely to explain why these added features are now possible, and as a way to balance them. If that's not a good idea, it could just be ignored. Either way, the feature wouldn't affect existing scripts in any way, and would hardly affect gameplay. About all it'd be doing is to offload certain fairly specific tasks (drawing? better input handling?) to the client, removing network lag and traffic from the list of potential problems.
But steve does care. He's sitting there wondering why he has a magical "client-side" program on the computer he's sitting in front of, and wondering why that's different than the normal programming he's been doing.

The player's computer does not exist in-game, and therefore running code on it that never hits the server is a huge, HUGE break of the 4th wall. You guys are trying to justify this by saying that the player isn't affected. But the player is affected. Programmers are still players.
gollark8 #36
Posted 15 February 2014 - 03:44 PM
Steve doesn't care. :P/>/>
As I was saying earlier - the gameplay impact would be small or non-existent. The only reason it'd have ANY impact would be something like a peripheral being added, purely to explain why these added features are now possible, and as a way to balance them. If that's not a good idea, it could just be ignored. Either way, the feature wouldn't affect existing scripts in any way, and would hardly affect gameplay. About all it'd be doing is to offload certain fairly specific tasks (drawing? better input handling?) to the client, removing network lag and traffic from the list of potential problems.
But steve does care. He's sitting there wondering why he has a magical "client-side" program on the computer he's sitting in front of, and wondering why that's different than the normal programming he's been doing.

The player's computer does not exist in-game, and therefore running code on it that never hits the server is a huge, HUGE break of the 4th wall. You guys are trying to justify this by saying that the player isn't affected. But the player is affected. Programmers are still players.
What's the issue with being allowed to do this with a PDA?
D3matt #37
Posted 15 February 2014 - 04:08 PM
Steve doesn't care. :P/>/>
As I was saying earlier - the gameplay impact would be small or non-existent. The only reason it'd have ANY impact would be something like a peripheral being added, purely to explain why these added features are now possible, and as a way to balance them. If that's not a good idea, it could just be ignored. Either way, the feature wouldn't affect existing scripts in any way, and would hardly affect gameplay. About all it'd be doing is to offload certain fairly specific tasks (drawing? better input handling?) to the client, removing network lag and traffic from the list of potential problems.
But steve does care. He's sitting there wondering why he has a magical "client-side" program on the computer he's sitting in front of, and wondering why that's different than the normal programming he's been doing.

The player's computer does not exist in-game, and therefore running code on it that never hits the server is a huge, HUGE break of the 4th wall. You guys are trying to justify this by saying that the player isn't affected. But the player is affected. Programmers are still players.
What's the issue with being allowed to do this with a PDA?
The only issue discussed earlier with that is "Why can my PDA do stuff that my gigantic 1x1x1 brick of a desktop can't?" but I don't feel that's reason enough not to do. However, I also don't see a particular need to add this and I still feel it makes things overly-complicated and less unified.
sci4me #38
Posted 06 March 2014 - 03:12 AM
no, i dont think its a good idea… causes too much issues for very little benefit.
GopherAtl #39
Posted 06 March 2014 - 10:42 PM
Some better issues with doing it with the PDA: they're gonna be wireless. Suddenly rednet messages have to cross the client-server divide. Would also require one of two responses to dropping a pda, storing it in a chest, etc: either shutting it down (which doesn't seem ideal to me), or somehow transfering the entire lua state of the device back and forth between client and server. It's possible the PDAs are going to shutdown when not held anyway, I dunno what direction dan's going with that and can't guess from their current state in the beta, but either way, making rednet into something that has to be transmitted between client and server seems like a bad idea.