Server Records;Time

blie4

Not a Peon
Mod
Nov 3, 2013
387
160
I agree, it would be a nice touch to add this in for the speedrunners. There could be your own personal records as well as a server record, which would provide a nice incentive to replay maps over and over in hopes of beating the server record.

(Also, you could have filed this under plugin suggestions on the main forum menu, but it's fine. :p)
 

Srentiln

minr op since Nov 2011
Op
Oct 28, 2013
1,934
838
I can see a few potential problems with implementing it. Getting the basic information wouldn't be all that difficult since it's just searching for specific terms within the server logs. However, the search is rather resource intensive. To give a general idea, let's take the example of pulling the logs for a specific player. For someone who has been on the server a week, it's fairly quick. The longer a player has been on the server, the more data there is to pull. For every hit on the player's name, all the data within that log entry line has to be copied to the file that is created. This process takes up RAM and processor cores while it is being executed. For a record system, you could take this log file and search for the start and finish points of a specific map. However, you need to set up the search so that it recognizes a case where the player gave up on the course and then went back to it. So, pulling this information on the fly is a bit impractical.

So, let's look at a second option: pulling the raw data from the server in the same stream that creates the full logs and putting it into a database. This makes it less resource-intensive for accessing the data since it is already sorted and ready for access. However, you are trading this for the additional storage space it takes up. Considering that we get new players and maps "all the time", this space will increase over time, just as the logs do. I don't know how much space is currently used on the server drives, but from reviewing logs, I would say a database like this could potentially take up 15 to 20% of the space that the server logs do.

If someone can think of a more efficient method, I would love to hear it. It could save me some space with some of my experiments.
 

CreepaShadowz

Maze Connoisseur
Mod
Apr 21, 2014
1,056
453
I actually tested this on zero, a timing system that worked for multiple people, held theirs times until they reset it and stuff. Only problem was that everyone could see the scoreboard. I might have been able to refine it.

Also was that it ran off a constant clock that activates 10 times a second.

So all you would have to do is keep the chunks loaded. I don't feel like it would impact on the lag, but I'm not the one making that call.

This is what I based it (copied mainly) off:
 

rickyboy320

Penguin Master
Op
Board
Nov 18, 2013
1,926
1,032
Theoretically we could also add something to the checkpoint plugin which starts a timer when you hit a checkpoint. (This will only add up an integer every tick, per player, which shouldn't be that resource intensive (there's also the possibility of extending that time it ticks)). In the case you hit the endpoint, your timer is saved. Would you leave the server (too?). in the case that you click a new checkpoint/respawn at your checkpoint the timer is restarted. Thinking of which, multicheckpoint maps would cause to be a problem.

I've also attempted at making the /checkpoint ffa command somewhat userfriendly, but it still causes some bugs (and introduces a new command). Which would be (still open for change) /checkpoint map <map-code> <points> <map-name>
This way it stores the mapcode with the amount of points rewarded and the name of the map, so if you do /checkpoint ffa it would display every map with it's code, pointvalue and full name. In this case, we could also add the timevalue. So it would display the name, code, points and timevalue for that player. (Will add a page stystem too if I ever pick up the work)

@Creeper2685 I believe in 1.8 there are teamspecific playerboars (may be in 1.7) so if you add everyone to a certain team in a different map, it would only be visible for those in the team/map. /scoreboard <objective> setdisplay sidebar.team.<teamcolor> Instead of just sidebar :)
Also 10 ticks per second, times the hundreds of maps we have may result in over 1000 ticks per second. And it apperantly spams the console as we figured out a while ago. But that can be fixed by setting the /gamerule logAdminCommands false. That will hinder all the admin commands(including the commandblocks) to show up in the server console, but I have no idea how it will hinder the logs. Hopefully it doesn't but it could.
 

Srentiln

minr op since Nov 2011
Op
Oct 28, 2013
1,934
838
Theoretically we could also add something to the checkpoint plugin which starts a timer when you hit a checkpoint. (This will only add up an integer every tick, per player, which shouldn't be that resource intensive (there's also the possibility of extending that time it ticks)). In the case you hit the endpoint, your timer is saved. Would you leave the server (too?). in the case that you click a new checkpoint/respawn at your checkpoint the timer is restarted. Thinking of which, multicheckpoint maps would cause to be a problem.
And that is why I love working with other people. Fairly simple solution using existing tools with a modest increase in calculating resources. Still needs data storage, but Using the checkpoint plugin would probably allow it to be injected into the player data files.
 

Chillers

Administrator
Op
Oct 26, 2013
1,525
819
I can see a few potential problems with implementing it. Getting the basic information wouldn't be all that difficult since it's just searching for specific terms within the server logs. However, the search is rather resource intensive. To give a general idea, let's take the example of pulling the logs for a specific player. For someone who has been on the server a week, it's fairly quick. The longer a player has been on the server, the more data there is to pull. For every hit on the player's name, all the data within that log entry line has to be copied to the file that is created. This process takes up RAM and processor cores while it is being executed. For a record system, you could take this log file and search for the start and finish points of a specific map. However, you need to set up the search so that it recognizes a case where the player gave up on the course and then went back to it. So, pulling this information on the fly is a bit impractical.

So, let's look at a second option: pulling the raw data from the server in the same stream that creates the full logs and putting it into a database. This makes it less resource-intensive for accessing the data since it is already sorted and ready for access. However, you are trading this for the additional storage space it takes up. Considering that we get new players and maps "all the time", this space will increase over time, just as the logs do. I don't know how much space is currently used on the server drives, but from reviewing logs, I would say a database like this could potentially take up 15 to 20% of the space that the server logs do.

If someone can think of a more efficient method, I would love to hear it. It could save me some space with some of my experiments.

It would be far better to have a webpage that displays the data instead. Especially if the data is stored in an sql database. Running simple query would be pretty quick and effective especially if the data is hosted on a separate server.
 

rickyboy320

Penguin Master
Op
Board
Nov 18, 2013
1,926
1,032
That makes me think about the app again, I wish making apps for IOS was free, and since I don't have an android phone.. darn, I could've made that app..

Anyhow, I finished cleaning up the /checkpoint ffa command. I'll be posting the updated plugin after I've figured out how to do the timing. Any suggestions how we would go about multicheckpointed maps?
 
Last edited:

CreepaShadowz

Maze Connoisseur
Mod
Apr 21, 2014
1,056
453
You could add a extra tag to the checkpoints so like the first cp would be like TimerStart

and the end could be like TimerFinish.

The midcps would have those tags.
 

Chillers

Administrator
Op
Oct 26, 2013
1,525
819
Not that shit please, it's what were doing in the IT course at school right now and just reading it makes me cry.
It's a good thing you are learning it because tonnes of businesses use them. I wish my IT course taught me this stuff as a kid. The only thing it taught us is how to use, word excel and office.
 

rickyboy320

Penguin Master
Op
Board
Nov 18, 2013
1,926
1,032
Plugin works as far as I know, it may just need testing from multiple players. Will post it in the devforum later today.
It requires a hellload of scriptblocking though, since not every single [checkpointW] should start a timer, and not every [checkpointP] should stop it.

Command updates:
Non-op commands:
/checkpoint ffa - Displays your FFA list in a revamped way :)
/checkpoint ffa <page> - Displays your FFA list in a revamped way (if your FFA list is larger than 8 entries, it goes to a different page)
/checkpoint ffa <playername> <page> - Displays <playername>'s FFA list in a revamped way
/checkpoint ffa <map-code> - Displays if you have completed the map by mapcode.

Op commands:
/checkpoint map <map-code> <points> <map-name> - Maps the map-code to a specific amount of points and a mapname
/checkpoint map delete <map-code> - removes <map-code> from the mapping list.
/checkpoint map list - Lists all mappings (not in a userfriendly manner.. heh)

/checkpoint timer start - Starts a timer, should be scriptblocked on every starting checkpoint sign.
/checkpoint timer stop <map-code> - Stops the timer using a mapcode, should be scriptblocked on every endsign
/checkpoint timer list <map-code> - Displays the top 3 times with the player that completed it.

Note that when scriptblocking, it should bypass the normal commandexecutions, so it requires the tag @bypass. (Of course this plugin isn't there yet, so we can't do that yet, but when the time comes.. :))

Just gotta clean up the code a little more, comment stuff for readability, and then I I'll post it.

Also - if you beat a map twice, the better time stays, obviously.

If no op wishes to map every single map, I can also premake the mapping file :)

Update: Posted
 

CreepaShadowz

Maze Connoisseur
Mod
Apr 21, 2014
1,056
453
It might be better if you actually scripted the /checkpoint timer start to for example, a Redstone block NEAR the beginning of the map. I think this should be done because several maps like, 'Napped, Wretched Earth, etc. have a starting area, usually with those really annoying piston doors.

So like for 'Napped, it could be at the start of the parkour (you need to get the foof first) and Wretched could have it as soon as you fall into the house.
 

blie4

Not a Peon
Mod
Nov 3, 2013
387
160
Is Scriptblock even updating to 1.8? We may have to get a Minr member to update it themselves, as far as I know Scriptblock wasn't an active plugin.
 
Top