Commit Graph

16 Commits

Author SHA1 Message Date
Firecage
b1feb2c215 Absolute paths for the files in the Controllers folder 2014-08-16 12:57:38 +02: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
8c172733a8 Standardizes and expands the warning() and error() procs. 2014-03-09 18:08:19 +01: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
YotaXP
6db2c59772 Reduced the potency of carrying multiple light sources. 2014-02-05 16:54:46 -05:00
supersayu
58b2e7f2a0 Minor lighting optimization
Reduces redundant looping in lighting checks
2013-10-25 16:01:29 -04:00
supersayu
4883c14257 More modular version of starlight (space lighting) 2013-10-25 00:24:03 -04:00
supersayu
f8575c4767 Evens out space lighting and prevents space fire/party alarms
Adds a dedicated lighting subarea for space turfs, and forces all space turfs to use it.  This evens out irregularities in lighting space turfs ("this empty space is slightly brighter than that empty space") and removes fire and party alarms from space tiles.

For now I have also made space lighting subareas unpowered.  I guess this operates on the theory that the tiles mysteriously teleport power between themselves (along with flashing red lights and party strobes) but it does not work on empty space.
2013-10-21 17:34:41 -04:00
Giacomand
1dacc17070 Blueprint areas will now have dynamic lighting. 2013-07-03 21:08:50 +01:00
giacomand@gmail.com
ba64e33122 Committing DAL_TG lighting tweaks for carn.
http://forums.nanotrasen.com/viewtopic.php?f=16&t=12096

> UpdateAffectingLights() is a bit less silly. It now uses oview() to find lights which could be shining on it. It only searches a maximum of LIGHTING_MAX_LUMINOSITY_STATIC-1 away from itself, as this is all it needs to do (reducing the number of atoms it searches/lights it updates).
> UpdateAffectingLights() is called more sensibly, generally it will only be called when opacity actually changes on a lit turf (or something in a lit turf), as opposed to before where it would be called simply if something was opaque.
> Fixes a typo in cheap_hypotenuse(), it will now work correctly.
> Added circular lighting (using cheap_hypotenuse, a cheap linear approximation of pythagoras theorem). Old square lighting is toggable by commenting out #define LIGHTING_CIRCULAR
> Wall-fixed lighting will break when Move()ed. This means their lighting will not be updating whilst the singulo is on a rampage (which would cause lots of lighting updates). This should help reduce lighting updates a fair bit in such circumstances. Also the lord of darkness actually creates darkness! omg
>Halved the theoretical number of calls to UpdateAffectingLights() by turfs being deleted/created (aka replaced), by moving relevant code from New/Del into ChangeTurf(). Tidied ChangeTurf up a little.
>SpaceVines now update opacity correctly (this somewhat worries me though)
>Reduced the range of dynamic lighting effects for most objects. Fixed the bug where mob luminosity could try to go negative when dropping many held active flashlights.
>Space area no longer uses dynamic lighting. (at request)
>Fewer shades of darkness (reduced from 7 to 6) - means fewer shift_to_subarea calls and makes lower luminosity lights appear brighter
>Turfs can be luminous, removed the warnings. capped luminosity effects of turfs to a radius of 1.
>PDAS ARE NO LONGER SUNS!
>ChangeTurf() no longer replaces turfs with turfs of the same type. This means that singulos will no longer replace space with space with space over and over and over every tick
>there is a cpu-usage cap thingy on the lighting process(). It's currently set to (a ridiculously high) 98. This simply stops the process attempting to do any more work when the server is already dying. If you're feeling brave you could probably reduce further.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5650 316c924e-a436-60f5-8080-3fe189b3f50e
2013-02-04 19:58:14 +00:00
giacomand@gmail.com
45d98a271e -Fixes Issue 1142. Thanks to carn for the solution to the issue. The tags were being cut off and there were multiple areas of the same tag, so when locating with the tag it gave out unpredictable results.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5254 316c924e-a436-60f5-8080-3fe189b3f50e
2012-12-04 11:10:43 +00:00
elly1989@rocketmail.com
1d6d5d28ad Resolves Issue 1083 - Dynamic lighting will no longer revert custom areas back to their previous state.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5202 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-26 13:46:21 +00:00
elly1989@rocketmail.com
734135389c Proper fix for the area-luminosity bug. It seems the issue was a > instead of a >=. Meaning that most pitch-black areas were not having luminosity set to 0.
This fixes space being dark.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4747 316c924e-a436-60f5-8080-3fe189b3f50e
2012-09-24 06:40:10 +00:00
elly1989@rocketmail.com
9265255ab5 Fixes an issue where areas were set with luminosity = 1. Not sure why the hell I done that and why the hell I never noticed it. Thanks Kor.
Once again, Only crates may be sold on the supply shuttle.
Changed adminverb updates to be called by Login if holder.state changes. This is so we don't have to mess around with it elsewhere and we don't have to call it as often.
Added some missing verbs to the clearadminverbs proc
Fixed a icon reference not using the fullpath (Goddamn stop doing that)
Going catatonic makes you fall down
All mobs with the resting variable can now unrest (god damn what were you doing).
"Lay down / Get up" was renamed to "Rest".
Rest now uses src rather than usr (again, wtf)
Added some ugly fatty fat hacky code to make admin-ghosted mobs appear braindead rather than catatonic
Admin-ghosting (set-observe and set-play) merged into one verb named "Aghost" (short for admin ghost, same convention as asay)



git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4708 316c924e-a436-60f5-8080-3fe189b3f50e
2012-09-17 02:27:12 +00:00
elly1989@rocketmail.com
e97813d2b6 Replaced the master_controller with the WIP sequential version.
Fixed a problem where TG was using this sequential master_controller but I had removed a spawn where master_controller.process() was called because I was working with the default master_controller. This problem was causing the master_controller to prevent the lighting_controller.process() ever running properly because it was hogging the current thread (thread isn't the right word there, not sure what you call it....stack?)

Added debugging to both the lighting_controller and master_controller. http://filesmelt.com/dl/debugging.png

Both lighting_controller and master_controller may be deleted to terminate their processes (this is done via the restart controller verb. This allows for clean restarts without 'doubling up' (where, for instance, the master_controller would be running more than one instance).

lighting_controller has a prototype recovery proc which is called by the "restart controller - lighting" verb. It's basically an overly paranoid version of process() which will only transfer light_sources to the replacement controller if they don't runtime. It's not needed at the moment as the process() has yet to runtime.

master_controller has the beginnings of self pruning lists. This method using list.Cut(index,index+1) is faster than doing list.Remove(thing) all over the place (the latter iterates through the list to find the thing).

Added more detailed time-measurements for the master_controller. It now displays the processing costs (in real-world seconds) of each part of the master_controller's cycle.

The stat panel only updates for mobs actually -looking- at the stat panel.

Explosion debugging is now hidden behind a if(Debug2). To have it print that data to world.log just click the DebugGame verb

debug controller and restart controller verbs are now both GameAdmin rank. Not sure how they got split up.

Fixed another cause of dark splotchy space turfs. (turf/wall/ex_act was replacing the turf with space and then deleting that new space turf)


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4593 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-31 04:14:26 +00:00
elly1989@rocketmail.com
6e274cd395 New lighting, it's essentially just the old DAL system with a queue.
Comments for lighting:
	Like sd_DAL (what we used to use), it changes the shading overlays of areas by splitting each type of area into sub-areas
	by using the var/tag variable and moving turfs into the contents list of the correct sub-area.

	Unlike sd_DAL however it uses a queueing system. Everytime we  call a change to opacity or luminosity
	(through SetOpacity() or SetLuminosity()) we are  simply updating variables and scheduling certain lights/turfs for an
	update. Actual updates are handled periodically by the lighting_controller. This carries additional overheads, however it
	means that each thing is changed only once per lighting_controller.processing_interval ticks. Allowing for greater control
	over how much priority we'd like lighting updates to have. It also makes it possible for us to simply delay updates by
	setting lighting_controller.processing = 0 at say, the start of a large explosion, waiting for it to finish, and then
	turning it back on with lighting_controller.processing = 1.

	Unlike our old system there is a hardcoded maximum luminosity. This is to discourage coders using large luminosity values
	for dynamic lighting, as the cost of lighting grows rapidly at large luminosity levels (especially when changing opacity
	at runtime)

	Also, in order for the queueing system to work, each light remembers the effect it casts on each turf. This is going to
	have larger memory requirements than our previous system but hopefully it's worth the hassle for the greater control we
	gain. Besides, there are far far worse uses of needless lists in the game, it'd be worth pruning some of them to offset
	costs.

	Known Issues/TODO:
		admin-spawned turfs will have broken lumcounts. Not willing to fix it at this moment
		mob luminosity will be lower than expected when one of multiple light sources is dropped after exceeding the maximum luminosity
		Shuttles still do not have support for dynamic lighting (I hope to fix this at some point)
		No directional lighting support. Fairly easy to add this and the code is ready.
		When opening airlocks etc, lighting does not always update to account for the change in opacity.

Explosions now cause lighting to cease processing temporarily.

Moved controller datums to the code/controllers directory. I plan on standardising them.
"Master","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply Shuttle","Emergency Shuttle","Configuration","pAI" controller datums can be accessed via the debug controller verb (used to be the debug master controller verb)
Supply shuttle now uses a controller datum. Shuttles tend to arrive up to 30 seconds late, this is not a bug.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4537 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-25 16:06:57 +00:00