Jump to content
tipforeveryone

Script memory usage explaination

Recommended Posts

I notice that the number of Script memory usage is increasing second to second.

Is it ok ? or there are somecode in my game make it increased. More explaination of this please :) Thanks

image.thumb.png.cb141165e725a83e817bfbaba983edf2.png

  • Like 1

Share this post


Link to post

Lua periodically performs a garbage collection step. You can test this by calling collectgarbage() in your main loop. However, you should normally just let Lua do this automatically when enough memory has accumulated.

  • Like 2

Share this post


Link to post

I am too not sure about this...

While I am working on rain simulation with about hundred sprites, each one attached to a box with mass, falling on the ground, collision detection occurs using a pick ray on the ground, to avoid the rain coming through a roof for example.

Well this runs OK for fps, even if it costs a few ones to run, but the ram cost increases like about 1 mb each second...not sure if Is this normal?

I added System:CollectGarbage() in the main loop but not sure if this is the right use of it ? 

Thx for any help.

 

Edit Okay you have to add as Josh said collectgarbage() and not System:CollectGarbage() !

  • Thanks 1

Share this post


Link to post

FYI, the particle system has a built-in collision detection system you can use for rain if you want to.

  • Thanks 1

Share this post


Link to post
8 hours ago, Josh said:

FYI, the particle system has a built-in collision detection system you can use for rain if you want to.

I've been testing the collision of the particles, but something strange happens, in the editor with the realtime render option enabled, the particles do collide, however when you launch the game as such, those particles don't collide.

What am I doing wrong?

Share this post


Link to post

Yes I encountered three problems with an emitter with collision turned on,

1) as yue said there are particles that just do not collide, but this seems to depend on how high and with which speed the particles are falling.

2) to simulate the rain, the particles should disappear after the collision, instead they are bouncing away after colliding, maybe I do something wrong?

3) the emitter collision detection, with many particles to make the rain, over 100 for sure is incompatible with the vegetation collision feature. Each time the rain is coming over colliding trees built with the vegetation tool, the fps are dropping to unplayable values...

Sorry this is actually no rain building thread, just wanting to add this.

  • Like 1

Share this post


Link to post
On 1/9/2020 at 12:27 AM, Marcousik said:

2) to simulate the rain, the particles should disappear after the collision, instead they are bouncing away after colliding, maybe I do something wrong?

you will actually be able to do that with this.

  • Like 1

Share this post


Link to post

I m actually really curious about what of games leadwerks five will let us construct.. What do you think Josh? Will it be possible to build kind of just cause 3 with it, including all features of the game???

Share this post


Link to post
6 hours ago, Marcousik said:

I m actually really curious about what of games leadwerks five will let us construct.. What do you think Josh? Will it be possible to build kind of just cause 3 with it, including all features of the game???

What is your current limitation in LE4?  Is it framerate?

Share this post


Link to post

Well I'm ok with LE 4.

I do not complain because I am mostly  lacking of time and concentration or inspiration and creativity  to make what I want. And it would not be fairplay to say Leadwerks is the problem.

Nothing new: I am missing in LE4 an integrarted road tracer and maybe few things like good rain collision feature.

As I said I'm curious of what kind of games LE5 will support.

  • Like 1

Share this post


Link to post

Flight and space simulators, as well as massive zombie games or anything that has a lot going on at once..Other than that I think it will just be easier to use with better graphics and better performance.

  • Like 1

Share this post


Link to post
2 minutes ago, Josh said:

Flight and space simulators, as well as massive zombie games or anything that has a lot going on at once..Other than that I think it will just be easier to use with better graphics and better performance.

 

 

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...