« first day (3634 days earlier)      last day (1386 days later) » 

12:08 AM
"so RaycastCommands
these all have to be allocated"

by the way, thanks for that :D
 
12:19 AM
The RaycastCommands are structs, so wouldn't they use the existing allocation of the list, rather than creating a new GC allocation each?
 
user92578
I don't think it'd know to use the list memory for the temporaries?
 
user92578
But those should just be on the stack?
 
i don't know, i tried to limit the allocations now:
[NonSerialized]public int MaxGCAllocsPerFrame=1000;
[NonSerialized]static int _currGCAllocs;
bool limitGCAllocs(int allocs){
_currGCAllocs+=allocs;if(_currGCAllocs>=MaxGCAllocsPerFrame){_currGCAllocs=0;return true;}
return false;}
//for every .Add
if(limitGCAllocs(1)){yield return null;}
and the spikes just go crazy, now
limitGCAllocs(int allocs) is a local function
they were like one big spike, now a lot of spikes with lower impact
"The RaycastCommands are structs, so wouldn't they use the existing allocation of the list, rather than creating a new GC allocation each?"

I don't know how unity deals with the memory because it's managed and unmanaged, something like that, i don't understand very well
"I don't think it'd know to use the list memory for the temporaries?
But those should just be on the stack?"

I just noticed I can changed the value of the command[i] instead of using Add(new)
I'll try to check if length is ok and just update the values or if it really needs a new add call
 
12:38 AM
Worth a try. It's still very strange to me that you're getting GC allocations from this code, but that could be a gap or misunderstanding in my own knowledge.
 
i'm really careful with memory management because i had a lot of troubles with it before in unity, now i know better when to use local and global variables, and optimize the gc collect mode, and other cool things, but it still surprises me with weird stuff happening behind the scenes
 
Is it possible the allocation is happening, not from adding items to the list itself, but when you pass the list to the job that actually performs the raycasts? Maybe it copies it to a fixed-length array at that time - I notice the method signature takes a NativeArray.
 
12:56 AM
yes, maybe. I'll try to slice the list before passing to the job after this next test i'm doing.

I already tried nativearray allocation with NativeArrayOptions.UninitializedMemory
and i changed to native list because i had to dispose the array everytime and create a new one
"Uninitialized memory can improve performance, but results in the contents of the array elements being undefined. In performance sensitive code it can make sense to use NativeArrayOptions.Uninitialized, if you are writing to the entire array right after creating it without reading any of the elements first. "
 
1:18 AM
i gotta go to bed now, i've been working on this all day long, but i'll try tomorrow rewriting all this part of the code and searching for any instantiation that could be the culprit if not the raycastcommands or job scheduling which i'll try to find if are there any other problems.

Thanks for the help! :D
<3 <3 <3
 
 
2 hours later…
2:49 AM
@DMGregory i wonder why "variables" setting in " additional settings for linus projects"
couldnt find how to change variable in cmake project (vs environment) because of that
 
 
2 hours later…
4:27 AM
Might be of interest. Does anyone play games on supercomputers?
23
Q: Supercomputers around the world!

ThomasFor a matter modelling person, the most valuable resource is computing power. For many of us, computing power at hand limits the scale of problems we can solve. There are many national supercomputing facilities for academics. What are the resources available in each country?

 
 
8 hours later…
12:37 PM
@NikeDattani This chat is about game dev, you should ask about that instead ;)
I don't know about that site, but this looks off-topic to me per stack exchange standards...
 
@Arthur'Gibraltar'Condino I was a programmer and lead programmer for 18 years, and I switched to game design about 2 years ago.
if you want to see something i made myself, try Cognizer on phones and steam. I'm currently working on dead by daylight on the job.
 
1:29 PM
Do big c++ games use pimpl?
 
I'm not sure I understand the question
 
user92578
Depends on the topic I think, a common use IIRC is hiding platform dependent handles / data into the source file
 
@Almo Private implementation can be used, as Tyyppi_77 says, to do hide some platform dependent stuff; but it can also be used to hide implementation details and possibly reduce compilation time, as I recall. I know a game dev book used that in their examples. I am wondering if it is a common practice.
 
user92578
I think we use it in a few places, but for data only, and generally it's discouraged in any higher level code
 
nwp
It improved compilation speed at the cost of performance and ease of implementation. That doesn't feel like a trade-off gamedevs would be happy with.
 
user92578
1:42 PM
Personally I use it in a similar way, so that I don't have to #include anything annoying (like something that pollutes global namespace) in the header
 
@nwp Yes, I agree, good points.
 
nwp
Personally I have found that forward declarations are good enough.
 
@Tyyppi_77 You're hiding member variables?
@nwp Yeah; I think I remember a Google coding standard that said no-no to that, though, but we're not google. I can see their point.
 
I think we just throw a build farm at our compilation time problem, most of the time. ;)
 
user92578
@Vaillancourt Yeah
 
nwp
1:47 PM
@Vaillancourt Did you watch the talk on the Google coding standard? I really like it.
 
Ooh, got a link? (Sorry if you shared it already and I missed it)
 
@nwp No I only read it some time ago, do you have a link to it?
 
nwp
Primarily because it's made by the Google style guide maintainers and explains why you should not follow the Google style guide.
 
@Tyyppi_77 It must help a bit with compilation time.
 
user92578
I'm just happy if all of Windows.h/SDL doesn't show up in Intellisense
 
@Tyyppi_77 Hmm, we have that in our precomp.h so we're kind of stuck with it ;)
But maybe we could take it out of there and use it only in the cpp files that require it.
@nwp thanks
 
nwp
I can spoil it for you if you don't want to watch for that long.
 
user92578
Please do
 
nwp
TLDW: If you make a style guide all the rules have to have a purpose and a way to enforce the rule.
For example one reason why Google doesn't allow exceptions is because they have hundreds of millions of lines of code that is not exception-safe. The other reason is that they employ non-programmers who hack on their code and teaching those people takes too long.
If you don't have a huge exception-unsafe code-base or untrained employees it doesn't make sense to prohibit exceptions.
(probably, you may have other reasons)
The checking is the other part where they try to have automatic checks like clang-tidy which finds most style guide violations.
They said some more about the checking which I forgot.
They also emphasized that the rules are not absolute. Occasionally you have to catch an exception because they happen to use boost which throws exceptions, so they encapsulate that away. Sometimes you can get around the reason without following the rule.
Oh, and the reason why you shouldn't use the Google style guide is because it makes no sense if you're not Google because the reasons don't apply to you.
 
I guess it's useful to see why they do it;
Most "rules" generally come from "we messed up in the past with this so here is something that will allow us to no mess up again like this".
We had a 80 character line limit in our style guide.
Then wider displays and resolutions came around.
 
nwp
2:02 PM
@Vaillancourt It's worse than that. It's "We messed up in the past and now it's unfixable, so we keep making the same mistake to stay consistent."
 
We increased the limit to 120 characters..
 
:D
 
@nwp Lol, I'm sure devs at Microsoft know exactly the feeling :P
 
nwp
Another point of the talk was that "tabs vs spaces" and other formatting and character limiting rules do not belong in a style guide. Just force everyone to use clang-format and be done with it.
 
@nwp That kind of thing ends all conversations :P It was on my list before our team size got reduced and I had to wear more hats..
 
user92578
2:08 PM
clang-format is pretty awesome, missing a few options that I'd like to change but definitely a big quality of life improvement
 
@Vaillancourt It was asked by a mod, hahaha
 
@NikeDattani Yes, I noticed :P
 
user92578
lol yeah how is there an accepted answer???
 
nwp
2:24 PM
Clearly mod abuse.
 
@Vaillancourt The site's Beta only went live about 2 months ago and we haven't had a chance to edit that Help Center yet.
 
nwp
It doesn't look off-topic to me. At least I can't point to the rule it breaks.
 
user92578
"every answer is equally valid:"?
 
nwp
It's somewhat poorly worded, but "Where do I get compute resources for my matter modelling project" seems to want to solve a real problem.
 
@NikeDattani Still, the page I linked to is not editable by mods. You can decide what is "on topic", i.e. what is your site about, but imho, that question fits in some "off-topic" criteria.
@nwp "every answer is equally valid" "there is no actual problem to be solved"
 
nwp
2:30 PM
Hmm. I don't think so. Some places have better compute resources or give easier access than others. There probably aren't that many places that just give you compute resources at all, so I wouldn't expect a lot of answers.
 
@nwp This would probably be a nice community wiki with a single, well organized answer (@NikeDattani)
 
nwp
Making it international is kind of a problem. "Oh, there is that awesome place in New Delhi which lets you rent a super computer for cheap" isn't very useful unless you live there.
 
We might be leaning in the conservative direction since the world of game tech is such a wild west of competing solutions, so parallel questions on this exchange would be hopelessly too broad.
 
nwp
Actually maybe the international part is fine. Data modellers probably have no problem with sending their stuff to New Delhi if they don't need to be physically present.
 
 
8 hours later…
11:02 PM
wow, cool!! :D

I wish I had the opportunity to work in other big projects too, like, I'm a self taught programmer and I only learnt LUA by myself when I was at eight grade for making an AI in Ragnarok Online. Then I studied XNA and then i moved to Unity.

I had to learn C# and everything all by myself. My first code was a mess like, it worked, but too much spaghetti coding
but i learnt a lot about threads and dead locks and memory management because of that
 
I'm also self-taught :D I got a master's in physics; didn't study computer stuff at all
 
@Almo i think we all can learn by ourselves, we just need to have the will
 
don't ping me if i'm right here
 
sorry
i did it again
lol
 
haha no biggie :)
 
11:06 PM
so, i used deep profiler now, in unity, the gc alloc problem was unity ways of dealing with dictionaries and i had too many debug.log strings being created. I'm cleaning the function now. but optimizing by changing native array to native list did help a lot
i'm going to try to use just lists
instead of dictionary
i'm working in a game since 2010, like, even if i don't finish it, i add everything i learn in it after i test in new projects. As you are experienced in the area, do you think i'm "wasting too much time in it"? Because sometimes anxiety and fear make me depressed and idk, i wish i could work on something more "reliable".

I'm not a full programmer because i have only high school completed. I just wanted an opinion from a experienced programmer, what do you think?
i really want to finish this game and it's hard work and i'm in a position i can work in it like full time, in my home, but idk, do you have any motivational thoughts?
how does cognizer work, did you use an engine or did you create the program from scratch?
you even made a colorblind feature!
wow, nice
 
11:27 PM
oh yeah, beware of debug.log! We had that problem in some mobile games
I used Unity for it
mainly because it gives easy access to cross platform
I hat emessing with that kind of stuff
#1 what's your goal? My goal on my projects is "publish a finished product"
4
so I don't spend much time messing around with paradigms (ECS vs OOP) or caring about what language I use
I just want tools that get out of my way and let me make the game
if your goal is learning about engines and the game is secondary, then rolling your own stuff makes a lot of sense
it's just not something I would do, because for me programming is a means to an end: make a game
i never loved programming for the sake of it
as far as motivation, you have to find what motivates you. for me it's "ok, another menu done on cognizer and it doesn't look noob. closer to publishing it."
for my friend who's a programmer, it's learning new things
he requested being transferred onto dead by daylight so that he could do some work with Unreal (he'd been almost only on Unity projects, or no-engine projects at home).
now he's working on graphics rendering pipeline stuff on the Stadia version to learn that
I gotta go for now though, talk later :)
 
11:41 PM
"what's your goal?"
see my characters walking with ai using skills doing combat and interacting by themselves like in the sims, or the homunculi in ragnarok online. my game will let the player control the character manually or let it go doing things freely.

I think my main goal is creating the AI. I loved making the homunculus behave in random ways to save the owner in ragnarok, and get unstuck from walls or obstacles using movement maneuver. that's what i'm looking for. so in unity, i finally reached the pathfinding but i'm using an a star approach
 

« first day (3634 days earlier)      last day (1386 days later) »