Jump to content
Sign in to follow this  
sickboy

6thSense.eu Presents: "Pack1"

Recommended Posts

Something though;

a sleep command always sleeps at least 1 frame, so sleep 0.001 should in nearly every case make this happen.

1 frame might be longer/shorter than the other as it depends on FPS.

That is why I suggested changing the delay to 0.05. As long as the FPS is at least 20, the delay will be about the same. Of course the delay will be more when the FPS is lower, but that isn't worth worrying about as you don't want your FPS to be that low anyway.

A distance loop probably wouldn't be any more accurate. You are still limited by FPS.

In OFP bullets were only 'updated' at 20FPS, no matter what the FPS the game was being rendered at.

Also, maybe even better use:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

sleep 0.05*acctime;

That will make sure that even when the game is running in slow motion (such as cutscenes/film making) the tracers will still look smooth.

If bullets are still updated at 20FPS as in OFP, then I don't think there is any use using a delay of less than 0.05 seconds as it just increases load on the PC a bit.

Edit:

Used eliteness to open ArmA's main config.bin. Under Class CfgAmmo I found

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

simulationStep = 0.05;

So it looks like bullets in ArmA are updated 20 times a second just like in OFP.

Share this post


Link to post
Share on other sites
That is why I suggested changing the delay to 0.05. As long as the FPS is at least 20, the delay will be about the same. Of course the delay will be more when the FPS is lower, but that isn't worth worrying about as you don't want your FPS to be that low anyway.

A distance loop probably wouldn't be any more accurate. You are still limited by FPS.

In OFP bullets were only 'updated' at 20FPS, no matter what the FPS the game was being rendered at.

Also, maybe even better use:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

sleep 0.05*acctime;

That will make sure that even when the game is running in slow motion (such as cutscenes/film making) the tracers will still look smooth.

If bullets are still updated at 20FPS as in OFP, then I don't think there is any use using a delay of less than 0.05 seconds as it just increases load on the PC a bit.

Edit:

Used eliteness to open ArmA's main config.bin. Under Class CfgAmmo I found

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

simulationStep = 0.05;

So it looks like bullets in ArmA are updated 20 times a second just like in OFP.

1 frame sleep (20FPS, 1frame = 0.05, 40FPS, 1 frame = 0.025) can already be too much, so in any case I would like to be able to make a smaller delay than 1 frame.

If a while loop does not sleep 1 frame per loop, then depending on the instructions, a while loop should theoretically be able to loop multiple times within 1 frame creating the possibility to have a better management/controlability over the time between shooting and tracer appearing.

The bullets positions updating only 20times per second, I will do some tests with it, but ur theory seems to be backed up by the findings you did indeed smile_o.gif

Which would throw whole my idea out of the Window

Ty for the tip on Acctime biggrin_o.gif

Share this post


Link to post
Share on other sites
...so in any case I would like to be able to make a smaller delay than 1 frame...

A smaller delay wont do any good. I assume you saw the edit in my last post. Besides, a person can't see an effect before the frame is actually rendered.

The bullet will have only moved away from the point on the barrel after 0.05 seconds, even if the PC is getting a higher FPS than 20. So if the FPS is, for example, 40 and you put a really small delay like 0.001 or even 0.025, then the tracer will (well, in theory, but it could be hard to see) appear at the tip of the barrel for a small fraction of a second. Most likely this is the tiny glitch I reported earlier. After 0.05 seconds the bullet will be at it's next point, and that's a good spot to start the tracer.

If you use a delay smaller than 0.05, then you are just creating extra loops in the script that wont be doing anything useful.

I don't think a while loop would sleep for 1 frame, it should only sleep with the sleep command. But if you don't have a sleep command and get ArmA into an infinite loop then the game should freeze.

Share this post


Link to post
Share on other sites
A smaller delay wont do any good. I assume you saw the edit in my last post. Besides, a person can't see an effect before the frame is actually rendered.

The bullet will have only moved away from the point on the barrel after 0.05 seconds, even if the PC is getting a higher FPS than 20. So if the FPS is, for example, 40 and you put a really small delay like 0.001 or even 0.025, then the tracer will (well, in theory, but it could be hard to see) appear at the tip of the barrel for a small fraction of a second. Most likely this is the tiny glitch I reported earlier. After 0.05 seconds the bullet will be at it's next point, and that's a good spot to start the tracer.

If you use a delay smaller than 0.05, then you are just creating extra loops in the script that wont be doing anything useful.

Jep, as in my reply stated: Your 20fps bullets-story kinda craps up my wishes biggrin_o.gif

Good one about the not being able to "see" the tracer before the frame is actually rendered smile_o.gif

btw "simulationStep = 0.05;", must still be related to the FPS of the machine, meaning that the time between the updates can be different, or are they somehow always rendering at exactly 20FPS? (I'm such a knob in theory wink_o.gif)

Quote[/b] ]I don't think a while loop would sleep for 1 frame, it should only sleep with the sleep command. But if you don't have a sleep command and get ArmA into an infinite loop then the game should freeze.
Jip smile_o.gif Ergo; If anytime used, make sure you don't create an infinite loop biggrin_o.gif

Share this post


Link to post
Share on other sites
btw "simulationStep = 0.05;", must still be related to the FPS of the machine, meaning that the time between the updates can be different, or are they somehow always rendering at exactly 20FPS? (I'm such a knob in theory wink_o.gif)

I guess if the FPS of the machine is lower than 20, maybe the time between bullet updates will be lower than 20. But that's not an issue here as the sleep delay can't be less than 1 frame anyway.

I doubt that the bullets will be updated at more than 20FPS, otherwise there wouldn't be any point in that config entry.

As a definitive test to see if that entry is used, you could try lowering it to see if it makes a difference. Maybe I will test it if I'm really bored sometime.

Share this post


Link to post
Share on other sites

sickboy, did you change rifle tracers back to one in every three rounds? I'm seeing tracers out of my M4 again!

Share this post


Link to post
Share on other sites

Over the weekend I will look into the idea about difficulty settings... If anyone has any comments or ideas please hurry ;-) I hope to be hit the final release v0.1 in the weekend :-D

sickboy, did you change rifle tracers back to one in every three rounds? I'm seeing tracers out of my M4 again!
No. Plz review six_tracers.hpp to disable the SPcfg. I guess that's another one of those 'features' that are supposed to be on the list of "disabled-per-default".

Share this post


Link to post
Share on other sites
...If anyone has any comments or ideas please hurry ;-)...

I've got nothing left tounge2.gif

Looking forward to the final release smile_o.gif

Share this post


Link to post
Share on other sites
... I hope I can finally drop this RC act and get over with the final v0.1 (I know, after repeating that at least 3 times it does start to sound funny biggrin_o.gif)

hm wink_o.gif sometimes I had the impression the tracers were off.

I did some more testing, reducing tracer rate to 1 and testing at different conditions.

with increasing frame rate you get more wrong tracers, I finally moved out to an small island (60 frames per sec.) and fired a few meters in front into the ground. Nearly all tracers were some meters above the gun!

do tracers have a collision model? If yes, is it required? The engine moves stuff on creation to avoid collision.

Also the 0.05 delay might be a good idea!?

Another issue I had with RC3, I tried a downloaded mission and the game got slower and slower, looked like some mission scripts were colliding with the six_misc functions. Might be solved by having them disabled by default.

QuietMan

Share this post


Link to post
Share on other sites

Ty for the report Quiet Man:

Collision with other scripts; As good as impossible, if you would have some names it would make a lot of things more easy. Also, we're these problems not there when the SIX_* Addons weren't loaded, in the same missions, same situation?

Collision is disabled inside the model, i'll look into the config to see if there are options I can toy with to change the behaviour. After I done that I will toy with the sleep as discussed earlier.

Btw, we're on RC4, please do not report problems of older versions ;-)

Share this post


Link to post
Share on other sites
Ty for the report Quiet Man

your welcome notworthy.gif

Quote[/b] ]Btw, we're on RC4, please do not report problems of older versions ;-)

that's why it was more a side note than a bug report wink_o.gif

QuietMan

Share this post


Link to post
Share on other sites
Ty for the report Quiet Man

your welcome notworthy.gif

Quote[/b] ]Btw, we're on RC4, please do not report problems of older versions ;-)

that's why it was more a side note than a bug report wink_o.gif

QuietMan

Roger mate, I assumed you were testing RC4 but better be sure ;P

@MaddMatt, difficultyEnabled Tracer settings:

Looked into the difficultyEnabled function. Been thinking about the implementation but I think that I should Enable/Disable the whole addon based on this setting, and not only rifle tracers.

My reasons for this that the difficulty setting originally is to disable/enable ALL tracers. It's not fair if you can see tracers even if it's not Rifle tracers (but mg, vehicles etc), while the rest of the server can not. The only fair outcome in this case would be to disable/enable all tracers, based on the tracer difficulty setting, which should be the same for everyone in a server.

Pulling this further down, it should also mean that I should enable the Rifle Tracers by default, while people have the ability to change it for themselves in SP through the SIX_TracersCfgSP. And the additional possibility for mission makers to change the settings for everyone in MP.

In desperate need of your opinions :-)

Share this post


Link to post
Share on other sites
@MaddMatt, difficultyEnabled Tracer settings:

Looked into the difficultyEnabled function. Been thinking about the implementation but I think that I should Enable/Disable the whole addon based on this setting, and not only rifle tracers...

Actually it does only disable rifle tracers. Vehicles and heavy MGs still fire tracers, I just tested this. Though the M249 has it's tracers disabled, I guess because it's not a heavy MG like the M240 or because it uses the same ammo as the M4 and M16.

It's called rifle tracers for a reason wink_o.gif

The setting works as it should, except for the M249 but maybe that's intentional.

Share this post


Link to post
Share on other sites

A suggestion, can you make the tracer thicker for the tank rounds? They seem to be the same thickness as a Mg round

Share this post


Link to post
Share on other sites
@MaddMatt, difficultyEnabled Tracer settings:

Looked into the difficultyEnabled function. Been thinking about the implementation but I think that I should Enable/Disable the whole addon based on this setting, and not only rifle tracers...

Actually it does only disable rifle tracers. Vehicles and heavy MGs still fire tracers, I just tested this. Though the M249 has it's tracers disabled, I guess because it's not a heavy MG like the M240 or because it uses the same ammo as the M4 and M16.

It's called rifle tracers for a reason wink_o.gif

The setting works as it should, except for the M249 but maybe that's intentional.

Arghh... my bad indeed, feeling stupid atm!! Never looked at the tracer difficulty setting (idiot!! smile_o.gif), as such I thought it was simply called "Tracer Difficulty Setting". The term "Rifle Tracers Enabled/Disabled" came from the Tracer Mod itself biggrin_o.gif

Anyway, that simply discards my points completely ;-)

On the way to implementation, also fixed is:

[*] Delay of tracers appearing

[*] The tracer ammo count check was off by 1 bullet, so the tracers appeared "out-of-sync" with the real ammo count smile_o.gif

Quote[/b] ]A suggestion, can you make the tracer thicker for the tank rounds? They seem to be the same thickness as a Mg round
Heya, they are as big as the bigger guns tracers, not the 7.62 and lower. There was a discussion going on that the current one is actually too big because the part of the sabot where the tracer-material is attached, is actually as big or even smaller than the 30mm AA etc guns, but my memory is a bit cranky on these details.

I can ask the modeler to make bigger ones anyway and include them, so you can for instance change the settings for yourself personally in the SP configuration in SIX_Misc.hpp or the SIX_TracersCfg.hpp for Multiplayer (on a per mission basis).

An example of how such configuration would be, if the new bigger tracer would be called: "ExtraBig" (I knew I should've just used the sizes for names :P)

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Sh_120_HE

{

SIX_tracerSize = "ExtraBig";

};

class Sh_120_HE: Sh_120_HE {};

class Sh_120_SABOT: Sh_120_HE {};

class Sh_125_HE: Sh_120_HE {};

class Sh_125_SABOT: Sh_120_HE {};

(and there's a similair method for MP but it requires configuration on a mission level, --> ReadMe)

If others agree with your points, I can configure them per default like that of course.

Share this post


Link to post
Share on other sites
Arghh... my bad indeed, feeling stupid atm!! Never looked at the tracer difficulty setting (idiot!! smile_o.gif), as such I thought it was simply called "Tracer Difficulty Setting". The term "Rifle Tracers Enabled/Disabled" came from the Tracer Mod itself biggrin_o.gif

Anyway, that simply discards my points completely ;-)

On the way to implementation...

Haha, well at least it's cleared up now. But there is still the problem of the M249. For things to be fair against players not using the mod, it will have to also go without tracers when the rifle tracers are disabled confused_o.gif

Share this post


Link to post
Share on other sites
Haha, well at least it's cleared up now. But there is still the problem of the M249. For things to be fair against players not using the mod, it will have to also go without tracers when the rifle tracers are disabled confused_o.gif
No problem, just an extra consideration ;-)

6thSense.eu "Pack1" v0.1 RC5

Tweaked most of my functions and some of the logics.

RC5 Changes

Tracers

[*] Added SIX_tracerDiff setting to Weapon classes, this setting can be used to make the "Rifle Tracers Enabled" dependent on your own "Rifle Bullet Tracers" difficulty setting in the ArmA Options. In case of MP it takes the setting from server. Thanks goes out to MaddMatt for the idea, not to mention his determination ;-)

[*] Rifle Tracers are enabled by default, unless as described above, the Rifle Tracers Difficulty setting is set to Disabled.

[*] SP Configuration is disabled by default (check SIX_Tracers.hpp).

[*] Using a pause of 0.05 seconds (~) to make sure the tracers do not appear to close to the barrel. Again that MadGuy ;-)

[*] Extra performance considerations in place, altough if they are measurable; you tell me

Personally I am not so happy with the sleep 0.05 effect, the tracer appears now too late to my taste.

I'll try to tweak it to my taste and share the value so others can check it too if they want.

As mentioned earlier, a setting for this might not be a too bad idea, possibly biggrin_o.gif

Concerning the model/config class properties on collision etc; looking into it biggrin_o.gif

Concerning Extra FX on the tracers and when tracers hit the ground, bigger sized tracers etc. I would like to keep those for v0.2, I think I should get out of this RC-stage like yesterday biggrin_o.gif

Share this post


Link to post
Share on other sites

Okay, I hit the sweet-spot at: sleep 0.01;

(Tested under FPS ~85, ~40 and ~25)

Let me know smile_o.gif

@MaddMatt, I know you have ur theory on the bullets update per 20fps etc. Still I notice a "jump" difference between 0.01 and 0.05. It seems that the numbers inbetween either appear to look exactly like 0.01 or when closer to 0.05, they appear to look exactly like 0.05 smile_o.gif

Share this post


Link to post
Share on other sites

The tracers appear way to far away now. Like 20 or so meters after they leave the barrel. I think the old one was better. (Tracer starting at the tip of the barrel would be the best though.)

Share this post


Link to post
Share on other sites
@MaddMatt, I know you have ur theory on the bullets update per 20fps etc. Still I notice a "jump" difference between 0.01 and 0.05. It seems that the numbers inbetween either appear to look exactly like 0.01 or when closer to 0.05, they appear to look exactly like 0.05 smile_o.gif

Makes me wonder if the sleep command is accurate. It could be waiting a bit more than that delay. In that case, you could probably also change the first delay to something smaller than 0.05 to make tracers appear closer to the barrel.

I actually had a look at some of my old scripts for OFP, and among them is an old tracer effect. It's made using the drop command (and the actual particle effect is someone else's work), so it has a big hit on performance when many units open fire. In that I used a delay of 0.025 for the loop. It was so long ago since I even looked at these scripts, guess at the time I found 0.025 to be the best delay.

What happens in theory != what happens in practice tounge2.gif

A couple proposed changes to SIX_tracer_life.sqf:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

private["_pr","_tr","_life"];

_pr=_this select 0;_tr=_this select 1;

// Sleep about 0.05 to make tracers appear at the right position, will ALWAYS at LEAST sleep 1 frame

sleep 0.05;

_life=time+(_this select 2);

while{alive _pr&&time<_life&&speed _pr>100}do

{

_tr setVectorUp (velocity _pr);

_tr setPos (getPos _pr);

sleep 0.01;

};

deleteVehicle _tr;

to

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

private["_pr","_tr","_life"];

_pr=_this select 0;_tr=_this select 1;

_life=time+(_this select 2);

while{alive _pr&&time<_life&&speed _pr>100}do

{

sleep 0.025;

_tr setVectorUp (velocity _pr);

_tr setPos (getPos _pr);

_tr setVelocity (velocity _pr);

};

deleteVehicle _tr

Now you only have 1 sleep command. Not much point, but the more optimization the better biggrin_o.gif

I put in the 0.025 delay, but I'm not sure how well that will work. Worked well for my old OFP tracers as far as I remember. The setvelocity command could make the tracers movement look smoother at higher FPS, but it might cause more trouble than it's worth. Just put it in there if you feel like experimenting with it.

Real tracers don't ignite instantly, so maybe it's better to have that small delay at the start. Maybe let the guys who know more about this comment on it.

Share this post


Link to post
Share on other sites
The tracers appear way to far away now. Like 20 or so meters after they leave the barrel. I think the old one was better. (Tracer starting at the tip of the barrel would be the best though.)
And how do you look at it when reading all the reasons and background about it? Still, they appear too far atm as described in one of my posts. 0.01 did a lot better.
Quote[/b] ]Now you only have 1 sleep command. Not much point, but the more optimization the better biggrin_o.gif

I put in the 0.025 delay, but I'm not sure how well that will work. Worked well for my old OFP tracers as far as I remember. The setvelocity command could make the tracers movement look smoother at higher FPS, but it might cause more trouble than it's worth. Just put it in there if you feel like experimenting with it.

1 Less sleep command, for the price of:

[*]1 extra command in the loop (Altough I guess we can put that under "thats to make up for the 0.025 as opposed to 0.01 sleep" :-)

[*]No Possibility to "Configure" the delay between firing+ignition (As you configure the loopsleep+delay as one)

[*]_life needs an extra: +0.025 to make up for the ignition time because the _life is calculated before the sleep command instead of after

[*]While conditions are checked before sleep, instead of after. This should not give problems, but the conditions make more sense to check after the sleep, if you get my idea smile_o.gif

I hardly see the improvement mate ;-)

Btw IIRC the spawn command also adds a short delay, altough I haven't measured how long yet, this possibly has some effect on where the tracer ignites smile_o.gif

I will however toy with your 0.025 sleep altough as I just wrote deep in the night, I hit the sweetspot at 0.01, and that was after 3 hours of testing 0.00001 0.0001 0.001 0.005 0.008 0.01 0.02 0.03 0.05. Is yours based on try-outs, or just on old ofp-scripts?

Share this post


Link to post
Share on other sites
I will however toy with your 0.025 sleep altough as I just wrote deep in the night, I hit the sweetspot at 0.01, and that was after 3 hours of testing 0.00001 0.0001 0.001 0.005 0.008 0.01 0.02 0.03 0.05. Is yours based on try-outs, or just on old ofp-scripts?

Old OFP scripts, I haven't experimented with changing your addon yet. I haven't given the latest version of the tracers much testing, but I will today. If you've already tested other values, then maybe just leave it as it is. The tracers don't seem to have much of a performance hit anyway.

Share this post


Link to post
Share on other sites
Old OFP scripts, I haven't experimented with changing your addon yet. I haven't given the latest version of the tracers much testing, but I will today. If you've already tested other values, then maybe just leave it as it is. The tracers don't seem to have much of a performance hit anyway.

Ok mate, thanks smile_o.gif

I'm happy you run through the scripts to look for improvements anyway.

Share this post


Link to post
Share on other sites

hey sickboy -

first, smashing addon... hands down. love your work

questions:

1. say i wanted to make the m249 fire a tracer every other round, what is the path to the config to do so?

2. i noticed the tracers deflect. if i where to update the bis default weapons config to deflect = 90%, would the be reflected in your tracer mod OR would i have to make deflect = 90% somewhere in your config.

3. i read somewhere that this will increase fps? is this true when using your tracer mod? by that meaning your replacing bis's default crappy tracers with this one will that help increase fps?

thanks in advance for reading thru my questions, and thank you for all the hard work you've done to bring more life to this wonder game.

Share this post


Link to post
Share on other sites
questions:

1. say i wanted to make the m249 fire a tracer every other round, what is the path to the config to do so?

2. i noticed the tracers deflect. if i where to update the bis default weapons config to deflect = 90%, would the be reflected in your tracer mod OR would i have to make deflect = 90% somewhere in your config.

3. i read somewhere that this will increase fps? is this true when using your tracer mod? by that meaning your replacing bis's default crappy tracers with this one will that help increase fps?

thanks in advance for reading thru my questions, and thank you for all the hard work you've done to bring more life to this wonder game.

Quote[/b] ]hey sickboy - first, smashing addon... hands down. love your work
Thanks mate smile_o.gif

1. enable the SP configuration in SIX_Tracers.hpp

and add the M249 to the cfgWeapons config:

class M249

{

SIX_tracerPer=1;

};

for MP Mission configuration check SIX_TracersCfg.hpp, which you need to include in all ur missions.

2. No configuration needed, Tracers follow bullet trajectory

3. Prolly Bullshit :-)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×