Camera Not Updating when Re-Compiled on latest Download

Hi everyone,

I am here to report something weird, I think probably even a bug, with the latest download, that adds support for MD3 body tags and whatnot.

When I change the camera translation/movement in the example demonstrating how to use MD3 tags with the human torsos, and then save the project (it prompts you to anyway when you compile and play the app, which is the same as the older versions), the changes are not saved, and it shows exactly the same output on my screen as the unmodified version that I first opened.

I tested this by A: making the camera a child of an object, in this case SceneTyrant, because the focus was already on a different model, SceneHumanBase, and it should update its position according to that (It wasn’t working either when I tried adding a ThirdPersonNavigation interface with the Tyrant model as the avatar and “Camera Follows” checked on, which I think is probably also part of this weirdness, because it also should do that), but it didn’t,

B: Keeping the camera the same position in the hiearchy, and not a child of anything else in the Viewport Items hierarchy, but moving its translation by changing numbers in the “translation” option on the properties menu, it didn’t show any different results then either,

And finally C: Doing the same as B, except moving what the camera had in its center (SceneHumanBase) instead of the camera itself, but either way it shouldn’t have shown it exactly in the same spot after I compiled and ran the changed version.

Does anyone know why this is happening? Is it because I have to update the camera in a very specific way that I am ignorant about?

I tested all A,B,C on examples/animations/md3_animations_tags/ and everything works correctly. The camera is saved in design file, and is correctly restored – both at design-time and run-time. And it works regardless of whether camera is a child of SceneTyrant or directly Viewport.Items. And there wasn’t really any camera-related changes recently, camera stuff works the same as ~month ago. I’m attaching a video recording how I’ve tested.

  • Please record a movie of what you’re doing, so that I know precisely what you do and where it fails.

  • Your description is not 100% clear, so maybe there’s some misunderstanding in how you think things should work. If you haven’t already, also please consult the manual Tutorial: Designing a 3D world | Manual | Castle Game Engine – there’s a section explaining how to deal with camera. It’s similar to other engines.

Okay, how I saved my changes was by saving it as a seperate project after each change, like in the same folder but with a different name for the .castle-user-interface file, so that I didn’t override the old one permanently in case the code didn’t work properly (which I think is the right way to save modified versions of projects you didn’t create or own yourself), and then clicking the black “compile and play/run program” button above the main window to the viewport.

I didn’t implement all the changes at once, but did part A, did the save and play, undid it back to normal, then tried method B using the same steps in the same order, and then method C using the same steps in the same order when B didn’t work.

Because doing this the same exact way in the same exact order wasn’t any different on older versions, I don’t know why it should be any different now.

Even more weirdly, in your version the camera is visible as a pyramid object, but in mine, making sure it is the latest download from the downloads page and uninstalling previous versions completely, the camera is totally invisible and unclickable, so you can’t move it the normal way (clickling on it and dragging).

Like there is no transparent gray camera icon either, where the camera’s center is, like it shows clearly in your video. I never did anything to change it, I just opened the example just like you did and it was like that from the start

If you save the design as a a different file (e.g. opened gamestatemain.castle-user-interface, made changes, saved as gamestatemain-new.castle-user-interface), note that the application (when you run it) will continue to use old design – because the view contains line like

constructor TViewMain.Create(AOwner: TComponent);
begin
  inherited;
  DesignUrl := 'castle-data:/gameviewmain.castle-user-interface';
end;

If you want the game to use a different design URL, you have to change the DesignUrl assignment to point to new file.

Creating a new filename for each time isn’t really a usual workflow – it would fail in the same way with Lazarus forms, Unity scenes etc. The game by default uses a specified design, it will not use a new design automatically, the code doesn’t update automatically which design file you consider “the one to use”.

There wasn’t any change around this (since the beginning of CGE existence :slight_smile: ) so I’m not sure what could have changed in this regard.

The normal recommended workflow is to keep saving and changing one file, matching the view Pascal unit name (so that F12 works in editor too). Use version control (like GIT and GitHub) to keep older versions, or if you really don’t want to use version control – rename older designs to like xxx-old.castle-user-inteface (but you really should use version control :slight_smile: ).

Please again send the movie showing what you do. I am speculating/guessing from your description what actually happens. It will be more productive if you just record a movie what you’re doing, then we’ll be clear what happens :slight_smile:

This feels like an unrelated (from saving) rendering problem. We had one report about in the past from @eugeneloza not seeing gizmos. Maybe it is the same issue, maybe unrelated.

Again, please record a movie what you’re doing (starting from definitely unmodified CGE example version). It’s difficult to speculate what goes wrong, seeing a movie would be much better.

Also send a report of your system information, go to “Help → System Information” and do “Save To File” from editor, and attach it here. This will allow us to see how CGE detects your GPU. In case there are rendering issues, this will make it easier to debug.

Okay, it makes more sense now that I understand why saving it as a seperate file name doesn’t work, because the app initilaizer code is told explicitly to use the file you tell it to, and will not update by itself if you start a different file.

So I think instead, I should either A: change the code to say the new name instead of the original example, or B: override the original example (you said that’s actually the intended solution, I’m assuming cause you can just undo what you did like I did with my example above)?

I will also send you my system information, I have a hi-tech gaming PC from 2020 that should not be having this problem if it can run things like Fortnite or Unreal Engine 5 smoothly, but I know the information will help you troubleshoot the problem.

Sadly,

I could not go to “Help → System Information” verbatim because the latest version of Windows 10 I am using does not bring up “Help” on the Search bar on the start/Windows button menu, so I tried just “System Information” directly, and fortunately it did come up this time,

But unfortunately, it didn’t allow me to upload the file I saved, and on top of that the option was called just “Save” and there was no “Save to File” to be found.

I did figure out however, there was an export option for different types of files than just the one it saves by default, called “export”, so I exported it to .txt (Text Document), which I know is supported on the site’s uploads.

sysinfo.txt (3.7 MB)

Okay, now that you showed me how I was saving my changes was what was the biggest thing about what was wrong/the problem, it works flawlessly now, like the camera actually updates correctly to where I want it to go.

The reason I wasn’t uploading a video was because I was telling you every step I did in the text, with nothing in between that I was hiding, so a video would show you the same exact steps just in a different form.

However, in the future I should upload a video instead of describing the problem using text, because a video will show you personally what exactly I did, whereas using text is subject to interpretation and misunderstanding?

Working on the design by updating (overriding) the same file is indeed a recommended, standard approach. You would use it with any software, any game engine – when you modify e.g. Delphi/Lazarus form, or Unity scene, you’re also supposed to just modify the file, not create a new one for each modification :slight_smile:

To be clear, the undo functionality in CGE only works to undo changes in the current editing session.

To be able to always undo, go back to past revisions, use version control (like GIT and GitHub). This is unrelated to CGE.

The “Help → System Information” menu item is in CGE editor, not in Windows :slight_smile: Sorry I wasn’t clear about it. Here’s how it looks. There’s “Save To File” in the bottom-left.

Thank you for the sysinfo.txt, but I’d still like to see CGE output of “Help → System Information”. This tells us how CGE sees your GPU.

Video is better, because it’s too easy to miss things in a text description.

We have demonstrated this above in this thread – you submitted a description of A,B,C, you described them precisely… but you missed the fact that each time you do it, you save it to a new file, instead of overwriting the same gamestateview.castle-user-interface. And that was actually a critical information to debug when things go wrong.

So a video is better, because this way I can see even details that you didn’t think are relevant, but they may be :slight_smile:

I’m also unsure how the camera rendering problem looks like in your system now – again, this would be obvious to me if I would see recording (or screenshot).