The big day is finally here. This is what we worked towards. We have finished a final build for a presentation and just a few ours from here we will have to go defend it. We are prepared and will nail this!
Check out our final build, or if you want a standalone build you can always contact us! 😉
Killer Chiken Team out.
*Drops the mic*
Aaron, Brian, Jana, Ruben and Tom.
I forgot to make a blog post during the week we had no class so this one will cover two weeks. We needed something to increase playtime and replayability, add spice and just generally make the game more enjoyable. And we figured random levels could just be that. So here’s the stuff I did so far to get our current result. Keep in mind a lot of stuff isn’t in the playable build yet because it’s still in the testing fase.
Step 1 Making the road.
First things first. You need a road from point a to point b. These points are still hard-coded but can be easily changed to random. The random road is a list of vectors made using (for now) one bezier point. That one (technically 2) dimensional road then gets an offset on both sides to form the mesh used for pathfinding.
Step 2 Making the grass.
The grass is basically the entire level minus the road. This sounds easy but unfortunately unity has no boolean operations for meshes. So I had to make one myself basically. Getting the vertices wasn’t hard. It’s just the vertices of the road plus the 4 corners of the map. But the indices that’s a whole different story.
(^Example triangulation, Gray = road, red = unwalkable)
First I had the road split in 4 quarters. Each side triangulating to a different corner. This unfortunately lead to crossing edges because the road didn’t always curve in the middle. So I had to make a function that using the random bezier point decided which vertices should connect to which corner. That involved some trial and error since I’m not a math wizard. But it works now. The reason we needed it was to show the base where it couldn’t go. This didn’t work right away though and I secretly blamed Tom’s pathfinding scripts. But I was to blame. His scripts where basically pure perfection. I just accidentally generated a tilted mesh instead of a flat one, which caused the issues. And I almost spend a week to find this mistake. Perfect anecdote to discourage someone from ever wanting to program.
Step 3 Placing nests
The enemy nests placement was pretty easy. It just chooses either north or south to decide which part of the road to be on. And the it just chooses a random z value in that area. The x value is not completely random since I didn’t want like 5 boxes right next to each other. And the numbers of nests is also set, for now.
Step 4 Placing props
At this point there are only two kind of props being spawned. Road fences and longer nest fences. The road fences are set on the side of the road using a probability which makes for like an average of 2 or 3 fences next to each other. Getting the right angle was the hard part. Since it basically needed the differential of the road curve. It’s using an estimated differential based on the previous and next vertex based on the random point on the road edge where it spawns. The second type of fences are placed around nests. It uses a bounding box to see if it fits in the level. And it chooses a random side around the nests to place on or two fences. It doesn’t check to see if it overlaps with the road yet. So I’ll probably set it inactive for now. The code for other props is still in development since I have to make sure no stuff overlaps without making that check to cpu intensive. It’s for Webgl after all.
Besides the random level stuff I also made the shotgun spreadshot and fixed a bug with the double wielding pistols being held in the same hand because of its parenting. And ad finem made a zoom for the controller.
This week I made a few simple models for my killstreaks.
- model for the care package
- model for the chicken airstrike
This is what happens when a developer designs killstreaks, you get a weird round chicken looking to destroy everything that’s on his path.
For this week I worked on several development parts to get it more working. I worked on the sound sliders, so they work overall, the loading screen has a refinement since last week, the intractable are getting more clear and I finished some more things for the tutorial overall.
I also helped Aaron with fixing pathfinder in his self generating levels (But I wont spoil more about that, you will have to read his posts!)
For the sound slider I worked on making it work. These work now and will work over the whole game. I also added the sliders to the pause menu so you can adjust the sound from there as well. The sound sliders get set at the default value in the start of the game but will be updated along the game so you always have the right volume there. This might still get an update later to work better.
The loading screen got a big change this week. It actually moves now ( wich I am pretty happy about ) but in the build it still goes a little bit slower and more laggy. I will still fix this later, but it is not the endless waiting and hoping there will be something displayed. The sentences are just a list of senteces now but can still change later and the picture of the base will get an update when this art is more finished. So this is what the base of the loading screen is at the moment. Normally it is added to every part where there is some loading new scene in the background.
I have been toying around with the intractable to make them more clear. For now I am toying around with a borders shader wich gives an outline. This is still rough work and still in progress and might not display correctly in the shader yet. I will fix this later. I also added an arrow so it might be more clear what the interactables are since they might fall away a little in the environment.
This will still be fixed more and get better
Final but not last I fixed some little things in the tutorial yet. You can still jump up the base ( NO CLUE WHY ) but you can not leave the boundaries anymore, so there is no way to break that part. Yes, I say that part, because there will probably always be something you can break ( And I will fix it! ). For now there might still be some issues with the fact you can still fire when there is a certain screen but that will be fixed later as well!
For this week I fixed the lighting and terrain for the tutorial. This is still up for some changes but this will work for now. I added some sand based ground where there is only a little bit of hay to be found. Now there is not too much hay anymore.
The lighting became a soft but warm lighting, with a little bit of fog effect in it. This is not with post effects yet. We might still implement that but for now it is only in the editor. I worked on the lighting for level 01 as well a little so it fitted in with the tutorial more.
For further Art work I also worked on an arrow to be displayed above the intractable prefab. More information about those prefabs you can find in my development post where I will explain more of what I did.
Video: Press HERE
Ik heb ervoor gezorgd dat alles op vlak van xbox controller in tutorial nu werkt.
Er zaten onderandere nog fouten in waardoor je niet op ‘OK’ kon klikken met de Xbox Controller na stap 4.
Daarnaast is het nu ook mogelijk om op ‘Pauze’ en op ‘Reset’ te klikken wanneer je enkel een xbox controller in bezit zou hebben.
Deze functies werken nog niet voor level 1. Daar ben ik nu mee bezig.
For this week I didn’t have much time. My excuses for that. But I worked on the level limiting. From now on you will have to play the tutorial level first before the first level. This will count for further levels in the game as well. This way you can’t skip levels and have to play through all.
For now it is still just this way, with no loading ways for the files to remember the levels you played.
I used the player manager wich we already had for the player, so that it will know wich levels are already done at the moment and wich arent.
I don’t have much pretty pictures to show you except for the button being intractable and not. But in a next progress I will do, I might have more so stay tuned!
Last week our game had more T than an entire fleet of the East Indian trading company. Jokes aside though we had no character animation until now. The player (chicken) got 6 animations. Two for running (running and shooting), one idle animation, two for getting hit (while running and while standing still) and one animation for standing still and shooting.
The enemy (fox) also got 6 different animations. One taunt, one walking animation, 2 for attacking (boxing and kicking) and two for dying (doesn’t work yet).
During last week’s feedback moment the teacher said he was really bothered by the low frame rate. No one in our team had frame rate issues so we didn’t know that was a problem till our teacher said so. As developers we strive to make our game run decent on every system though. And guess what. I managed to double the frame rate.
Remember when I made the minimap. It had separate lights to make it more readable. Well turns out webgl isn’t a big fan of pre and post culling events. Simply removing that part, evidentially making the minimap worse, really improved the frame rate. So you don’t only have to give me credit for doubling the frame rate you can also give me credit for halving it in the first place.
Like every week there were some bugs that needed to go. Bugs removed include:
The infinite audio parameter was back due to the “Don’t destroy on load” function not being very flexible.
There was again an issue with variables not being made before another script needed them. This was because I somehow didn’t realise that even with the timescale on zero, the awake method still gets called. Making initialize functions and changing some Updates to FixedUpdates seem to have fixed it.