Steemnova - correct base speed calculation for small cargos, bombers and recyclers
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.
(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:
After this was done the speed for the recycler in the database would need an update too:
Github-Links
Posted on Utopian.io - Rewarding Open Source Contributors
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
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
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