Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ca4d65a
experiment: Оптимизация сабсистем
dageavtobusnick Jan 28, 2026
50183d5
фикс
dageavtobusnick Jan 28, 2026
922d521
dir change
dageavtobusnick Jan 28, 2026
33ac74c
фикс
dageavtobusnick Jan 28, 2026
cdf5ae2
фиксы
dageavtobusnick Jan 29, 2026
93c0503
Оптимизация строк
dageavtobusnick Jan 29, 2026
5e53494
lists optimisation
dageavtobusnick Jan 30, 2026
7e77e5a
lists optimisation
dageavtobusnick Jan 30, 2026
970e23a
pow2 pow3 optimisation
dageavtobusnick Jan 30, 2026
a2d0471
фиксы
dageavtobusnick Jan 30, 2026
238d8ca
правки
dageavtobusnick Jan 30, 2026
b8c8878
фикс ошибки
dageavtobusnick Jan 30, 2026
bb5e01e
фиксы
dageavtobusnick Jan 31, 2026
a065e19
фикс
dageavtobusnick Jan 31, 2026
81f5f26
фикс и оптимизация атмосферных гранат
dageavtobusnick Feb 1, 2026
d500b1a
минимизация числа листов + фикс проблемных вербов
dageavtobusnick Feb 2, 2026
e7a2057
big harddel fix
dageavtobusnick Feb 4, 2026
fa7a869
фикс рантайма
dageavtobusnick Feb 5, 2026
87db1c4
Delete run_server.bat
dageavtobusnick Feb 5, 2026
c6d600b
фикс хардделов
dageavtobusnick Feb 5, 2026
51bc3ce
еще немного хардделов
dageavtobusnick Feb 7, 2026
a832f85
Merge branch 'master220' into optimisation_2
dageavtobusnick Feb 7, 2026
a8edfc8
фикс
dageavtobusnick Feb 7, 2026
395c7a4
фикс
dageavtobusnick Feb 7, 2026
59e4151
Merge branch 'master220' into optimisation_2
dageavtobusnick Feb 7, 2026
3416632
фикс проблем из-за хардделов
dageavtobusnick Feb 7, 2026
26ab5bb
реверт 1
dageavtobusnick Feb 8, 2026
31de418
реверт 2
dageavtobusnick Feb 8, 2026
18a0ab2
внезапно нейронка нашла небольшой косяк
dageavtobusnick Feb 8, 2026
a51595e
фикс еще одной возможной причины зависания
dageavtobusnick Feb 18, 2026
39e742d
Merge branch 'master220' into optimisation_2
dageavtobusnick Feb 18, 2026
3df0d89
фикс
dageavtobusnick Feb 18, 2026
79096d3
Merge branch 'optimisation_2' of https://github.com/dageavtobusnick/P…
dageavtobusnick Feb 18, 2026
3bb915b
Build Rust library
actions-user Feb 18, 2026
021670f
Merge branch 'master220' into optimisation_2
dageavtobusnick Feb 18, 2026
95deb7e
логирование
dageavtobusnick Feb 18, 2026
a9b6712
пробелы
dageavtobusnick Feb 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 33 additions & 8 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ The _flatIcons list is a cache for generated icon files.
var/render_icon = curicon

if(render_icon)
var/curstates = icon_states(curicon)
var/curstates = icon_states_fast(curicon)
if(!(icon_exists(curicon, curstate)))
if("" in curstates)
curstate = ""
Expand All @@ -687,9 +687,9 @@ The _flatIcons list is a cache for generated icon files.
//Determines if there's directionals.
if(render_icon && curdir != SOUTH)
if(
!length(icon_states(icon(curicon, curstate, NORTH))) \
&& !length(icon_states(icon(curicon, curstate, EAST))) \
&& !length(icon_states(icon(curicon, curstate, WEST))) \
!length(icon_states_fast(icon(curicon, curstate, NORTH))) \
&& !length(icon_states_fast(icon(curicon, curstate, EAST))) \
&& !length(icon_states_fast(icon(curicon, curstate, WEST))) \
)
base_icon_dir = SOUTH

Expand Down Expand Up @@ -829,8 +829,8 @@ The _flatIcons list is a cache for generated icon files.
/proc/rand_hex_color()
var/list/colors = list("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f")
var/color=""
for(var/i=0;i<6;i++)
color = color+pick(colors)
for(var/i in 0 to 6)
color = color + pick(colors)
return "#[color]"

//Imagine removing pixels from the main icon that are covered by pixels from the mask icon.
Expand Down Expand Up @@ -1208,9 +1208,34 @@ GLOBAL_LIST_EMPTY(bicon_cache)

if(isicon(thing))
return icon2html(thing, target)
var/datum/universal_icon/flat_icon = get_flat_uni_icon(thing)
var/file = get_icon_from_uni_icon(flat_icon, "[thing]", FALSE, FALSE)
return icon2html(file, target, sourceonly = sourceonly)

/proc/get_icon_from_uni_icon(datum/universal_icon/flat_icon, name, yield = TRUE, dmi_icon = FALSE)
var/data_out
var/job_id
var/entries_json = json_encode(list(name = flat_icon.to_list()))
if(yield)
job_id = rustlib_iconforge_generate_async("data/icons/", name, entries_json, FALSE, dmi_icon, TRUE)
UNTIL((data_out = rustlib_iconforge_check(job_id)) != RUSTLIBS_JOB_NO_RESULTS_YET)
SSasset_loading.assets_generating--
else
data_out = rustlib_iconforge_generate("data/icons/", name, entries_json, FALSE, dmi_icon, TRUE)
if(data_out == RUSTLIBS_JOB_ERROR)
CRASH("Icon [name] JOB PANIC")
else if(!findtext(data_out, "{", 1, 2))
rustlib_file_write(entries_json, "[GLOB.log_directory]/spritesheet_debug_[name].json")
CRASH("Icon [name] UNKNOWN ERROR: [data_out]")
var/data = json_decode(data_out)
var/size = data["sizes"][1]
if(!size)
CRASH("Icon [name] UNKNOWN ERROR: [data_out]")

var/png_name = "[name]_[size].png"
var/file_directory = "data/icons/[png_name]"
return file(file_directory)

var/icon/flat_icon = getFlatIcon(thing)
return icon2html(flat_icon, target, sourceonly = sourceonly)

#define CACHED_WIDTH_INDEX "width"
#define CACHED_HEIGHT_INDEX "height"
Expand Down
62 changes: 56 additions & 6 deletions code/controllers/subsystem/events.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#define EVENTS_STAGE_EVENTS 1
#define EVENTS_STAGE_CONTAINER 1

SUBSYSTEM_DEF(events)
name = "Events"
init_order = INIT_ORDER_EVENTS
Expand All @@ -6,6 +9,8 @@
offline_implications = "Random events will no longer happen. No immediate action is needed."
cpu_display = SS_CPUDISPLAY_LOW
ss_id = "events"
var/list/current_run
var/stage = EVENTS_STAGE_EVENTS
// Report events at the end of the rouund
var/report_at_round_end = 0

Expand Down Expand Up @@ -35,13 +40,58 @@
allEvents = subtypesof(/datum/event)
return SS_INIT_SUCCESS

/datum/controller/subsystem/events/fire()
for(var/datum/event/E as anything in active_events)
E.process()
/datum/controller/subsystem/events/fire(resumed)
if(!resumed)
stage = EVENTS_STAGE_EVENTS

switch(stage)
if(EVENTS_STAGE_EVENTS)
if(length(active_events))
fire_events(resumed)
else
stage = EVENTS_STAGE_CONTAINER
return

if(EVENTS_STAGE_CONTAINER)
fire_containers(resumed)

/datum/controller/subsystem/events/proc/fire_events(resumed)
if(!resumed)
current_run = active_events.Copy()

var/index = length(current_run)

while(index > 0)
var/datum/event/event = current_run[index]
if(QDELETED(event))
index--
continue
event.process()
if(MC_TICK_CHECK)
current_run.Cut(index)
return
index--

stage = EVENTS_STAGE_CONTAINER

/datum/controller/subsystem/events/proc/fire_containers(resumed)
if(!resumed)
current_run = event_containers.Copy()

var/index = length(current_run)

while(index > 0)
var/datum/event_container/event = current_run[index]
if(QDELETED(event))
index--
continue
event.process()
if(MC_TICK_CHECK)
current_run.Cut(index)
return
index--

for(var/i = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR)
var/datum/event_container/EC = event_containers[i]
EC.process()
stage = EVENTS_STAGE_EVENTS

/datum/controller/subsystem/events/proc/event_complete(datum/event/E)
if(!E.event_meta) // datum/event is used here and there for random reasons, maintaining "backwards compatibility"
Expand Down
5 changes: 3 additions & 2 deletions code/controllers/subsystem/http.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ SUBSYSTEM_DEF(http)
return "P: [length(active_async_requests)] | T: [total_requests]"

/datum/controller/subsystem/http/fire(resumed)
for(var/r in active_async_requests)
var/datum/http_request/req = r
for(var/datum/http_request/req as anything in active_async_requests)
// Check if we are complete
if(req.is_complete())
// If so, take it out the processing list
Expand Down Expand Up @@ -56,6 +55,8 @@ SUBSYSTEM_DEF(http)
log_data += "\tResponse headers: [json_encode(res.headers)]"
log_data += "END ASYNC RESPONSE (ID: [req.id])"
WRITE_LOG(GLOB.http_log, replacetext_char(log_data.Join("\n[GLOB.log_end]"), CONFIG_GET(string/tts_token_silero), "TOKEN"))
if(MC_TICK_CHECK)
return

/**
* Async request creator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
var/curstate = appearance.icon_state || defstate
// Filter out 'runtime' icons (server-generated RSC cache icons)
// Write the icon to the filesystem so it can be used by iconforge
if(!isfile(curicon) || !length(string_curicon))
if(curicon &&(!isfile(curicon) || !length(string_curicon)))
var/file_path_tmp = "tmp/uni_icon-tmp-[rand(1, 999)].dmi" // this filename is temporary.
fcopy(curicon, file_path_tmp)
var/file_hash = rustlib_hash_file(RUSTLIB_HASH_MD5, file_path_tmp)
Expand Down
9 changes: 1 addition & 8 deletions code/modules/lootpanel/search_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

// Icon generation conditions //////////////
// Condition 1: Icon is complex
if(ismob(item) || length(item.overlays) > 2)
if(length(item.overlays) > 1)
return

// Condition 2: Can't get icon path
Expand All @@ -45,13 +45,6 @@
return
#endif

// Condition 4: Using older byond version
var/build = owner.byond_build
var/version = owner.byond_version
if(build < 515 || (build == 515 && version < 1635))
icon = "n/a"
return

icon = "[item.icon]"
icon_state = item.icon_state

Expand Down
Loading