[SOLVED] SkyControl phase does not seem to save

Working on a new game in which I noticed that the Phase is not being saved and it seems to always jump back to LunarPhase.FULL.

@sgold , can you confirm that it is the case or am I smoking my socks?

I am using version 1.1.0 with jME 3.7.0

1 Like

I studied the read() and write() code in “SkyControl.java”, and it looks perfect to me. I think the next step would be to write a simple test case. Before I do so, it would help to know whether you are serializing to J3O or XML or some other format.

I am serializing the j3o.
Thanks for looking at this. :heart_eyes:
I have a suspicion that it could be related to the clone().
Because in my editor, I clone the full scene to have it tested and at that point the phase also resets.

1 Like

Alright, I’ll look at cloning and test that as well.

2 Likes

I added an automated test, which didn’t find any problems with cloning/loading/saving the phase field:

Admittedly I only tested with JME 3.8, so the issue might be specific to 3.7 .

I think the next step is for you to write a simple test that demonstrates the issue you’re seeing.

1 Like

Thanks for your investigation and effort on this.
I found a place in my code after referencing all usages of SkyControl where I actually parse the scene and for some reason, I have forced set the phase.
Man, rookie mistake. I am so sorry.

This problem was solved.

3 Likes

I enjoy collaborating with you, and I’m glad you found the bug.

3 Likes