Pagina's

Showing posts with label 3d. Show all posts
Showing posts with label 3d. Show all posts

Wednesday, 10 April 2019

Crouch!

Alright, an update from the bus. Yesterday, I made some adjustments to the deep water mask because I got some feedback from a colleague who thought it was not watery enough and it looked more like fog. I might change it again later. Besides, maybe I'll have the opacity change from code to reflect the player being deeper.

I also dropped a red ball in the scene and named it Red ball. Nothing much happens here. Idea is that the player can look at it with the crosshair and have the GUI show the info.  Later I'll implement picking it up. I need that for interacting with objects. The door script now just triggers on being near the door and pressing the key. I need the player to look at the door directly for it to work. Doors are just other kinds of balls, so if a ball works, it's a small step to make the door work. 

Lastly, I made something that my old game did not have yet: a player state script to keep track of what the player is up to. Now it only tracks if the player is running or not and if he's crouching. This datascript will be referenced from different scripts, most notably the game handler and the movement script. 

The first thing implemented is basic crouching.  It's not finished yet, but for now it just makes the player smaller and the camera lower when pressing Ctrl. Next time on Ctrl, the player goes back to the original size.



This works, with a little drop when getting smaller. It does not, however change the size of the collider and I want the camera to clamp differently when crouching, so that'll be work. Now to the office and earn money first.


Saturday, 23 March 2019

Graphics...

I told you, I'm a programmer, not an art guy, but indiegame development makes people at least jacks of all trades. Or try to be one because making a game means... making a game.

Most of the posts I wrote up to now were about programming and I think that is what i'm doing best, but secretly I think I like making graphics too. Especially pixelart animations for the 2D game, but I'll need some 3D and vector stuff in the big game, so I ran a little Inkscape course on Udemy and downloaded Blender to make a character for my game.

It's not finished by any long stretch, but it is starting to look humanoid:


No head, nor feet, quite literally, but starting to get better. I might have to start all over again later, but at least I learn to work with programs and now I know what "extrude" means, so win-win.

Monday, 18 March 2019

Fixing the view

Somehow, in the last weeks, I found out that my player character suddenly looked somewhere else entirely. It did not happen when I were running around in the field with all the room in the world, but it did happen when there was more subtlty needed, like in the maze. Since I was trying to get the quest system to work, I hid a sword in the maze and went looking for it. That was nearly impossible. Imagine walking around a small hallway where all the walls and the ceiling have the same colour and suddenly you stand the other way around. I had to fix that, but that'd be a pain for years to come.

I refuse to use the Standard Assets first player controller because I don't really understand what is happening there and I want to be able to add features later. I need to understand what is really happening, so that I can do that correctly and efficiently. That's why I watched the First Person Controller tutorial by Acacia on Youtube in the beginning to get a good grip and be able to add things later.

I learned a lot, especially about controlling speed and the overall concept that we have two objects to control: the camera and the player himself. This tutorial is really helpful, also fixing a problem for when the ground is sloping downwards, teaching me about raycasts and physics laws that this historian does not even dream about. But somehow it was not working like I wanted it to, so I looked for another tutorial to guide me.


This one was by Holistic3d, a very welcome female voice in this male world of tutorials and a nice and well-explained one. Not sure what made the difference, but it fixes my problems. Now I only had to make sure that I could not look over my head and see the world behind me upside-down. That was easily done by clamping the rotation of the camera. Nice. Now I can carry on with the quests and fix the fact that somehow the inventory does not show up anymore. Enough to do.

Anyway, I also got a github thing to work. Appeared easier than expected. Makes me wanna take a little more risks, because I can always turn back, which is nice for the creativity. 

All in all, a lot of work done and a lot of work to be done in this game.

Thursday, 21 February 2019

Drowning

Being a genius, sometimes ideas just pop up in my head in the bus or somewhere else. While I was pushing it ahead until I had enough of a grasp of how Unity deals with these issues, I found out a way to detect the player is in the water. There's a problem with just detecting collision with the water, because water is kind of just the surface and when the pond gets deep enough for the player to be inside it, below the surface of the water and not touching it, things are difficult.

The ingenious thing I came up with is this:

The thing on the right is a meassuring stick and the stick figure is the First Person Controller in the game. The blue semicircle is the water. What I came up with is a system with a dual Collider under the surface of the water. The purple "Water" collider and the red "Deep water" one. 

Because normal gravity rules do not apply to water bodies (we don't just walk over the bottom and up the banks), we have something detecting that, while not having the extra drowning perks. the collider is half the size of the FPC, so it'll allow the player to keep his/her head above the surface, literally. When the player drops to the red zone, the same gravity rules apply, but there are some more perks, including a timer that starts running. When the timer hits a certain level, the player is out of oxigen and health will drop quickly.

Another thing, nice idea from my colleague Annika, when the player is in the red zone, the UI will get a semi-transparant blue mask to have it visually obvious we're in a dangerous spot.

Other things I'll put in there will be about slowness and the possibility to fight, with some way to move up and down (probably by jumping-a-like behaviour). And probably more, but that's for later.

Friday, 15 February 2019

Another project

Ok, they say we need to finish our projects. I know. On the other hand, they also say it needs to be fun and feeling rewarding and it's a good thing to have a massive list of little goals to hit on the way to finishing the project, so I'm starting another one. A first person RPG adventure game in 3D.

Before making it look awesome, I'm focussing on the mechanics like a basic First Person Controller with a crosshair and my first experiments with raycasts that I'm pretty pleased with. Even though it isn't big, it's nice to see that the player will detect an object that is tagged PickUp and within a certain distance from the player and that when we press E, the object will disappear.



Next, I'll do a bit of GUI with a health bar and a fatigue bar and something in the world to affect those values. After that, I'm going to work on the basic inventory and find a way for the player to have some head bobbing when moving. Hopefully I'll be able to hit these goals in the days to come.

I'm starting to like this stuff more and more.