Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 3    [LBP3] Help!!
#1

Health Bar Help! (Yes, another one)

Archive: 5 posts


I read up on feedback loops and health bars the other day and to my surprise, it was very straight forward, I made a simple health system in a short amount of time on my first attempt...

Unfortunately, I need one that accounts for several damage types and preferably, with a healing system.
http://i.imgur.com/58pYCqT.jpg
Mostly irrelevant, I like to keep all my logic neatly organised so I never have to bother with notes. It seems to also use less thermo but I cannot say for sure. The two microchips are for damage and Melee combat, respectively, the stuff in the middle is just for special powers on some characters.

More importantly:
http://i.imgur.com/OVGtQDW.jpg
The issue I'm having is that I can get it to add multiple damage types (as seen by the tag sensors) but when the sequencer hits the end, it bounces back. So, for instance, I can use meele attacks which bring the health down in even chunks but if I was to leave the oponent one hit away from death and then use a missile or other attack which takes considerably more damage, it ends up giving them more health because it's hitting the end of the sequencer and bounces back to account for the leftover damage. I tried to set the XOR gate to 'inverted' as well because the healing system doesn't work [I did absolutely nothing at all], This got the healing system working (except it heals the player fully instead of gradually, which is wrong), I've tried setting the battery on the healing to -1,1,-100 and 100 but it seems to not make a difference. Inverting the XOR gate also opens another can of worms which can be seen in the video below; the health bar stops at the halfway point, regardless of what damage is taken, which is just odd.


https://youtu.be/jF_HPshJuUI

Aside from the bouncing issue, it should (and does) work fine. The other character in the video uses a player health whearas NPCs have a lot less health, which is where this starts to become an issue. I want the characters to heal a small amount at set intervals (e.g. 1% every 5 seconds) which means I dont have to bother with logic to prevent healing whilst in combat, and I can also adjust it for characters with a regenerative healing factor. It also means I can use opacity tweakers, etc. and have the character respawn in the same place, without having to use more emitters, but this isn't 100% an issue. NPCs wouldn't heal either.

I'm 9 characters in of around 80 total playable, so I really want to get this fixed now because the 10 I have are mostly variations of the same character (7 Iron Man+ War Machine variants). So you can see that I don't want to have to recapture all 80 at the end of it. Thanks for reading, I hope you can help!

Oh and the timer used for the display works perfectly fine so it's not that causing the issue.

*EDIT* If anyone wants to look at it first hand, I'm more than willing to send it to them/accept friend requests (I'm on PS3 though)
Crud, Also forgot to mention that I'm using sackbots as opposed to characters, in case that wasn't clear.
2015-08-20 02:03:00

Author:
wally-217
Posts: 521


A big issue I see with your logic is that all damages are looping back into the combiner, and that makes all inputs absolute, regardless of sign value when they came in

for example, if the value is negative, it will turn positive, which explains the bouncing. To fix this, ensure signs stay separate, for example, just multiply the damage value by -1, and feed it into an adding feedback loop consisting of an OR gate, no combiner necessary, that way there's no absolute involved. Either that, or take your current system and split the value out of the end of the combiner using a splitter; feed the outputs of the splitter respectively back into the damage and heal slots you have prepared, that way, though absolute still exists in your system, it stays respectively separate using the splitter in the end, never changing the sign.

If you need an example, I can hop on my vita and make a logic diagram for you, if necessary. I don't see the need if this is easily comprehensive for you though.
2015-08-20 02:53:00

Author:
amiel445566
Posts: 664


A big issue I see with your logic is that all damages are looping back into the combiner, and that makes all inputs absolute, regardless of sign value when they came in

for example, if the value is negative, it will turn positive, which explains the bouncing. To fix this, ensure signs stay separate, for example, just multiply the damage value by -1, and feed it into an adding feedback loop consisting of an OR gate, no combiner necessary, that way there's no absolute involved. Either that, or take your current system and split the value out of the end of the combiner using a splitter; feed the outputs of the splitter respectively back into the damage and heal slots you have prepared, that way, though absolute still exists in your system, it stays respectively separate using the splitter in the end, never changing the sign.

If you need an example, I can hop on my vita and make a logic diagram for you, if necessary. I don't see the need if this is easily comprehensive for you though.

If it really is a quick thing for you to do then by all means, make a diagram, I'm more of a visual learner (may also help anyone else that stumbles across this thread). But that's completely up to you since I don't mind firing up the brain muscles. Written instructions always seem to get me. Perhaps I'm just tired (it's almost 5am, whoops), I may just need to refresh my memory since these are still new to me. Thanks! I'll get working on it right away (or in the morning if I fall asleep)
2015-08-20 04:44:00

Author:
wally-217
Posts: 521


http://i9.api.vita.lbp.me/img/ft/c2995fb2f773ff80b8adb000f1f452dc42682f69.jpg
http://ie.api.vita.lbp.me/img/ft/76ef6bea0f73377a24a1292743cd304883c99795.jpg
Note: The AND gate is set to multiply with a -1 (-100%), and the OR is set to add
I prefer the latter as it is easier to modify, but both of these work for your situation

Hope this helps
2015-08-20 04:50:00

Author:
amiel445566
Posts: 664


I prefer the latter as it is easier to modify, but both of these work for your situation

Hope this helps

The first one is fine... With one exception - The healing
http://if.lbp.me/img/ft/07fe7f16170e79c75e10ed0a19397c1e13a85db3.jpg
The only way I could get a health regeneration was to use a direction combiner (previously was an AND) but even then, the % of the battery determines the absolute value of health (e.g. +/-10% or +/-90% heals up to 90% of health if the health is below that amount, +/-100 and 0 fully heal you) whereas I want 10% to be relative so you can heal over time, instead of instantly. It may be because, as you said originally, there's still absolute signals in my logic.

The second, however, I could not get working at all. The battery value on the healing seems to actual set the point at which I can no longer receive damage (I think) or it just instantly kills me.
http://ie.lbp.me/img/ft/1ae61305df77974afe05c0bb62d9cb5e6506e539.jpg

Any ideas? Am I doing something wrong?

*EDIT* Found a solution! Set the health regen timer to 60 seconds and triggered it to reset when either full or when a damage counter is detected, thanks for your help! I'll be sure to remember this when I do the credits.
2015-08-20 07:28:00

Author:
wally-217
Posts: 521


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.