Recent Posts

Pages: 1 ... 4 5 6 [7] 8 9 10
61
Other Open Source Projects / Re: Standalone Tank IR
« Last post by LukeZ on July 08, 2023, 03:29:05 PM »
Hi Rongyos,

I don't know if I understand your question exactly, but I will try to explain this bit of code and maybe that will help you.

First of all, if we reach the code you have posted, we already know that we have received a cannon hit (not a machine gun hit).

By this point we have also already calculated our new damage percentage based on this cannon hit. All that has come before this code.

Now, in the code you posted, we have the first part of the "if" statement: if (DamagePct >= 100.0)

This means that we've added up all our damage and it's equal to or over 100%, therefore the tank is "destroyed" and must be disabled.

The second part of the "if" statement is the "else" condition: else we have been hit, and our damage has increased, but we are not yet destroyed (in other words, damage is less than 100%).

In that case we flash the LEDs in the apple that indicate a hit was received. We also enable an invulnerability timer, but only a very brief one. This is simply to prevent receiving multiple hits from a single shot of someone's cannon. As you know, the Tamiya signal lasts for a full second - that would be enough time for us to register many hits if we didn't have this brief timer.

I hope that helps!
62
Other Open Source Projects / Re: Standalone Tank IR
« Last post by Rongyos on July 07, 2023, 04:16:24 PM »
Hi Luke!

I'm just modifying the code for using relays for disconnect motors (to reduce advantages relating tamiya speed reducing function) and just dont understand the code below. After the "else" statement the HitLEDs_CannonHit object shouldn't be HitLEDs_MGHit? If yes my relay object shouldn't be there :)
Code: [Select]
if (DamagePct >= 100.0)
                {
                    // Don't let damage go above 100%
                    DamagePct = 100.0;
                                       
                    // After destruction, the tank becomes inoperative for some period of time (15 seconds is the Tamiya spec - NOT the same as recovery/invulnerability time!)
                    // After that time it will automatically recover itself. During invulnerability time, the tank can fire but is impervious to enemy fire.
                    // Invulnerabilty time is dependent on the weight class.
                    isDestroyed = true;
                    TankTimer->setTimeout(DESTROYED_INOPERATIVE_TIME_mS, ResetBattle);   // DESTROYED_INOPERATIVE_TIME_mS is defined in OP_BattleTimes.h
                    // Start the destroyed light effect
                    HitLEDs_CannonHit();   // After the cannon hit effect, because isDestroyed is true, the subsequent HitLEDs_Destroyed effect will start automatically
                    HitRelay();    //After the cannon hit effect the relay disconnect the motors. Tank cannot move
                    ClearHitRelay();
                }
                else
                {
                    // Flash the hit notification LEDs
                    HitLEDs_CannonHit();
                   HitRelay();
                    ClearHitRelay();
                    // Start a brief invulnerability timer. Each IR signal is sent multiple times, but we only want to count
                    // one hit per shot. For the next second after being hit, we ignore further hits
                    TankTimer->setTimeout(HIT_FILTER_mS, EnableHitReception);

Thanks and regards!
Rongyos
63
TCB Dev / Re: Barrel Smoke
« Last post by LukeZ on June 14, 2023, 03:27:15 PM »
Well it took me two years, but I finally got around to adding the Wiki page for the barrel smoker.

Please feel free to continue using this thread for questions and discussions about barrel smokers.

Barrel Smoker Wiki page
64
TCB Dev / Re: Ideas for the OP Config
« Last post by NS-21 on June 04, 2023, 04:29:40 PM »
Yes, I put a hat on my head, immediately take it off, and put it on my chest.
This is a great addition!

65
TCB Dev / Re: Ideas for the OP Config
« Last post by LukeZ on June 04, 2023, 03:22:17 PM »
Thanks again Rongyos for helping with the testing!

I've finalized all the changes and posted a new official release, it is version 0.93.76 (both TCB and OP Config). I've also updated information in the Wiki.
66
TCB Dev / Re: Ideas for the OP Config
« Last post by NS-21 on June 03, 2023, 03:45:15 PM »
Yes, I agree, it looks cool and realistic!
Now I understand what it was about!
67
TCB Dev / Re: Ideas for the OP Config
« Last post by Rongyos on June 03, 2023, 02:27:43 PM »
I hope this looks better.

Hi Luke,

Its perfect now :) (the sound doesnt represent the flickering its just test. Flickering is realistic in electric starting not flywheel)
Here is a video of the brake light flickering:


Thanks for your efforts and quick support!
Rongyos
68
TCB Dev / Re: Ideas for the OP Config
« Last post by LukeZ on June 02, 2023, 03:43:51 PM »
Ok, I've taken your suggestions.
- The fade back to full brightness at the end has been shortened to almost nothing.
- The flickering has been "softened" a little. I have limited how much the brightness can vary between each step so that it doesn't make changes so abruptly.

I hope this looks better.
69
TCB Dev / Re: Ideas for the OP Config
« Last post by Rongyos on June 01, 2023, 02:18:57 PM »
    Hi Rongyos,

    • When the flickering is finished (the transmission engage delay has expired/your engine start sound has finished), the lights will gradually return to full brightness instead of doing so abruptly all at one.

    You can let me know what you think.

    Hi Luke,

    Sorry for the late reply I was not near my computer
    Honestly, the softness on the end of the flickering is too high and not realistic now. Can you lower (much much lower it) to almost nothing?
    Also, the flickering is almost perfect and realistic. Can you add a little bit more softness? Just a little bit :) Unfortunatelly I only have TCB right now and no free arduino :(

    Regards
    Rongyos[/list]
    70
    TCB Dev / Re: Ideas for the OP Config
    « Last post by LukeZ on May 31, 2023, 04:42:40 PM »
    Hi Rongyos,

    I bought a cheap Arduino UNO and a couple LEDs so I could do some testing on my laptop. Here is yet another update where I've adjusted the flickering effect to be about as good as I can get it.

    Other changes:
    • I've removed completely any effect on the headlight output since that simply doesn't look good.
    • But I did add the effect on the Aux output (Arduino pin 8 ). So you use that for your headlights instead. Of course the Aux output needs to be On when the engine is started or else nothing will happen.
    • The flickering effect will apply correctly now to the brake light depending on whether the brake light is on or just the running light.
    • When the flickering is finished (the transmission engage delay has expired/your engine start sound has finished), the lights will gradually return to full brightness instead of doing so abruptly all at one.

    You can let me know what you think.
    Pages: 1 ... 4 5 6 [7] 8 9 10
    bomber-explosion