Jump to content

[Game Update] - 481873


Recommended Posts

is there any difference between "Development build" and "Regular build"? or its only a logo at bottom screen?

fps issue started happen somewhere after 469473

but i notice that you turned off the "Development build"

Edited by gabberworld
Link to comment
Share on other sites

soo i made quick compare between two versions

the 469473 and the 471883

i to notice

that they change allot code by changing like this

        bool flag = this.Items.Count == 0;
        if (flag)

        for the

       if (this.Items.Count == 0)

       but if anyone read the unity engine stuff before,  Unity had issues with garbage collections

      soo i not know atm but in past

  change the code

        bool flag = this.Items.Count == 0;
        if (flag)

        for the

       if (this.Items.Count == 0)

 

       would made very big issue . maybe it ok for new Unity engines . i not know that

      and we to lost the 40 FPS after version 469473. soo maybe its something todo with this as well

 

Edited by gabberworld
Link to comment
Share on other sites

2 hours ago, gabberworld said:

soo i made quick compare between two versions

the 469473 and the 471883

i to notice

that they change allot code by changing like this

        bool flag = this.Items.Count == 0;
        if (flag)

        for the

       if (this.Items.Count == 0)

       but if anyone read the unity engine stuff before,  Unity had issues with garbage collections

      soo i not know atm but in past

  change the code

        bool flag = this.Items.Count == 0;
        if (flag)

        for the

       if (this.Items.Count == 0)

 

       would made very big issue . maybe it ok for new Unity engines . i not know that

      and we to lost the 40 FPS after version 469473. soo maybe its something todo with this as well

 

What does a bool on the stack have to do with garbage collection?

Edited by AyCe
Link to comment
Share on other sites

1 hour ago, AyCe said:

What does a bool on the stack have to do with garbage collection?

let me tell again Unity Engine self in past tell that they had issues at garbage collection with similar stuff.

also they tell dont use regex and the Linq

how the hell i know what is that todo with garbage collection,. you asking me like im unity engine maker

its typed for old unity engine tho. soo it can be that this is not the issue atm

but where go that 40fps after version 469473

its kind big number and that needs something very large change for happen something like that

and that bool is just one line what i typed, but they change the full Assembly-CSharp-firstpass.dll with this kind stuff

 

and that all garbage collection talk, makes me feel that i want add 2 fingers to my mouth as you cant see this garbage in c++/ delphi

fps.thumb.png.6c332fc50f20e8608b3c6ec698ba10b5.png

Edited by gabberworld
Link to comment
Share on other sites

16 hours ago, gabberworld said:

let me tell again Unity Engine self in past tell that they had issues at garbage collection with similar stuff.

also they tell dont use regex and the Linq

how the hell i know what is that todo with garbage collection,. you asking me like im unity engine maker

its typed for old unity engine tho. soo it can be that this is not the issue atm

but where go that 40fps after version 469473

its kind big number and that needs something very large change for happen something like that

+and that bool is just one line what i typed, but they change the full Assembly-CSharp-firstpass.dll with this kind stuff

 

and that all garbage collection talk, makes me feel that i want add 2 fingers to my mouth as you cant see this garbage in c++/ delphi

fps.thumb.png.6c332fc50f20e8608b3c6ec698ba10b5.png

this.Items.Count looks like a simple property access, not a LINQ call.

Whether you put it in a bool before the if or not does not matter, it executes the same bytecode. The bool is not an object and is just 1 byte on the stack, allocated when the method is entered and destroyed when the method exits. Not related to garbage collection at all.

You are free to use whatever functions in Unity, but you should not do expensive operations every frame, or even on every object every frame. But this is the case in all game engines. If you query all gameobjects with LINQ each frame, you are probably doing something wrong, for example.

I guess optimizing a game like ONI can become quite tricky, as there is a lot that can potentially matter in every frame, but sometimes there are indeed expensive operations done too frequently, which can kill the framerate.

Garbage collection is great, and programming without it really sucks, at least when you want to get things right. But as with everything, you need to know what you're doing. Especially Unity offers a lot of optimization potential to reduce allocations by using structs that are not allocated on the heap. But the best optimization is usually to use a better algorithm, like pre-filtering objects once instead of going through all of them all the time. The ONI devs are probably already doing that in most places.

C++ and other older languages not having standard garbage collection means that many tasks that are trivial in languages like C# become hard to implement correctly in those. Never had a single project where garbage collection was the issue.

Source: 15y programming experience :P

Link to comment
Share on other sites

5 minutes ago, AyCe said:

this.Items.Count looks like a simple property access, not a LINQ call.

Whether you put it in a bool before the if or not does not matter, it executes the same bytecode. The bool is not an object and is just 1 byte on the stack, allocated when the method is entered and destroyed when the method exits. Not related to garbage collection at all.

You are free to use whatever functions in Unity, but you should not do expensive operations every frame, or even on every object every frame. But this is the case in all game engines. If you query all gameobjects with LINQ each frame, you are probably doing something wrong, for example.

I guess optimizing a game like ONI can become quite tricky, as there is a lot that can potentially matter in every frame, but sometimes there are indeed expensive operations done too frequently, which can kill the framerate.

Garbage collection is great, and programming without it really sucks, at least when you want to get things right. But as with everything, you need to know what you're doing. Especially Unity offers a lot of optimization potential to reduce allocations by using structs that are not allocated on the heap. But the best optimization is usually to use a better algorithm, like pre-filtering objects once instead of going through all of them all the time. The ONI devs are probably already doing that in most places.

C++ and other older languages not having standard garbage collection means that many tasks that are trivial in languages like C# become hard to implement correctly in those. Never had a single project where garbage collection was the issue.

Source: 15y programming experience :P

you commend the linq but i not talked about nothing that they use linq, i typed what Unity engine talked

please stop. you even know what im talking about atm?

Edited by gabberworld
  • Big Ups 1
Link to comment
Share on other sites

A primitive datatype declared on the stack is not going to interact with the garbage collector, because it's a primitive datatype; full stop.

I knew a C programmer that liked to stuff non-primitive structures into stack space, specifically because it meant he didn't have to worry about any garbage collection; it would all be deallocated when the frame was popped off the stack.

Link to comment
Share on other sites

22 minutes ago, gabberworld said:

you commend the linq but i not talked about nothing that they use linq, i typed what Unity engine talked

please stop. you even know what im talking about atm?

Tbh others are making much more sense than you chasing poor boolean on stack.
Did profiler show you that this line of code is heavily ussed?

Link to comment
Share on other sites

 

24 minutes ago, Simonova said:

A primitive datatype declared on the stack is not going to interact with the garbage collector, because it's a primitive datatype; full stop.

I knew a C programmer that liked to stuff non-primitive structures into stack space, specifically because it meant he didn't have to worry about any garbage collection; it would all be deallocated when the frame was popped off the stack.

like unity engine explained. stuff is related to Garbage collection and that self slows down the game performance as it search what to garbage and what not

they tell that it is fixed soo you not need use anymore stuff like

        bool flag = this.Items.Count == 0;
        if (flag)

but there is a thing. how good they actually fix that? maybe its just a imagine fix in paper. as we to lose 40FPS after that when Klei devs changed those commands

9 minutes ago, Orzelek said:

Tbh others are making much more sense than you chasing poor boolean on stack.
Did profiler show you that this line of code is heavily ussed?

im chasing boolean? i only pointed one example off code, there is thousand off changes about similar stuff what klei devs made

Edited by gabberworld
Link to comment
Share on other sites

50 minutes ago, gabberworld said:

im chasing boolean? i only pointed one example off code, there is thousand off changes about similar stuff what klei devs made

It would help to use examples that can show what you are talking about.
What you were showing didn't seem relevant thats why there are all the questions and explanations.

I'm not sure how much you know about garbage collection but it was not present in your example in any way.
I did n ot play around with looking at ONI code but do you have examples that actually show changes that would cause excessive garbage collection?

Link to comment
Share on other sites

20 minutes ago, Orzelek said:

It would help to use examples that can show what you are talking about.
What you were showing didn't seem relevant thats why there are all the questions and explanations.

I'm not sure how much you know about garbage collection but it was not present in your example in any way.
I did n ot play around with looking at ONI code but do you have examples that actually show changes that would cause excessive garbage collection?

are you the ONI dev? you know that i was pointed this info to the game devs? explaining over and over same thing where it goes nowhere

 

Link to comment
Share on other sites

Locally declared value types (like bool) don't come into play for the garbage collector, specifically because they are both locally declared and value types; they are stored on the stack, which gets it's memory management for free (the memory is allocated and deallocated at the method boundary, so there is no need for a garbage collector; that's why you don't need to manually free value types in C, which doesn't have a garbage collector at all).

Declaring a bool, assigning the conditional to it, then evaluating the bool does make an extra trip to memory that doesn't need to happen, but it doesn't put any additional strain on the garbage collector; to do that, they would need to create their own class that functioned like a bool, then new it up, such as:
 

 BooleanClass flag = new BooleanClass(this.Items.Count == 0);
        if (flag.ToBoolean())

(I have seen professional Java developers write overly classy code like that)

The easy rule of thumb is, if you have to use the "new" keyword to create the instance of the object from scratch, then it's being allocated on the heap, and it is going to be a candidate for the garbage collector. If it's a basic construct of the language, it's going to be stored on the stack, UNLESS it's explicitly declared as a ref, or reference (which is how all classes work; the object stored on the stack is a reference to a location in heap space where they object can actually be found).

Link to comment
Share on other sites

4 minutes ago, Simonova said:

Locally declared value types (like bool) don't come into play for the garbage collector,

 

yes yes yes. but i not talk here about the C#. I talk about Unity Engine and his bugs what they had in past.

Old game developers know that.

thats why you see allot commands like this

       bool flag = this.Items.Count == 0;
        if (flag)

Edited by gabberworld
Link to comment
Share on other sites

26 minutes ago, RageLeague said:

The scripts in Unity use C#. Changes to the game code are all changes to the C# scripts.

i know that they use. C# but i not about C# in general i talk about the issues what Unity engine self made after when they compile the game code

its ALL FIXED NOW. ATLEAST THEY TELL THAT

BUT i ask again WHERE go that 40FPS

when developers change all those thousands line codes for the simple ones

fps.thumb.png.fe76fdbe225dfc1aab8208a8da81f5a3.png

Edited by gabberworld
Link to comment
Share on other sites

1 hour ago, RageLeague said:

Where did you get the information that "Unity recommends assigning expression result to a temporary variable before passing it into a function"?

it was writen somewhere in UnityEngine webpage. also it docent matter for you because like you see at code Oxygen Not Included developers know that as-well and used this method long time in game but for some-reason  they decided change that stuff.

also UnityEngine write that they fixed that issue. soo in paper  it should work at current UnityEngine what ONI use atm.

thing is what if they not actually fixed that at all

 

Link to comment
Share on other sites

30 minutes ago, gabberworld said:

it was writen somewhere in UnityEngine webpage. also it docent matter for you because like you see at code Oxygen Not Included developers know that as-well and used this method long time in game but for some-reason  they decided change that stuff.

also UnityEngine write that they fixed that issue. soo in paper  it should work at current UnityEngine what ONI use atm.

thing is what if they not actually fixed that at all

 

As a Unity user myself I would be very interested if you could point to any statement the Unity devs said to this topic. Are you sure it's not just your decompiler or Mono behaving differently? You don't even need to write != null in many cases, just if(sprite) could be enough.

Link to comment
Share on other sites

9 minutes ago, AyCe said:

As a Unity user myself I would be very interested if you could point to any statement the Unity devs said to this topic. Are you sure it's not just your decompiler or Mono behaving differently? You don't even need to write != null in many cases, just if(sprite) could be enough.

you again point out that code. game is little bigger than that little image what i show

read RageLeague post she/he actually gets what im talking here

Edited by gabberworld
Link to comment
Share on other sites

1 minute ago, gabberworld said:

you again point out that code. game is little bigger than that little image what i show

Nevermind the game, I'm just asking if you have any sources on that I could read. You keep stating that the Unity devs fixed something, but you seem to be the only one that claims that. I want to learn more about the Unity engine, Mono and C#, so I would like to read why this seemingly strange thing would happen. Maybe you are right, but right now it just sounds like you're making it up, sorry.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...