Commit Graph

75 Commits

Author SHA1 Message Date
Bjorn Neergaard
29fdf73cc6 tgui power monitor; linegraph component 2016-02-05 17:06:04 -06:00
Bjorn Neergaard
c5e6a922ca Cache canister updates and make huge scrubbers use power; add movable version 2016-02-05 17:06:03 -06:00
Firecage
754491ce4c Changes relatives paths into absolute paths and makes some if()'s better 2016-01-17 01:36:56 +02:00
bear1ake
f697ae90f5 removes a bunch of .0 2015-09-10 20:57:30 +09:00
duncathan
51c09f16bf makes all Destroy()'s return properly 2015-08-31 00:21:01 -06:00
Firecage
4688c2c969 Fixes proc arguments 2015-07-15 23:52:35 +02:00
Remie Richards
d9ec8a1008 area/proc/get_apc() is no longer shit and does not lag (AT ALL) on large areas anymore, the new method stores a list of all APCs in the world, and checks if their area var is equal to the area get_apc() was called on. 2015-06-30 12:20:28 +01: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
phil235
e16a817b55 Adjusts electrocution damage from cells and powernets. Less RNG and never goes above 95 to avoid instacrit.
Fixes item attacks targeting a random limb instead of the one selected.
2015-04-26 23:48:20 +02:00
xxalpha
13e291a4e9 Merge remote-tracking branch 'upstream/master' into catwalkmachines
Conflicts:
	code/game/turfs/turf.dm
	code/modules/power/power.dm
2015-03-06 19:19:09 +00:00
xxalpha
15dacd50b1 Replaces cancable var with two new procs.
Clean up.
2015-02-21 20:15:03 +00:00
Remie Richards
5fc7af7fbf attackby() now has an argument containing the parameters of the click that called it. Items placed on tables now center their icon where the user clicked. this is NOT true for racks, since racks look organised in their sprite.
Items reset their pixel_x and pixel_y values on pickup.
2015-02-19 13:02:43 +00:00
xxalpha
ec4bc5665c Allows portable machines to be mounted on any turf that cancable. 2015-02-17 02:27:41 +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
paprka
3ca6d769a1 adds catwalks 2014-12-26 17:38:55 -08:00
paprka
404da4dbdd code optimizations 2014-12-25 13:28:05 -08:00
Aranclanos
55dd64fdc2 Adds static power value on areas. These variables should replace machines on the process list, that are only there to consume power.
This commit removes lights from the process list, about 500 of them on the current map.
The purpose of this is to reduce lag from the master controller ticker.
2014-08-06 06:57:52 -03:00
Menshin
e65919da42 Removed the now unused directwired variable 2014-07-02 23:58:12 +02:00
Menshin
c6c8c58ef7 Machines de/connecting from/to a powernet will now always call the connect_to_network/disconnect_from_network procs instead of de/connecting directly. 2014-07-01 18:54:41 +02:00
Menshin
788a97471f Fixes _make_pownernets_ proc not adding the first cable found to its cable list.
Fixes #4011.
2014-06-25 15:49:50 +02:00
Menshin
6749f21042 Tweaked the power distribution handling :
* the power is correctly handled each tick instead of 1 tick on 2, because of bad reinitalization,
* apcs now draw power as others machines and fixed the amount of power send to them

Partially fixes #3761.
2014-05-25 00:54:41 +02:00
Menshin
2269a2f168 Alternative version of the powernets refactoring (cables connects if they have matching ends) 2014-05-11 00:04:49 +02:00
Menshin
d42c7114c1 * cleaned, organized and commented a large part of the power code,
* new procs handling : powernets creation/destruction, cable adding/removing, machines adding/removing,
* new cable laying possibility : if you click in the turf you're standing on, you'll try to lay a node cable in the direction you're facing,
* cleaned oversights that could (and would) leaved an empty powernet in the powernets global list
* rewrote the cut_cable and propagate_network procs to correctly updates every connected cables and machines (fix, at last, #1455)
* others fixes and polish...
2014-05-04 00:19:55 +02:00
Miauw
7fccaac902 WTF BYOND???? 2014-03-22 17:55:36 +01:00
Miauw
a80dd4df0f Merge branch 'master' of https://github.com/tgstation/-tg-station into warnstandardization
Conflicts:
	code/game/objects/items/weapons/AI_modules.dm
2014-03-22 17:42:07 +01:00
Miauw
d41e02c5b5 Finishes up warning and error standardization. 2014-03-22 17:20:43 +01:00
MrPerson
6930283efc Merge branch 'master' of https://github.com/tgstation/-tg-station into qdel_r
Conflicts:
	code/game/gamemodes/changeling/changeling_mutations.dm
	code/game/gamemodes/changeling/changeling_powers.dm
	code/game/gamemodes/malfunction/Malf_Modules.dm
	code/game/objects/items/weapons/tanks/watertank.dm
	code/game/objects/structures/tables_racks.dm
	code/modules/research/server.dm
2014-03-21 03:05:39 -07:00
Cheridan
4e5d757726 Merge pull request #3064 from Rockdtben/removeTLEComments
Removing TLE comment stamps and other useless comments
2014-03-14 15:40:27 -05:00
Rockdtben
a034e41f25 Removing TLE comment stamps and useless comments 2014-03-13 08:25:28 -05:00
Rockdtben
6eeeb1e5fe Removed some useless comments from years ago. 2014-03-12 07:59:34 -05:00
MrPerson
6b29fecda1 Merge branch 'master' of https://github.com/tgstation/-tg-station into qdel_r
Conflicts:
	code/game/machinery/bots/ed209bot.dm
	code/game/machinery/rechargestation.dm
	code/game/machinery/turrets.dm
	code/game/objects/structures/crates_lockers/closets.dm
	code/modules/research/circuitprinter.dm
2014-03-08 22:03:03 -08:00
MrPerson
20027aa442 Fix a use_power() runtime if the object was in nullspace (was qdel()'d)
Also remove some debug shit in atmospherics I left around.
2014-03-03 01:16:21 -08:00
Razharas
b27d9c7396 Added RPED, some sprites and new power cell path
Your dreams of big part storage and fast machine part exchange came true
14 slot R&D part-only autoseeker/picker/dropper/exchager is in
Added different sprites for better capacitors and scanning modules
Changed the power cell type to be compatible with all this machine
changing faggotry
All sprites here are codersprites so ask nien/WJ for better ones if you
want
2014-02-24 05:14:43 +04: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
Laurence Reading
4cb9f66164 making propagate_network non recursive 2013-11-08 00:09:30 +00:00
Laurence Reading
ce24949ace creating a get_marked_connections method for machines that doesnt check for powernet==null 2013-11-08 00:09:19 +00:00
Laurence Reading
589c1e6cfb Update for power code to remove some bugs and fix some functionality
Functionality
========
*Cables can now be placed across each other and not connect, just like cables placed in the map editor.
*Alternately by leaving a "node" or "dot" in both cables you can have these cables connect

Bugs Fixed
=======
*Unconnected cable networks which share the same powernet and power are no longer created when adding cable to nodes or removing nodes on top of smooth cable

Code changes:
==========
*Adds denode proc that should be called when a wire is added to causing it to no longer be a "node" (i.e. terminates in the centre of the turf)
*Adds propagate_network proc that traverses the graph adding every cable to a new network while removing the old one
*Adds call to denode in the cable_join proc
*Fixes mergeConnectedNetworksOnTurf() to only connect cables that are both nodes
*Adds a get_marked_connections() proc to cable which finds all edges connected to it's endpoints regardless of whether they have a powernet(as opposed to get_connections())
2013-11-06 20:17:56 +00:00
Uristqwerty
bf4b58cc7d Fixed infinite loop in powernet rebuild.
If a machine was not anchored, it would spin forever, doing nothing.
Fixed on baystation a while ago.
2013-03-25 16:28:04 -04:00
giacomand@gmail.com
542eff3a28 - Fixes a powernet runtime which could cause problems.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5662 316c924e-a436-60f5-8080-3fe189b3f50e
2013-02-07 21:30:09 +00:00
giacomand@gmail.com
e70ddc5356 Committing SuperSayu and Kaze Espada's patch.
http://forums.nanotrasen.com/viewtopic.php?f=16&t=11958

Atmospherics:
 * Atmo computer UI auto updates again (simple interact() fix)
 * Injectors should show up on atmo computers without hitting refresh
 * Fixes Issue 1258

Powernets:
 * Rebuild powernets no longer breaks the system.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5652 316c924e-a436-60f5-8080-3fe189b3f50e
2013-02-04 20:24:55 +00:00
giacomand@gmail.com
13b25d24cf -Breathing plasma will now give you the plasma reagent for toxic damage which will need treatment, in order to remove it from your body quickly. This creates a nice poison effect.
-Made the plasma reagent damage you more.
-Syndicate agent cards will now work inside pdas/wallets.
-Switched some comments around in event.dm
-There was a bug with a local variable list which became null, the problem was that there is no where in the code which could've nulled it. My only theory is that not having . = list() first maybe caused problems, but it seems unlikely. I changed it anyway and I'll keep watch for it re-appearing.
-Fixed a bug with the new firedoors not keeping out heat, since they have an opacity of 0. I switched everything around to accommodate this.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5516 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-11 13:53:48 +00:00
giacomand@gmail.com
e4478711e4 -Added a logging message for a node having a null powernet.
-Misc stuff.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5475 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-06 00:08:51 +00:00
giacomand@gmail.com
31e8a5ebae Portable generators will not remake powernets everytime a wrench is used on it.
Got rid of the reliability factors for generating power or critically failing.
Increased the time factor for each sheet for all generators.
Added some feedback stuff such as saying which fuel the generator takes and how much power is in the current powernet, that it is connected to.

Powernet making will not wire up "power" machines that are not anchored.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5458 316c924e-a436-60f5-8080-3fe189b3f50e
2013-01-03 15:23:43 +00:00
johnsonmt88@gmail.com
0549de1b93 Removed some world messages when disconnecting powernets.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5428 316c924e-a436-60f5-8080-3fe189b3f50e
2012-12-31 02:57:05 +00:00
giacomand@gmail.com
a04eb3f275 -Changed emitters.
Emitters will now need to be wired.
Emitter type has changed to /obj/machinery/power/emitter
Fixed cables not correctly disconnecting power machinery from the powernet after being removed.

-Fixed a typo with smashing tables/racks.
-Fixed maps having incorrect types.
-Fixed singularity EMPing when at stage 1.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5423 316c924e-a436-60f5-8080-3fe189b3f50e
2012-12-30 10:47:25 +00:00
giacomand@gmail.com
7af60a7fb5 -Changed the powernet nodes list to be a dictionary list (associative list, hashtable, etc..)
-Added a solars_list. The sun will use this list instead of the machines list. I made a proc which decided on whether to use this list or the powernet nodes list depending on what is smallest. I replaced some loops to use this proc.
-The sun will reference this list for debugging purposes. The sun will also remove solar equipment in the list which are not connected to a powernet.
-Cut down on some duplicated code.
-Fixed an issue with solar panels not updating their direction correctly.
-Changed the proc updateicon()'s name to update_icon()

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5418 316c924e-a436-60f5-8080-3fe189b3f50e
2012-12-29 07:24:42 +00:00
giacomand@gmail.com
eca72b69aa -Added constructable solar arrays.
-Added a solar pack crate to order.
-Machines that have a use_power of 0 will no longer be turned off due to lack of power in the area.
-Fixed a bug with the solar computer not reconnecting to the powernet when dismantled and remantled.
-Increased the cap of crates to 30.
-Some performance tweaks.
-Some standardization.
-All objects of type /obj/machinery/power will try to disconnect from the powernet before deleting, this will help reduce the node list size.
-Added a heat_proof variable for doors. It will effect glass airlocks and it'll determine whether they can block heat or not. Research glass airlocks will always have it enabled.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5344 316c924e-a436-60f5-8080-3fe189b3f50e
2012-12-16 19:51:23 +00:00
giacomand@gmail.com
a6b214cc06 -Monkeys will now start dying when in crit.
-Fire heals Metroids now!
-Improved corrosive acid.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4952 316c924e-a436-60f5-8080-3fe189b3f50e
2012-10-24 20:24:48 +00:00
giacomand@gmail.com
92d0367c17 -Potentially fixed Metroids not going after food. They kept targeting unconscious food.
-Removed metroid core flushing. There doesn't seem to be a point of it.
-Badly made metroids unelectrutable. I'll change this later.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4947 316c924e-a436-60f5-8080-3fe189b3f50e
2012-10-24 02:23:17 +00:00
giacomand@gmail.com
1c9b1a48fe -The use_power() proc, for machines, will now default to using it's assigned "power_channel", when the proc is used.
-Slightly increased the power usage of the chemistry dispenser. From 2000 to 3000.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4791 316c924e-a436-60f5-8080-3fe189b3f50e
2012-10-01 17:29:35 +00:00