Can someone help me fix the water reflection, when the scene is restarted.
It works properly with game restart actuator, but not with scene restart actuator.
Here is the file
Is there any reason you can’t use game restart?
Have you tried UPBGE?
Hi, yes it is a known bug… I don’t know if we have it in upbge (we have it too. I opened an issue). Here is a workaround: http://pasteall.org/blend/index.php?id=45341
I noticed this too with the texture module. In the embedded player the textured don’t always work when you restart.
I don’t know if this is a bug or not. I think this is because of that: http://pasteall.org/blend/index.php?id=45342 (bge.logic is not freed at scene restart)
Is there any reason you can’t use game restart?
I’m using scene restart in Tomato Jones 2, because restarting on player die is instant. And players are dying very frequently in this game.
Have you tried UPBGE?
Yes, this was the first thing I’ve tested. Unfortunately the bug is there too.
Hi, yes it is a known bug… I don’t know if we have it in upbge (we have it too. I opened an issue). Here is a workaround:
Thank you youle!
I don’t know if this is a bug or not. I think this is because of that: http://pasteall.org/blend/index.php?id=45342 (bge.logic is not freed at scene restart)
I also noticed that sometime ago, but didn’t think it could cause a problem until now.
By the way…the same bug is happening with the wind shader on scene restart.
Haidme, for my most recent game I put all the level data and character data in a Level() class.
When I switched scenes or the player died I called Level.end_level() to delete all the assets and then created a new level object.
end_level had code to go through each element that had been created, like the player model, background and items as well as stuff like the walkmesh and end them, and unlink any outside references.
The result was that the new level would be created very quickly. In fact so quickly that initially created a bug, because it was possible to end a level, start a new one, end that one and start again within a single tic, which led to a bug where I was double transitioning between scenes (going in to a room and coming out immediately).
Anyway, the positive side is that there was no need to reload the scene, and no need to incur the extra overhead of creating all the textures and models in the blender engine, they were already there.
You could even make the level data and character data separate, so that you only reload the character data (including maybe pickups and powerups). Saves even more time as the level just stays as it is.
Maybe too late to use this structure in your current project but I hope it’s something you could consider in the future.
I put all the level data and character data in a Level() class.When I switched scenes or the player died I called Level.end_level() to delete all the assets and then created a new level object.
Yes, for a simple platformer like TJII it is a very good idea.
But as you said I’ll need to create a level manager and it would take me some time. But thanks, this is actually a very good idea for new projects.
have each object store its intial rot and position that may need reset.
for object in scene.objects:
if 'resetME' in objects:
storeProp = []
for prop in object.getPropertyNames():
storeProp.append([prop, objects[prop]])
object['InitalPos']= object.worldPosition.copy()
object['InitalRot']= object.worldOrientation.copy()
object['StoreProps']=storeProp
and this should reset everything
for obj in scene.obj:
if 'resetME' in object:
object.worldPosition = object['intialRot']
object.worldOrietnation = object['initialPos']
for prop in object['StoreProps']:
object[prop[0]] = prop[1]
Thanks Blue,
Yes, this would be the overall idea. But the game setting is a bit more complicated. Like having savepoints, objects that are already taken(coins), interface information, traps animation frame position, some rigid bodies current orientation(platforms),speed and position also the bge bug with repositioning the soft cloth object.(Mr.Jones) Actually I already dump that info into a .txt save file, so it wouldn’t be that hard.
It is really a good way to make very fast level reset and I will probably take it into consideration for my next game.
having touching the savepoint update all the data
also, you would want a ‘coin controller’
that when you get a coin, it stores it on a list, so when you die it can spawn them again,
if you touch a savepoint just purge the coinlist, (the actor has the coins now as a property anyway)