networking in megazeux - has it been done?
#1
Posted 09 January 2007 - 01:38 AM
#2
Posted 09 January 2007 - 01:43 AM
This is something I've also been trying to work on for many years. I made an attempt using the save.mzx feature and then sending to player 3 via messenger. But of coarse this too would only be for good a turn-based game.
I have not played around enough with the fwrite command to see if its possible to write to it from two sources. If this can't be discussed on DMZX I may provide another location strickly for it.
Hopefully you dont get burnt alive for making this post
#3
Posted 09 January 2007 - 01:51 AM
anyway thanks. maybe someday i could make a Battlefield 1942 for mzx!! that'd be cool.
#5
Posted 09 January 2007 - 01:54 AM
unfortunately it doesn't, so the shared file route is the best you can expect to achieve.

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
#6
Posted 09 January 2007 - 02:24 AM
#7
Posted 09 January 2007 - 02:25 AM
EDIT:
That's actually a screen shot from "Blood in Berlin" a project put on hold
This post has been edited by T-bone6: 09 January 2007 - 02:25 AM
#8
Posted 09 January 2007 - 06:45 AM
I was also going to make a megazeux game called "lobby" where you can chat over lan. I got halfway then realised the default input string boxes were interrupting cycles and messages weren't getting through.
So far, all my experiences with lan in mzx have been futile, I think the only way to make lan succesfully in mzx is to add lan support in later mzx versions.
edit: I just realised I have four gems. Yay.
This post has been edited by CHEZZY: 09 January 2007 - 06:47 AM

koji: SCRUMTRELLESCENT!
#9
Posted 09 January 2007 - 07:07 AM
#10
Posted 09 January 2007 - 08:07 AM

koji: SCRUMTRELLESCENT!
#11
Posted 09 January 2007 - 08:21 AM
<burstroc> SORRY FELLAS ONE SECOND *crankcrankcrank* I'LL BE ABOUT A MINUTE OR TWO HERE
<Fighter-Phil>Your mum is so funky she is friends with revvy.
#13
Posted 09 January 2007 - 06:02 PM
SO
you have each instance of mzx continually try to open and read the content of the file into memory (a string read is the fastest) and then close the file so it's available for the next instance.
This way it's practically every [number of players] cycles you get updated content
#14
Posted 10 January 2007 - 12:18 AM

koji: SCRUMTRELLESCENT!
#16
Posted 10 January 2007 - 01:17 PM
#17
Posted 10 January 2007 - 03:42 PM
How networking in MZX would be best implemented wasn't just as a bit of robotic or a few magic counters. It should handle verification of worlds, authentication, perhaps some sort of sandbox API, auto-synchronization of players. Obviously for this to work you'd have to add multi-player support to MZX, or some funky robotic hacks. It's a lot more work than at first you might think.
Plus, it would be nuts if every game had to implement its own GUI for handling network connections, disconnects, chat, etc. That stuff should be done properly, inside MZX.
--ajs.
#18
Posted 10 January 2007 - 06:25 PM
#19
Posted 10 January 2007 - 10:19 PM
ajs, on Jan 10 2007, 03:42 PM, said:
How networking in MZX would be best implemented wasn't just as a bit of robotic or a few magic counters. It should handle verification of worlds, authentication, perhaps some sort of sandbox API, auto-synchronization of players. Obviously for this to work you'd have to add multi-player support to MZX, or some funky robotic hacks. It's a lot more work than at first you might think.
Plus, it would be nuts if every game had to implement its own GUI for handling network connections, disconnects, chat, etc. That stuff should be done properly, inside MZX.
--ajs.
For the record, Cube doesnt even have networking code as complex as you're suggesting (Doesnt authenticate, doesnt verify worlds, doesnt auto synchronize, etc.), and it works fine.
Not that I support networking being added to MZX, I DONT. That's a bad idea that's been brought up over and over..
If you want to do LAN based stuff, a shared folder is definately the best option. If you want to do internet stuff, write a program in C that periodically reads a file and sends/recieves data from a server. Have MZX write to that file as needed. Infact, I think there are already a few free programs which can do basically that.
<Mooseka> YES LANCER <b>TALK DIRTY TO ME</b>
<GMCBay> When creating a game, the first thing I do is design the box cover for the special edition collectors DVD. The second thing I do is begin thinking about what will be in the sequel.
<Koji> SOYLENT MILK IS COWS!! D:
<Jotz> you guys have such a mindless disdain for a delicious mint julep! that you're making it not work by thinking that it won't.
<Jotz> Sorry, but I don't think this project is going to succeed like a delicious mint julep! did.
<xicloid> Isn't there anything like "return null"in C?
#20
Posted 10 January 2007 - 11:46 PM
Elig, on Jan 10 2007, 10:19 PM, said:
It authenticates, in that each player is an entity and has a name.
It probably does verify the map you're trying to join exists on your PC and that you are trying to play on the same map :-)
It will provide synchronization in the sense of a "world view". It will have data structures for distinguishing world objects that are in fact human players. It will have functionality that automatically keeps all the contributing players in sync with each other, compensating for lag, disconnection, etc. A Cube level designer doesn't have to worry about such things.
Imagine writing a Quake3 mod and having to handle the location of projectiles in every map or mod you wrote. It would be insanely wasteful and non-trivial, and that's exactly what reading and writing a socket in a MZX game would require. Every game would have to home brew its own implementation, and that's _really_ bad.
--ajs.
#21
Posted 10 January 2007 - 11:56 PM

koji: SCRUMTRELLESCENT!
#22
Posted 11 January 2007 - 12:21 AM
If the connection were DSL it probably wouldn't be so bad. But if it were dialup, you'd have to have each robot check if its data were transmitted or not and all sorts of headache stuff. Especially if you had to use counters.
#23
Posted 11 January 2007 - 12:40 AM
#24
Posted 11 January 2007 - 02:37 AM
#25
Posted 11 January 2007 - 04:00 AM

koji: SCRUMTRELLESCENT!
#26
Posted 11 January 2007 - 04:11 AM
MZX Help File said:
SET "file.txt" to "LOAD_ROBOT"
SET "file.txt" to "SAVE_ROBOTn"
SET "file.txt" to "LOAD_ROBOTn"
These commands can save Robotic code to text files and import text files into a Robot. The first forms use the current Robot, while the second forms use the Robot with the given Robot ID n.
<Exophase> HES STEALING MAH AIRSHIP!!!!!!11111111
#27
Posted 11 January 2007 - 04:35 AM
ajs, on Jan 10 2007, 11:46 PM, said:
Elig, on Jan 10 2007, 10:19 PM, said:
It authenticates, in that each player is an entity and has a name.
It probably does verify the map you're trying to join exists on your PC and that you are trying to play on the same map :-)
It will provide synchronization in the sense of a "world view". It will have data structures for distinguishing world objects that are in fact human players. It will have functionality that automatically keeps all the contributing players in sync with each other, compensating for lag, disconnection, etc. A Cube level designer doesn't have to worry about such things.
Imagine writing a Quake3 mod and having to handle the location of projectiles in every map or mod you wrote. It would be insanely wasteful and non-trivial, and that's exactly what reading and writing a socket in a MZX game would require. Every game would have to home brew its own implementation, and that's _really_ bad.
--ajs.
First, and somewhat unrelated to the topic of this thread, Cube is very minimalist.
Cube doesnt verify that you have the map on your computer (If it cant find the map, it'll play on the map you're on instead), nor does it attempt to verify that the map is the same map (Which it may not be either through modification or through what I mentioned before. A "bug" the developers openly admit to). Cube doesnt have any mechanism for compensating for lag/latency. This means every time you're updated, you're seeing something that's a certain latency old. Cube doesnt attempt to compensate for this at all. Cube's server is nothing more than a multicaster, it doesnt handle player positions, collision detection, or player health. It barely even handles connects/disconnects. Like I say, it's a multicaster. It was designed this way intentionally, so that the networking code would be as small and simple as possible, and so that the server could run on virtually anything.
Anyway...
However, you have a point that in MZX networking, you'd definately need MZX to handle the data structures, you'd probably need a GUI for connection (Because I doubt every single game would want to create their own), you'd likely need to handle connections and disconnects internally, this means you'd have to have some messy interface for spawning multiple player or some such... The interface to the connection GUI would also be messy.
You'd pretty much have to either have every game creating their own buggy home brew networking support, or, you'd have to completely redesign MZX from the ground up. Both of which are stupid. And even if you had every game with their own buggy home brew networking, there'd still be a lot of behind the scenes work. You'd still have to keep track of recieved and outgoing information in MZX, which is no small project. Further, you may break some platform compatability, you'd also undoubtably introduce new bugs... There is absolutely no way to add it to MZX cleanly. I've never liked the idea.
<Mooseka> YES LANCER <b>TALK DIRTY TO ME</b>
<GMCBay> When creating a game, the first thing I do is design the box cover for the special edition collectors DVD. The second thing I do is begin thinking about what will be in the sequel.
<Koji> SOYLENT MILK IS COWS!! D:
<Jotz> you guys have such a mindless disdain for a delicious mint julep! that you're making it not work by thinking that it won't.
<Jotz> Sorry, but I don't think this project is going to succeed like a delicious mint julep! did.
<xicloid> Isn't there anything like "return null"in C?
#28
Posted 12 January 2007 - 01:55 AM
Quote
Yeah, so cube is quite broken. Small and simple should not equal "badly designed", which it clearly is from this description. I don't think MegaZeux should ever model this design.
Quote
It's absolutely no small project. However it is doable. What I'm trying to discourage here are people hacking sockets into MegaZeux (which even the most novice programmer could do in a couple of hours). It needs to be properly thought out and a real infrastructure provided. That's why it probably won't happen.
And I totally agree with you, I don't really like the idea in a 2.x version of MZX.
--ajs.
#29
Posted 12 January 2007 - 02:37 PM
ajs, on Jan 12 2007, 01:55 AM, said:
Quote
It's absolutely no small project. However it is doable. What I'm trying to discourage here are people hacking sockets into MegaZeux (which even the most novice programmer could do in a couple of hours). It needs to be properly thought out and a real infrastructure provided. That's why it probably won't happen.
And I totally agree with you, I don't really like the idea in a 2.x version of MZX.
--ajs.
First of all, I think it's apparent you understand very little about modern networking code, so I am surprised you so readily offer judgments. Do your research before commenting.
Secondly, I agree with everything else you have to say
<Mooseka> YES LANCER <b>TALK DIRTY TO ME</b>
<GMCBay> When creating a game, the first thing I do is design the box cover for the special edition collectors DVD. The second thing I do is begin thinking about what will be in the sequel.
<Koji> SOYLENT MILK IS COWS!! D:
<Jotz> you guys have such a mindless disdain for a delicious mint julep! that you're making it not work by thinking that it won't.
<Jotz> Sorry, but I don't think this project is going to succeed like a delicious mint julep! did.
<xicloid> Isn't there anything like "return null"in C?
#30
Posted 12 January 2007 - 02:56 PM
Elig, on Jan 12 2007, 02:37 PM, said:
ajs, on Jan 12 2007, 01:55 AM, said:
Quote
It's absolutely no small project. However it is doable. What I'm trying to discourage here are people hacking sockets into MegaZeux (which even the most novice programmer could do in a couple of hours). It needs to be properly thought out and a real infrastructure provided. That's why it probably won't happen.
And I totally agree with you, I don't really like the idea in a 2.x version of MZX.
--ajs.
First of all, I think it's apparent you understand very little about modern networking code, so I am surprised you so readily offer judgments. Do your research before commenting.
It might surprise you to find that I've actually WRITTEN a network stack for more than one application! I also spent many years reading and writing Quake3 mods and hacked directly on the Quake3 sources, so I know _precisely_ why Cube's networking (from your description, which is probably entirely wrong anyway) is an example of a _bad_ network layer.
Thanks for flame baiting anyway. Nothing like unsubstantiated claims to start my afternoon.
--ajs.

Help










