Jump to content
  • Latest updates

  • Newest Posts

    • What do you mean by that?
    • Discussion about the overkill situation brought me to this vague idea: consider more units at an equal range, so that units spread out their damage a little. Ideally, a target precision value could be stored in the templates (higher for archers, lower for skirms for example) and then used to influence the 'EntityDistanceOrdering' on certain calls to the range manager. (Things like choosing the closest unit don't need to be super precise and maybe shouldn't be wrt overkill). https://code.wildfiregames.com/source/0ad/browse/ps/trunk/source/simulation2/components/CCmpRangeManager.cpp#:~:text=class EntityDistanceOrdering,}%3B Perhaps some replacement for .CompareLengths() could be used with an optional precision value (0.1,0.5,1,3,5,10). Since stable_sort is used, maybe this would also be faster with more 'equivalent' values?
    • Just a quick note another big performance improvement in A27 will be with the removal of spectre and meltdown mitigations in spidermonkey which slow considerably the js execution. wraitii did a few other improvements iirc but not sure which got it and which got reverted. The one about messages could potentially be good if it worked ^^"
    • It's okay. Perserverance is all you need Regarding your interrogation I think by default everything is INVALID_PLAYER = -1 You might also print this.entity so you know which is which. Ideally in one statement warn("entity: " + this.entity + " Owner: " + cmpFoundationOwnership.GetOwner()); Or use string interpolation warn(`entity: ${this.entity} Owner: ${cmpFoundationOwnership.GetOwner()}`);   Maybe we forgot the edge case of QueryOwnerInterface not having an actual player    
    • For the first part: Yes it would be good to implement that. There is a ticket: #5323 For the second part: There is also a ticket #3752 Most computation isn't executed every turn (or in a constant turn interval), like a builder deciding what to do when a field is placed. Still some computation does that, like the AI deciding what to do. IIRC An AI only executs each 8th turn. With more frequent turns the constant-turn-interval tasks could be spaced out more. So the average computation is roughtly indipendant of the turn length. Engine things (rendering, network...) Isn't done per turn but per frame. In a cpu intensive game there is a turn every frame. So engine things could be seen as constant-turn-interval tasks. (This entirely refutes my previous argument )   There isn't one magical thing which makes the game run fast (in a single thread (multithreading really is magical (that's a joke magic doesn't exist ))) If you only care about game speed (your complain 1) you want do as few constant-turn-interval tasks. Thus longer turns. If you only care about a responsive UI (your complain 3) you want to do as few sim-things per frame as possible. Thus shorter turns. About your 2. complain: I think in such a situation the fast clients repeatetly have to wait for the slowest client. When a fast client ends it's turn it has to wait's for the slow client to finish the turn. In this time the fast client shows an interpolation (IIRC 5 frames) to the user. When the slowest client is really slow thous 5 frames aren't enough. A solution (which just came to my mind, it isn't elaborate) would be to space thous "interpolation-steps" out, like one interpolation-step each second frame. The interpolation-step / frame ratio should be dynamic to the expected speed of the slowent client. Maby also the interpolation-step count could be dynamic. (I'm just thinking loudly at this point)   We head in the direction of decreasing turn length even more:   Hosts can already specify the turn length by typing `Engine.SetTurnLength(100);` in to the js console. (yes the feature is hidden) I'd like to see the results of your experiments .
    • Just to summarize, after reading the previous discussion, I would be in favor of: Allow the host to change the turn rate (maybe a settings option). Make the game report the real speed the game is running at (as a moving average for example). Make the game indentify the player responsible for slowing down the game to its current speed. Just with those tools we could study the problem of setting an optimal turn rate in real games played in the lobby instead of speculating. I suspect the optimal turn rate will not be a single number set in stone for every type of game. There are plenty of smart players and hosts that can give feedback about how turn rate impacts games after a while of testing. I would not disregard that help from the community.  
    • I did this to the UpdateColor function :  UpdateColor() { // warn("UpdateColor"); let cmpFoundationOwnership = Engine.QueryInterface(this.entity, IID_Ownership); if (cmpFoundationOwnership) { cmpFoundationOwnership.SetOwner(cmpFoundationOwnership.GetOwner()); } warn("Owner : " + cmpFoundationOwnership.GetOwner()) let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual); if (!cmpVisual) return; const color = QueryOwnerInterface(this.entity, IID_Player).GetColor(); cmpVisual.SetVariable("colorr", color.r); cmpVisual.SetVariable("colorg", color.g); cmpVisual.SetVariable("colorb", color.b); // warn("red : "+color.r); // warn("green : "+color.g); // warn("blue : "+color.b); } I try to SetOwner at this moment but I think i'm doing it bad. I saw this function comes from a .cpp compoment and is quite simple. But how can I SetOwner the final building AND the foundation AND the preview ?  I'm testing many things but I don't understand why when I print the owner of my 2 civil_centre at the beginning of the game I have this :  It seems like the owner is changing 3 times before getting the right owner, maybe that is the problem Moreover, I'm not the best programmer in the team, that's why it's harder for me to understand these things, sorry for being a noob (Steph is not available)  
×
×
  • Create New...