mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
fps (#17676)
This commit is contained in:
+1
-1
@@ -1414,6 +1414,7 @@
|
||||
#include "code\modules\admin\verbs\debug.dm"
|
||||
#include "code\modules\admin\verbs\diagnostics.dm"
|
||||
#include "code\modules\admin\verbs\dice.dm"
|
||||
#include "code\modules\admin\verbs\fps.dm"
|
||||
#include "code\modules\admin\verbs\getlogs.dm"
|
||||
#include "code\modules\admin\verbs\map_template_loadverb.dm"
|
||||
#include "code\modules\admin\verbs\mapping.dm"
|
||||
@@ -1427,7 +1428,6 @@
|
||||
#include "code\modules\admin\verbs\SDQL.dm"
|
||||
#include "code\modules\admin\verbs\SDQL_2.dm"
|
||||
#include "code\modules\admin\verbs\SDQL_2_parser.dm"
|
||||
#include "code\modules\admin\verbs\ticklag.dm"
|
||||
#include "code\modules\admin\verbs\tripAI.dm"
|
||||
#include "code\modules\admin\verbs\viewlist.dm"
|
||||
#include "code\modules\admin\verbs\warning.dm"
|
||||
|
||||
@@ -157,7 +157,7 @@ var/list/gamemode_cache = list()
|
||||
var/protect_roles_from_antagonist = 0// If security and such can be traitor/cult/other
|
||||
var/allow_Metadata = 0 // Metadata is supported.
|
||||
var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1.
|
||||
var/Ticklag = 0.4
|
||||
var/Ticklag = 0.33
|
||||
var/antag_hud_allowed = 0 // Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round.
|
||||
var/antag_hud_restricted = 0 // Ghosts that turn on Antagovision cannot rejoin the round.
|
||||
var/list/mode_names = list()
|
||||
|
||||
@@ -225,7 +225,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
#endif
|
||||
|
||||
world.TgsInitializationComplete()
|
||||
world.tick_lag = config.Ticklag
|
||||
world.change_tick_lag(config.Ticklag)
|
||||
|
||||
var/initialized_tod = REALTIMEOFDAY
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
//replaces the old Ticklag verb, fps is easier to understand
|
||||
/client/proc/set_server_fps()
|
||||
set category = "Debug"
|
||||
set name = "Set Server FPS"
|
||||
set desc = "Sets game speed in frames-per-second. Can potentially break the game"
|
||||
|
||||
if(!check_rights(R_DEBUG|R_DEV))
|
||||
return
|
||||
|
||||
var/cfg_fps = (10 / config.Ticklag)
|
||||
var/new_fps = round(input("Sets game frames-per-second. Can potentially break the game (default: [cfg_fps])","FPS", world.fps) as num|null)
|
||||
|
||||
if(new_fps <= 0)
|
||||
to_chat(src, SPAN_DANGER("Error: set_server_fps(): Invalid world.fps value. No changes made."), confidential = TRUE)
|
||||
return
|
||||
if(new_fps > cfg_fps * 1.5)
|
||||
if(tgui_alert(usr, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [cfg_fps]","Warning!",list("Confirm","ABORT-ABORT-ABORT")) != "Confirm")
|
||||
return
|
||||
|
||||
var/msg = "[key_name(src)] has modified world.fps to [new_fps]"
|
||||
log_admin(msg, 0)
|
||||
message_admins(msg, 0)
|
||||
|
||||
world.change_fps(new_fps)
|
||||
@@ -136,7 +136,7 @@ var/list/debug_verbs = list (
|
||||
,/client/proc/count_objects_all
|
||||
,/client/proc/cmd_assume_direct_control
|
||||
,/client/proc/jump_to_dead_group
|
||||
,/client/proc/ticklag
|
||||
,/client/proc/set_server_fps
|
||||
,/client/proc/cmd_admin_grantfullaccess
|
||||
,/client/proc/kaboom
|
||||
,/client/proc/splash
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
//Merged Doohl's and the existing ticklag as they both had good elements about them ~Carn
|
||||
|
||||
/client/proc/ticklag()
|
||||
set category = "Debug"
|
||||
set name = "Set Ticklag"
|
||||
set desc = "Sets a new tick lag. Recommend you don't mess with this too much! Stable, time-tested ticklag value is 0.9"
|
||||
|
||||
if(!check_rights(R_DEBUG|R_DEV)) return
|
||||
|
||||
var/newtick = input("Sets a new tick lag. Please don't mess with this too much! The stable, time-tested ticklag value is 0.9","Lag of Tick", world.tick_lag) as num|null
|
||||
//I've used ticks of 2 before to help with serious singulo lags
|
||||
if(newtick && newtick <= 2 && newtick > 0)
|
||||
log_admin("[key_name(src)] has modified world.tick_lag to [newtick]", admin_key=key_name(src))
|
||||
message_admins("[key_name(src)] has modified world.tick_lag to [newtick]", 0)
|
||||
world.tick_lag = newtick
|
||||
feedback_add_details("admin_verb","TICKLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
else
|
||||
to_chat(src, "<span class='warning'>Error: ticklag(): Invalid world.ticklag value. No changes made.</span>")
|
||||
@@ -196,7 +196,7 @@
|
||||
if("ooc")
|
||||
pref.ooccolor = initial(pref.ooccolor)
|
||||
if("fps")
|
||||
pref.clientfps = 0
|
||||
pref.clientfps = initial(pref.clientfps)
|
||||
return TOPIC_REFRESH
|
||||
|
||||
return ..()
|
||||
|
||||
@@ -159,7 +159,7 @@ var/list/preferences_datums = list()
|
||||
|
||||
// SPAAAACE
|
||||
var/toggles_secondary = PROGRESS_BARS | FLOATING_MESSAGES | HOTKEY_DEFAULT
|
||||
var/clientfps = 40
|
||||
var/clientfps = 100
|
||||
var/floating_chat_color
|
||||
var/speech_bubble_type = "default"
|
||||
|
||||
|
||||
+23
-1
@@ -56,7 +56,7 @@ var/global/datum/global_init/init = new ()
|
||||
cache_lifespan = 0 //stops player uploaded stuff from being kept in the rsc past the current session
|
||||
maxx = WORLD_MIN_SIZE // So that we don't get map-window-popin at boot. DMMS will expand this.
|
||||
maxy = WORLD_MIN_SIZE
|
||||
fps = 30
|
||||
fps = 20
|
||||
#ifdef FIND_REF_NO_CHECK_TICK
|
||||
loop_checks = FALSE
|
||||
#endif
|
||||
@@ -458,4 +458,26 @@ var/list/world_api_rate_limit = list()
|
||||
else
|
||||
return TRUE
|
||||
|
||||
|
||||
/world/proc/change_fps(new_value = 20)
|
||||
if(new_value <= 0)
|
||||
CRASH("change_fps() called with [new_value] new_value.")
|
||||
if(fps == new_value)
|
||||
return //No change required.
|
||||
|
||||
fps = new_value
|
||||
on_tickrate_change()
|
||||
|
||||
/world/proc/change_tick_lag(new_value = 0.5)
|
||||
if(new_value <= 0)
|
||||
CRASH("change_tick_lag() called with [new_value] new_value.")
|
||||
if(tick_lag == new_value)
|
||||
return //No change required.
|
||||
|
||||
tick_lag = new_value
|
||||
on_tickrate_change()
|
||||
|
||||
/world/proc/on_tickrate_change()
|
||||
SStimer?.reset_buckets()
|
||||
|
||||
#undef FAILED_DB_CONNECTION_CUTOFF
|
||||
|
||||
@@ -254,7 +254,10 @@ GUEST_BAN
|
||||
|
||||
## Remove the # to allow special 'Easter-egg' events on special holidays such as seasonal holidays and stuff like 'Talk Like a Pirate Day' :3 YAARRR
|
||||
ALLOW_HOLIDAYS
|
||||
##Defines the ticklag for the world. 0.33 (30 FPS) is the normal one, though you can go as low as 0.2 (50 FPS) for low-load servers.
|
||||
|
||||
##Defines the ticklag for the world. Ticklag is the amount of time between game ticks (aka byond ticks) (in 1/10ths of a second).
|
||||
##0.33 (30 FPS) is the normal one, though you can go as low as 0.2 (50 FPS) for low-load servers.
|
||||
## This also controls the client network update rate, as well as the client fps if the preference is set to 0
|
||||
TICKLAG 0.33
|
||||
|
||||
## Uncomment this to activate the five day from character creation timelock on modifying IPC tags
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
################################
|
||||
# Example Changelog File
|
||||
#
|
||||
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||
#
|
||||
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||
# When it is, any changes listed below will disappear.
|
||||
#
|
||||
# Valid Prefixes:
|
||||
# bugfix
|
||||
# wip (For works in progress)
|
||||
# tweak
|
||||
# soundadd
|
||||
# sounddel
|
||||
# rscadd (general adding of nice things)
|
||||
# rscdel (general deleting of nice things)
|
||||
# imageadd
|
||||
# imagedel
|
||||
# maptweak
|
||||
# spellcheck (typo fixes)
|
||||
# experiment
|
||||
# balance
|
||||
# admin
|
||||
# backend
|
||||
# security
|
||||
# refactor
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: FluffyGhost
|
||||
|
||||
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||
delete-after: True
|
||||
|
||||
# Any changes you've made. See valid prefix list above.
|
||||
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||
# SCREW THIS UP AND IT WON'T WORK.
|
||||
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||
changes:
|
||||
- refactor: "Refactored the old set tick lag verb to the modern set fps one."
|
||||
- backend: "Added two functions to set the fps/ticklag, and reset the SStimer bucket to account for the rate change."
|
||||
- backend: "The world now starts at 20fps, should slightly speed up the lobby init until the configuration is loaded."
|
||||
- backend: "At lobby runlevel, the FPS from the config are loaded resetting the bucket, in theory this should make them consistent with the configured tickrate/time ratio."
|
||||
- rscadd: "Clients are now defaulted at 100fps refresh rate, disconnected from the server (world) refresh rate."
|
||||
- rscadd: "Some additional insight in the comment above the ticklag configuration."
|
||||
Reference in New Issue
Block a user