|
Post by Enzo on May 10, 2021 7:10:30 GMT
Is this possible, on what scale, are there DLLs that decrease file storage and reading and access time,
Idea is to offer for free a Data Base that can be read with two functions and operate alone and in realtime be updated for other sessions. Reading files with a buffer file to indicate if file is being read?
What do you think the lacency could get down to, is JB unlimited on its use to harness hardware power, even at a older computer, 4ms read and 0ms write still is estimaed, only 40 max sessions per 1 Frame per Second?
|
|
|
Post by Enzo on May 10, 2021 7:32:50 GMT
Anything with an output file looking for another sessions update on a LAN could use this system, .i.e games, servers, anything you can get creative with
readybuffer$="OPEN" notreadybuffer$="CLOSED" [reloop] 'other applicable code [fileclientsload] sessionid = sessions()'load sessions file
on error goto [err]
sessionid = 1 to sessions 'loop for amount of sessions/clients filename$ = str$(sessionid) [retry] if fileexists( filename$ + readybuffer$ ) then ' try for load and load a$=renamefile$(filename$,notreadyforbuffer$) b$loadfile$(filename$) c$=renamefile$(filename$,readyforbuffer$) else if flleexists( filename$ + notreadybuffer$ ) <> 0 then null = null goto [retry] else 'buffer 'ghost' if server links up timing wise and renames inbetween you get a lag and first input after goto [retry] end if
goto [reloop]
Is how I think it would work
|
|
|
Post by Rod on May 10, 2021 12:18:47 GMT
|
|
|
Post by Enzo on May 11, 2021 3:21:28 GMT
I'll have to try it out although I wonder about lacency.. one method vs the other.
Also no mention of max client amount
|
|
|
Post by Enzo on May 11, 2021 12:05:44 GMT
For sake of simplicity I'd like to make the first MUD a remote login to my 'server' for my friends, i'll be able to update debug and release current verisons including mutiple session login debug, rather then needing a new computer.
I believe I tested this method a long time ago,
If even then could get at least 2 people logged into the same server, that gives a read write cycle of about 50ms with many over writes (reinput to client without an update from another user), lag was from emote login but tolerable back in nearly 2010.
|
|
|
Post by Enzo on May 16, 2021 9:59:54 GMT
global command, clientcount, pid global file$, Default$, pid$, closed$, looping, footer$, header$, closed$, space$, upload$, closefile$, filen$, fileaname$ link$ = "4556" if fileExists(Default$, link$+".txt") then kill link$+".txt" end if
open link$+".txt" for output as #main print #main, "3" close #main
for looping = 1 to 3 open str$(pid)+"AB"+".txt" for output as #handle close #handle open str$(pid)+".txt" for output as #handle close #handle next looping
[MAINserver] Default$ = DefaultDir$ dim arrayinfo$(10) 'max clients 'setup constants loopfilename$ = link$ files$ = link$ +".txt" footer$ = "AB" header$ = ".txt" closed$ = "closed" space$ = " " [serverloop] 'get current player count if fileExists(Default$, loopfilename$+header$) then 'if fileclientcount > 0 (exists) then command$ = renamefileclosed$(Default$, files$, closed$, header$, file$, closefile$, link$) 'rename to not allow anyone else to open if reloop = 1 then reloop = 0 goto [serverloop] end if clientcount$=openfileclient$(Default$, files$, header$) 'open and read client count for current loop files$ = loopfilename$+closed$ command$ = renamefileopen$(Default$, files$,closed$, header$, file$, closefile$) 'once file is closed rename back to allow to be opened else goto [serverloop] end if clientcount = val(clientcount$) [looppid] 'download clients upload for pid = 1 to clientcount 'loop all saved pid files pid$ = str$(pid) if fileExists(Default$, pid$+header$) then 'if fileclientcount > 0 (exists) then / else reloop if file is being edited command$ = renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$,link$) 'rename to not allow anyone else to open array = openfile(pid) 'open each pid load into array arrayinfo$(pid) = str$(array) command$ = renamefileopen$(Default$, pid$,closed$, header$, file$, closefile$) 'once file is closed rename back to allow to be opened else goto [looppid] 'reloop if file is being edited end if next pid [uploadforclientdownload] for pid = 1 to clientcount 'now loop all pid pid$ = str$(pid) if fileExists(Default$, pid$+header$) then 'if fileclientcount > 0 (exists) then / else reloop if files are being read command$= renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$,link$) 'rename to not allow anyone else to open open str$(pid)+footer$+header$ for output as #2pid for pid2 = 1 to clientcount upload$ =arrayinfo$(pid) print #2pid, str$(pid)+space$+upload$ next pid2 close #2pid command$ = renamefileopen$(Default$, pid$, closed$, header$, file$, closefile$) 'once file is closed rename back to allow to be opened else goto [uploadforclientdownload] 'reloop if file is being read to not skip protocol end if next pid goto [serverloop] '/------------Functions '-----------------------------------------------------------------------------------------
function openfile(pid) open str$(pid)+header$ for input as #pid input #pid, info$ close #pid openfile = val(info$) end function
function openfileclient$(Default$, files$, header$) filen$=Default$+"\"+files$ ' open filen$ for input as #clientcount ' input #clientcount, count$ ' close #clientcount ' openfile = val(count$) openfile =3 end function
function renamefileclosed$(Default$, files$, closed$, header$, file$, closefile$, link$) file$ = files$ closefile$ = link$ + closed$ + header$
if fileExists(Default$, file$+header$) then null=null reloop = 1 else name file$ as closefile$ end if end function
function renamefileopen$(pathrename$, renamefilename$, closed$, header$,file$,closefile$) file$ = renamefilename$ + header$ closefile$ = renamefilename$ + header$
name file$ as closefile$ end function
function fileExists(path$, filename$) dim info$(0, 0) files path$, filename$, info$() fileExists = val(info$(0, 0)) 'non zero is true end function
Seems an error at function openfileclient$(Default$, files$, header$) when nun noting '
|
|
|
Post by Enzo on May 16, 2021 10:07:54 GMT
[looppid] is used for looping in client aswell, other then timing say down to a even number machine ms wise and buffering loads within set time frames of every second and que-ing up post process to start on que I don't see a friendlier way of LAN support in real time, but am open to suggestions. global command, clientcount, pid global file$, Default$, pid$, closed$, looping, footer$, header$, closed$, space$, upload$, closefile$, filen$, fileaname$ link$ = "temp"
[MAINserver] Default$ = DefaultDir$ dim arrayinfo$(10) 'max clients 'setup constants loopfilename$ = link$ files$ = link$ +".txt" footer$ = "AB" header$ = ".txt" closed$ = "closed" space$ = " "
[l] timer 20, [w] wait [w] timer 0 null = null [uploadforclientdownload] for pid = 1 to clientcount 'now loop all pid pid$ = str$(pid) if fileExists(Default$, pid$+header$) then 'if fileclientcount > 0 (exists) then / else reloop if files are being read command$= renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$,link$) 'rename to not allow anyone else to open open str$(pid)+footer$+header$ for output as #2pid for pid2 = 1 to clientcount upload$ =arrayinfo$(pid) print #2pid, str$(pid)+space$+upload$ next pid2 close #2pid command$ = renamefileopen$(Default$, pid$, closed$, header$, file$, closefile$) 'once file is closed rename back to allow to be opened else goto [uploadforclientdownload] 'reloop if file is being read to not skip protocol end if next pid goto [l] function fileExists(path$, filename$) dim info$(0, 0) files path$, filename$, info$() fileExists = val(info$(0, 0)) 'non zero is true end function
function renamefileclosed$(Default$, files$, closed$, header$, file$, closefile$, link$) file$ = files$ closefile$ = link$ + closed$ + header$
if fileExists(Default$, file$+header$) then null=null reloop = 1 else name file$ as closefile$ end if end function
function renamefileopen$(pathrename$, renamefilename$, closed$, header$,file$,closefile$) file$ = renamefilename$ + header$ closefile$ = renamefilename$ + header$
name file$ as closefile$ end function
I am able to get 6 clients running on one server run, per session, have not benchmarked yet and did not want to error out no "on err goto" yet, looking to produce the error if there will be one. Have not seen data transfer as of yet.
|
|
|
Post by carlgundel on May 17, 2021 14:33:30 GMT
[looppid] is used for looping in client aswell, other then timing say down to a even number machine ms wise and buffering loads within set time frames of every second and que-ing up post process to start on que I don't see a friendlier way of LAN support in real time, but am open to suggestions. I am able to get 6 clients running on one server run, per session, have not benchmarked yet and did not want to error out no "on err goto" yet, looking to produce the error if there will be one. Have not seen data transfer as of yet. You're concerned about it being slow, or you notice that it is slow?
|
|
|
Post by Enzo on May 18, 2021 6:31:13 GMT
[looppid] is used for looping in client aswell, other then timing say down to a even number machine ms wise and buffering loads within set time frames of every second and que-ing up post process to start on que I don't see a friendlier way of LAN support in real time, but am open to suggestions. I am able to get 6 clients running on one server run, per session, have not benchmarked yet and did not want to error out no "on err goto" yet, looking to produce the error if there will be one. Have not seen data transfer as of yet. You're concerned about it being slow, or you notice that it is slow? No, Not slow at all, actaully using 17ms timer loop, on all clients and server app, the config ran around 1000ms/17ms FPS ; I imagine there is overlapping with the else nulls which I was going to start counting to see if a metered system is possible by slowing clients down to a single cycle per server loop. Once how long it will take all clients to download their respectful file and set server timed loop as such anyone could arrange a pid type spot for retiveing data rather then it be on a looping free-for-all, I was considering keeping it at the free for all config for the MUD and track the amount of first updates to see if there is a unfair repeating pattern, in actuallity rather then a predicted model on a linear scale graphing calculator, as to actual game data parsing client-end Making timers longer isn't a negative here, it will allow, as long as clients can load the graphics and machine can also handle the amount of display sessions, for more read and write cycles to happen while maintaining at least a 12-16 FPS, for any application should be good enough, 84ms is almost 40 clients accessing per one data server, at an average of 4ms write/read speed, which JB can produce faster on better machines, I've seen less then a total of 0 ms for read and write of simple files, primarly on 7200rpm HDD, but to handle over 40 sessions of remote login... I would be using a SSD with 550MB/sec read/write techincally 35 sessions per 2ms, as 1000ms / 550MB = 2ms / 1MB, average file size about 1/40 a MB or 25kb I should also say I could of ran more then 6 sessions but chose not too, computer did not power up it's fan so im sure I could of gotten 2 times the amount of sessions easy.
|
|
|
Post by Enzo on May 19, 2021 11:12:46 GMT
Trying to test theoredical max clients for my server machine today, SSD is coming in, intel core 2 duo 4gb of ram, linux mint/wine, without any graphical clients or remote login sessions. I think this machines gives a mid tier best possible case, compute power wise
Hoping for at least 40+ - 100, realisictically 20+
|
|
|
Post by Enzo on May 19, 2021 12:12:17 GMT
global command, clientcount, pid global file$, Default$, pid$, closed$, looping, footer$, header$, closed$, space$, upload$, closefile$, filen$, fileaname$, path$ 'open$ would be null / i.e. reset set = 3 link$ = "fffatest" fileextension$ = "txt" est$ ="."+fileextension$ filen$ = link$ clientsamount$ = str$(set) clientcount = set footer$ = "AB" dataloading = time$("ms") print "loading test null pagefile list" for looping = 1 to set string$=str$(pid) open Default$+string$+footer$+est$ for output as #handle print #handle, "data" close #handle string$=str$(pid) open Default$ + string$+est$ for output as #handle print #handle, "data" close #handle next looping print "done." print "prefetch"
[reset] if fileExists(Default$, link$+est$) then print "Server file found," print "" print "..." print "test start server clients" else open link$+est$ for output as #main print #main, clientsamount$ close #main end if
[MAINserver] Default$ = DefaultDir$ + "\" dim arrayinfo$(10) 'max clients 'setup constants
header$ = est$ closed$ = "closed" space$ = " "
print "done." print "startingservernow" print "." print ".." print "done," dataload = time$("ms") print "started in;";dataload-dataloading print "-------------------" timer 1000, [serverloop] wait [serverloop] 'get current player count timer 0 startloop = time$("ms") if fileExists(Default$, link$+header$) then 'if fileclientcount > 0 (exists) then command$ = renamefileclosed$(Default$, pid$, closed$, header$, filen$, closefile$, link$, filename$) 'rename to not allow anyone else to open if reloop = 1 then reloop = 0 goto [serverloop] end if rename = time$("ms") clientcount$=openfileclient$(Default$,pid$, header$, filen$) 'open and read client count for current loop
command$ = renamefileopen$(Default$, pid$,closed$, header$, filen$, closefile$, filename$) 'once file is closed rename back to allow to be opened print time$("ms") -rename;"rename file loop in ms" else goto [serverloop] end if
[looppid] 'download clients upload startpid = time$("ms")
for pid = 1 to clientcount 'loop all saved pid files startpid2 = time$("ms") pid$ = str$(pid) if fileExists(Default$, pid$+header$) then 'if fileclientcount > 0 (exists) then / else reloop if file is being edited command$ = renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$,link$, filename$) 'rename to not allow anyone else to open if reloop = 1 then reloop = 0 start = pid goto [loopid] end if array = openfile(pid,header$) 'open each pid load into array arrayinfo$(pid) = str$(array) command$ = renamefileopen$(Default$, pid$,closed$, header$, file$, closefile$, filename$) 'once file is closed rename back to allow to be opened 'if reloop = 2 then 'null=null 'notice "err2" 'reloop = 0 'end if else goto [looppid] 'reloop if file is being edited end if if pid = set then print "LOOP" END IF next pid [uploadforclientdownload] startpid2 = time$("ms") for pid = 1 to clientcount 'now loop all pid pid$ = str$(pid) print time$("ms")-startpid2 if fileExists(Default$, pid$+header$) then 'if fileclientcount > 0 (exists) then / else reloop if files are being read command$= renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$,link$, filename$) 'rename to not allow anyone else to open open str$(pid)+footer$+header$ for output as #2pid for pid2 = 1 to clientcount upload$ =arrayinfo$(pid) print #2pid, str$(pid)+space$+upload$ next pid2 close #2pid command$ = renamefileopen$(Default$, pid$, closed$, header$, file$, closefile$, filename$) 'once file is closed rename back to allow to be opened else goto [uploadforclientdownload] 'reloop if file is being read to not skip protocol end if print time$("ms")-startpid2;" file loaded" if pid = set then print "LOOOP" END IF next pid
print time$("ms") - startpid; " looped all files in total of in ms" print time$("ms")-startloop;" server loop entirely of 17 ms pause and latter d/u w/r status in ms"; startloop- startpid ;" / ";startpid2-time$("ms") startpid= 0 startpid= 0 startpid= 0 startloop= 0
timer 20, [serverloop]
print "LOOP" wait
'/------------Functions '-----------------------------------------------------------------------------------------
function openfile(pid, header$) open str$(pid)+header$ for input as #pid input #pid, info$ close #pid openfile = val(info$) info$ = "" end function
function openfileclient$(Default$, pid$, header$, filen$) filen$=Default$+pid$ 'pen filen$ for input as #clientcount ' input #clientcount, count$ ' close #clientcount openfile = val(count$) openfile =3 end function
function renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$, link$, filename$) file$ = Default$ + pid$ + filen$ + header$ closefile$ = pid$ + closed$ + header$ name file$ as closefile$ closefile$ ="" files$="" file$="" fileb$="" end function
function renamefileopen$(Default$, pid$, closed$, header$,file$,closefile$, filename$) 'Default$ pid$ .txt file$ = Default$ + pid$+ filen$+closed$+ header$ closefile$ = pid$ + header$ name file$ as closefile$ closefile$ ="" files$="" file$="" fileb$="" end function
function fileExists(Default$, filename$) dim info$(0, 0) files Default$, filename$, info$() fileExists = val(info$(0, 0)) 'non zero is true end function
Having trouble
|
|
|
Post by Rod on May 19, 2021 18:19:31 GMT
The error I get is that you cannot NAME a file to a file that already exists. If that is what is happening you would need to kill the old file first.
function renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$, link$, filename$) file$ = Default$ + pid$ + filen$ + header$ closefile$ = pid$ + closed$ + header$ [b]name file$ as closefile$[/b] closefile$ ="" files$="" file$="" fileb$="" end function
|
|
|
Post by Enzo on May 20, 2021 1:39:34 GMT
The error I get is that you cannot NAME a file to a file that already exists. If that is what is happening you would need to kill the old file first. function renamefileclosed$(Default$, pid$, closed$, header$, file$, closefile$, link$, filename$) file$ = Default$ + pid$ + filen$ + header$ closefile$ = pid$ + closed$ + header$ [b]name file$ as closefile$[/b] closefile$ ="" files$="" file$="" fileb$="" end function
I thought name command renamed file, is there a way to rename file other then opening a new file inputting data and deleting old, nonetheless kill file will work and hold information in the random access memory.
|
|
|
Post by Rod on May 20, 2021 14:16:09 GMT
Why not just overwrite the file contents? You could have a date time stamp that identifies when the contents were written.
|
|
|
Post by Enzo on May 20, 2021 19:44:08 GMT
Logical order implies filename must exist for this to work, therefore on a tethered input output where the only error should be if file is read when updating name, if within a single line of code mid way though the machine client reads document on close, which I'm not sure if OS's even allow this, or JB, basically trying to say once file is made there no buffer when it can error out from being read too early where file is not ready but created?
I've come across something, with my SSD drive I've gotten 50 'client files' on a 750ms loop, however something occurred to me
If the server is looping on xy filename inputs and over ms client loop is optional as if server handles people based on nearness to the row of data, it can still loop within players given area within enough time over the 50+ clients, if a patchual parse is made for the different areas (rows of data) and handled as such say 5 rows at a time, then every 10 rows worth of data will be parsed in less then server loop, it will run on a seek and update over allotted data
Map is 500x500 therefore 50 rows of 10 parses; 750ms a parse at 50 clients, 10 750ms loops where 10 servers are going and data is stored in ram or updated xy via client to reach new area, or 500 players, actual results may vary then it could handle more players because it could handle 50 clients * 10 servers within 750ms, 500 players could play the game on the open world. Would also need more then 4GB of ram to handle 50+ clients.
|
|