Commit Graph

30 Commits

Author SHA1 Message Date
Kyle Spier-Swenson
55b9abd488 Make lighting object management robust. (#19365)
* Make lighting object management robust.

Fixes a bug that caused lighting objects to not properly manage themselves on turf change, and adds nosiness and runtimes for when such a case happens again.

* does the remie
2016-07-19 14:53:42 +12:00
Kyle Spier-Swenson
6bfccafe41 Fixes random dark turfs
This was causing turfs changed at world init from a no lighting system turf to a turf that used the lighting system to have two lighting overlays, one randomly stuck at black depending on timing.
2016-07-02 19:41:26 -07:00
MrPerson
df637898ef Fixes mechs breaking lights by walking onto them
Fixes #17271
2016-06-23 02:51:55 -07:00
Kyle Spier-Swenson
235b79fb5a StonedMC, the bastard love child of GoonPS and CarnMC (#17987)
Basically, they key difference between StonedMC and CarnMC is that when multiple ticks want to run at the same byond tick, we divvy up the tick between the subsystems, rather then allow one subsystem to hog it all.

The key difference between StonedMC and GoonPS is that we allow the subsystems to tell us how to divvy up the tick using flags and priority.

The new SS_ flags allows us to select behaviors that used to be piggybacked as side effects of dynamic wait or default but sometimes unneeded behavior.

Dynamic wait is 100% gone, lower priority and SS_BACKGROUND are better more refined ways of doing this when combined with MC_TICK_CHECK

I have by design never looked at the inners of goonPS, so this is all original code but I know it uses two loops because of comments by goon devs on reddit threads, that design didn't make sense before, but when I can tell a SS how much of a byond tick it is allowed to have, knowing how many need to run this tick is helpful I also know a bit more about how it works from piecing together comments in #vgstation.

Detailed list of changes:

Subsystems now have flags, allowing fine grain control over things like rather or not it processes, inits, rather it's wait is how long between runs (post run timing) or how long between starts, and rather or not late fires should cause the next fire to be earlier.

Mc now has two loops One loop handles queuing shit, one loop handles running shit.

MC now splits up tick allotment rather than first come first serve Subsystems can even request a bigger share using higher priorities. (It will even resume subsystems it paused if other subsystems hadn't used as much as it predicted they might need)

Default fps is now 20 This is related enough to the MC and it's a change that's really long since over due

All code oddities are most likely to be necessities to lower overhead on the mc since it runs every tick
2016-06-16 18:01:16 +12:00
Joan Lung
2cfb2d8eed Layers are now defines (#17949)
* Layers are now defines

* this looks better

* GAS_phil_LAYER

* no message

* remove the three unneeded defines

* no message
2016-05-27 22:16:21 +02:00
coiax
4483d5275c Shuttle manipulator (#17436)
* Starting out on our tgui journey

* God tgui, why do you need to be updated

You're dynamically generated anyway

* Commit of stuff

* Further progress is being made

* Everyone loves buildscripts

* Further modifications to my incredible running script

* Starting to modify the minimap code to be better

* It's going well thusfar, I guess

* What have I done

* RIP minimap

* FUN FUN FUN FUN FUN

* Adds shuttle_manipulator.dmi

MUH HOLOGRAMS

* Is it done? IS IT OVER

* Peer review

* Some bug fixes

* Makes that damn greentext shut up

* Shuttle registration

* Made the Emergency Escape Bar more robust

No climbing on the bar.

* Do not stare into the operation end of the device

* Compile shame

* THE MOST DUMB

* Passive barmaiden

* Emergency shuttle memes

* MORE SAFETY CODE

* Fancy shuttle manipulator icons

* Smoothing it out

* We are going to have a lot of fun with this one

* Independent blobbernauts

* WABBAJACK WABBAJACK

* Message for attempting to authenticate old style

* Angry alert noise is back

* Revert "Independent blobbernauts"

This reverts commit 34d6af7c9c88cfc2864990cb37b586bb90163dd3.

* No parrot sleep plz

* Moves the special shuttle stuff to special.dm

* No Bartender like a Centcom Bartender

* Non-controversial map changes

- Backup shuttle moved closer to Centcom main structure, docking tube
created
- Moved shuttle import landmark to above Centcom main building
- Added shuttle displays to Conference Room
- Squashed the Chapel a bit in Metastation
- Made the docking port on Z2 massive
- Made the docking port on Metastation a lot larger

* Hacks and slashes at Box

A bunch of things are extended and squashed so Box shuttle dock can
support the MetaStation emergency shuttle.

* Some Metastationshit

* Never ending changes

* Wabbajack to TGM

* Modified the bar, I think that's all of them

* Stops Barmaiden wandering around

* More code review

* Whitspace, the bane of us all

* DIE WHITESPACE DIE
2016-05-26 15:15:19 +02:00
KorPhaeron
0bbcc00c4d Revert "Move some stuff from different layers to different planes" 2016-04-29 16:07:23 -05:00
MrPerson
b50e0ee42c Merge branch 'master' of https://github.com/tgstation/-tg-station into planes_on_a_snake 2016-04-27 17:03:32 -07:00
MrPerson
3f70f880ac Move some stuff from different layers to different planes
Moves everything on a 15+ layer to a plane. So now you get screen catcher (-99, was already on a plane), lighting (15), effects that ignore lighting (16), fullscreen UI effects (18), screen objects used to build the UI (19), actual equipment in the UI slots (20), and everything else (0).

Also created a file to contain plane and layer defines for hopeful eventual use.

Hopefully this doesn't change anything now but does enable some nifty new features in the future.
2016-04-24 04:03:41 -07:00
YotaXP
0d8cc8aee7 Make the loader use ChangeTurf() for turfs. 2016-04-18 17:41:05 -04:00
duncathan
3525bcfcbb fixes huge roundstart bugs 2016-03-30 16:07:35 -06:00
duncathan
e86cf0f280 praise the good lord, for the game finally compiles 2016-03-29 19:04:37 -06:00
KorPhaeron
6716fc9282 Entirely area based 2015-12-24 03:50:27 -06:00
KorPhaeron
70060cb6c1 Weather datums 2015-12-22 05:31:46 -06:00
Kyle Spier-Swenson
969e4ca2b7 forgot a line 2015-12-16 03:29:24 -08:00
Kyle Spier-Swenson
e5b6078bc4 Cleans up turf/get_lumcount
I'm going to just declare that any case where a turf's loc isn't an area to be a bug that lighting code shouldn't be hiding
2015-12-16 03:19:17 -08:00
Kyle Spier-Swenson
dc337a6344 Fixes runtime in lighting system
fixes #13478
2015-12-06 07:32:28 -08:00
MrStonedOne
a1bfb37f0c Tweaks lighting some more.
This should be ready to go.
2015-12-02 07:12:37 -08:00
MrStonedOne
102896196f lighting tweaks 2015-11-30 01:44:44 -08:00
Tkdrg
3308f76efb Improves speed of redraw_lighting()
No longer uses animate() when unneeded, because animate() is slow.
Also turns Clamp() into a macro to reduce proccall overhead.

The whitespace changes in atmos are needed because of the way the
preprocessor handles macros.

Thank you MrPerson for helping with this.
2015-11-06 23:36:03 -03:00
MrStonedOne
8c755da84f Adds a way to make certain area/space areas not force 100% brightness 2015-10-31 02:30:49 -07:00
MrStonedOne
03ff22fbbc Adds the ability to set a light source's high end
Makes starlight use new system to have far spreading low levels of light rather then near spreading high levels of light.
2015-10-29 22:31:08 -07:00
Tkdrg
c2093e3709 Improves starlight performance
Still laggy, but now quite a bit better.
Fixes #8154
2015-10-25 01:55:04 -03:00
xxalpha
e82a216447 Changed various instances of range() and orange() to ultra_range(). 2015-10-19 20:04:14 +01:00
MrPerson
d97d2a3bac Disallow nulls in the lighting system's lights list
This bug isn't reproducable so no, I'm not sure this will fix it. It's still a good idea to do this though.

Best guess as to what happened: A light was deleted pre-round for some reason. The garbage ss del()'d the light before the lighting system's first tick, so a null got into the lighting ss's lights list. This broke the whole system directly from roundstart and caused the thousands of "can't run null.check()" runtime errors from yesterday.
2015-10-12 01:52:30 -07:00
Firecage
4688c2c969 Fixes proc arguments 2015-07-15 23:52:35 +02:00
KorPhaeron
97990c94cc Changes how destroying turfs works
Turfs now have a baseturf var which determines what is "under" every
turf. The default is space.

Actions that previously did changeturf(/turf/space) (like bombs or RCD
deconstruction) now do changeturf(baseturf). Functionally the same for
the station, but allows special turf types that don't break to space
(such as planet tiles).

Right now the asteroid tiles are the only thing with a baseturf other
than space (the baseturf is an asteroid tile).

Baseturf is tracked when new things are built, so building a floor and
then a wall on the asteroid tile, and then bombing that wall will return
it to an asteroid tile, not space.

Allows building on asteroid tiles now that doing so wont randomly make
holes to space. Time for giant mining forts.

I should have done this years ago for away missions.

Also added myself to admins.txt
2015-05-29 18:43:34 -05: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
Ikarrus
4ff044dc78 Gang v3 has been tested and is now good to go! 2015-04-19 22:26:15 -06:00
MrPerson
01a8aa662a Moved lighting stuff from controllers folder to its own module
Lighting SS no longer cares about the return of check(); the light datums are responsible for deleting themselves.
Cap on lighting effects from turfs is now 8 because they're static and shouldn't be flashing lights too often. This means starlight actually works now instead of being capped at 1 measly turf.
Lighting related ChangeTurf() code is in the lighting module. Changed it up to be faster on lighting controller init and not leave dangling lights when a turf becomes or stops being opaque or when it turns into space. This diff log is gonna be useless sadly but take my word for it, it all works.
Lighting related Moved() code is also in the lighting module. Opaque objects will now update nearby lights when they move (mechs).
Opaque objects other than the light datum's owner on the same tile as its owner will block the effect of the light. In other words a mech standing on the same square as a light bulb will block all the light of that bulb.

Changed "cheap_hypoteneuse()" with an even cheaper version; actually calculating the hypoteneuse! I can prove it's cheaper if needed.
Removed move_contents_to() because it's unused and trying to use it would cause major bugs with lights and other shit and I have no interest in supporting that, so let's not even tempt people.
2015-04-12 02:25:28 -07:00