New 3d Engine - Help filling 4-sided polygons

I fall through the world when I try to go on the slopes :confused:

2 Likes

If you change the side count (with up/down) you can glitch through the world, or if the sides are 3 or less. Otherwise, I’ve tested thoroughly and have never glitched out of the world.

2 Likes

Same here…

2 Likes

Sorry, the collision wasn’t super great but I will continue to work on it… I didn’t do enough testing and the old method wasn’t good because it didn’t take into account multiple polygons per frame at once. For now, I’ve removed the collision so I can work on a new system, but I implemented depth sorting. This was extremely painful to implement because of 1 bug (related to keeping the textures in the same place even though the rendering order changes) that took me most of an afternoon and evening to resolve while the rest of the code for depth sorting took like an hour. There are some rendering flaws (very minor, on some corners and when you move too fast), and the system wouldn’t work for a full 3d world, but in exchange it is heavily optimized. It’s only for when you’re outside the tunnel (for now) so it should be sufficient. With all that being said, here’s the demo at this point:

3 Likes

i mad the resolution four times bigger and the bigger the resolution the more ofset the tunnel is
image
4 times bigger
image
normal size
image
8 times bigger

but over all the fps is great even at 1920x1440 i still get a good 40-80 fps (at the normal screen size (160x120) i get 270-300 fps)

3 Likes

Thanks for letting me know about that bug! I hardcoded some stuff but I’ll try to fix that moving forward. I am away for now but I’ll be back and coding in the near future!

(I think if you go into typescript into where it draws the polygons, there are variables for the position it draws and in that is + 80 for width and + 60 for height, supposed to draw it in the middle of the screen. If those are changed to screen.width / 2 and screen.height / 2, this b7g should be fixed.)

2 Likes

alright

1 Like

now that i think about it 300fps is about what i get in minecraft :skull:

2 Likes

I can hardly reach a stable 60fps in Minecraft at a 12 chunk render distance XD

1 Like

Also here’s a version where the screen’s dimensions aren’t hardcoded (and I just threw in the kiwiphoenix364/pxt-double-res extension.) I still don’t have collision in the game though. Maybe eventually…

6 Likes

Venge is gonna look crazy.

2 Likes

Are you going to create run? That would be really cool

2 Likes

Here’s my new version with collision… Again… (but it works this time)

Thanks to Bing AI for showing me some stackoverflow pages and helping write some matrix math code to determine the intersection point between 2 lines. The weird collision logic I did myself though. There are still some bugs like getting stuck on the outside of the tube, but you shouldn’t be able to easily glitch in/out of it without changing the number of sides. There are some issues with corners, more easily visible if you switch it to 3 sides and jump straight up, but it is a vast improvement over previous iterations. These issues probably won’t be as difficult to fix though.

6 Likes

Yeah, that’s the goal!

2 Likes

12? i use 24 chunk render distance lol :skull:

1 Like

I will put some twists on it though. I’m going to make it first person (unlike the original.) Gravity shifting will be added soon. If you have some ideas for things to get added, just comment them, and I might add them! They just have to fit the game and be feasible to code. No guarantees, but I’ll definitely consider recommendations.

3 Likes

I definitely want to see some kind of boss fight or combat system to go with navigation I think that would be interesting

2 Likes

Ummm… if you jump while it’s shifting you end up glitching out of tube/tunnel thing.
Screenshot 2024-01-17 5.40.33 PM

1 Like

also if you spam the multiplier or whatever it is enough it starts unraveling?
WARNING: VERY CURSED IMAGE
Screenshot 2024-01-17 5.47.29 PM
UMMMMMMMMMM…

2 Likes

@Kiwiphoenix364 can you make the character a little bit faster?

1 Like