Code that is not actually written is being exexuted

Hi there. I’m still working on my VoxelEngine and the various ways to optimize the ram usage, which is actually quite high. I made a really dumb, but actually working, greedy meshing algorithm and I’m currently using a texture arrsy for textures. But that’s not the point. I also tried some frustum culling, using jme3 classes and methods (Camera.contains() and FrustumIntersects) but it had some problems, so I decided to remove it until i solved other mayor problems that came up since I implemented the greedy meshing. The problem is that the if statement that checked frustum culling (simply by checking if the chunk node was inside or intersecting the camera space) is actually being executed despite it’s not in the code anymore. To avoid this I tried several things such as Building and Cleaning, Deleting the build folder of the project, importing the code in a new project. And, since I prefer working on Ubuntu, I tried switching to the Windows partition and importing the project on both jme3 for Windows and Eclipse with the jme3 libraries imported but the problem was still there. Then I tried also to reinstall Ubuntu (I have already planned to do that even without it due to some problems with the gpu drivers). I also asked a friend to test the code for me, but it had the same problem.
I don’t know what to try anymore. Any help will be really appreciated. Thank you😀

Frustum culling is built into JME and happening automatically. Was no need for you to code it yourself (unless you have some special purpose) and so when you remove your version of it JME is still doing it.

My bad, I did not explain what I used it for. If the chunk node is not in the camera space it’s actually unloaded, with the node being detached from the root node. The difference between using or not that code is pretty evident, since the chunk node bounding volume used for frustum culling checking is at the bottom-left of the chunk and if that point is outside the camera space the whole chunk node gets unloaded, which makes some not-quite-good visual effects

So you added some code to JME? Then took it out and it’s still running?

Then it’s still in the jar that you are using. It cannot be otherwise.

Also check if you did not include the jme jars twice.

I did not added it to JME, but to my code

Well, in that case, put a breakpoint, debug it and see the stack.

Ok, then that code is still being run. Something is weird about your setup… but the old .class files must still be being run.

Edit: are you using the SDK or something else?

I’m using the SDK, but I also tried Eclipse just to see. I also deleted the build folder with the compiled .class, but it’s still there

Tomorrow I’ll try, I’m not at home currently

Starts to sound like you have two different .java files and you are editing the wrong one.

Anyway, there is no magic here… if something is still running then it’s still in the code somewhere.

The point is that I changed some other methods in the two classes where I tried this method and the new code in actually been executed. Also, in one of those classes, I completely rewrote the method to change lots of things

The only other thing I can think is to turn off “Compile on Save” in the project settings. it’s the only thing that does anything weird with compiling.

otherwise, .java file becomes .class file… and if code is still running then it’s still there somewhere and you’ve missed it somehow.

At any rate, I 100% guarantee that we cannot help with this anymore because all of the code is on your machine.

Oh, you are right. Here: GitHub - EmaMaker/voxel-engine-jme3: Source of my VoxelEngine written using JME3. is the link to the github repo on my account. Here’s is not included that line of code, but it was in the Chunk.load (inside the if statement). The code here is not updated, I have made some other changes to the code.

I also used the search function built-in jme3 and FrustumIntersect was not found anywhere

With the breakpoint where the code was placed, the main thread actually stops from being executed.

I’m starting thinking that the only way to avoid this strange thing is hand-copying the code in an other project.
Disabling Compile On save neither works.
This is driving me mad

@pspeed @The_Leo I updated the master branch of the github repo with the latest code. The line for frustumculling is not there but it actually does that weird thing

Yes, because somehow you are running class files on your machine that you don’t realize.

Java is not magic. The only code it runs is the code you give it on the java command.

I don’t know where this line was or how/when it was being called and I don’t really have time to ingest your whole project into my head to figure that out. Hopefully you sort out where your confusion is.

Here’s another set of tests you can do before creating a new project:

  1. add a System.out.println() where the removed call is. Something really obvious. See if you see this output. No? Then you aren’t really running this code.
  2. run from the command line and control exactly what jars you are passing on the command line. Look in those jars and see when the code was compiled last.

Hi EmaMaker,
Did you maybe extend Spatial ( /Geometry / Node) and when you where trying out stuff you also overrode checkCulling(Camera cam) method to run your method in addition to where you were usually calling it from and later on you forgot to remove that overridden checkCulling(Camera cam) method? Not sure it could even be the cause but i was just playing around with that method myself recently

Greetings from the shire,