Get your own planet in online strategy Xcraft. Conquer the cosmic space, create your own empire! QUICK START (2 minutes): for Humans or for Xerjs +2500 of metal +2500 of minerals

Now: 22 October 2019 16:38
Responsible: Семен  

Pirate domination

Post  Post #1 
Reputation 6
Group xerj Alliance Experience 22 12 36 Points 945 573 Messages 636
Warnings
Hi,

the description of pirate domination says that the OPS around my planet gets the resources that are drained from my planet. This is wrong. No resources from pirate domination count towards the resources on the OPS.

Pirate domination description: http://prntscr.com/odvhzo
Resources on the OPS after a couple of days with pirate domination: http://prntscr.com/odvi5r
Third class award

Third class award

This award can be exchanged for fleet award. It is issued for assistance in addressing bugs in game.

Reward issued by: Семен

12 July 2019 04:04
12 July 2019 04:04
Post  Post #2 
Reputation 63
Group Terminator Alliance Experience 26 5 9 Points 7 168 013 Messages 2628
Warnings
Tii, Thanks, issue solved

UPD. Not solved, closed by mistake
12 July 2019 13:33
12 July 2019 13:33
Post  Post #3 
Reputation 63
Group Terminator Alliance Experience 26 5 9 Points 7 168 013 Messages 2628
Warnings
We made it work such way. Calculating production is a one of most resource-intensive part of our game. We do as many optimization as we can. 

It is very easy to do tribute subtraction from player`s planets and it is very hard to do resource`s addition to NPC`s planets. So I just did subtraction`s part and "throw" you resources away.

You can think that pirates wasted you resources on drinks, ladies and other cool stuff.
15 July 2019 22:37
15 July 2019 22:37
Post  Post #4 
Reputation 6
Group xerj Alliance Experience 22 12 36 Points 945 573 Messages 636
Warnings
In case you do not have it like this yet, I would have an idea for an optimization.

Do not calculate the resource production often. Calculate it when a production-influencing value changes and save the result.
Then only work with the result instead of calculating it anew every time.
Only update the result when a production-influencing value changes.


Production-influencing values are:

Building levels (build/destroy) of res prod
Researches (for example vespene research of xerjs)
Alliance taxes
Dominance taxes
OPS appears/disappears
Dues (taken capital key)
A couple of Medals
Planet colonization (important for imperium view's total)
A couple of officers/mutants/elders
Amortization
Depletion

I think you get what I mean with it. Only when one of this values changes re-calculate the stored results. If the implementation of this is possible it should significantly reduce the necessary calculations.

Just an idea..


Addition:  I was bored and made you a drawing..
http://prntscr.com/ofkyq6
15 July 2019 22:55
15 July 2019 22:55
Post  Post #5 
Reputation 63
Group Terminator Alliance Experience 26 5 9 Points 7 168 013 Messages 2628
Warnings
Thanks Tii, you just described our algorithm)
16 July 2019 08:48
16 July 2019 08:48
Post  Post #6 
Reputation 6
Group xerj Alliance Experience 22 12 36 Points 945 573 Messages 636
Warnings
Alright :)
Then I know where we stand. And I wouldn't call this "bad" for a first guess ;)


I don't know how others feel about this but I personally would not mind if my resources are updated once every 15 seconds rather than being permanently up to date. 30 seconds would be fine too I guess but 60 seconds should be considered too long. If this is a improvement mostly depends on if you're really calculating the resources for every second or if you're only updating on user access, which could be considered a option too to save resources.

There also is another, a little crazy, idea I had. You basically have a network of at least 800 permanently connected computers which would be able to calculate the resources, instead of the server doing it, in advance for the players and the database only applies the pre-calculated values at the correct time. This would completely remove the servers need to calculate the resources and freeing a lot of capacities. On the other hand this slightly increases the load on the database. This idea would work even smoother when paired with the first idea of updating the resources only once in a while rather than permanently.
16 July 2019 09:28
16 July 2019 09:28
Post  Post #7 
Reputation 63
Group Terminator Alliance Experience 26 5 9 Points 7 168 013 Messages 2628
Warnings
We can`t trust those 800 computers. And we do not update frequently we just store start time and resources speed, so we just update when player updates page, if player offline we do not update production.

Pirate domination was a fast solution, I had a limited time to make this feature and as I know we don`t have plans to upgrade it to something better.

So it is definitely not a bug we made it work such way... booze, ladies...
16 July 2019 13:30
16 July 2019 13:30

Information

You are not authorized

1 users are reading the topic (guests: 1)

Users: 0

Xcraft is a free browser strategy game with unique combat system.
Battle demonstration >>
Registration >>

2009 — 2519