Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vehicles can now idle. Allows generators. Storage batts keep charge when removed and added. Adds floodlight, working fridge. #4665

Merged
merged 14 commits into from Nov 25, 2013

Conversation

Projects
None yet
5 participants
@freezerbunny
Copy link
Contributor

commented Nov 25, 2013

Vehicles will now need the engine to be powered on in order to drive.

Engines that are on will actually idle, consuming fuel and charging batteries.

Storage batteries can be removed and will keep their charge. When installed, they will add their charge to the vehicle.

The minifridge can now be powered on and will keep food fresh for five times as long.

A floodlight object was added that acts as a very powerful lightsource, for indoor lighting with the new generator.

Power generation and consumption was rebalanced around this.

Fixed light power consumption.

src/map.cpp Outdated
if (it->is_food() && next_vehicle->part_flag(*part_index, "FRIDGE") &&
next_vehicle->fridge_on) {
if (!one_in(5)) {
it->bday++;

This comment has been minimized.

Copy link
@ianestrachan

ianestrachan Nov 25, 2013

Contributor

To the best of my knowledge, this won't have any effect outside of the 'reality bubble'. That is, however, very much well outside of the scope of this PR; just something you should probably be aware of.

This comment has been minimized.

Copy link
@freezerbunny

freezerbunny Nov 25, 2013

Author Contributor

Good to know.

Solution would be to process active item in vehicles no matter where they are.

However that would require a new list of vehicles that have active things in them, so we don't needlessly check every single vehicle in the world.

When they no longer have active items in them, remove the vehicle.

That or, set the bday somewhere many turns in the future when we put it in, and decrement the appropriate number of turns when we take it out.

This comment has been minimized.

Copy link
@ianestrachan

ianestrachan Nov 25, 2013

Contributor

Those are all band-aid fixes to the bigger problem of the 'reality bubble' itself.

The only solution that doesn't involve simulating the entire world is to track when a section is unloaded, and when it is reloaded, fast-forward it to simulate all the turns that were missed. That'll fix fires and suchlike being frozen in time if you get too far from them.

Still well out of the scope of this PR though.

This comment has been minimized.

Copy link
@freezerbunny

freezerbunny Nov 25, 2013

Author Contributor

I've implemented a fix, keeping a list of fridged foods and processing them accordingly.

Can't really be done this way.

Got a new solution involving calculating the difference between the current turn and the old turn and dividing it by 5.
ie. the rate of passage for turns is decreased by 5, hence making it rot less.

@freezerbunny

This comment has been minimized.

Copy link
Contributor Author

commented Nov 25, 2013

That should be it working even if we leave.

@yobbobanana yobbobanana merged commit 02540c1 into CleverRaven:master Nov 25, 2013

1 check passed

default Merged build finished.
Details
@yobbobanana

This comment has been minimized.

Copy link
Contributor

commented Nov 25, 2013

this was awesome so i merged it.

i tested it a little first.

@freezerbunny

This comment has been minimized.

Copy link
Contributor Author

commented Nov 25, 2013

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Nov 25, 2013

item.cpp line 876 (item::tname) should call food->rotten(g) as currently it checks the rotten status of the container which as containers do not root is always false.

@freezerbunny

This comment has been minimized.

Copy link
Contributor Author

commented Nov 26, 2013

@BevapDin #4695 Done here. Thanks.

@EricFedrowisch

This comment has been minimized.

Copy link
Contributor

commented Nov 26, 2013

Wow! This looks awesome! Minifridges?!

@yobbobanana

This comment has been minimized.

Copy link
Contributor

commented Nov 26, 2013

working minifridges :)

@freezerbunny freezerbunny deleted the freezerbunny:vehicle-generators branch Dec 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.