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

View Distance Module #1063

Merged
merged 32 commits into from
May 14, 2015
Merged

View Distance Module #1063

merged 32 commits into from
May 14, 2015

Conversation

simonamdev
Copy link
Contributor

After two days and several stupid questions on the slack chat I'm happy with the progress I've made in this.

Everything works, except for GVAR(moduleViewDistanceLimit) which is always returning ANY, as discussed in slack chat.

@simonamdev
Copy link
Contributor Author

An improvement for performance would be to add https://community.bistudio.com/wiki/setObjectViewDistance, maybe at a preset co-efficient of the viewdistance, so it scales accordingly.

Example: OVD = 0.75 * VD

class GVAR(viewDistanceLimit) {
typeName = "SCALAR";
value = 11; // setting the highest number in the array below means no limit.
values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; // correspond to the INDEX values
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be strings, until we support other types in the options menu.

@simonamdev
Copy link
Contributor Author

Reworked a number of things as per comments and @esteldunedain 's advice on slack. My module value is still not being read and is always taking the default value of whatever there is specified in the config instead of taking the value in the module and overwriting GVAR(limit).

@simonamdev
Copy link
Contributor Author

Module bug fixed thanks to @esteldunedain

private["_land_vehicle","_air_vehicle"];

_land_vehicle = (vehicle player) isKindOf "LandVehicle";
_air_vehicle = (vehicle player) isKindOf "Air";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

player should be ACE_player

private ["_return"];

_return = switch (_index) do
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust to match our style:

_return = switch (_index) do {

Also use 4 spaces for indentation.

@nicolasbadano nicolasbadano added the kind/enhancement Release Notes: **IMPROVED:** label May 10, 2015
@nicolasbadano
Copy link
Contributor

Looks good. I'll try to test it ingame soon

@KoffeinFlummi KoffeinFlummi modified the milestone: 3.1.0 May 10, 2015
@nicolasbadano nicolasbadano self-assigned this May 14, 2015
@nicolasbadano
Copy link
Contributor

@Winter259, I've tried this and found a problem: setObjectViewDistance and setViewDistance work differently! (typical BIS)

setViewDistance is independent of the graphical settings, so it's safe to set it to e.g. 10000, while players with slower pcs can still keep their "graphical" view distance to lower values

However setObjectViewDistance changes the graphical settings and it's not independent. As a result, the object view distance usually ends up being increased on slower pcs, though creeplying the framerate.

To work around this, I think using setObjectViewDistance shouldn't be applied by default.

For this I have two ideas
1- We could add a simple user setting called "Dynamically change object view distance" that defaults off, and only do setObjectViewDistance if it's true.

2- Create a setting called "Dynamic object view distance" with the following options: Off, Low, Medium, High, etc. The default would be off, so no setObjectViewDistance is done at all. The rest of the setting would change this coefficient https://github.com/acemod/ACE3/pull/1063/files#diff-d46e67dfecb5d144b5dd575fa53e22c9R33.

I lean toward (2).

@Winter259, what do you think? Would you add this things or you prefer I do it before you refork?

@simonamdev
Copy link
Contributor Author

@esteldunedain I will implement option 2, I should (hopefully) not need to refork for this PR. Do these coefficients make sense?
Low: 0.33,
Medium: 0.66,
High: 1 ?

@nicolasbadano
Copy link
Contributor

Yes, but maybe add a couple more?

Very low: 0.20
Low: 0.40,
Medium: 0.60,
High: 0.80
Very High: 1.00

Centred prompts, fixed erroneous if statement, adjusted function
headers.
@nicolasbadano nicolasbadano merged commit 8c7d752 into acemod:master May 14, 2015
@nicolasbadano
Copy link
Contributor

Merged, thanks @Winter259 and congratulations

@simonamdev
Copy link
Contributor Author

Big thanks to you @esteldunedain and to everyone else on slack who put up with my questions 👍

@thojkooi
Copy link
Contributor

Could this be expanded with an toggle for enable/disable? Also this does not work reliably for JIP units. Should be expanded with a JIP event.

@simonamdev
Copy link
Contributor Author

I'll open another pull request for the above as I've since reforked my repo as it was broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants