Jump to content

Script memory usage explaination


tipforeveryone
 Share

Recommended Posts

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

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 9 months later...

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

 

 

Link to comment
Share on other sites

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?

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

  • 3 weeks later...
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

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...