Raycasting 3D render -- Blocks Edition

I did this version that shows the time when finishing! I did a 14.127 seconds

4 Likes

Oh, I don’t know, the answer might be Never :rofl:
As to this extension it will updated as long as:

  • new feature demanded, and possible to implement
  • or bug reported, and possible to fix
  • I have time to do

Like other extensions and Makecode itself, always are possible be improved better or added new features, I think.

4 Likes

Awesome! Can’t wait to see more iterations!

3 Likes

No problem, here’s a Lantern Effect preview for you and for celebrating this extension got approved.

6 Likes

I am not sure but is there a way to move faster (forward/backward and look left/right) if not please make that a thing!
That would be cool because in the speedrunning version I made you only have to kill the first guy to pass the door… So shooting doesnt get rewarded.
But I want the played to run faster for a second after killing an enemy! (To make speedruns more demanding and need good coordination)

1 Like

cool idea, shooting enemy shoud get reward of speed, in a speedrunning game.
This block can help:
image

2 Likes

Hello again!

Here’s a few ideas I have for the Raycasting plugin.

  • Camera Sway or Camera Shake (This would allow for things like the camera moving up and down while moving the character (like View Bobbing, but I don’t know the proper term.))
  • Particle Effects (this might already be possible! I’m not sure.)
  • Adjusting specific tile WallZ scale. (Considering that you use Tilemaps, this could make things pretty interesting! Might go against your thought of keeping things simple.)
  • Simple block for making Projectiles. (Don’t know if this is needed, but it could make certain things pretty easy!)

Thats all I have so far, have a great day!

2 Likes

OMG I didn’t know lantern effect worked on rendering. This is awesome!! Thanks for the demo!

3 Likes

Ooh these are great ideas!

One other one I was thinking would be cool was if you could set a separate tilemap for ‘ground texture’ - that takes in the tilemap as a parameter and uses that to draw texture for the ground only. That might be a bit of a rabbit hole though depending on if you want to extend the physics engine to account for overlaps / etc on that second tilemap or just having it be only visual. (Or another option would be to have the ground tiles be the original tilemap, with the new block being something like explicitly set 3d tilemap, but that’s also pretty messy)

6 Likes

Hi guys!
So sorry for late response, I have to take care kids whole day recently.
Thanks for your ideas, keep on these discussion please, I am reading and thinking about them.
And I will reply as soon as possible.

2 Likes

Hi @CarltonFade
For your feature advice 1.

I searched in youtube, found https://www.youtube.com/watch?v=Vu0PqUFVuMY
Sway effect in this video include left/right transfer, and a slight rolling of camera also(let me know please if I was wrong). The “transfer” is easy in our render, but the latter, we can’t do a “roll” in raycasting. So following is a preview, with left/right transfer only.
Added sway range setting in existing “move with controller …” block

Do you think, is this acceptable? (To say the truth, I felt a little sick after played a while. :joy:)

2 Likes

Hello!

The feature works well, but usually the left/right sway is a lot less and the camera moves up and down, somewhat like a figure 8. (if this makes any sense) I can’t find a great example, which really sucks but this is really close! (The feature itself is pretty funny lol.)

Thank you, have a great day!

1 Like

The “figure 8” does make sense.
I will improve it later.

2 Likes

I know this is kind of a hack, but you already have the jumping code, so can’t you just make swaying up/down based from the jumping code like this? (I know it goes up and down when against the walls, but myself sprite velocity x/y don’t work.

4 Likes

That’s cool dude!
You did it in a clever way! And the walking become vivid finally.
I will implement it just like it, but with inside values ZOffset, ZVelocity, ZAccelerate instead. (Bocks for accessing them has done, and will release in next update)

The same issue in my preview, have no good idea to solve it yet, cus I can’t got a actual value which indicate the sprite really moved a distance. Maybe I missed something. :confused:

1 Like

The #2

If you ask me this last week, I must answer “impossible”, cus these particle draw to “screen” object directly. But now, it would be “very possible”, cus I got an idea to override the “screen”. Actually, override updateScreen() method with a fake screen object, copy particle result on “screen” to that fake screen with our logic (position, scale, color fade, etc). This would cost a little of FPS, for there would be one more copy and calculating.(and a fill(0), but it’s extremely fast)
I haven’t done the feature preview/POC yet. Have a look at this, if you interesting on it.

5 Likes

you could always take the position of the sprite at the end of the frame and compare it to the position the next frame (current position - previous position), then to get the velocity, multiply the calculated value (current position - previous position) by 50 (or the number of screen updates that happen every second).

2 Likes

It is possible to render a ground texture (as seen with KWX’s demo in makecode kart), but Idk how easy it would be to render walls and a floor at the same time (and have them look “connected”). You could have tiles in a tilemap that are set to be walls render like the current renderer does, and tiles that are not set to be walls could render as a floor texture. (just a few ideas, don’t feel too much pressure to implement them @AqeeAqee)

3 Likes

Hello, @AqeeAqee, I really love your extention but I wanted to ask if you could make (or if one already exists) a way to turn raycasting ON|OFF, because the player keeps moving if I, let’s say make a main menu and it is kind of bothering.
Thanks, S0m3_random_guy

1 Like

preview Paticle Effects

Made it !
With somewhat perf cost though, and a littel tremble (might not obvious in this preview)
No new block/func and operation required, just start particle effect with Arcade block, auto takeover also.

5 Likes