Hey there. This is my first time posting.
I have been working on a "clone" of games like Terraria and Minecraft for about a month now. I figured it was time to show off progress a little bit.
The world is generated in chunks, and is effectively infinite (rounding errors make the game spaz at ~2-billion tiles out). Right now the basics of world generation, physics, collisions, and player controls are in place. Crafting, combat, and lighting have been partially implemented. Other things such as lighting, enemies, and world saving/loading are planned as well.
Constructive criticism and ideas are welcome, and encouraged, for both the game and the code. If you have any questions or issues please let me know.
Thanks for your time
If you want to keep up with progress, bookmark the itch.io link. I post updates frequently to that page.
https://cavegame.itch.io/play
Controls:
A, D - move
Space - Jump
Click - use item
Scrollwheel - change item
Escape - open inventory
Tab - open console
Edit: reuploaded the .love with a few bug fixes.
Edit 2: putting up newest edition of the project, along with some new info.
Edit 3: bumping about major updates.
cave game - generic terraria clone
cave game - generic terraria clone
- Attachments
-
- cavegame-0.3.love
- (454.52 KiB) Downloaded 573 times
Last edited by josh_uu on Fri Sep 20, 2019 6:13 pm, edited 2 times in total.
epic epic epic discord: joshuu#6360
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: cave game - generic terraria clone
Well, I fell through the floor when switching active windows. I believe it is a derivative of the bullet tunneling problem. It is repeatable if you grab the window and shake it while over a cavity in the ground. If the frame rate drops a sufficient amount you will fall through the ground. You can also get stuck in a space not big enough for the player by doing that. You should add a keyboard method to change items. Some crazy people play games on a laptop with no mouse. Otherwise, this is very good so far.
Re: cave game - generic terraria clone
Yup, that's exactly right. I've looked into finding a fix, but honestly just haven't gotten around to it yet.
For the keyboard-swapping, I suppose the standard 0-9 keys are a logical choice. I'll go ahead and add that today.
Thanks!
For the keyboard-swapping, I suppose the standard 0-9 keys are a logical choice. I'll go ahead and add that today.
Thanks!
epic epic epic discord: joshuu#6360
Re: cave game - generic terraria clone
Capping dt should work as an easy fix. It's probably also a sensible fix.
Re: cave game - generic terraria clone
Hey, thanks for the tip. It seems to fix issues caused by lag or window scaling/dragging. Now I just need to fix collision solving having a tendency to teleport you randomly if you get stuck inside tiles, as well as tunneling from massive velocities.
epic epic epic discord: joshuu#6360
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: cave game - generic terraria clone
If I recall correctly tunneling is caused by predicting the location after movement and if there is no collision then you are allowed to move. If the next location is extremely far away you can travel through walls because you are only testing the target location and not everything in-between. Large delta times and velocities both cause this. You can cap the velocity in the game very easily. You then only have to worry about the delta time. The solution for this I believe is a fixed time step. Essentially you set an acceptable delta time for your game to run at. If the fps is higher causing a lower delta time you skip the update callback to get to the target delta. If the fps is too low you would call the update callback more than once. You would probably have to set the max velocity to where at most you move only one block per time step. Raytracing might also be a solution for things that have to move fast.
Example of fixed timestep:
https://gist.github.com/Leandros/98624b9b9d9d26df18c4
Example of fixed timestep:
https://gist.github.com/Leandros/98624b9b9d9d26df18c4
Re: cave game - generic terraria clone
Awesome, thanks for the tips. For now i've made naive adjustments by clamping velocity and deltatime before passing them to the physics solver. In the meantime, I also just finished up the fluid mechanics. Open the console and type if you want to try to break it. Here's the new .love file.
Code: Select all
give water_tile 999
- Attachments
-
- cavegame.love
- newer version Aug 24
- (424.41 KiB) Downloaded 397 times
epic epic epic discord: joshuu#6360
Re: cave game - generic terraria clone
Another progress update. Implemented rope climbing, and partially implemented lighting. My flood-fill algorithm does not yet account for when light sources are removed, maybe I can find a fix soon.
https://youtu.be/mq1KwwmNUwc
https://youtu.be/mq1KwwmNUwc
epic epic epic discord: joshuu#6360
Re: cave game - generic terraria clone
Not entirely sure what you mean by clamping velocity, but what I usually have in the start of love.update(dt) is:josh_uu wrote: ↑Sat Aug 24, 2019 7:27 pm Awesome, thanks for the tips. For now i've made naive adjustments by clamping velocity and deltatime before passing them to the physics solver. In the meantime, I also just finished up the fluid mechanics. Open the console and typeif you want to try to break it. Here's the new .love file.Code: Select all
give water_tile 999
if dt > 0.1 then dt = 0.1 end
Who is online
Users browsing this forum: Google [Bot] and 2 guests