Need Help Understanding how to Assign a Transform as an Avatar of a Third Person Navigation Camera, After Following Instructions

Hi everyone,

I made sure to follow the instructions given carefully and calmly to me earlier, about how to assign a Transform object specifically as a target of a third person camera and not just one Scene, and I do not get any errors anymore because I made sure to be particular about typing, declaring and initiailizing everything exactly in the way I was told the first time this time,

but unfortunately, I still get a blank black screen after I load up the game, for the project I want to work on.

Does anyone know if I am perhaps doing something else wrong that I am not aware of?

The link to the project in full is:

Does anyone know what I did wrong here?

I made sure to be careful about only including what was instructed of me the first time here, rather than copy pasting huge blocks of code mindlessly,

But I believe I probably didn’t include something else after I calmly and politely followed the instructions given.

Does anyone know what else I need to fix or add to make the game actually work, perhaps michaelis who has always thoughtfully helped me out from the start?

Thank you very much in advance.

Hi everyone,

I saw I didn’t or forgot to add the custom Navigation to the viewport on the main program start, but even after I added that I still didn’t get anything but a blank black screen on starting the program, even though it starts perfectly and error free.

I also left out the parts about animation on purpose, because I want to do things one at a time and also because having animations shouldn’t be related to whether I can view it or not - that just wouldn’t make sense, because I can view most things without any animations just fine.

Does anybody know what else I need to do so that the level and player character show correctly?

Thank you very much in advance :slight_smile:

Quickly looking at GitHub - JPF12141999/Toy-Story-2-Ripoff-Game: Ripoff of Toy Story 2: Buzz Lightyear to the Rescue, which takes place in the SpongeBob Universe instead. :

  1. You placed all files, code and data, at the top-level folder of the application. This makes it hard to see what’s going on. Please move data files to data/, code to code/, as all CGE examples do and as new CGE projects (created using “New Project” from CGE editor) have.

  2. Your code defines TThirdPersonNav derived from TCastleThirdPersonNavigation, and then MyThirdPersonNav derived from TThirdPersonNav. This is not necessary. You need only one descendant from TCastleThirdPersonNavigation.

  3. The SetAnimation has to be declared with override, right now it obscures the virtual method instead of overriding it. The compiler warns about it:

    .../gameviewplay.pas(38,15) Warning: An inherited method is hidden by "SetAnimation(const {Open} Array Of AnsiString);"
    
  4. Your design refers to absolute filename that can only work on your system: file:///C:/Users/Joshua/Downloads/SandyTreedome-zipline.glb .

    When you were setting this, CGE editor warned you that it will not work, that you should place things inside data/ subdirectory, and then URLs would be relative to data like castle-data:/SandyTreedome-zipline.glb.

    Please fix your project to work on other systems – as mentioned above, move data to data/ subdirectory, and make sure your design refers using castle-data:/ URLs. ( Data directory | Manual | Castle Game Engine )

I didn’t yet get to actually see the blank screen, so I can’t comment on your exact question. If you fix AD 1 and AD 4 above, I’ll be able to easily test the project on my side.

Okay, awesome! Thank you very much for the helpful feedback.

I noticed myself that it probably wasn’t the right way to format the upload, because again only I could see where the “.glb” was the old way, but didn’t understand how exactly I should upload the files.

I tried following what the examples did by learning by imitation, like you suggested I do from the start, as in putting all the data in “data” like the examples do, but unfortunately even after I put everything in a neat ZIP I was told it was too much data (the exact error Github said was something like “Yowza! That’s a big file!”)

Do you know if maybe I should upload it to Google Drive or something similar instead, if Github doesn’t like the sheer amount of data (every file counts for the game to work unfortunately, there is no way I can cut down on any of it at all).

I don’t understand what you tried to do, when did you experience the error about “too large files”. I wasn’t suggesting to use ZIP file for anything.

I was suggesting to update the project source code, and what is in GitHub - JPF12141999/Toy-Story-2-Ripoff-Game: Ripoff of Toy Story 2: Buzz Lightyear to the Rescue, which takes place in the SpongeBob Universe instead. , to have data subdirectory and code subdirectory. Move data files, like *.glb files, to data.

See how all CGE examples look like, see how “New Project” done by CGE editor looks like (if you created a project using CGE editor, you should have already seen data/ subdirectory, so I guess you deleted it). See castle-engine/examples/fps_game at master · castle-engine/castle-engine · GitHub , Castle Game Engine Overview For Unity Developers | Castle Game Engine .

And note that

I already tried that is my point, and when I uploaded everything as it was from the original folder, I got accused of uploading too much data.

Your point though is that on Github I can make the folders manually and then put everything from the appropriate folder in the Github folder? Makes more sense now.

And probably don’t upload everything all at once, but just do it in pieces, as well, is an obvious answer

I don’t know why GitHub accuses you of uploading too much data. I would need to know what did you try to commit.

If you clone fresh GitHub - JPF12141999/Toy-Story-2-Ripoff-Game: Ripoff of Toy Story 2: Buzz Lightyear to the Rescue, which takes place in the SpongeBob Universe instead. , you will surely be able to just move files to data and commit that. All your files are ~52 MB.

I know it’s weird but it really did think it was too much data trying to upload it all at once, so instead I will just do it in pieces.

You would need to commit > 2 GB of data to make it “too large for single push”.

All your files are ~52 MB. You don’t even need GitLFS. They fit within all GitHub limits.

If GitHub accuses you of trying to upload too much, then you have tried to upload something weird, well above your actual data files.

Follow my advise –

If you clone fresh GitHub - JPF12141999/Toy-Story-2-Ripoff-Game: Ripoff of Toy Story 2: Buzz Lightyear to the Rescue, which takes place in the SpongeBob Universe instead. , you will surely be able to just move files to data and commit that. All your files are ~52 MB.

I uploaded every single thing in the project and not just the data, like the “castle-engine-output” and “backup” as well, which would make it exceed the data limit; you are saying though I just need to upload the data itself?

I can understand the backup and castle engine output not being necessary, because those aren’t relevant to your project data, but I think the code is still needed as well as the Lazarus file (the lps file).

I get though, the data needs to go in “data” because that’s exactly how it was in the original.

Okay, and actually I was still 100% right about being accused of too much data, except the error message is “Yowza! That’s a lot of files!” rather than “a lot of data”.

So again, I just know to be patient and upload it a couple of files at a time, although tedious it will pay off in the long run.

  • Don’t upload castle-engine-output. There’s a file inside it called DO-NOT-COMMIT-THIS-DIRECTORY.txt and the contents explain to not commit it.
  • If you create a project using editor “New Project”, you have .gitignore that tells all GIT tools to ignore this directory. You actually have this file: Toy-Story-2-Ripoff-Game/.gitignore at main · JPF12141999/Toy-Story-2-Ripoff-Game · GitHub .
  • See at example CGE projects I pointed above. They don’t have castle-engine-output.

I guess you have already made too big commit, and now you cannot push it. Follow my advise:

If you clone fresh GitHub - JPF12141999/Toy-Story-2-Ripoff-Game: Ripoff of Toy Story 2: Buzz Lightyear to the Rescue, which takes place in the SpongeBob Universe instead. , you will surely be able to just move files to data and commit that. All your files are ~52 MB.

Make a fresh clone.

If you have made any modifications to your sources since the last push, copy them over manually to new fresh clone.

Alternatively, learn how to “undo unpushed GIT commit”. (git reset --soft HEAD^, but do not paste and execute this line blindly if you don’t understand what it does or without doing backup of all your work).

This is now a GIT usage problem, unrelated to Castle Game Engine. If you have issues with this, please ask around on GIT related forums and read GIT / GitHub docs.

Yeah, I get all of that, so I am just going to do the clone with only the data, just like the example projects do.

Okay, now it’s all uploaded according to how the examples do it, so I don’t include the .exe files or anything like that, only the most necessary files.

I also made sure to refresh the page constantly a couple of times to just be extra safe the changes went through.

I didn’t want to start a new project for no reason, especially if it’s a duplicate of an existing one, so I just deleted all the old files and re-uploaded the newest ones, and again not every single file in the folder but only the most necessary ones.

I also fixed points 2 and 3, about the unecessary and/or missing code, like how I need “override” to actually override the line; it’s all fixed now in the latest upload.

Thank you, indeed all 4 points I mentioned in Need Help Understanding how to Assign a Transform as an Avatar of a Third Person Navigation Camera, After Following Instructions - #4 by michalis are solved in the latest version of GitHub - JPF12141999/Toy-Story-2-Ripoff-Game: Ripoff of Toy Story 2: Buzz Lightyear to the Rescue, which takes place in the SpongeBob Universe instead. and I can test the project easily.

I see the problem (blank screen), looks like because of initial camera direction being exactly orthogonal to a “side vector” of avatar. Please give me some time and I’ll get back to you with more complete answer – how to avoid it.

Awesome! Thank you so much!

I am definitely excited to be able to solve this issue, so that way I hopefully have a functional game I can proudly show everyone :slight_smile: