yay :)

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

yay :)

Post by turshija »

Hey guys ! :)
Even though I'm not active almost at all, I'm visiting forum from time to time, reading posts, comments, tricks ... Looking at your projects and I'm amazed how things are becoming better, and better ...
Finally the thing I've been waiting for ... Possibility to write to file ... :)
Only thing I think ZGE is missing that is very important, is some kind of network thingy, so we can make multiplayer games, but I'll satisfy with this also ... :)
One thing I did with friend few years ago in school in mighty PASCAL, was making multiplayer Snake game using files ! :roll:
Using very stupid (but somewhat working) way, we managed to get really good real-time synchronization ...
I want to try that in ZGE also, but I need a little new feature ...
Let me explain how we did it ...
It is totally unpractical but its fun ...
We put file.txt file for example in C:\folder\ on both of the computers and share that folder ... game writes snakes coordinates and direction in C:\folder\file.txt , and reads opponents coordinates and direction from \\PC2 (or PC1)\folder\file.txt (or something like that) ...
And it works ! :D
Small problem was, that when one client is writing in the file and other one tries to read it in the same time, the program would crash, but we just put that in some kind of "try-catch" so if that happens we would just skip reading for that iteration ...
I tried that in ZGE on single file, and it works pretty nice ! :)
I have attached the examples ... You start rwtest and client, and when you click somewhere in rwtest with your mouse, you write X and Y coordinates in test file so the client can read it ... AND IT WORKS ! :lol:
But the problem is that I can't set file path to something like C:\blah\ or \\PC2\ or something ... I can only use current EXE path or \folder\file (i hope you understand me at least something)...
If the exe is for example in D:\ZGE\project\ , I can only access files in that folder or folders located there ... I cant access file on C disk if the exe is on D:\ ... So, can ZGE accept absolute path (i hope its the name for it :D) ?

Dunno if its too rude from my side to ask for a new feature since I'm totally inactive here, but you decide ... :oops:
Attachments
rw test.rar
rwtest.zgeproj and client.zgeproj
(1.19 KiB) Downloaded 654 times
rwtest.PNG
rwtest.PNG (27.67 KiB) Viewed 13243 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

ha! nice hack!

I had been thinking about a some simple networking suport as well., I would like to see a bit more practical implementation,. Not to take away from your idea, as if it works and ppl can have fun with it, then more power to you,. However, even some simple net support for sending highscores to a site would be cool,. and of course in the end I would like to do a server based game,. I am learning about PHP now, to rebuild my web site, and having some interesting ideas about games that can be done,. but I will post a request when I have something more like this specific idea. trun based stratagy designs or even a Spore like server library/data exchange system should be trivial,. . peace
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Yes, it is very cool when someone thinks of new creative ways of using existing features! Good work Boris.

I don't know about allowing absolute paths... potentially a security risk if someone writes to c:\windows\system.dat or something :) . Since a shared path is needed anyway (such as \\net-drived) you might as well put both exe-files in that path and use relative paths.

No networking features are currently planned for zge, but simple stuff like what jph describe should be easy to add in a future version. We'll see.
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Post by turshija »

VilleK wrote:I don't know about allowing absolute paths... potentially a security risk if someone writes to c:\windows\system.dat or something :) .
Well, that means every programming language has that security risk ... :P
But programming language shouldn't care if there are evil programmers at all ... :twisted:
Useful example:
If I want to make demo/trial game that unlocks with serial number, I would save some random unusual .dat file in C:\windows\system32\ with special code that game will read on every start to check if the game is registered or not ...

Only problem about adding absolute paths not multiplatform ...
What if the game tries saving something in C:\windows\system32\ on Linux? :lol:
VilleK wrote:Since a shared path is needed anyway (such as \\net-drived) you might as well put both exe-files in that path and use relative paths.
Just tried putting in share folder of other computer ... Copied exe files to \\PC1\share\ and when I try starting exe files from this computer I get "send/don't send" error ... :( I've checked the permissions, its not the problem ... Oh well, ill try hacking a little bit more ... :)

I'm not sure, but If we had absolute paths maybe we could be able to upload scores to FTP just by writing to file like this:

Code: Select all

ftp://username:password@ftpsite.com/scores.dat
Dunno if its possible, but only my guess ... :roll:
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi guys,

Serial / license information is usually stored in either a encrypted file in the program's directory or the registry. Storing such information in for example the Windows directory is considered bad practice as far as I know.

Online highscore is something quite different to network based multi-player. Although both ( might ) use TCP/IP, you generally just query a SQL command or PHP/ASP page ( passing variables in the URL ), which is quite a bit more simple then what you usually need for online / LAN MP.

About ten years ago some classmates actually used a similar network trick to set up a simple multi-player game :) Unfortunately ZGE executables seem to crash when run through a Network from a other PC ( Windows Program Error ). It does work within the Editor, but it's laggy ( especially on the PC running from behind the network ) and you get invalid results when the file is being written to ( this can be solved by writing some kind of file cue though ).

I've attached a simple 2 player mouse example. Put the zgeproj in a shared folder on one of the PC's, load it up in the editor on both PC's, change the ClientIdentity constant in one of the projects to 1, and press Preview on both PC's to witness the horror :wink:

K
Attachments
Multiplay.zgeproj
(4.96 KiB) Downloaded 616 times
User avatar
diki
Posts: 140
Joined: Thu Sep 11, 2008 7:53 pm
Location: GMT+1
Contact:

Post by diki »

on the topic of communications, i was wondering how difficult/time consuming it would be to implement a most simple network protocoll component into zge (i was thinking of OSC, but that would just be an abstraction on TCP/IP or UDP, right?) ...
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Post by turshija »

yeah, any kind of network protocol would be pretty useful in ZGE, but I don't think it would be possible to implement it without some additional libraries, that would certainly increase the executable size ...
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I've never really attempted network coding so I don't know how much work it is or if external libraries are needed. There is a SDL NET library that could probably be used for platform independence though. I welcome anyone who have experience with network coding to share their knowledge and suggestions here, or start a new thread about it.
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Post by turshija »

heh, coincidence I have started learning SDL 1 week ago, and I tried doing something in SDL_net ...
The bad thing is that when distributing exe file, you have to keep sdl.dll and sdl_net.dll files in the same directory as exe file, because the program cannot start without it ... And sdl.dll is 232kb, so that means no more 64kb games ... :)
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

the point is just this: if you are making a 64 kb game, it won't be multiplayer :P If the game is not multiplayer, no dll is needed :P
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
Post Reply