Page MenuHomeWildfire Games

elexis (Alexander H)
User

Projects

User Details

User Since
Dec 21 2016, 3:52 PM (121 w, 2 d)

Recent Activity

Yesterday

elexis added a comment to rP22197: Change Run Speed into a Run multiplier..

make the run multiplier optional and handle that specifically

That's what I was wondering about - whether there was a limit check in place before somewhere, I didn't find one from a quick look.

Fri, Apr 19, 10:19 PM
elexis added a comment to D1830: Const-correct the hierarchical pathfinder (D53 outtake).

const-correct

(I guess the previous code was not incorrect, but adding the const adds benefits)

Fri, Apr 19, 9:20 PM
elexis updated subscribers of rP22196: Correctly handle receiving 0 damage as not receiving any damage..
Fri, Apr 19, 9:13 PM
elexis added a comment to rP22197: Change Run Speed into a Run multiplier..

Formations have a 100 run multiplier which effectively sets their maximal walking speed at 100

https://code.wildfiregames.com/D438?id=7178#inline-34668

Sounds hackish

Indeed, why is that run multiplier 100 and not left undefined, or to be defined by the specific formations?

Fri, Apr 19, 9:10 PM
elexis added a comment to rP22196: Correctly handle receiving 0 damage as not receiving any damage..

Very informative description by Angen that was used in the commit message, thanks for writing and chosing that.
(I hope you have examined possible edge cases)

Fri, Apr 19, 8:17 PM

Sun, Apr 14

elexis updated subscribers of D1825: Resize (XML object) bar JS GUI addon.

@vladislavbelov should this code not be in other source/gui/ code where all the other GUI code is, for two reasons (1) cohesion and (2) performance (onTick)?
About (1), I suspect C++ has access to things that JS doesn't have access, but would either required or useful to be accessible / interactable / configurable in this context.
But I can't make a conclusion without having seen the thing in action.

Sun, Apr 14, 11:27 AM

Thu, Apr 11

elexis added a comment to D1637: BoolArray array wrapper..
In D1637#74458, @smiley wrote:

(Maybe add an iterator?, for something like tileclasses, it may not be relevant, but I assumed this was not to be restricted rmgen/ )

Thu, Apr 11, 11:51 PM

Wed, Apr 10

elexis accepted rP21957: Only update the gamesetup settings panel position when it actually changes..

I didn't test, but I guess it works as expected now. (I didn't figure out whether the bugfix is the cleanest way, I suppose I can still do another concern if it was that bad.)

Wed, Apr 10, 5:02 PM
elexis added an edge to rP22175: Remove useless class, test class and use boost instead of it in…: D1821: Remove useless Random class.
Wed, Apr 10, 2:23 PM
elexis added 1 commit(s) for D1821: Remove useless Random class: rP22175: Remove useless class, test class and use boost instead of it in….
Wed, Apr 10, 2:23 PM

Sun, Apr 7

elexis added inline comments to rP13472: Write mod data correctly. Fixes #1940..
Sun, Apr 7, 8:05 PM
elexis added inline comments to rP13472: Write mod data correctly. Fixes #1940..
Sun, Apr 7, 6:08 PM
elexis added a comment to D1819: Make capture attack work with units with BuildingAI..

That it attacks and captures simultaneously is a bit in contradiction with the rest of the units that can either capture or attack at a time. I see this making the unit probably OP if not nerfed somehow otherwise.
I wonder whether it makes sense for a siege engine to capture - I thought the men are rattling at the door.
Due to popular demand, UnitAI.js should support capturing for units with buildingAI anyhow.

Sun, Apr 7, 2:17 PM

Sat, Apr 6

elexis awarded rP22163: Remove unneeded death sounds from structure templates, as they inherit from… a Like token.
Sat, Apr 6, 5:48 PM
elexis added a comment to D1813: Remove unused variable from CInput.

15:34 < bb> just leaving it accepted for a short while (till tonight) in case someone wants to add something

Sat, Apr 6, 5:47 PM
elexis added inline comments to D1622: [CSlider] On click move the slider-button to the mouse position.
Sat, Apr 6, 5:42 PM
elexis added a comment to D1637: BoolArray array wrapper..

21:20 < nani0> btw vladislavbelov[ how do you organize all your current projects (pending patches), do you use git branches or just save *.diffs?

(Branches are useful if you have multiple patches that depend on each other, so you can rearrage the commits and pop one of them at a time into the review queue. If it's a standalone patch that doesn't have merge conflicts with others, you can create a revision proposal or paste and then there is one backup of it. Also I used a messy directory per year/month/day for 0ad notes, abandoned patches etc.)

Sat, Apr 6, 11:44 AM
elexis added a comment to D1637: BoolArray array wrapper..

Somewhere between 30% (most cases) to 50% faster.

Thanks for testing it, sounds promising. I will try too once I open my IDE again and closed some hundred revision proposals...

Sat, Apr 6, 11:38 AM
elexis updated the Trac tickets for D1819: Make capture attack work with units with BuildingAI..
Sat, Apr 6, 11:26 AM

Fri, Apr 5

elexis added a comment to D1637: BoolArray array wrapper..
In D1637#74229, @nani wrote:
MapSizesvnsvn + booArray + tileClass patchtime reduction factor
Fri, Apr 5, 5:37 PM
elexis added a comment to D1702: GUI addon to animate objects proprieties.

I can't read the last two comments now, so I might repeat things mentioned by bb or say something that was responded to by nani. But I add some comments sooner rather than later:

Fri, Apr 5, 5:32 PM
elexis added inline comments to D1622: [CSlider] On click move the slider-button to the mouse position.
Fri, Apr 5, 4:57 PM
elexis added a comment to D1816: Remove wrong assignment introduced in rP21113.

(I meant we can find the answer in the specs if we are not sure)

Fri, Apr 5, 4:25 PM
elexis added a comment to D1816: Remove wrong assignment introduced in rP21113.

What does the C++ specs say what happens?

Fri, Apr 5, 11:02 AM
elexis added a comment to D1806: standardized structure aura descriptions.

The tooltip lies about elephants, quite a stuffed tech, but it should still work out, the part +15% melee and ranged attack damage could be +%(AttackMeleeHack)s%% melee and ranged attack damage, still seems less than more likely to mess up the numbers, as one now only needs to compare that ranged and melee attack is the same, instead of testing that ranged and melee attack and the number in the tooltip are the same?

Fri, Apr 5, 2:43 AM
elexis added a comment to D1816: Remove wrong assignment introduced in rP21113.

Don't forget to add the references in any text field (rP21113), this way the referenced site will also receive a link to this document and readers can click their way through history.

Fri, Apr 5, 2:31 AM
elexis updated the summary of D1816: Remove wrong assignment introduced in rP21113.
Fri, Apr 5, 2:18 AM
elexis retitled D1816: Remove wrong assignment introduced in rP21113 from Remove wrong assignment introduced in rP2113 to Remove wrong assignment introduced in rP21113.
Fri, Apr 5, 2:18 AM
elexis added a comment to D1637: BoolArray array wrapper..

Would improve generated maps times by 3~4x times for all sizes if combined with the other diff of TileClass.

The factor 3-4x is still misleading nani (see post above).
If the Boolwrapper would make it 50% slower than the current implementation, then the other patches combined could be 6-8x as fast.
x + y + z = 3 doesn't tell us that x > 0, it could even be x = -100, y = 101, z = 2.

Fri, Apr 5, 2:16 AM
elexis added inline comments to D1622: [CSlider] On click move the slider-button to the mouse position.
Fri, Apr 5, 1:44 AM

Thu, Apr 4

Imarok awarded D1574: Get XML syntax errors not only the first time that file is loaded a Love token.
Thu, Apr 4, 10:48 PM
elexis added a comment to D1806: standardized structure aura descriptions.

That .8 was necessary because its a really powerful effect (healing 200 units nearby simultaneously) and it degenerated the game balance towards people always having to train the unit.
The question is whether that one unit having one more digit than all the others makes it right to change all the others.
What if an upcoming template change uses 0.75?
If the objective of this diff to achieve consistency, one can also use consistently avoid trailing zeroes.

Thu, Apr 4, 2:59 PM

Wed, Apr 3

elexis added a comment to D1806: standardized structure aura descriptions.

What's the benefit to having .0? Didn't it use round numbers everywhere?

Wed, Apr 3, 11:14 PM
elexis added inline comments to rP21113: Allow random map scripts to load heightmap image files, fixes #5018..
Wed, Apr 3, 11:01 PM
elexis added inline comments to rP14877: Second (main) commit for the SpiderMonkey upgrade..
Wed, Apr 3, 10:18 PM
elexis added a comment to D1798: move territory_pull.xml from other/ to special/.

I guess every improvement can be defined as a defect. Files should be grouped by commonalities, right? The less fragmented it is, the better. I didn't claim this to be a good idea, was just exploring thoughts. I'm sure the settings/data/ folder was once grouped by the fact that it's JSON.

Wed, Apr 3, 3:18 PM
elexis added a comment to D1809: Simple cleanup of Shapes.

I don't think that the header would be more clear, only smaller.

(I meant the includes, not the header. Sometimes we find something like 30 includes in a file with 3 classes, 10 of them for one class, 10 for another, 10 for the last class, then it's hard to tell what is forgotton, what is unused and what include is used by which class (here are no includes, so there's that))

Wed, Apr 3, 3:11 PM
elexis added a comment to D1809: Simple cleanup of Shapes.

Then add it to CC.

CC is to allow people to chose between multiple syntactically and semantically correct solutions.
It's not a convention that we avoid bugs.
It could be added under a different chapter or different document: Common Pitfalls or so.

Wed, Apr 3, 2:42 PM
elexis added a comment to D1798: move territory_pull.xml from other/ to special/.
In D1798#73947, @Nescio wrote:

Hm. I think auras and techs are also templates, just not entity templates.

What do you mean exactly? Auras and technologies are json files located under simulation/data/auras/ and simulation/data/technologies/, respectively; why should they be placed under simulation/templates/ instead?

Wed, Apr 3, 2:21 PM
elexis added a comment to D1798: move territory_pull.xml from other/ to special/.

Hm. I think auras and techs are also templates, just not entity templates.

Wed, Apr 3, 1:49 PM
elexis added a comment to D1809: Simple cleanup of Shapes.
In D1809#73904, @elexis wrote:

But even better might be adding the comment to the code itself, so that people stubmle upon it while reading the code.

About what? It's too common thing and it's related to many places in the code. So I'd prefer to add comments to our CC.

Wed, Apr 3, 11:40 AM
elexis added a comment to D1798: move territory_pull.xml from other/ to special/.

special/ does not inherit from any template_*.xml

Wed, Apr 3, 11:22 AM
elexis added a comment to D1493: Camera view config options.

Currently all settings besides one or two IIRC take effect immediately, so players expect these to take effect immediately too.
Therefore you either have to mention that it requires a restart, like we do with the other settings, or actually make them take effect.

Wed, Apr 3, 11:13 AM
elexis added a comment to D1809: Simple cleanup of Shapes.

So it's good that we publish the version history of our source, so people can find this information.
But even better might be adding the comment to the code itself, so that people stubmle upon it while reading the code.

Wed, Apr 3, 10:55 AM
elexis accepted D1798: move territory_pull.xml from other/ to special/.

doesn't belong in other/ (which contains various gaia structures).

Confirmed, looked at all the other files in there.
Makes me wonder why that folder is called "other" and notthing relating to "gaia"?
So should the "other" folder be moved to gaia afterwards?

Wed, Apr 3, 8:07 AM
elexis raised a concern with rP13472: Write mod data correctly. Fixes #1940..
  1. The comment is wrong https://wildfiregames.com/forum/index.php?/topic/25579-cannot-play-custom-maps-please-help/&do=findComment&comment=371878
Wed, Apr 3, 7:01 AM

Tue, Apr 2

elexis awarded rP22154: Removes unused variable. It was introduced in rP3893, an interface to control a Like token.
Tue, Apr 2, 9:35 PM

Mon, Apr 1

elexis added a comment to D1809: Simple cleanup of Shapes.

You did a good write up on the logic change, not the syntax candy change at https://wildfiregames.com/forum/index.php?/topic/25594-c-tip-1-constant-references/&tab=comments#comment-371946
Should mention it here too, at least that there is such a logic change at all.

Mon, Apr 1, 10:04 PM
elexis added a comment to D1637: BoolArray array wrapper..
In D1637#73755, @smiley wrote:

There is a mismatch between the < 27 and >= 27 code path, creating different maps, nani had investigated it too. It would be good to know which one of the two is wrong in order to fix it if it's the one we keep.

I guess you would be out of the loop on this one. But the 27 mismatch was found. And I failed to find any mismatches. But nani claimed that he found mismatches in water maps (only). (This was independent work from both sides, so it is hard to establish conclusions).

Mon, Apr 1, 3:09 PM
elexis updated subscribers of D1637: BoolArray array wrapper..
In D1637#73726, @smiley wrote:

Since I was mentioned here and all of this has been discussed with the author before.

Thanks for the requested response (I only recalled you spoke about doing something with C++, but not which aspect would be moved.)

Mon, Apr 1, 10:40 AM

Sun, Mar 31

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

On the importance of the feature:
we need to know how much memory and performance cost this influences.

Sun, Mar 31, 10:51 PM
elexis added a comment to D1786: Refactor input.js.

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
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.

Sun, Mar 31, 1:17 AM

Sat, Mar 30

elexis added 1 auditor(s) for rP21026: Cleanup TileClass prototype and use vector arguments for countInRadius…: Restricted Owners Package.
Sat, Mar 30, 9:47 PM
elexis awarded D1804: Fixes black water glitches for certain wind angles a Like token.
Sat, Mar 30, 9:28 PM
elexis added a comment to D1804: Fixes black water glitches for certain wind angles.
In D1804#73654, @Stan wrote:

This patch seems to fix the issue for me. Tried on a bunch of different maps and could not reproduce the bug anymore.

Sat, Mar 30, 9:28 PM

Fri, Mar 29

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

The fsm.js has been modified to be able to have a default function and "_" in state name

What uses the underscore?
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.

Fri, Mar 29, 12:33 PM

Thu, Mar 28

elexis added a comment to D1800: Display correct ranged attack overlay for structures.

Performance is of lesser importance; range overlays are options that can be turned off.

Don't underestimate possible consequences of bad performance.
An simple aura bugfix in a23 made the code so slow that it consumed 10 seconds (i.e. 0 FPS, full freeze) when starting a game, that in turn disconnected most players of a match, aborting the game after people clicked on start, basically every time. That was terrible for the players.
You don't want freezes under any circumstance, and a freeze is nothing but CPU taking that long to compute the current operations.

Thu, Mar 28, 7:25 AM

Wed, Mar 27

elexis added a comment to D1800: Display correct ranged attack overlay for structures.

Thanks for the measuring.

Wed, Mar 27, 12:58 AM

Tue, Mar 26

elexis added a comment to D1571: Refactor and cleanup of CGameView.
In D1571#73526, @elexis wrote:

If you want to commit this patch to continue working on greater features that depend on this, and if you have done your best to ensure the correctness, I would suggest to take that decision to commit into your hands.

Edit: You can add "Comments By:" if you can't post "Reviewed By:"

Can I really do that? To commit without accept if it's not a blocker.

Tue, Mar 26, 3:15 PM
elexis added a comment to D1571: Refactor and cleanup of CGameView.

If you want to commit this patch to continue working on greater features that depend on this, and if you have done your best to ensure the correctness, I would suggest to take that decision to commit into your hands.

Tue, Mar 26, 1:01 PM
elexis added a comment to D1674: Check translations for sprintf errors.

Another case
https://wildfiregames.com/forum/index.php?/topic/25534-hot-key-error/

Tue, Mar 26, 12:21 PM
elexis added a comment to rP22137: Remove and Update some outdated tips and refactor tip displaying.

I listed myself, because I thought not listing myself leaves the impression I didn't review the patch.

Tue, Mar 26, 10:31 AM
elexis added a comment to D1571: Refactor and cleanup of CGameView.

@wraitii @elexis Removed m_Smoothness getter until we have something finished with config.

Tue, Mar 26, 12:12 AM

Mon, Mar 25

elexis added a comment to rP22137: Remove and Update some outdated tips and refactor tip displaying.

(Reviewed by: <committer> always seemed redundant to me.

I think a possible use-case of the Reviewed By is when someone made a review remotely from phabricator, like via IRC/voice chat/live (for example on conference).

Mon, Mar 25, 11:56 PM
elexis added a comment to D1786: Refactor input.js.

21:45 < nani> does someone knows/has done FSM (finite state machines) before?

You can find authors in the revision history "svn log", or in the webbrowser on Phabricator -> Diffusion or trac -> browse source for FSM developers.
But I guess there are many UnitAI devs and only one or two absent devs who messed with the FSM code. I guess you need more a GUI reviewer who is familiar with input.js than FSM, since FSM can be learnt more easily than gaining a complete picture of input.js.

Mon, Mar 25, 10:12 PM
elexis added a comment to D1800: Display correct ranged attack overlay for structures.

Well, I meant that one should try to work with the definition of the component properties more than with what the implementation currently does.
Who says that UnitAI is the only component to initiate a position change? It could also be a trigger script relocating a non-unitAI entity.
Or if the terrain is changed, then the height, and thus the elevation bonus can change as well for an entity.
There could be new components for arbitrary reasons that trigger position changes, it could be some scripted AI, or someones experimental alternative unitAI, or a magic tree that is moved in a cutscene.

Mon, Mar 25, 8:24 PM
elexis added a comment to D1800: Display correct ranged attack overlay for structures.
In D1800#73403, @Angen wrote:

But is it actually such problem if range overlay is not updated on movement ?

Well it says "Display correct ranged overlay for maximum range".
If one wants to intentionally semi-support it, then one should mention it in a code comment, otherwise people think it's just something missing that can be added, rather than an intentional omission.

Mon, Mar 25, 6:50 PM

Sun, Mar 24

elexis updated the test plan for D1630: Add perlin noise generator..
Sun, Mar 24, 8:20 PM
elexis changed the visibility for P133 Attempt at a better UI for external links.
Sun, Mar 24, 8:10 PM

Sat, Mar 23

elexis added a comment to D1800: Display correct ranged attack overlay for structures.

With the new message subscription, one could patrol on a hill with a unit that has the range displayed. Then the thing would be updated very often.

Sat, Mar 23, 7:49 PM
elexis added a comment to D1800: Display correct ranged attack overlay for structures.

Didn't we have a ticket for it? I recall receiving a report about that once.
I also seem to recall having looked into the code and having gained the impression that range bonus was already accounted for.
Actually I get it again looking into the code and wondering why the elevation code in GetRange doesn't already provide the information.
I guess ElevationBonus != GetElevationAdaptedRange, the former must just have been height of the building.
Good then.

Sat, Mar 23, 5:08 PM

Mar 21 2019

elexis added a comment to rP22137: Remove and Update some outdated tips and refactor tip displaying.

Actually, would have been a good opportunity to move the strings from public-gui-other.pot to a new translation resource, so that strings like 2000 Food. are not in the same pot as the majority of the GUI. Too bad I didn't think of that sooner. (Though I'm not sure whether the transifex webinterface offers previous similar translations of different resources.)

Mar 21 2019, 12:08 AM

Mar 20 2019

elexis added a comment to D1461: Hint the location for "You have been attacked" notifications.

Now the question remains how we make it visible to the players that this click-feature exists.
Usually the mouse cursor changes when one hovers a link. Underlining won't be supported by our small font base, but adding a sprite should be easily possible (resource icons in tooltips.js / setup_resources.xml as an example).

Mar 20 2019, 5:41 PM
elexis added inline comments to D1377: Loading Tips update.
Mar 20 2019, 4:57 PM
elexis changed the visibility for P142 rmgen a23 performance boost hack.
Mar 20 2019, 4:18 PM
elexis changed the visibility for P143 Use a bit mask for tiledata.
Mar 20 2019, 4:18 PM
elexis changed the visibility for P144 rmgen cleanup.
Mar 20 2019, 4:18 PM
elexis changed the visibility for P131 Poisson disc sampling..
Mar 20 2019, 4:17 PM

Mar 19 2019

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

(See rP22134#32587 on the JSInterface question.)

Mar 19 2019, 2:16 PM
elexis added a comment to rP22134: Add a `GetTextSize()` method to GUI objects.

Unless the object doesn't contain text, in which case the method will return undefined`

I thought you mean empty string (that should return 0 size instead of undefined, because the size is known for empty string),
but you mean absence of a caption property from what I gather.

Mar 19 2019, 2:15 PM

Mar 18 2019

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

I'm pointing out these things mostly because I want to inform on our coding conventions and good practices.
But I think the entire file needs to be revisioned structually, adding some syntax sugar is not the essence but part of what needs to be done IMO.
And the more stuff is added to the patch, the harder it will be to review.
Fixing 6000 lines in many logical and syntactical ways is something that can be done in a github branch and typically consumes several weeks to discover all the defects and the ideal structure. Then one can refactor that into small disjoint, atomic, patches.
(I guess the code isn't really inviting to newcomers who want to add one feature and are confronted with a piling disarrangement.)

Mar 18 2019, 9:43 PM

Mar 16 2019

elexis added a comment to rP22111: Align the settingspanel with its background, fixing te misalignment itroduced….
In rP22111#32514, @bb wrote:

Broke the mp while at it, fix incoming

Mar 16 2019, 10:23 PM
elexis added a comment to D1786: Refactor input.js.

You incline me to agree with the idea of the patch, as it's selfcontained and only changes one little thing.
Would use arrow-functions while at it.
The question is how it should be ultimately structured and whether this is a step towards that.
Theres a ticket for refactoring this file, should be referenced both ways.
If I recall, this file is 6000 lines long, so I guess there's a lot more stuff to clean up there. A rabbithole for 2-4 weeks I guess, meh.
I'm not sure if some of the humongous object shouldn't be split into smaller objects.
For #5387 I had the idea that every file would be 200-500 lines of length, so that newcomers don't have to learn 6000 lines of relevant context to understand one file. I didn't plan how to structure this file however.

Mar 16 2019, 9:03 PM
elexis added a comment to rP21378: Allow units to be positioned with freehand placement.

smiley claimed to have deleted his password, so I guess he can't remove himself from the subscription list now.

Mar 16 2019, 6:06 PM
elexis accepted rP21108: Set victory conditions for autostart games..

Thanks for the documentation fix!

Mar 16 2019, 5:54 PM
elexis accepted rP21474: Implement combine victory conditions.

Thanks bb!

Mar 16 2019, 5:49 PM
elexis added a comment to rP20639: Remove VFS cache, because it is less effective and less efficient than the OS….

Here janwas paper "Optimizing File Accesses via Ordering and Caching":
http://wassenberg.dreamhosters.com/articles/study_thesis.pdf

Mar 16 2019, 12:42 AM

Mar 15 2019

elexis added a comment to D1377: Loading Tips update.

translate(sprintf -> sprintf(translate

Mar 15 2019, 4:57 PM

Mar 14 2019

elexis added a comment to D1377: Loading Tips update.
In D1377#72779, @Imarok wrote:

Taken. Please do that change @Angen. But don't forget to translate "• %(tiptext)s".

(The hangup was implementing the JS diff?)
(As mentioned, I don't want to lobby for one or the other implementation, more than I want the decision to become as far-sighted and well argued as achievable)

Mar 14 2019, 8:17 PM
elexis added a comment to D1377: Loading Tips update.
In D1377#72777, @Nescio wrote:

If I understand correctly, you want

Mar 14 2019, 12:40 PM

Mar 13 2019

elexis added a comment to D1377: Loading Tips update.
In D1377#72775, @Nescio wrote:

Reasons why I requested bullets:

  • These loading tips are simple txt files, not markdown or something
  • The gui/manual/intro.txt file also uses bullets for itemization
  • The game properly displays many (most?) Unicode symbols, therefore there is no point in limiting ourselves to ascii
  • Let's keep hypens for hyphenation and use bullets for itemization; if in the future a different symbol is preferred then people can do a simple find-and-replace
  • A bullet looks visually better than a hyphen, especially on the folding lines of that parchment background; it's also clearer on high-resolution screens
Mar 13 2019, 10:07 PM
elexis added a comment to rP22103: Clean ResourceSupply up..

In this patch, IsInfinite() is called only in TakeResources, i.e. comparatively rarely, the string to number conversion is cheap and the isinfinity test is cheap too.
A JS Number can store what a C++ double can store, i.e. up to 2^53, so at least 64bit for every resourcesupply entity. That'd be at least 8 byte * 10k trees = 80KB. Probably 250KB with all the memory management overhead. Quite considerable if we only need it very rarely.
Actually there could be 150 gatherers * 8 players = 1200 units calling TakeResources every second.
But the cmpFogging.Activate(); will have a much worse performance effect than the isInfinite function call.
The patch was meant as a preparation for D1718, that also only uses it once upon Init.

Mar 13 2019, 8:35 PM
elexis added a comment to D1377: Loading Tips update.

Ok, that could work, but what if someone wants to use two lines as heading out of some reason?
I think we shouldn't overcomplicate this issue...

Then let's don't.
Is there a case to use two lines as a heading, or two lines to the same bullet, and if there is, why doesn't it use one long line and relies on the textwrapping?
If someone comes up with some more desires for this format, they can use JSON, or straight XML.
If one wants to argue with freedom to edit, XML would probably be better in the long term, since it could also specify the image to be shown and other arbitrary sprites.

Mar 13 2019, 8:18 PM
elexis added a comment to D1377: Loading Tips update.

So yes I think (and it seems like you do too) it is best to modify each line.

The difference is that in the one case every line has to be changed and every translation of every line has to be redone everytime one changes the style, as opposed to every line having to be touched only one and then never again if one wants to change the style (but only the one line style definition).

Mar 13 2019, 6:58 PM
elexis added a comment to D1377: Loading Tips update.

Doesn't sound like a good alternative, as some language might want to e.g. add the symbol at the end of the line...

sprintf(translate("%(symbol)s %(text)s"))

Mar 13 2019, 6:56 PM
elexis added a comment to rP22103: Clean ResourceSupply up..

How could we decide the memory/performance tradeoff?

Mar 13 2019, 2:30 PM
elexis added a comment to D1377: Loading Tips update.

Is it really better to modify every line to use that `•? Translators will have to edit it again. They might do so once, but what if we like to chose a different styling, for example an actual texture?
Alternatives would be keeping the "-" and replacing it if the line begins with that character (sounds like keeping ballast);
or deleting the - and prepending an arbitrary symbol to every line but the first.
XML would be an alternative but had the disadvantage that one can't use the same GUI object structure for every tooltip.
JSON would be an alternative, but I don't see where the txt format is worse than JSON for the loading tips.

Mar 13 2019, 2:26 PM

Mar 11 2019

elexis added a comment to rP22103: Clean ResourceSupply up..

So the question is whether IsInfinite is called so often that it's worth the cache variable, considering that there can be 10k resource supply entities (trees), or whether the additional memory usage is worse; same for this.cachedType.

Mar 11 2019, 1:54 AM

Mar 7 2019

elexis added a comment to rP22103: Clean ResourceSupply up..

The only alternative implementation that I can imagine is to keep the cache property, thus avoid the repeated parsing + infinity test, while still not serializing the property.
That means there is a higher memory footprint (not unlikely tens of thousands of trees) * few bytes but also many less CPU cycles.

Mar 7 2019, 7:45 PM
elexis added a member for Contributors: shh.
Mar 7 2019, 7:08 PM