Steemnova - correct base speed calculation for small cargos, bombers and recyclers

in #utopian-io6 years ago (edited)

Bug Fixes

What was the issue(s)?

As described in the issue mys created the base speed for various ship types should change according to the researched technologies.

Type Basespeed Technology New Speed
Small Cargo 5000 Impulse Drive lvl5 10000
Bomber 4000 Hyperspace Drive lvl8 5000
Recycler 2000 Impulse Drive lvl17 4000
Recycler 2000 Hyperspace Drive lvl15 6000

What was the solution?

The new speed is saved in the database in the column "speed2".
Therefore I needed to detect if the various technologies where having the right level for this shiptype.
If yes we would have to calculate the speed with the value of "speed2".
For this purpose I created a new variable $base_speed and stored the correct value in it.
image.png
(If you are wondering about the hardcoded value for the recycler: this is because to store the value in the database we would need another column and this was out of scope for now. )

I later used $base-speed to calculate the final speed:
image.png

After this was done the speed for the recycler in the database would need an update too:
image.png

Github-Links

Repository

Pull Request

Related Issue



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Thank you Vlad :)

Great contribution, pal. Thanks indeed.

I have achieved technology Impulse Drive level 5. I expected my small cargos to double their speed, but it seems they didn't. They might have increased speed 10%, perhaps, I'm not sure. But they haven't doubled speed.

Can you comment on this?

Hey there!

My coding was already accepted by @mys 2 days ago :)
So all we have to do now is to wait for it to be deployed on the live server.
I'm guessing it wouldn't take too long.
But maybe @mys can say more about when exactly this will happen :)

Greetings,
Martin

Exactly, the server isn't updated to most recent github repo yet.

Hey @mwfiae I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.19
TRX 0.13
JST 0.030
BTC 63850.79
ETH 3415.87
USDT 1.00
SBD 2.46