Pseudo 3D Examples

Next step…Beat Unreal engine 4 …impressive work, is that cow made with program or is it imported?

2 Likes

The cow is downloaded from the internet. You can use many obj files but I only support 2 instructions out of ≈ 8 of the obj file format, so only basic models work. You can make one in blender and should be able to import it if you export it with the right options.

1 Like

Can I know the method of importing the obj and can I have the file?

1 Like

The project is downloadable in the javascript channel of GDevelop’s discord.

To load a 3d model, scroll down the first JS event and at the end uncomment the loading method you need, comment the cube loading and save the project before starting the preview.

Make sure to modify the Z position in the second JS event to make the object far enough to not clip into the camera.

1 Like

Hello all! I decided to publish pseudo 3d example with the camera rotating. First post updated.

8 Likes

Maybe someone will be interested - raycasting test 3, I was able to improve the emission of rays using the condition “Raycast”, it works instantly, but so far it is impossible to make walls with textures without bugs. But this pseudo 3D method works faster than the non-ray method and I will try to develop it further.

11 Likes

That’s awesome! I’ve been watching your other videos with textures and it looks really nice! :+1::+1::+1:

1 Like

Thank you! I also like how it looks :grin: It is a pity that so far it will not work to make a full-fledged game, a lot of things still need to be finalized

2 Likes

This is amazing. :sunglasses:

1 Like

Hi everyone, a gdevelop newbie here, although I’ve dabbled in amateur game development for about 20 years, starting with, among other things, Klik & Play. So I’m pretty used to gdevelop’s even system.
I downloaded Mikhail’s work from his comments on YouTube (I go by the handle elveede there) and have experimented with it a lot.

My question: Does anyone have an idea how to integrate mouse look (only horizontal) into this pseudo-raycasting “engine”? I’m not sure gdevelop can catch the mouse although HTML5 can do it via “Pointer Lock API”. Anyone have any ideas?

black magic :exploding_head:

1 Like

@Unluccy I’m sure that with these you can do it:

“Camera” rotation is controlled by changing the angle of the player’s sprite, so mouse control is possible. Use conditions as advised @ars_creativa .

Thanks for the quick replies!

I will try that out asap. The issue usually was that the mouse cursor can still leave the game window making it impractical. But I will see whether I just did something wrong! Thanks!

Okay, I give up. It’s easy enough to get the player sprite to move based on the mouse input (by using MouseX instead of of the Cursor X position) but it’s all useless if the cursor can move around freely on the screen?

How do I lock the cursor to the center of the window? I could not find a variable to do this, as compared to (for example) Construct Classic.

This is a problem… Сentering the camera on the cursor may help? Although I’m not sure

It occurs to me that you can hide the cursor, and make two variables for X and Y that copy and caps the mouse position to the window’s dimensions. Then you can calculate the difference between these variables to the mouse position each frame to calculate the difference of the angle and change the view accordly.

That sounds good but how do you even cap the mouse position? So far I have not found a way to interact with the mouse cursor in any way from inside the program. It’s position can only be read, it can be hidden, etc. but there is no way to cap it that I have found so far.

You don’t need to cap the mouse position, just the variables that copy the mouse position.
In pseudo code could be as is:
variable Xcapped = clamp (MouseX, 0 , WindowWidth)
variable Ycapped = clamp (MouseY, 0 , WindowHeight)

You might calculate the difference between the center of the camera and the mouse position to find the angle of movement.

And there is an action to hide the cursor:
imagen

Thanks! However, that means the mouse cursor can still leave the window, making it impossible to use it in-game. As far as my research goes GDevelop simply doesn’t support keeping the mouse cursor within the window.

1 Like