« first day (3766 days earlier)      last day (1239 days later) » 

9:46 AM
Hello ! Is this okay to set frameratelimit to lets say 10 for example?
The thing is i dont want to use time in my game and i need to slow things up on the screen. Setting framerate limit to lower value solve the problem for me but is this safe to do that?
 
9:59 AM
Hello
How would I copy last N Frames in Unity3d ?
Is it a must to use a stack of texture2D ? check if its not empty, pop it ?
or there is a clever way of doing so ?
 
@0x00004 I mean it's "Safe" .. it would also probably get your game labelled as unplayable
@AhmedSaleh don't know of a better, more proper way to do it. But I would reuse the textures if possible, Allocating such a large object every frame is not the best idea if you can avoid it
 
    if(s.Count == 4)
    {
        int count = 0;

       filterMaterialAssetLeft.SetTexture(_historyIDs_flow[count++], s.Pop());
    }
that's what I did now
where s is a stack
 
user92578
10:23 AM
For a history buffer what you want is a FIFO queue, not a stack?
 
user92578
Unless I've misunderstood what you want to do?
 
@Tyyppi_77 I want to save Last N Frames ?
Is that a stack or a fifo
 
user92578
And then on the next frame you want to drop the oldest one, and add a new one?
 
yes
 
user92578
Then it's easy to see that a stack does not give you that
 
10:27 AM
a queue ?
or a circular queue ?
@Tyyppi_77
 
user92578
If I don't reply within 5 minutes doesn't mean you have to ping me.
 
user92578
A queue should work fine as it's made for dropping the first element that went in
 
sorry
 
 
4 hours later…
2:35 PM
Hello!
 
user92578
3:04 PM
Hey!
 
The government has told us the parameters on how the holiday time should be spent. And of course, it can't please everyone...
also, I've started to build llvm/clang to see what it can do for us..
 
user92578
4:00 PM
Build your software with clang or build clang from source?
 
4:14 PM
Building clang from the source, then use it as a static analyzer for our software. (And probably check what clang-format can do.)
 
user92578
Does that require building from source? Or is that because you want to add custom features to clang-tidy?
 
You mean as opposed to installing the visual studio plugin?
I don't intend to add any custom features, no.
I have not been able to find "binaries" aside from the VS/VSCode integration.
 
user92578
As opposed to that or just simply downloading a prebuilt binary?
 
The plan is to integrate the tools with scripts, and I think, at least here, having the devs download and extract a zip is simpler than having them install and use the plugin.
Oh, look!
 
user92578
Was just about to link that
 
user92578
4:24 PM
I think that's where my clang-format is from, since VS was shipping with an older one that was missing a feature I wanted
 
Nice! I'll try that.
Could you do a "drop in replacement"?
replacing the old binaries by new ones?
 
user92578
Unsure if that's a good idea, but VS lets you specify the path for clang-format
 
Ah, right, nice!
 
4:38 PM
When configuring linters in sublimetext, you also need to specify the binary path
 
5:32 PM
Now I need to figure out how to use that in a script...
 
user92578
Like invoke clang-format from a script?
 
6:33 PM
yep
I've managed to do that with cppclean and cppcheck.
 
user92578
I have a Python function that formats a string and returns the formatted string, but I assume you want to run it on a bunch of files?
 
user92578
My script is for formatting generated code (WIP shader code gen), actual main usage is just running it on save in VS
 
Likely, yes, at least for now. I understand there is a python script already made that will do a diff and format only the updated code; maybe down the road that'll be what we'll use; I don't know yet.
That's a clever way to use that tool :P
 
user92578
Ah, so like run a script with commit hooks to format before committing?
 
6:49 PM
Yes, well the script would be fired manually, but the idea is to run it before requesting a code review.
Some here don't like much the idea of having a difference between what is reviewed and what is then committed. (Which is understandable.)
 
user92578
So workflow would be commit unformatted stuff to branch, then run script manually locally, commit formatting changes, request review on branch?
 
Yep!
 
user92578
Sounds like a pre-commit hook would be work pretty well there to remove the manual step but I guess that works too!
 
In fact, the script I have now runs cppcheck, cppclean, our JSON files and XML files so that they are "clean". So this script would be improved by adding clang-tidy and clang-format.
 
user92578
Ah yeah, maybe too big of an operation to run on every commit
 
6:55 PM
yes, a pre-commit hook would work. (But as I said, some people here don't like the idea of having something that modify their stuff before they commit).
I suppose one could set it up to run only when committing to branches and not to the trunk.
Yeah; I don't know. It sure is not instant.
 
user92578
Ah yeah, sort of understandable... Which is why I guess it would make the most sense to integrate it into your editor, but are people using different editors and stuff?
 
instantaneous?
Hmm. Well most of us use VS, but my boss uses like ultraedit or his favourite unix editor like vi or something.
 
user92578
In our uni project we had linting also in CI, unformatted code would error there
 
This could also be split; what's fast can be made as a hook, and what's slower needs a manual intervention.
Yeah, we don't really have that, though.
Well... we do, but that's something I don't want to touch.
I figured that adding the changes to the "reports" of these tools to the code review would help highlight more potential defects.
 
 
2 hours later…
9:17 PM
Quick question here... Is there a performance advantage in an ecs if you go pure ? So components without any methods inside ? And if theres one, what if the component references a class which contains the method to call ? Like "Rotation{ vector3 rot }... rot.rotateBy()" ?
 
Do you know anything about cache misses?
 
Not really... we arent that deep into it yet. But i know that the cache loads the next lines of code and jumping around fills up the cache, which means he loads fewer lines which results in performance loss... thats why a ecs is more performant. Atleasts thats how i understood it
 
Yes, that's basically that.
There is instruction cache and data cache.
 
user92578
The main benefit of ECS is data cache though, not instruction cache
 
If your data is contiguous in memory, you have a gain. If you don't have to jump a lot instruction-wise, you have a small gain.
I don't think whether the function is in the component or in the system matters much in this case.
The best thing you could do is try and profile both and see if there is a difference.
I suppose instructions take less space in memory and it is why it is less important.
 
9:28 PM
Thanks :) Currently my transform component looks like this : "Transform{ x,y,z }" but i wanted to switch to a library which implements tons of the vector and matrix operations to speed up the development... but then my transform would simply reference one of their vector classes and use their methods instead, thats why im asking
 
user92578
@genaray Reference or own? This is an important distinction when we're speaking data cache
 
Reference, its java :(
 
Do you have anything like "inlining" in java?
 
user92578
@Vaillancourt My guess would be that instruction cache is less important because it's something that the compiler can't help you a lot with, but with data cache the compiler can do a lot of magic
 
user92578
Sorry for the triple ping, what a terrible sentence I had written
 
user92578
9:30 PM
Well it's still wrong
 
@Tyyppi_77 Yes. Also, I think there is something like path prediction?
 
user92578
Branch prediction, yeah
 
Thats actually a good question... i dont even know what inlining is, i used it in c++ sometime ago with templates... without inline the templates didnt worked properly
 
user92578
But that's more about skipping conditionals instead of instruction cache
 
user92578
I wonder if the data localicty in ECS works at all given how reference based Java is
 
9:32 PM
Yes; it was just a point that you need to check how the data is laid out and used more than how you structure the code ;)
Yes, I don't know.
IMHO, ECS should be used first to help development speed, and only then with performance.
 
I also have no clue... atleast it helps the development speed ^ im using "artemis odb", which had a pretty good benchmark compared to other java ecs implementations
 
When I profile my app, I notice that the getComponent<GfxTransform>() is the heaviest one. It is also the most used, hence the high time. BUt it's still nothing compared to how render() does...
@genaray Keep on working on your thing, profile and fix what seems optimizable ;)
You'll probably not see any major difference between both approaches.
And even if you learn something with this project, it might be different with the next project.
 
Alright thanks ^^
 
 
1 hour later…
11:07 PM
In response to inlining with Java: normanmaurer.me/blog/2014/05/15/Inline-all-the-Things
Take away points:
- JIT automatically detects "hot" methods and try to inline them for you
- you can influence what is considered "hot"
- you can manually inline the code yourself
- but Java doesn't have an inline keyword like some languages
- and the JIT might opt not to inline some hot code for various performance reasons
 

« first day (3766 days earlier)      last day (1239 days later) »