#Need help with correct window configuration : GameOff 2024 project related help

1 messages · Page 1 of 1 (latest)

craggy sleet
#

`

Called every frame. 'delta' is the elapsed time since the previous frame.

func _process(delta: float) -> void:
# Add the gravity.
if not is_on_floor():
velocity += get_gravity() * delta

if player!= null:
    if Input.is_action_just_pressed("interact") and is_on_floor():
        isCubeAttached = !isCubeAttached
        
print("Is Cube attached ", isCubeAttached)
print(global_position)
handleCubeHorizontalMotion()
move_and_slide()

func handleCubeHorizontalMotion() -> void:
if player != null:
cubeDirection = player.playerDirection
else:
cubeDirection = 0

#print("Is Cube attached ", isCubeAttached)
if isCubeAttached:
    velocity.x = cubeDirection * player.SPEED
else:
    velocity.x = move_toward(velocity.x, 0, velocity.x)

func _on_player_detector_body_entered(body: Node2D) -> void:
if body is Player:
player = body
print("Cube detected plaer")

func _on_player_detector_body_exited(body: Node2D) -> void:
if body is Player:
player = null
print("Player left cube")
cubeDirection = 0
isCubeAttached = false`

This is my cube code. I am observing this behavior : (video attached)

Print logs:
Is Cube attached false
(nan, nan)
Is Cube attached false
(nan, nan)
Is Cube attached false
(nan, nan)

tardy garden
#

your speed isnt too high any chance?

craggy sleet
#

nope it is working fine when i am trying to pull the upper box individually

nova temple
#

Cubes getting sent to the shadow realm

craggy sleet
#

lol

#

Fixed it, used rigidbody and changes the entire way i coded it

craggy sleet
#

Can anyone help me on why is the floor missing when i export and run html buiild. What will be correct window settings? I have set 1920 * 1080 the normal one

#

web export vs debug.exe

attached later (i thought deleting here and pasting again will work but after deleting old photos it did not allow me to post new photos)

craggy sleet
#

Need help with correct window configuration : GameOff 2024 project related help

worldly laurel
#

Try going to the full screen mode.

bold sphinx
#

ah i see we had the same idea XD

#

you should at least enable keep aspect in the Window settings.

craggy sleet
#

How do i then ensure that atleast the length and width ratio remains same in browser if not the screen size

craggy sleet
#

Wait let me post my configs here

bold sphinx
#

okay that looks like how it should be.
I'm not that experience with web export, could be that resolution works differently there, as it's not its own window.

craggy sleet
#

no issue. @worldly laurel can you check the configs and guess what might be wrong?

worldly laurel
#

Maybe try reducing the width of viewport so it creates black bars.

bold sphinx
#

it's also not clear if there is actually a problem since the "comparison" pictures don't have the same camera position.

#

or even position in game

craggy sleet
#

Oh right let me update the pics properly thanks for pointing it out

#

The floor is missing

bold sphinx
#

yeah that looks like the bottom of the screen got cut off because the browser header limits the screen height.

#

could it be that you're limiting how high the camera can go?

craggy sleet
bold sphinx
#

i checked in the browser with aspect keep and it works properly for me.

#

can you check by resizing the window that keep aspect is actually enabled?

#

because the first picture is too wide to actually be 1920x1080, so even that one should show some black bars.

craggy sleet
#

Hey you are right it is not maintaining aspect ratio. I tried resizing

craggy sleet
bold sphinx
#

so this doesn't seem to be a problem specifically to the Web.

craggy sleet
#

But then why is it not maintaining the aspect ratio ?

bold sphinx
#

no idea. the setting only gets read at project start as far as i know.
You could use print(get_window().content_scale_aspect) to check what this setting is while the game runs. it should return 1 for keep aspect.

craggy sleet
#

🙂

#

so i am not getting logs

bold sphinx
craggy sleet
#

yeah normally it is returning 1

bold sphinx
craggy sleet
#

yeah

bold sphinx
#

this sounds like a weird bug, but not one i'm able to replicate. what godot version is this on?

craggy sleet
#

4.3

bold sphinx
#

okay same as me

#

@worldly laurel we found out that it's not just a problem with the web export but in general, that the window doesn't scale the viewport correctly despite aspect set to keep.

craggy sleet
#

can you send me your window configurations?

craggy sleet
#

let me try copy pasting and praying that it works

worldly laurel
#

I have no idea what to say or do now.

#

I am gonna go procrastinate a bit now

#

Bye

bold sphinx
#

the stretch mode is the only thing i changed

#

it also worked properly wen set to maximised instead of windowed.

#

the only thing i could think of is you sending me your project.godot-file and i test if there is some setting that prevents it from working properly.

craggy sleet
#

i tried your configs but now i am unable to resize. the tile bar is gone 😦

bold sphinx
#

huh? that's weird

craggy sleet
#

This is my second time exporting 🙂 In my last project i did not face this issue

bold sphinx
#

i can resize it just fine, and i also have the tile bar showing.
Do you have simlar problems with other projects or is it just this one?

craggy sleet
#

Tile bar thing i am not sure for other projects since the viewport is much smaller

#

but those are not resizeable

#

even tried switching to forward from compatibility

bold sphinx
#

so you have that problem with all of your projects?

craggy sleet
#

i assumed thats just how godot behave 😭

bold sphinx
#

fortunately/unfortunately no

craggy sleet
#

the hell

#

what should i do now

bold sphinx
#

i have no idea unfortunately

craggy sleet
#

do you know anyone who can help out?

bold sphinx
#

the only thing i can think of is that your godot executable might be damaged somehow.

craggy sleet
#

Ooh, should i try uninstalling and reinstalling godot?

bold sphinx
craggy sleet
bold sphinx
#

godot doesn't have to be installed, so executeables work individually from eachother

craggy sleet
craggy sleet
#

i can try that

bold sphinx
#

okay, i tried the project, for some reason stretch mode was disabled.

#

enabling made it work properly

#

but you showed your screenshot so this should only be a difference between the repository and your local verison

craggy sleet
#

Yes i am trying a bunch of things

craggy sleet
bold sphinx
craggy sleet
bold sphinx
#

did you have any success with redownloading godot?

craggy sleet
#

I am going to do that now. Went to have dinner. Also for some reason the tilebar disappears if i disable resizeable. If i enable it tilebar appears

craggy sleet
craggy sleet
bold sphinx
#

that is some strange behaviour. reminds me of how ui nodes resize. are you using a Subviewportcontainer?

craggy sleet
bold sphinx
#

yeah, and i also checked this scene and it doesn't contain one.

#

is the version on Github an old one?

#

because that one doesn't have the issue when i tried it, so you could check differences between it and your current version to narrow down what could cause this.

craggy sleet
#

let me do a git reset

#

and check

#

but i think i am facing this from day 1

#

atleast the resize stuff

bold sphinx
#

well the good news would then be that it should probably only be a problem for you, not others that then play the game.
the bad news is that i don't know if it would then be something that could be fixed with a godot update.

craggy sleet
#

okay so after git resetting, yes the exe file is resizing, but html is not

bold sphinx
#

well that's at least one victory.
oh, could it have something to do with the settings of your web export preset?

craggy sleet
#

okay, so now i tweaked web export settings and floor is visible health bar is gone 🙂 but atleast now i know where to tweak

#

not yet resizeable but

bold sphinx
#

the setting canvas resize policy seems to make it so you have to set it to adaptive to work properly. at least for me.

craggy sleet
#

yes did that

bold sphinx
#

but still progress of some kind

craggy sleet
#

Yeah

#

I dont know what else to tweak in web exports

bold sphinx
#

i'm also not that experienced, i would suggest that you report this on the github, this sounds like either a bug, or just really unintuitive design, both bad.

#

although of course your current main concern would probably be the deadline of the game jam.

craggy sleet
#

Yes exactly

#

I can try halfing the viewport width height and camera zoom

#

And see atleast if it is playable without getting cropped

#

I mean the entire viewport should be atleast visible unlike current situation 😭

bold sphinx
#

yeah...

craggy sleet
#

didnt help after html export

#

😭 i dont know what the hell is happening

bold sphinx
#

me neither

#

you could maybe ask the question specifically in the #web-html-js chat.

craggy sleet
#

did that thanks