Commit Graph

57 Commits

Author SHA1 Message Date
Aranclanos
77e4cff6d2 Removes most world.log messages at roundstart, 'all minimaps have been generated' now appears in world and bold red. 2015-08-03 20:43:08 -03:00
MrStonedOne
d38cfcb4ec Removes MC's after init proc
It was only used for air, we can just move air to init last with priority = -1 (this is what this is for)
2015-07-25 23:04:49 -07:00
MrStonedOne
08b9f6c8c6 More Dynamic wait tweaks.
I forgot a step in the algo and made it so it was decreasing in its slowdown effect with more lag, not increasing.

I've also made the -1.5 magic number in the algo configurable. its was a simple buffer of cost the subsystem is allowed to use that isn't counted against it in dwait.
2015-07-10 23:25:34 -07:00
Razharas
6d0c3840ab Merge pull request #9882 from MrStonedOne/mctweaks
Tweaks MC's dynamic rate system a bit. Lowers lag from singulo getting released.
2015-06-13 04:37:00 +03:00
Aranclanos
109aa5a715 Adds AfterInitialize() to the subsystem datums, it will be called once all Initialize() calls finish. Currently only atmos uses it to set up the turfs.
Before I had the luxury to initialize atmos last, by just ordering the calls, but now that they are on a list it's not viable
2015-06-11 03:48:32 -03:00
MrStonedOne
14b258c655 Tweaks MC's dynamic rate system a bit
The MC will now track the total cost of all subsytems (normalized out to a per second cost number so that subsystems that only run every 10 minutes but are costly (looking at you server tasks) aren't accounting for 90% of the number when they shouldn't.)

This is now used in the dynamic wait subsystems to ensure they slow down when other things are being lagging

This mainly means that air won't lag things if the singulo gets free.

I also tweaked the scaling curve used by the dynamic wait system so that it scales less during slight lag, but much more during higher lag times.

I added qdel to the dynamic wait subsystem with a really high scale. This didn't make sense before, because it limits its run time, but now it can scale back how often it runs when the other subsystems are being laggy. I also lowered qdel's max runtime from 2ds to 1ds, because deletes take 0.9 ds on avg, so it would end up running for 2.9ds often.

This should prevent air+singulo+qdel causing excessive amounts of lag.
2015-06-10 05:04:56 -07:00
MrStonedOne
94a132dbde pr-9231 changelog and minor subsystem tweaks 2015-05-01 05:24:33 -07:00
MrStonedOne
bd6d51a0b5 Massive MC and subsystem rewrite
MC:
	No longer tracks a subsystem's cpu usage. This was basically worthless and took up space on the stat panel
	Can calculate wait down to a tenth of a decisecond to make it fps/world.ticklag agnostic
	Now allows subsystems to have a dynamic wait, that is based on a ratio of how long that subsystem has been taking to process(cost). (This system allows for upper and lower bounds, and an changeable cost delta for each subsystem)
	MC can now be told to init a zlevel

All Subsystems:
	Stats panel now allows child subsystems to pass it a message to add to its stats entry. All subsystems have been moved over to this system - This should cut down on subsystems having to copy and paste the stats proc in order to add to it
	All subsystems now properlly handle being given a zlevel in their init proc

Subsystem changes:
	Air:
		Added air to the dynamic wait subsystem. upper bound: 50, lower bound: 5, cost delta: 3 times process cost
		Air now fires 4 times faster when it can do so without lagging things up
		Pipenet has been merged into air
		Atmos machinery now processes with process_atmos(), ticked by air, not machinery.
		Hotspots (the fire object) are now object pooled
	Pipenet:
		Deleted, added to air
	Machinery:
		Moved all atmos calcualtions in all objects's process() to process_atmos().
	Lighting:
		Added Lighting to the dynamic wait subsystem. upper bound: 20, lower bound: 5, cost delta: 3 times process cost
	Ticker:
		Fixed ticker not updating the lobby panel when game start delayed
		Fixed the game start timer updating rapidly from queued fires when game start delay is removed
	Garbage/qdel:
		qdel will now limit its process time to 2ds a fire.
		qdel can now be given hints as a return to Destroy() as to what should be done with the object.
		the options are:
			queue: (default) this is the normal behavior.
			letmelive: old default to non-null/zero. does nothing with the object
			iwillgc: functionally the same as above, mainly to let people working with objects know that the object will not be queued for GC checking
			harddel: this will queue the object to be deleted without storing a soft reference, mainly to save locate() processing time.
			harddel_now: this will del() the object. To allow for a clean removal of every del() not in qdel
		All objects have been updated to the new system, harddel and iwillgc was not added to any new objects.
		Fixed some objects not GCing because they didn't properlly clear references in Destory()
		Fixed some objects getting qdel'ed preventing other objects from getting GCed because they did not null their reference to that object.
2015-04-29 02:00:25 -07:00
Iamgoofball
c06ad7e6b8 moved process() to datum. made /datum/reagents/ process instead of the containers. 2015-04-07 17:13:59 -07:00
phil235
29609457f5 Makes the message when you're attacked slightly bigger for better visibility."
Changes two "for... show_message()" into "visible_message()".
2015-03-12 23:15:54 +01:00
MrStonedOne
f36300d483 Fixes subsystems firing way to fast at round start. 2015-02-26 01:26:37 -08:00
carnie
a44795a699 Resolves #6993 - Moved pai controller into a subsystem. 2015-01-15 23:50:46 +00:00
carnie
a730649167 Fixes breathing (indentation error)
Fixes atmos machinery (old global list snuck back into code)
2015-01-05 19:44:17 +00:00
carnie
a029a49392 SubSystem rewrite
Misc:

+Fixes unreported issue with initializing lighting on a specific zlevel

+Fixes two similar issues with moveElement and moveRange. Where fromIndex or toIndex could be adjusted incorrectly in certain conditions. Potentially causing bad-sorts, or out of bound errors.

+Rewrites listclearnulls(list/L) to no longer iterate through L.len elements for every null in the list (plus 1). i.e. went from L.len*(number_of_nulls+1) list-element reads (best-case), to L.len list-element reads (worst-case)

+New proc/getElementByVar(list/L, varname, value) which finds the first datum in a list, with a variable named varname, which equals value. You can also feed it atoms instead of lists due to the way the in operator functions.

+Fixes an unreported issue with Yota's list2text rewrite. Under certain conditions, the first element would not be converted into a string. Causing type-mismatch runtimes.

+New global map_ready variable. This is not fully implemented yet, but will be used to avoid duplicate calls to initialize() for map objects.

+All turfs now maintain references to all lights currently illuminating them. This will mean higher memory use unfortunately, due to the huge number of turfs. However, it will speed up updateAffectingLights significantly. I've used list husbandry to reduce baseline memory usage, so it shouldn't be any worse than some past atmos modifications memory-wise.

-Removed 'quadratic lighting', can add this back at some point. Sorry.

+modified the way lum() works slightly, to allow turfs to have overridden delta-lumen. i.e. space cannot be illuminated more than its default ambiance. This allowed removal of some iffy special-snowflake lighting areas implemented by somebody else.

+Lighting images in the dmi can now use arbitrary naming schemes. It is reliant on order now. This allows the dmi to be replaced by simply dropping in a new dmi.

-Removed all subtypes of /area/shuttle. Shuttles now create duplicate 'rooms' of /area/shuttle. (More on this later). This will conflict with most maps. Guide on how to fix to follow.

+All verbs/tools relating to world.tick_lag were refactored to use world.fps. However old config text for setting tick_lag will still work (it converts the value to fps for you)

+MC stats improved using smoothing. They now have their own tab so they dont get in the way when you're playing as an admin.

-removed the push_mob_back stuff due to conflicting changes. Sorry Giacom.

_OK, NOW THE ACTUAL INTERESTING STUFF_

Following systems moved over to subsystem datums:
air_master
garbage_manager
lighting_controller
process_mobs (aka Life())
nanomanager
power
sun
pipenets
AFK kick loops
shuttle_controller (aka emergency shuttle/pods), supply_shuttle and other shuttles
voting
bots
radio
diseases
events
jobs
objects
ticker

Subsystems hooks and variables should be commented fairly in-depth. If anything isn't particularly clear, please make an issue.

Many system-specific global variables have been refactored into

All tickers which previously used world.timeofday now use world.time

some subsystems can iterate before round start. this resolves the issue with votes not working pregame
2014-12-31 13:25:41 +00:00
Cheridan
24456bcc22 Merge branch 'PipenetRevamp' of https://github.com/Aranclanos/-tg-station into Aranclanos-PipenetRevamp
Conflicts:
	_maps/map_files/tgstation.2.1.3.dmm
	code/ATMOSPHERICS/atmospherics.dm
	code/ATMOSPHERICS/components/portables_connector.dm
2014-11-13 18:55:53 -06:00
GunHog
7f41894319 Gives bots their own place in the MC!
- Adds bots to the Master Controller as their own datum instead of
machines.
- Puts bots into their own global list.
- Processes bots asynchronously so as to not hold up the MC processing
them.
2014-11-03 12:39:07 -06:00
Aranclanos
8aa5a137c5 Pipenet revamp
-Removed the pipenet network datum, now it will all be done with the pipeline datum
-All atmos pipes and machines will always have a pipeline datum
-Moved the valves to the binary subtype and the portable connectors to the unary subtype
-The pipe vents (who were barely used in three spots of the map) are removed, the map slots will replaced with outlets
-Fixes some bugs of pipenet disconnection, mostly on explosions
-Cleaned a bit the copypaste of construction.dm of pipes
-Removed the ID restrictions of digital valves and the frequency (both unused)
2014-11-03 08:21:31 -03:00
Menshin
b76b3fa298 * The Space Cube is now generated at world start, before away missions are loaded
This means away missions don't have space transitions
* The setup_map_transition proc is protected from excessive tiles proceeding (the proc is set to the background if too much tiles are processed)
* Added a comment explaining the Space Cube, by Incoming
* Fixes #4903 : "mobs don't maintain momentum on z-level transition"
* Serendipitiously fixes #2614
2014-10-04 21:16:23 +02:00
Remie Richards
cd53199398 Merge pull request #5004 from Menshin/malf_timer_fixes
Malf timer polishing/fixes
2014-10-03 21:41:15 +01:00
Cheridan
c2f6469a04 Merge pull request #4953 from Aranclanos/mastercontroller
Stops the master controller New() from reloading away missions.
2014-10-02 14:36:50 -05:00
Menshin
ed807f8538 * Polished the malf timer logic
* added a protection to prevent division by 0 when all hacked apcs are destroyed
* added a midnight rollover check for the MC (fixes #4905)
* toggling breakers won't add/remove a hacked APC from the AI apcs pool anymore
2014-09-28 12:16:21 +02:00
Incoming
f317c0b09d Predictably Random Z-levels and the SPACECUBE
The layout of the accessible z levels in relation to each other are now lain out in a massive preshuffled SPACECUBE. Every Z-level is no more than two screens from every other Z-level, and can be moved through in a predictable order* with a little ingenuity

*Except z.6

See pull for the full details
2014-09-23 16:10:13 -04:00
Aranclanos
b453189945 Moves the asteroid secret room creation and away mission load from the master controller New() to the world New() 2014-09-23 05:42:55 -03:00
Aranclanos
51f46bcb31 Better loops for all the process tickers of the master controller. 2014-09-08 17:49:17 -03:00
Firecage
6c7af5eb32 SPANCLASSES!!!!! 2014-08-26 09:52:13 +02:00
Firecage
b1feb2c215 Absolute paths for the files in the Controllers folder 2014-08-16 12:57:38 +02:00
Aranclanos
ca67aeb3aa Added more stuff to the status panel for admins, air related, these are only temporal (hehehe) 2014-04-17 21:37:06 -03:00
MrPerson
edc7cfd63a Make GC'd objects super invisible to help unreference them more.
qdel() and clear contents of things when they themselves are qdel()
Forgot to add the gc_cost to the total cost of the MC.
2014-02-23 18:07:33 -08:00
MrPerson
9eee3e5067 First pass at a qdel() garbage collection system for tgstation
Works pretty well. If it can't GC something, it'll just del() it and be done.
Speed is amazing, holy shit.

New procs you should be aware of:
qdel(atom/movable) - sets up an object for garbage collection. Call this rather than del(atom/movable).
atom/movable/Destroy() - called right before the object is GC'd, so it still has a loc. Also called if the object is del()'d.
new controller - garbage.dm has all the details on this. Basically it nulls all references on GC'd objects and force del() them if necessary.
Generally speaking, objects should use Destroy() for behavior prior to deletion rather than Del(). You should also always call the parent so the object gets the right gc_destroyed var set.

ISSUES:
Tries to GC mobs atm. This actually works for new players, not so much for humans/monkies/simple_animals/anything. I'm guessing it needs to clear out their mind and HUD and maybe other things.
Gibbing is really bugged. It works, but the overlays just sit there for awhile and ugh. I'm very tempted just to del() mob/living and mob/camera and call it a day.
qdel() equipment doesn't unequip the item.
Pipes don't generally GC correctly. Debugging suggests they get referenced in many pipenets and that isn't cleared properly. However some do work fine. Need assistance here.
Bots don't GC, probably in the radio controller.
Lots of other shit doesn't GC but it's hard to find them because of the pipe spam.
I think I'm calling Destroy() twice by accident.
2014-02-23 14:55:12 -08:00
Giacomand
f1e7637bab Disabled the game using set background by making all instances of it use a define, which can be changed in code/_compile_options.dm
Testing has revealed that it reduces the sluggishness of the game, though it will spike from lag when the singularity is loose. Thanks to ChuckTheSheep for suggesting it.

Server owners who want to keep set background enabled can do so by changing the define.
2014-01-10 18:32:28 +00:00
Cheridan
d9fbcbab74 Merge pull request #1647 from Giacom/small_tweaks
Fixed the network vars on the map, for the telecommunication computers. [MAP]
2013-10-28 10:41:18 -07:00
Giacomand
a756a04eba Fixed the network vars on the map, for the telecommunication computers.
Just small tweaks to basic stuff I found.
2013-10-25 10:46:10 +01:00
Aranclanos
bbd1cfd389 -the number of active turfs on the status tab will be refreshed and the end of each tick and when the air controller setup finishes.
-mining rooms will be generated before the air controller is created
-changed the total of moles of the NO2 turfs from 2000 to 6000 to compensate the replacement of the canister that spawns like 36000 moles on top of it for a normal canister. I'm talking about the NO2 canister inside of the chamber in atmos. (I will replace the canister in another pull request)
2013-10-21 20:09:57 -03:00
Cheridan
90c4eeaf1a Merge pull request #1443 from Giacomand/nobreathe
Removed an unnecessary sleep() in the MC.
2013-09-25 22:41:07 -07:00
Giacomand
8c38101129 You don't need a breather for this. 2013-09-23 18:43:26 +01:00
Pete Goodfellow
578215e3a7 Merge pull request #1335 from KazeEspada/supplypacks
Fixes issue #137
2013-09-18 07:00:10 -07:00
KazeEspada
2a1278ca88 Makes Supply Pack datums no longer garbage collect. Prevents them from making artifacts like mulebot #3. Fixes issue #137.
Moves the supply shuttle controller to the controller folder and adds its creation to the new proc of the master controller.
Also, makes the supply shuttle make supply packs on new instead process.
2013-09-10 11:00:43 -07:00
Mark Aherne (Faerdan)
57fa79a89d Nano UI Framework
------------------------------------------------------------
nanoui - For creating and updating browser UIs
manomanager - For managing nanouis
Includes the "D:\Development\SS13-TG\code\game\machinery\cryo.dm" rebuilt using Nano.
Templates are stored in /nano/templates

This code is in development, it's also not commented yet.
2013-08-19 21:23:53 +01:00
carnie
e6c8e67c3f Minor modifications to Yvar's A* fixes:
-Removed the priorityqueue datum. It is now a list()
-priorityqueue/proc/insert is now a helper /proc/sorted_insert() as it may be helpful in maintaining pre-sorted lists or insertion sorts.
-Replaced priorityqueue/proc/extract_last() calls with calls to pop(), which already existed.
-Removed last few references to "bestF" (from old awful A) in lighting and MC
-Replaced a section were it'd append to the end of the returned path list and then reverse the list. Now it inserts at the start of the list.
2013-05-19 09:54:39 +01:00
carnie
6a98fc89d0 >datum/event and datum/event_control were renamed to datum/round_event and datum/round_event_control. This is because datum/event was already used by a different/more-general event queue system (used primarily on mechas)
Removed overriding of event values via feeding in an associative list into datum/round_event/New(). Instead you can do basic initializations (i.e. feed it constants) by doing new /datum/round_event{variablename=5;}(). This method is handled well by the compiler (it's the same method the maps use), so it will detect unrecognized variablenames etc.
More complex initializations for post setup() stuff can be done by accessing variables directly Event.variablename = whatever;
round_events now have a processing variable, which effectively pauses them.
2013-04-08 07:42:46 +01:00
Pete Goodfellow
9e50852028 Fixes a typo in the dirty floor MC setup. \ref -> \red. 2013-03-24 16:00:36 +00:00
SuperSayu
680d607e23 Relocated dirtystation.dm to the proper location and re-adds the dirt-making code to the master controller setup() 2013-03-21 19:59:54 -04:00
giacomand@gmail.com
4989c88a22 Committing carn's modifications to events and other things. Full details below.
http://forums.nanotrasen.com/viewtopic.php?f=16&t=12245#p189186

Ported all the random events to Pete/Gia's event system:
>Event system now supports weighting. default is 10. a weight of 5 is half as likely as default, 20 twice as likely....etc.
>Increased the frequency of events (dust happens over 60% of the time though)
>tidied up some ninja code: ninjas now get ~5 objectives. So they are hardmode.
>made the gravity toggle into a random event
>event system now supports round-start events
>event system now supports holiday events
>event system now supports events which can only happen after the round has lasted a certain number of ticks
>event system now supports max_occurrences for events. Setting any event's max_occurrences to 0 will stop it randomly occurring
>events now support being fed associative lists inside new(). This allows you to override their variables easily.
>wormhole events no longer cause loads of lag. They are extremely deadly. wormholes should be avoided

Other:
>replaced the procs for fetching candidates for ninjas and aliums with /proc/get_candidates(be_special_flag), it returns a list of active clients with that be_special preference enabled.
>minor fixes to minds
>your memories are displayed to you at Login()
>removed aliens_allowed
>removed ninjas_allowed
>pick_n_take() is now more efficient (uses Cut() rather than Remove()


Things I added:

 - Made the pandemic call ..() instead of doing the checks itself.
 - Made the staff of animation use more charge.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5720 316c924e-a436-60f5-8080-3fe189b3f50e
2013-02-17 11:44:37 +00:00
baloh.matevz@gmail.com
ea2c5059b8 - Undid my edits to the master controller regarding fast atmos.. I've tested it on the live server in several rounds and think we could spare to call atmos processing twice as often, meaning air movement would spread twice as fast. Calling it 4x as often was too much tho, resulting in noticeable lag, especially when the station was destroyed.
- Time to tidy up my old projects: Moved a few of my old, unfinished projects to unused: liquid simulation, brewing, heavy cables and logic gates/cables.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5621 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-28 02:32:04 +00:00
baloh.matevz@gmail.com
31dfb6ca9e - Replaced MAX_EXPLOSION_RANGE with MAX_EX_DEVASTATION_RANGE _HEAVY_ _LIGHT_ and _FLASH_.
- Moved explosion capping to explosion code, overridable by setting a proc parameter, which defaults to off, obviously.
- Reduced r-walls' explosion resistance from 25 to 15. They can now be destroyed by strong bombs.
- Added liquid processing to the sun part of the MC
- Added additional calls to atmos processing to the MC. You can enable this by (manually, with the debug controller verb) enabling the fast_atmos_1 .. 3 variables in the configuration datum. The intent of this is to enable it in a few rounds to see if it is possible to make atmos calls more common.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5607 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-24 17:38:20 +00:00
entrian.tration@gmail.com
32c65d614d Now you can properly profile all the components of the master controller. Preliminary tests show machines in aggregate are more processor intensive than atmospherics.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5570 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-18 01:19:03 +00:00
baloh.matevz@gmail.com
5bb06b184c - Added a killswitch to the master controller for air processing and pipe processing, accessible through two toggle-verbs in debug verbs.
- Added a verb that breaks all airgroups into individually processing tiles and a verb that forces a group-rejoin attempt on all airgroups. Once the verb to break all air groups is used, they will not attempt to recreate until the recreate verb is used. In other words, this is for debugging, not goofing around. Verbs available in debug verbs.
- Some atmos code standardization
- Decreased the pressure resistance of most items by a factor of 10, meaning pressure will finally actually move items around!

I also attempted to speed up air movement, but it caused runtimes and everything moved in checkered patterns and I got scared so I didn't include it in this commit.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5554 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-15 07:12:32 +00:00
petethegoat@gmail.com
f27399bcd5 Added a new events system!
The old one still exists, mainly so the associated admin buttons still work.
At some point I'll add a nice little panel for event stuff and remove the old procs.

event.dm is pretty well commented, and it should be pretty easy to figure it out.

Casualties of the change are space dust (which should probably be implemented separately if we want it back), the black hole event (which was awful), space ninjas (which didn't turn up), ionstorms (the non-admin ones sucked anyway) and CLANG, which I will probably add at some point, if no one else does first.
Also, I removed pierott's throat from the disease outbreak list. f that s.

Thanks to Sukasa and BS12, as my system is loosely based off of theirs.
Thanks Giacom for help with structuring and especially commenting this.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5511 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-10 23:45:57 +00:00
giacomand@gmail.com
9941bb8587 Added mimics! There's the classic crate (chest) mimic which waits until somebody is close before trying to attack them. You can fill him with loot by putting items on him on your map. This was done by changing the base initialize proc to an /atom/movable and then instead of looping through the world for objects, instead loop for atom movables.
The next type of mimic is for the staff of animation! They will copy the icon of the object they're copying and will set themselves stats based on the object too. They will not attack the bearer of the staff which made them animated.

Added the option to get the staff on the wizard's spell book.

Added a "friends" var to hostile mobs. It will make the simple animal ignore friends when choosing targets.

Changed the statues from /obj/effect/showcase to /obj/structure/showcase.

Added a new variable to projectiles, "shot_from" is the gun that shot the projectile. It's used to determine what staff animated the mob and it will then add that staff, so it can ignore it when choosing targets.

Added a wander var for simple animals, turning it to 0 will stop the simple animal from moving when idle.



git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5246 316c924e-a436-60f5-8080-3fe189b3f50e
2012-12-02 04:38:43 +00:00
giacomand@gmail.com
7926b373af -Re-ordered some stuff around. I couldn't replicate any bugs with the preferences but I can't be sure that it's 100% full proof.
I did find that your be special preferences, i.e: be alien, be traitor, be changeling and etc, are shared between preferences. I'll ask if this is intentional or not.

-Some minor stuff.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5175 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-24 10:50:59 +00:00