SMES Exploit

fix pls
Locked
User avatar
elantzb
Registered user
Posts: 95
Joined: 11 Jul 2016, 00:36

SMES Exploit

Post by elantzb » 19 Mar 2017, 01:37

Bug Description: Rebuilding a SMES with little to no charge left gives it some free charge.


Steps to reproduce:
1. Find empty SMES (ones near briefing ladders, for instance).
2. Deconstruct it, then rebuild it.
3. Note that it has charge now.

User avatar
Casgair
Registered user
Posts: 117
Joined: 17 Nov 2015, 09:32

Re: SMES Exploit

Post by Casgair » 20 Mar 2017, 02:56

This is a holdover from baycode; I assume the code acts in this way so roundstart SMESes have enough power to start an engine/keep the station going long enough for solars to get wired.

User avatar
elantzb
Registered user
Posts: 95
Joined: 11 Jul 2016, 00:36

Re: SMES Exploit

Post by elantzb » 23 Mar 2017, 13:49

I'm pretty sure that you can programatically set a SMES's starting power, hence the beefy one that runs the lower deck without ever needing charging.

User avatar
Jroinc1
Registered user
Posts: 995
Joined: 10 May 2016, 22:32
Location: Changes too rapidly
Byond: Jroinc1

Re: SMES Exploit

Post by Jroinc1 » 23 Mar 2017, 17:12

Yup. It's not... common here though, or pretty much ever used outside of rare circumstances (Engine blew up... aand it's been 45 min).
Mentor-
3 Nov 16-15 Jan 17

Atmos bombs built- 16
Hull breaches repaired- 6
Charged SMs manually dragged to space- 2
Backup tcomms systems set- 4
SM de-lamination weapons detonated- 0
Times I've burned half the ship to a crisp- 5
Times I've burned half the ship to a crisp ACCIDENTALLY- 2
Engine SMs de-laminated on my watch- 0

Upper deck engines made-1
Lower deck engines made-1

Total kills with SM- 6

Most surgeries done at once- 3
Most anesthetic tanks used in a round- 3
Most surgeries done using only personal supplies- 37
Most perdiox made w/in 5 min of roundstart- 540u

User avatar
elantzb
Registered user
Posts: 95
Joined: 11 Jul 2016, 00:36

Re: SMES Exploit

Post by elantzb » 23 Mar 2017, 17:35

I found out about this because I'm used to Yogcode where SMESes have power cells inside. I opened the emitter SMES (power was out and there had been no engineering staff for ~1hr) with the hopes of charging the cells and rebuilding the SMES, but there was a magnetic coil(sp?) inside. So I put it back together and bam free power, problem solved.

User avatar
Casgair
Registered user
Posts: 117
Joined: 17 Nov 2015, 09:32

Re: SMES Exploit

Post by Casgair » 24 Mar 2017, 08:17

elantzb wrote:I'm pretty sure that you can programatically set a SMES's starting power, hence the beefy one that runs the lower deck without ever needing charging.
True, but we are talking about code that's probably been around since the first Goonstation. That code doesn't test for how much power is in the batteries, it just creates a new one according to some preset amount of power. I can't speak with absolute authority on it, but the answer I provided seems the most likely reason it acts the way it does.

User avatar
elantzb
Registered user
Posts: 95
Joined: 11 Jul 2016, 00:36

Re: SMES Exploit

Post by elantzb » 24 Mar 2017, 15:37

Casgair wrote:True, but we are talking about code that's probably been around since the first Goonstation. That code doesn't test for how much power is in the batteries, it just creates a new one according to some preset amount of power. I can't speak with absolute authority on it, but the answer I provided seems the most likely reason it acts the way it does.
Right, so I suggest making freshly constructed SMESes start with 0 charge. That's got to be a single variable change.

User avatar
Casgair
Registered user
Posts: 117
Joined: 17 Nov 2015, 09:32

Re: SMES Exploit

Post by Casgair » 24 Mar 2017, 23:26

That would be the easiest way to settle it, sure.

I would say something like a SMES_Power variable that would work on battery input SMES_Power = SMES_Power + Battery_Power; while deconstructing would create/set batteries with Battery_Power equal to SMES_Power / number_batteries (because AFAIK the SMES can be deconstructed prior to completion, so / 5 isn't necessarily the best input) would be more desirable from a power conservation aspect, but then you would get into hokey stuff like Research being able to keep the ship running purely by making Super cells alone.

(Apologies for the wonky code, python amateur over here)

User avatar
elantzb
Registered user
Posts: 95
Joined: 11 Jul 2016, 00:36

Re: SMES Exploit

Post by elantzb » 25 Mar 2017, 05:17

SMES units in CM don't have cells as their components is what I'm saying... just a research item (magnetic coil or whatever), no cells/batteries included

User avatar
Casgair
Registered user
Posts: 117
Joined: 17 Nov 2015, 09:32

Re: SMES Exploit

Post by Casgair » 25 Mar 2017, 11:06

Hah, my bad; I haven't really done much as MT/CE (certainly never had to build/decon an SMES). Hope a dev weighs in on this.

User avatar
elantzb
Registered user
Posts: 95
Joined: 11 Jul 2016, 00:36

Re: SMES Exploit

Post by elantzb » 25 Mar 2017, 23:10

Casgair wrote:Hah, my bad; I haven't really done much as MT/CE (certainly never had to build/decon an SMES).
Check out my Guide "Buck's Notes" in the Guides forum.

Locked