Page MenuHomeWildfire Games

nani
User

Projects

User does not belong to any projects.

User Details

User Since
Aug 18 2018, 10:57 PM (35 w, 5 d)

Recent Activity

Tue, Apr 23

nani updated the diff for D1631: TileClass optimization..
Tue, Apr 23, 1:03 PM
nani updated the diff for D1631: TileClass optimization..
Tue, Apr 23, 3:04 AM
nani added inline comments to D1631: TileClass optimization..
Tue, Apr 23, 3:02 AM

Sun, Apr 14

nani updated the diff for D1825: Resize (XML object) bar JS GUI addon.
Sun, Apr 14, 4:29 PM
nani created D1825: Resize (XML object) bar JS GUI addon.
Sun, Apr 14, 12:19 AM

Mon, Apr 8

nani awarded rP22171: Quarry stone a Like token.
Mon, Apr 8, 2:47 AM
nani retitled D1702: GUI addon to animate objects proprieties from GUI addon to animate objects proprieties. to GUI addon to animate objects proprieties.
Mon, Apr 8, 2:46 AM

Sun, Apr 7

nani updated the diff for D1702: GUI addon to animate objects proprieties.

Fixed all but the loop logic.

Sun, Apr 7, 10:20 PM
nani added inline comments to D1702: GUI addon to animate objects proprieties.
Sun, Apr 7, 10:03 PM
nani updated the diff for D1634: Fert random map..

Cleanup & made it a little more pretty.

Sun, Apr 7, 12:59 AM

Sat, Apr 6

nani awarded rP22164: [CSlider] On click move the slider-button to the mouse position a Like token.
Sat, Apr 6, 11:07 PM

Fri, Apr 5

nani updated the diff for D1702: GUI addon to animate objects proprieties.

Minor fixes from comments (will do bigger ones later) + gamesetup
example

Fri, Apr 5, 8:10 PM
nani added a comment to D1702: GUI addon to animate objects proprieties.
In D1702#74199, @bb wrote:

As elexis mentioned the color animation would in the vanilla game be dead code

Not committed but D1703 uses the three of them.

Furthermore it would help a lot when there was a simple test case, which uses this object already, something like the gamesetup options panel or so

Will try (or you could try the map browser diff D1703 which would show all the possibilities).

Fri, Apr 5, 4:04 PM
nani added inline comments to D1637: BoolArray array wrapper..
Fri, Apr 5, 2:31 PM
nani added a comment to D1637: BoolArray array wrapper..
MapSizesvnsvn + D1637 + D1631time reduction factor
MainlandNormal7.2 s2.3s3.1
MainlandGigant26.5 s5.8s4.5
Fri, Apr 5, 1:41 PM
nani updated the diff for D1786: Refactor input.js.

Follow up

Fri, Apr 5, 3:06 AM
nani updated the diff for D1786: Refactor input.js.

Follow up

Fri, Apr 5, 3:05 AM
nani added inline comments to D1786: Refactor input.js.
Fri, Apr 5, 2:59 AM

Thu, Apr 4

nani added a comment to D1637: BoolArray array wrapper..

This diff does two things: reduce the size of the memory allocated needed for the array and exploit the 16 bit type values to to check the binary information of upto 16 tiles in one go.
Would improve generated maps times by 3~4x times for all sizes if combined with the other diff of TileClass.

Thu, Apr 4, 7:22 PM

Fri, Mar 29

nani added a comment to D1786: Refactor input.js.

Btw, thanks for reviewing.

Fri, Mar 29, 6:55 PM
nani added a comment to D1786: Refactor input.js.

What uses the underscore?

None but given that the state can only be written with uppercase it might serve in the future as a word separator given that it doesn't conflict with the naming of the methods (but anyway I can just revert this change for now)

Defaults are an anti-pattern, because
(1) it means the caller omits mentioning the value, so when someone searches for the value, he won't find all matches
(2) the behavior of the default value might go unnoticed by the caller (assuming that default always fits because that's why it's the default) but mentioning the value makes the reader more critical as to whether the value is correct, and informs the reader directly which value is used.
(3) is all calls explicitly state the value, then it allows comparison between the calls, and in some cases one might find a better value than the default
That argument is mostly for function argument defaults function x(a, b = 123), I didn't investigate what you did with this default here, but I expect it will match the same pattern.

The default allows to ignore all the events that one might not want to process but still happen (e.g. if in a state "PLACING" you only want to process "onmousemotion" event and ignore all the other types of events) otherwise the FSM will warn you every time you try to process an event in that state that is not defined. Mostly the default method should be an empty function in this FSM case (unless we are talking about those two "default" that I had to define at "PRESELECTED" and "SELECTING.BOX" states given that I could not find a way to refactor them to non-defaults methods.
All in all, these possible unknown "default" calls that might happen can be easily seen uncommenting a warning in the FSM.js file to see what is being called at each processed event.

Fri, Mar 29, 5:56 PM

Thu, Mar 28

nani added a comment to D1786: Refactor input.js.

For now this patch moves:

  • INPUT_FOO
  • ACTION_FOO
  • the two big switch that evaluate the states (old fsm)
Thu, Mar 28, 8:47 PM
nani added a comment to D1786: Refactor input.js.

@Imarok

Thu, Mar 28, 8:35 PM
nani updated the diff for D1786: Refactor input.js.

Added a warning check

Thu, Mar 28, 4:02 PM

Wed, Mar 27

nani updated the diff for D1786: Refactor input.js.

Further cleanup, streamlined fsm states logic more.

Wed, Mar 27, 11:55 PM

Mar 27 2019

nani updated the diff for D1786: Refactor input.js.

Reupload (the formatter modified some unrelated lines)

Mar 27 2019, 3:14 AM
nani updated the diff for D1786: Refactor input.js.

Cleanup

  • Integrated all the ACTION_FOO into the FSM
  • Removed duplicated code
  • Moved most implementations specific methods to their corresponding files
  • Created corresponding functions calls to place/preview buildings/walls
  • Refactored double/triple click units selection
Mar 27 2019, 2:22 AM
nani added inline comments to D1786: Refactor input.js.
Mar 27 2019, 2:10 AM

Mar 26 2019

nani updated the diff for D1786: Refactor input.js.

Cleanup

  • Added minor helper functions
  • Removed duplicated code
  • Made easier to add new input events
  • Reorganized input states to a more logical naming/structure
Mar 26 2019, 5:27 PM

Mar 25 2019

nani updated the diff for D1786: Refactor input.js.

Cleanup

Mar 25 2019, 8:38 PM

Mar 24 2019

nani planned changes to D1786: Refactor input.js.
Mar 24 2019, 9:05 PM
nani updated the diff for D1786: Refactor input.js.

Turned the input events to a FSM from FSM.js (more o less)
Fixes #4848 and implements #2826

Mar 24 2019, 9:04 PM
nani awarded P133 Attempt at a better UI for external links a Pirate Logo token.
Mar 24 2019, 8:30 PM

Mar 19 2019

nani archived P137 gridBrowser + mapbrowser update + semi functional map browser diff.
Mar 19 2019, 7:15 PM
nani archived P136 Diff of GridBrowser + example.
Mar 19 2019, 7:15 PM
nani archived P135 Generic GUI Grid Paged addon .
Mar 19 2019, 7:14 PM
nani updated the diff for D1786: Refactor input.js.

Comments fixes.

Mar 19 2019, 12:54 AM

Mar 18 2019

nani updated the diff for D1786: Refactor input.js.

Added full context

Mar 18 2019, 8:52 PM
nani updated the diff for D1786: Refactor input.js.
  • Sent SDL codes to mod/gui/common (was a TODO).
  • Grouped related global variables and functions into an object.
  • Replaces var variables for let's.
  • Sent GUI events to input_events.js
Mar 18 2019, 2:59 PM

Mar 17 2019

nani accepted D1532: Reword the tooltip of the Disable Treasures option.
Mar 17 2019, 6:39 PM
nani added inline comments to D1532: Reword the tooltip of the Disable Treasures option.
Mar 17 2019, 6:35 PM

Mar 16 2019

nani updated the diff for D1702: GUI addon to animate objects proprieties.

Improved readability and code clarity.

Mar 16 2019, 10:09 PM
nani updated the diff for D1786: Refactor input.js.

Fixed from comments.

Mar 16 2019, 9:50 PM
nani added a comment to D1786: Refactor input.js.
In D1786#72871, @elexis wrote:

Would use arrow-functions while at it.

Mar 16 2019, 9:34 PM
nani added inline comments to D1786: Refactor input.js.
Mar 16 2019, 9:24 PM
nani added a comment to D1786: Refactor input.js.

Well my idea was to show this to test waters and see what people think of it, then I could refractor the rest if all is ok.

Mar 16 2019, 9:11 PM
nani created D1786: Refactor input.js.
Mar 16 2019, 7:29 PM
nani updated the summary of D1785: Custom building placement hotkeys + minor fix..
Mar 16 2019, 7:20 AM
nani added reviewers for D1785: Custom building placement hotkeys + minor fix.: elexis, ffffffff.
Mar 16 2019, 6:46 AM
nani created D1785: Custom building placement hotkeys + minor fix..
Mar 16 2019, 6:45 AM

Mar 6 2019

nani added a comment to D1781: Fix chat performance issue..

Still, it doesn't solve the problem of bloating the base object if we want to make a JS interface for each gui type.

Mar 6 2019, 9:01 PM
nani added a comment to D1781: Fix chat performance issue..

Not sure. But does look deceptively easy.

Mar 6 2019, 8:59 PM
nani added a comment to D1781: Fix chat performance issue..

Technically yes but I'm not sure it won't break something else (like the charts).

Mar 6 2019, 8:26 PM
nani added a comment to D1781: Fix chat performance issue..

The thing is I did look into to changing CText CTextOwnder and similar files but the current inheritance model that is made with is quite difficult to expand so I went for the most straight forward/short solution. Maybe composition over inheritance would give more leverage but that means a rewrite of the GUI.

Mar 6 2019, 8:06 PM
nani added a comment to D1781: Fix chat performance issue..
In D1781#72577, @elexis wrote:

As mentioned some polished version of the CList diff seems appropriate given that it relates to the TODO.

So can we have middle ground? The new method can be polished and use it at face value for the meanwhile so the chat doesn't hog the lobby.
All chat features will still be the same (needs that new extra tag to follow text bottom given that CList doesn't have it).
Nothing will change for the end user except 0ad being a little bit more performant. Not bad deal IMHO.

Mar 6 2019, 12:26 AM

Mar 4 2019

nani added a comment to D1781: Fix chat performance issue..

That means there is a textSmashup = chatHistory.join("\n") prior to that code, i.e. that the only thing you measure is the caption assignment?

Yes. I'm 100% sure c++ code is the problem.

So it takes 5 milliseconds for .caption = text if text is 500 lines long and 5ms equate to 1/200th of a second.
That is JSI_IGUIObject::setProperty which calls ScriptInterface::FromJSVal and GUI<CStrW>::SetSetting, the latter calls CText::SetupText(), which calls GetGUI()->GenerateText and computes the scrollbar properties.

So it's the GenerateText call on a 500line string that consumes 5ms?
But reading CList::AddItem, that also calls CList::SetupText which calls GenerateText for every item, but your diff replaces that call to a call to SetupTextLastItem removing all GenerateText calls except the one for the last item.
If there were numbers to back that up that would demonstrate that claim.

I did a chart in the previous demonstrating that is indeed GenerateText (what else could be? is clear as water that that for loop in GenerateText is unnecessary to add only another item-.-)

For instance one could call GenerateText to a 500 line string and see how much time that costs.

Already done in the chart.

I guess it's the parsing of the GUI tags that might take so long (linear complexity).

Parsing + text sprite generation

So if the analysis is correct, the SetupTextLastItem part of the diff might be correct to fix that removed TODO in CList.cpp (should just verify that one really doesnt need to rebuild texts or whatever else is rebuilt upon AddItem).

Now the remaining quesiton would be whether the same performance improvement could be achieved for CText and CInput.

Yes it can be done.

Perhaps they could store a vector of GeneratedTexts to implement an AddCaption with time complexity that has less than linear relation to the total caption length;
and then some day enable GUITag parsing for read-only CInputs, and thus make the chat both selectable and high-performant / O(1).

They already do have a vector, just needs someone to implement the JSinterface + methods for each case. :)

Mar 4 2019, 9:39 PM

Mar 3 2019

nani added a comment to D1781: Fix chat performance issue..

@elexis chat from the lobby for 2.5 h at sunday.

Mar 3 2019, 8:06 PM

Feb 26 2019

nani added a comment to D1781: Fix chat performance issue..
In D1781#72462, @elexis wrote:

If the slow part is the JS .join call concatenating and sprintf-formatting + 500 strings, we should remove that first and foremost (simply using .caption += new_line) before considering any C++ change.
It could be that this is already sufficient enough performance to provide sufficient performance.

I must say i haven't tried that (will try) but I'm 99% sure the problem is C++ given it needlessly deletes all computations as text parsing text sprite creation (expensive) and makes new ones for something which was already done.

Feb 26 2019, 9:33 PM

Feb 24 2019

nani added a comment to D1781: Fix chat performance issue..

Idk man.

Feb 24 2019, 9:04 PM

Feb 23 2019

nani added a comment to D1755: Fix line misaligment in gamesetup settings..

Will it get commited or do I need to change/do something? I made the change that broke it so I feel responsible :S

Feb 23 2019, 10:05 PM
nani added a comment to D1781: Fix chat performance issue..

@vladislavbelov is this ok?

Feb 23 2019, 10:01 PM
nani updated the diff for D1781: Fix chat performance issue..

Remove setting follow_last_if_visible as is orthogonal to the patch (will add in another patch if this goes through).

Feb 23 2019, 10:01 PM
nani added a comment to D1718: Decay/regenerate option for resources when not being gathered from.

There is a important difference between setTimeout and setInterval (at least in Node and web browsers in general)

Feb 23 2019, 9:16 PM
nani added a comment to D1781: Fix chat performance issue..
In D1781#72322, @elexis wrote:

The question is why this should become a CList to begin with

Feb 23 2019, 7:29 PM
nani added a comment to D1718: Decay/regenerate option for resources when not being gathered from.

This debounce thingy looks very nice, could be used in many places in gui.

Feb 23 2019, 6:40 PM
nani added inline comments to D1781: Fix chat performance issue..
Feb 23 2019, 6:24 PM
nani added inline comments to D1781: Fix chat performance issue..
Feb 23 2019, 6:22 PM
nani updated subscribers of D1781: Fix chat performance issue..
In D1781#72304, @elexis wrote:

So should optimize both performance and code complexity.

A little hard to add features without adding complexity. (can be refactored later tho but that's not the scope of this patch)

What is the performance critical part where FPS start to be dropped?

Having the lobby open for 1h (lots of comments on chat)

Is it the JS string building from the message history array or the passing of a long string?

Creates a big string from array.join("/n)

I.e. is Engine.GetGuiObjectByName("chat").text += newline similarly quick as the proposed diff?

First: += doesn't work as there is a JS <-> C++ conversion going on.
Second: even if it worked the C++ implementation would anyways delete all the list and make a new one.

Notice the session chat is not affected by this patch and it has to be rebuilt in case someone selects a different playerview or triggers the diplomacy colors feature (or muted/unmuted someone, or on other events).

Yep. Nothing can be done there (unless if <objects type="list"> is used for each filter but that sounds ugly.

I guess the lobby dialog UI performance is relevant FPS-wise because the lobby can be opened in-game.

Is not about the opening (first load) is about the accumulated text being added as if it were a whole new text each time.

Shouldn't selecting multiple lines of text become possible eventually? Would CList allow for that?

For the moment selected setting tag is a int type so no (an array of ints or a set could).

Feb 23 2019, 4:57 PM
nani updated the summary of D1781: Fix chat performance issue..
Feb 23 2019, 4:19 AM
nani created D1781: Fix chat performance issue..
Feb 23 2019, 4:18 AM

Feb 17 2019

nani updated the test plan for D1650: GridBrowser GUI addon.
Feb 17 2019, 2:38 AM
nani updated the summary of D1702: GUI addon to animate objects proprieties.
Feb 17 2019, 2:33 AM
nani updated the summary of D1702: GUI addon to animate objects proprieties.
Feb 17 2019, 2:32 AM
nani updated the summary of D1702: GUI addon to animate objects proprieties.
Feb 17 2019, 2:31 AM
nani updated the diff for D1702: GUI addon to animate objects proprieties.

Fixed some object references annoyance. Made sure shared animation settings don't get modified.

Feb 17 2019, 2:31 AM
nani updated the diff for D1703: Map browser for gamesetup.
Feb 17 2019, 12:47 AM
nani added inline comments to D1703: Map browser for gamesetup.
Feb 17 2019, 12:41 AM

Feb 13 2019

nani added a comment to D1778: More aura icons.
In D1778#72067, @Nescio wrote:

Basically that's what I did manually. To create _bonus and _penalty versions, I simply made two copies of the icon, pasting the bonus sprite on top of one and the penalty sprite on top of the other; costs about a minute, not much effort. And the icons are only a few kb each, so space is not really an issue.

Feb 13 2019, 12:23 AM

Feb 11 2019

nani added a comment to D1778: More aura icons.

Maybe instead of having a new icon for each bonus and penalty could be sprite combination of icon + bonus or icon + penalty combined? (would also make it easier to add new ones with less effort on the art side)

Feb 11 2019, 10:13 PM
nani awarded D1778: More aura icons a Like token.
Feb 11 2019, 10:03 PM

Feb 10 2019

nani updated the diff for D1703: Map browser for gamesetup.

@elexis I think is pretty much done now. Care to confirm? Thanks.

Feb 10 2019, 8:46 PM
nani updated the diff for D1777: Move map data to settings.js.
Feb 10 2019, 8:38 PM
nani updated the summary of D1777: Move map data to settings.js.
Feb 10 2019, 4:26 AM
nani created D1777: Move map data to settings.js.
Feb 10 2019, 4:18 AM

Feb 9 2019

nani added inline comments to D1703: Map browser for gamesetup.
Feb 9 2019, 6:10 PM
nani updated the diff for D1703: Map browser for gamesetup.
Feb 9 2019, 6:06 PM

Feb 8 2019

nani added inline comments to D1703: Map browser for gamesetup.
Feb 8 2019, 8:37 PM
nani updated the diff for D1703: Map browser for gamesetup.

@elexis changed code to reflect your comments and will refractor GameMap function if you think the rest of the code looks ok.

Feb 8 2019, 8:00 PM
nani added a comment to D1758: Smooth new Kushite background.

How about this?

Feb 8 2019, 6:27 PM · Contributors

Feb 7 2019

nani added inline comments to D1703: Map browser for gamesetup.
Feb 7 2019, 5:02 PM
nani added a comment to D1758: Smooth new Kushite background.

I can also feel the clouds move too fast relative to the city+river+desert+near mountain (looks like if the clouds are very close).

Feb 7 2019, 3:36 PM · Contributors
nani added inline comments to D1703: Map browser for gamesetup.
Feb 7 2019, 2:49 PM
nani updated the diff for D1702: GUI addon to animate objects proprieties.

Now can modify text color, object sprite color type and size.

Feb 7 2019, 4:13 AM
nani updated the diff for D1650: GridBrowser GUI addon.

Made coder more clear added some checks, functionality.

Feb 7 2019, 4:09 AM
nani updated the diff for D1703: Map browser for gamesetup.

Added search function, made code cleaner and made fixes mentioned by @elexis . Still not sure if we should show biomes previews.

Feb 7 2019, 4:08 AM
nani updated the summary of D1703: Map browser for gamesetup.
Feb 7 2019, 4:04 AM

Jan 27 2019

nani updated the diff for D1755: Fix line misaligment in gamesetup settings..

Back to how it was.

Jan 27 2019, 7:16 PM
nani added inline comments to D1767: Rewrite Profiler2's GUI using highcharts.
Jan 27 2019, 2:33 PM
nani updated the diff for D1755: Fix line misaligment in gamesetup settings..

Add the offset of 5.

Jan 27 2019, 1:02 PM
nani added a comment to D1766: Buildings shortcuts / hotkeys.
In D1766#71112, @elexis wrote:

Ticket somewhere. fpre has a similar patch too if Im not mistaken. The problem with this enumerating approach is that the player has to learn which number corresponds to which building, and that this is different for every civilization. My idea was to introduce more specific mappings, one key for the fortress, one for the house. To accomplish that, one could add a hotkey identifier to the template, or one could reuse the identity classes.

Jan 27 2019, 12:57 PM