Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Timer optimisation
Author Message
Jhobean
Journeyman
*

Posts: 62
Likes Given: 8
Likes Received: 0 in 0 posts
Joined: Jun 2019
Reputation: 0



Post: #1
Timer optimisation
We have a BIG timer problem. 24h real time is in game 29h... So I trying to reduce the number of timer for helping the core.

Here I'll explain what I want to do to remove 4000 useless timer in our shard. Tell me if it's possible.

We have 4000 worldgem_bit spawning interactive item.
EX: A worldgembit for our magic mushroom. There a timer in the gembit for check if mushroom are in place and if not, it will replace the mushroom. THis part is normal.

WHere I think We can optimize is the mushroom itself. When the item is create, the item have a timer and set to decay. When timer go to 0, he go up again to 1800.... What the purpose of this timer??? Just taking ressource on the core?

Here the code of my mushroom

Code:
[ITEMDEF i_champignon_maudit]
DEFNAME=i_champignon_maudit
NAME=Champignons maudits
ID=i_crop_mushroom
weight 0.1

ON=@Create
Color=07ca

There is a way to optimize this? This solution will help to reduce the 5h offset in 24h.

Thx for your advice.

NOTE: For Info the offset problem is not present on X but there is other problem forcing us to come back on 56.

https://www.uocryptonite.com/
(This post was last modified: 02-28-2020 12:06 PM by Jhobean.)
02-28-2020 12:03 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 985
Likes Given: 5
Likes Received: 225 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: Timer optimisation
Worldgem bit need a constant timer running to keep spawning more objects when needed, when reach TIMER=0 it will do these checks and start the timer again to check again later, so you don't have to worry about this

But anyway, timer precision is a bit complex, because OS timer is based on CPU clock, which is based on CPU ticks, which is based on electricity. Sounds weird, but CPU tick is like electricity, it keeps "ticking" hundreds/millions times per sec (thats why CPU speed is measured in hertz = Hz/MHz/GHz), each tick takes about 10 to 16μs (microsecond), and since this number is not static, the tick counter can also drift a bit after millions of ticks, causing this difference between CPU clock and realtime clock

This also affect the OS and everything running on it. OS will rarely show wrong date/time on interface because it periodically connect on a external server to sync the date/time, but sphere doesn't do this, so it should deal with this timing difference

Honestly I don't know why the OS doesn't report the correct timer value to sphere, because sphere just reads the OS timer using the API provided by OS itself. But anyway on next sphere build (probably build 1035) I will do some tests changing this API, you can try using this build to check if it will get better results
(This post was last modified: 03-08-2020 04:13 PM by Coruja.)
03-08-2020 09:36 AM
Find all posts by this user Like Post Quote this message in a reply
Jhobean
Journeyman
*

Posts: 62
Likes Given: 8
Likes Received: 0 in 0 posts
Joined: Jun 2019
Reputation: 0



Post: #3
RE: Timer optimisation
Thx for your answer. I'll try next nuild for sure because 5 hour in 24h is long.

https://www.uocryptonite.com/
03-08-2020 09:56 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.