[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Okay /b/ Game design and mathematical challenge Your character

The stories and information posted here are artistic works of fiction and falsehood.
Only a fool would take anything posted here as fact.

Thread replies: 8
Thread images: 1

File: Selectscr.png (225KB, 1481x790px) Image search: [Google]
Selectscr.png
225KB, 1481x790px
Okay /b/
Game design and mathematical challenge

Your character turns (turn-input * turnModifier) * turnspeed.

turnspeed lets assume is 300
turnModifier defaults at 1.
turn-input floats between -1.0 for left and 1.0 for right.


You can equip your character with items that hold percentages to modify your turning ability.
so if you have some item that gives you plus 40 percent turn

how do we solve?

40 / 100 = .4
turnModifier += .4 = 1.4 or "40 percent more"

But what if you equip multiple items that give you less modifiers? If you had 3 items that each knocked off 40 percent,
then you'd end up with -
(turn-input * -.2) * turnspeed
which may as well be
-(turn-input * .2 ) * turnspeed
so your modifiers may as well have stopped happening after 80.

How to handle this problem mathematically?
>>
If you can't handle this problem mathematically, you are in the wrong class.
>>
>>723080126
Look man. Nobody told me I'd be doing math when I signed up for this.

>jk
>I know I'm dumb and this should be easy

Something like,
store a new float,
make it the modifier float,
and make sure 1 is always added?
so if holdfloat = -.4
then
turn-Input * (holdfloat + 1) * turnspeed?
>>
please go to /sci/
>>
>>723080013
>>723080013
Let em stack. Lets say 40% of 1 is 0.4 less. Another 40% would be calculated with the first offset of 0,4 which means 0.16 then you calculate the second offset which would be 0,16 that one would give you 0,064. That means in total u'd lose 0,624 turnspeed => you have a remaining of turningspeed of 0,376. You could also add a cap where you stop lowering the value or add a deminishing value. Like first item 100% of the 40%, second one only has an effectivness of 80% of a percent value and so on.
>>
You should just force it to be minimum zero.
Accounting for more than 100% reduction in speed doesn't make sense imo, at least not in this case.

An increase of more than 100% may make sense, since there is no upper limit to speed (other than what you decide)
>>
>>723081509
Wait, I take that back.
If you have bonuses to speed that make you, for example, have 140% speed, then it would make sense to have a maximum of 140% reduction in speed. Except that's not how percentage works in some cases, so just do a flat out stacking of percentages and mathf.max(0, yourFinalSpeed) on the final value.
>>
>>723080836
so store a modifier float, newstep,
add 1 to that in the "* turnmod")
and instead of the next 40/100 i need (turnmod *(newStep/100) * (40 / 100)?
Thread posts: 8
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.