facebook

Welcome guest! You are not logged in on forum, so you may not have access to some features!
To solve this problem
log in or register new account.
>> NFS:SA Booster <<

Rain Suggestion (?)

Napisany przez MisterJohnson, 10-11-2017, 05:49
Rain Suggestion (?)

Offline MisterJohnson

#6
(10-11-2017, 18:26)Sardyna153 Wrote: It will lag so no

I'm on a 2nd generation i3 notebook, without any videocard, on superbly overused DDR2 3GB ram, this notebook is crippled to the point of not being able to run without having this cooling platform under it, the battery is gone and it runs always plugged to eletricity, I'm using this kind of hardware and I know when something will lag...

if you read carefully the topic, you'll notice that there won't be any rain on freeroam, which is a relief, the suggestion is about rain during races, 4 drivers, rain won't affect frame rate as much as seeing 8-10 drivers with several layers of vinyl on their cars

(10-11-2017, 22:31)Ice Wrote: I can't know what exactly is going on script-wise on server but believe me, I have pretty good idea of what kind of dark voodoo magic it is. Hence why I'm not sure why would you need to make it even more complicated, while you can either make script which would randomly enable/disable rain, or keep a slave staff member who would do it manually.

Well, you say that you don't know why I'd like to make the script even more complicated, but tell me something...did you like DYNO? did you like URL? the new car parts, etcetera? well I have a surprise for you, these features do make the gamemode mode complex.

About making a script which I could activate manually is pretty much the thing I'm suggesting here, the "manual" activation would be useable on custom racing, being able to select if the race you created is going to be raining to the 4 participants or not...the random thing which you're talking about isn't quite complicated aswell...

As a programmer, I'm sure the only difficult thing would be optimizing the rain effects, randomly choosing whether its going to rain isn't as hard as you think, it follows a pretty simple algorythm...He will need a rain function and a random number function, I'm not familiar with .lua or gta particle editing, though, the random number isn't something hard to do which in C++ is roughly:

"srand((unsigned)time(0));
int result = rand()%100;
cout << a+1 << endl;"

this function gives numbers from 1 to 100, so, before a quick race start, this is ran once on the following conditions..

First, the sum of the driver's car scores are divided by the amount of players, and this variable would be known as "room score", so, there's a switch here...a conditional branch which will make diferent results based on the conditions>

Switch(WillItRain)
case(room score < 251) "there will be no rain, WillItRain = false"
case(room score > 250 && < 301) "the random number function is called, if its above 90, its gonna rain, WillItRain = true"
case(room score > 300 && < 401) "the random number function is called, if it's above 85, its gonna rain, WillItRain = true"
case(room score > 400) "the random number function is called, if it's above 80, it's gonna rain, WillItRain = true"

Right aftewards another conditional branch is ran:

If (willItRain = true) {
"the random number function is called, if the number is below 51, it will be a simple rain race, if it's higher than 50 its a "clear / rain" race, if the number is between 50 and 65, between 65 and 80, 80 and 90 then 90 and 100, will determine which of the 4 kinds of "clear / rain" weather variations I stated on the suggestion"
}

so, not a big deal so far, the next thing is to define when it starts raining, a simple solution is at hand, we need a reference to determine when its going to start raining or stopping, the random number dice will roll numbers between the mentiond values on the suggestion, to determine the small variation of when the rain starts or stops, the reference will be a top time...but..which top time? we need to select a class, I would select the most class that has more cars on the race, case there are 4 cars of different classes, I'd take a C class top time, which is pretty balanced at this case...
so, I could write stuff out but it would be useless since MTA doesn't uses C++, but I'm pretty sure that the only thing that changes are the syntaxes, the algorythm is pretty much the same
Reply


Messages In This Thread
Rain Suggestion (?) - by MisterJohnson - 10-11-2017, 05:49
RE: Rain Suggestion (?) - by Ice - 10-11-2017, 05:55
RE: Rain Suggestion (?) - by MisterJohnson - 10-11-2017, 06:20
RE: Rain Suggestion (?) - by Sardyna153 - 10-11-2017, 18:26
RE: Rain Suggestion (?) - by Ice - 10-11-2017, 22:31
RE: Rain Suggestion (?) - by MisterJohnson - 11-11-2017, 00:57
RE: Rain Suggestion (?) - by Ice - 11-11-2017, 14:16

Forum Jump:

Users browsing this thread:
1 Guest(s)