Open comments for this post
I can’t find a solution that works for me with the default Unity Rigidbody system. So I have an idea.. What if I write my own? I could write my own physics system so I can have more control over how the velocity is calculated in an object. But, then I’d also need to do my own collision system logic, so I’ve been thinking…
what if I make this game with a bareknuckles engine, like raylib? It honestly feels like it might be easier for me, since it would load and run faster than Unity, use way less resources which would let me develop quicker on my laptop.
One can maybe see the Unity project as a prototype. It served the purpose of showcasing that I can figure out the necessities for making a game of this caliber, and to show me how much I dislike Unity’s physics system for this sort of work, especially with how my laptop interacts with Unity.
I’m gonna look into a new engine for this project. And worst case, I’ll write one myself. Maybe I’ll just write my own physics engine in Unity so I can keep the comfort features of the engine. We’ll see.
Happy coding.
Open comments for this post
Phew, this took me a while, mainly because my school laptop is slow as heck! But, hey, now you can have rotating objects! As seen here, the player stays aligned with the object until it leaves the confines of the “atmosphere” of the spaceship, where you can then see the spaceship swing around the planet in an ellipse shape as it spins! How much fun!
I also fixed a fix I made for the visitor system, as well as changing the crosshair (I’ll be adding interactables soon and so I want to have different crosshairs for when you can interact with something and when you can’t). Oh, and, I fixed the realignment code for the player to snap the player to the desired gravity after the while-loop is complete. This is mainly so if I adjust the realignment speed to something ridiculous that it will still result in the correct gravity being set.
Anyhow, that is all for now. Have a lovely day fellas, and I hope me being sick doesn’t interfere with the development of this too much.
Tomorrow I want to add interactables and an inventory system, although I should probably focus on the player movement rewrite. I guess we’ll see!
Happy coding!
Open comments for this post
So, I’ve been working on two very cool things for Starventure in the past few days.
First off, a sprinting system! Fairly obvious, you can sprint and you can drain stamina, just like the jetpack. Easy as that!
Speaking of stamina, I changed the DepletableResource script to only accept drainers, because trying to balance drainers and restorers became very confusing and inefficient when you only had two systems using the same resource, so I fixed that, yay!
I have also abstracted a good chunk of the gravity/planet system, so now we can have cool things such as homogeneous gravity fields! This is, as you can see, going to be used in space stations, because.. well it’d be weird if your gravity was spherical whilst you were standing on a plane, right? I’d definitely say so.
So, what’s up next? Well, I do wanna work more on the player controller to fix a bug that’s been plaguing me a good deal ever since I made the player force-based, when I limit the player gravity, I also limit the fall speed and jetpack force of the player! This wouldn’t be an issue if I was using regular gravity systems, but due to the complexity of gravity that is ever-changing and affects multiple axes at times, I’ll have to think of a solution. My main idea right now is to either get rid of acceleration forces and only move the player through impulses, which means there’s no need for a speed limiter, or something else. Or calculating the actual gravity velocity at runtime and approximating the raw movement forces. Or maybe I just calculate the forces right then and there and call rb.AddForce with ForceMode.VelocityChange at each FixedUpdate call once..
… that last one seems the most doable. I’ll keep y’all in the loop.
For now, I’ll work a bit on the camera rotation system, since travelling between gravity sources while your camera is rotating is… not fun.
See y’all!
Open comments for this post
Alright, let’s do this.
So, as I promised, I finally did something about the horrendous visuals of the past devlogs. Now, it’s still not the prettiest game ever, but I think the textures I got from ambientCG definitely make this more pleasing to look at!
Also, I revamped the player movement and jumping… why? Because moving on moving planets didn’t work at all! So, now the player movement mainly consists of a bunch of wacky _rb.AddForce(…) calls, as well as a somewhat janky speed limiter that I definitely have to work on, or… I could call the slow falling speed a feature… let’s do that, it’s a feature of the jetpack now.
Also, as I just mentioned, the jump has been replaced by a jetback! Now you can float around a planet… until your stamina (or fuel) runs out.
Oh, right, that blue bar in the top left of the game view is the stamina bar, just incase you had no idea what it’s there for.
So all of that definitely took me a considerable amount of time, especially since I had to wrap my mind around how I wanna handle jumping and gravity and limiting the player’s speed all at the same time. The system isn’t perfect, but, eh, screw it. Good enough.
Now I will head off, talk with some friends, and maybe code more after that. But for now, I’m gonna take a break until tomorrow.
Happy coding! And remember that you are all awesome!
Open comments for this post
Welp, this took me longer than I want to admit, but… you can finally jump between planets without your player’s view suddenly snapping and disorienting you. Now it still disorients you, but smoothly~
I’m very happy with how this is turning out and I am honestly just so glad I finally have this working, it was such a major headache. I really, really, wanted to use DOTween for this, but for the sake of me I cannot figure out how to make it work properly, actually writing this I have an idea. I’m gonna try that, but for now, I’m using a regular coroutine.
Now, I’m getting bored of looking at these bland cubes, spheres and this default skybox. I wanna make it feel more like space. Time for dev art!
Happy coding!
Open comments for this post
Alright, more stuff to showcase!
This time I worked on an orbiting system, so I can make stuff spin around other stuff, how neat!
I’m mainly going to be using this system for stuff like space stations, which I’ll add later on in development, or moons. Also, since I made it so the orbit ellipse is actually an ellipse! Which means I could make a full on solar system!
I am planning to do that, btw, I made a whole visitor system which parents StellarObjects like the player or scrap you might drag along with you to the player they’re currently on (which is determind by if they’ve collided with the AtmosphereCollider).
So, hey. Things are looking pretty good, if I do say so myself.
Now, I’m gonna go fix up the system for changing the player rotation when you jump between planets. Happy coding!
Open comments for this post
Alright! More stuff to showcase!
Been doing lots of work on the player controller today, mainly trying to figure out how the heck to make it function properly.
My first approach was to make a Rigidbody player controller like I did lots of times for my (failed) FPS projects. However, that resulted in my character either not moving, or slingshotting at mach 10 across space. And since it’s encouraged to post hilarious fails, here you go. First attachment is exactly that lol.
Doing some research, I found that you can also move Rigidbody players via Rigidbody.MovePosition(…), so I opted for that instead.
Then I added a jump, then some ground detection, and also (finally) a look controller so you can look around.
Honestly, pretty proud of my work so far. Only issue is that at the very top of planets, your player gets locked into place and all they can do is spin uncontrollably. But, that’s an issue I’m going to fix soon, as well as some small visuals, like a better skybox.
Also, you can hop between planets! I haven’t added camera smoothing to it yet, but it’s still super cool to do. Jumping off a planet’s atmosphere just to fly into another’s… so much fun! Maybe you’ll be able to do that with asteroids in the future or something… We’ll see!
For now, thanks for reading, and happy coding!
Open comments for this post
I added custom gravity, yay! It was honestly weirdly simple. The most complex part of it was honestly calculating the gravity vector for the rigidbody class. But now, I can have my cubes falling onto a planet, or even cruising through zero G! This is such a small thing, but it’s so exciting for me. Time to work on the player controller!
Open comments for this post
Ok, I’ve been working on getting the StellarRigidbodies to detect when they enter a planet. For that I made a brand new AtmosphereCollider class, as well as a new tag, just so thinks set themselves up automatically.
Now I just need to calculate the gravity vector and somehow apply it on the rigidbody and we should have (very basic) planet gravity working! Yay!
Thanks for reading, and happy coding!
Open comments for this post
Hello there! I’ve just started work on a project I’ve been meaning to work on for a long time… Starventure!
Starventure is going to be a survival-sandbox game where you can explore procedurally generated space, like in No Man’s Sky! You’ll have to fly down to new planets to keep yourself alive, whilst also building settlements in the orbits of planets.
Or at least, that’s the hope!
Right now I’ve got a simple visualizer and outline for the PlanetGravity class working, soon this class will be used by StellarRigidbodies to figure out what kind of gravity should be applied to a physics object. Let’s hope this goes well, and happy coding! (also happy pride month!)