Prototype Battery

I continued yesterday's work refactoring item charges, so that items could drain power over time or per use, as needed. By the end of the day, I was able to get the nightvision goggles installed with their own, charged battery:

IMAGE(http://www.bluebottlegames.com/img/screenshots/screenshot-2013-06-14.png) New night vision goggles, with battery power.

The plan is for there to be several battery types, and each has a different capacity for energy. Energy items can be moved around like water, except it cannot exist anywhere but inside batteries. So it's possible to transfer energy around freely (which is admittedly unrealistic), but not to hoard it on the ground, or put it in a pocket. It must go into another vessel.

Energy items are 1x1 items, and stack 20 high per space. For now, my rough approximation is that a single unit of energy in the game corresponds to about 1kJ of real-life energy. For reference, a AA battery is about 15kJ (1.5V * 2.7Amp_Hours * 3600 seconds/hour) of total stored energy, and a car battery would be ~2000kJ (12V * 50Amp_Hours * 3600 seconds/hour = 2000kJ). That means a AA battery would have room for about 1 stack of 20 energy units, while a car battery would have room for about 100 (a 10x10 grid).

I'm also assuming that a laser rifle emits about 30kJ per shot at high power setting, so roughly 30 energy units in-game. From what I've read, this is the minimum threshold the military considers to be a "high energy laser." It's about 30% of the power currently used in experimental warship lasers used to down incoming missiles and drones.

These are just data points I'm using for reference, to help model consistent values across items.

There are still some kinks to work out, however. For one thing, the goggles are still operational without charge in them right now. I need to look into that next. They should check if they're charged before imparting their bonus.

I also need to make sure the weapons have survived the refactor. They now use similar charge-tracking code to the goggles (except with bullets instead of energy). In theory, if one works, the other should. But you know theories...

Finally, I'll have to make sure things are discharging correctly when used, or as time/distance passes.

So far, I'm thinking the system will serve my purposes well. It seems like it should cover electronic tools both used and equipped, weapons, and vehicles. And once tested and fully working, I can start adding more electronics to the game like flashlights, iSlab apps, and maybe even a gas-powered test vehicle. Should be pretty interesting!

Hope everyone has a good weekend!

Comments

Aaron_PK's picture
Aaron_PK

Glad you're getting to work on electricity. Will we be able to salvage any types of solar panels for renewed energy? maybe making a low grade panel a rare find.

Cryovisitor's picture
Cryovisitor

So we will eventually be able to do something useful with the iSlabs? Sweet! Although I think it would be nice just being able to harvest their batteries/ battery power...

XxTechnoguyxX's picture
XxTechnoguyxX

Dan, have you thought about items with built-in batteries yet? If not, you could maybe treat the item as a battery itself and put electricity directly into it, or use the 'item condition' mechanic and have it decay into an unusable state and have to be "recharged". Just a thought. :)

--XxTechnoguyxX

UltimaVirus's picture
UltimaVirus

Questions:

How will you ensure efficient use of the goggles with charges? For example, can it be quick-toggled or is it either equipped and on or unequipped and off? Can it ever be auto-on/off as in such cases where it would be beneficial to have it on, it's on if equipped or a charge is used when used to scavenge.

I just think it'd be a PITA to have to unequip it every morning.

PS. Excellent work, LOADS of progress!!!

dcfedor's picture
dcfedor

Re: solar panels, that's a possibility. Some folks have mentioned stills and generators, too, so there will probably be at least one way of generating electricity from scavenged stuff. I'd also like to make a few places to just "plug-in" to existing mains, maybe at the cryo facility and DMC.

Re: iSlabs, yeah, I think it should be possible to do at least something with them. Hacking into a network might be a bit crazy, and I was thinking of also adding a laptop to the game for that purpose. Then, the iSlab could do app-y things (reading files, camera), while the laptop can do both app-y and more hardcore things (like hacking another device, altering software/apps, etc.).

I'm toying with the idea of iSlabs and/or smartphones being a source of sensitive data, rare bits of which unlock accounts in the DMC or could be sold to a fence. The laptop would be a tool used to extract that data. It'd provide a sort of subsistence to non-bushcraft builds, and an alternative way to obtain info on the player's identity.

Re: built-in batteries, there may be a few items like that. E.g. the iSlab might not have replaceable batteries, and the player must have an electrician skill to craft a "dead" iSlab plus new iSlab battery into a working iSlab that accepts energy directly. I like the idea, I just need to ensure it doesn't get out of hand/overload my schedule.

Right now, the goggles are likely to be PITA, unfortunately. When they're equipped, they're on, and when stored they're off. When scavenging, they should be available whether worn or not, and get discharged when used. I'll make a note to verify that's still working. But I don't think I can make it only discharge under certain circumstances (at least, not without a lot of custom programming for each item).

Thanks for the feedback and encouragement!

Dan Fedor - Founder, Blue Bottle Games

Aaron_PK's picture
Aaron_PK

I would like to see generators as a good power supply source for those who like to build bases and bring resources like gas, back to base. But I would like to see solar panels, even small inefficient ones, as an option for those who like to stay on the move.

asthepanda2iscool's picture
asthepanda2iscool

I like the idea of hacking computers or other machines(it did say that the main character had a bank acount so mabey you get a reward for hacking it).

all the ideas that just ran threw my head for islab apps!

asthepanda2

Teikai's picture
Teikai

car batterys save not energy she produce energy she work not with a aku.

XxTechnoguyxX's picture
XxTechnoguyxX

What?

TomeEclipse's picture
TomeEclipse

I concur. WHAT?

asthepanda2iscool's picture
asthepanda2iscool

so...car batteries don't save power,so she makes power,but not with a AKU?

asthepanda2

Keldoclock's picture
Keldoclock

I think he's saying that car batteries don't save energy, but produce it- but it doesn't work without an accumulator(lead-acid battery)

So: Cars produce energy, but don't store it long-term, but the cars don't work without car batteries.

Kaaven's picture
Kaaven

But, as far as I know, car batteries are, as the name suggests, only batteries - they store energy. Alternator is a car part that makes energy.


<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites

Cryovisitor's picture
Cryovisitor

I love how you created the link, but never read it... "...converts mechanical energy to electrical energy in the form of alternating current." is part of the first line of text!

Kaaven's picture
Kaaven

How did I not read it? It says clearly, in the first line about automotive alternators: "Alternators are used in modern automobiles to charge the battery and to power the electrical system when its engine is running".


<--Mighty (mini)Mod of Doom-->
DeviantArt Gallery of MoD Sprites