tisdag 27 maj 2014

Final week

So, after having spent all weekend in the office, and the monday at home with stomach pains, we're now on the final day of the final week.

In the last few days I've been working on solving some bugs, implementing the camouflage covers, redoing the vision cones (again) so that they are more intelligent, and a few related issues.

In addition to this, I've made some touchups on the camera controls, changing their scrolling speed and adding boundaries so that players no longer can lose the map with the camera.

More than that, I've also worked to fix some bugs (a minor one driving me close to insanity before I gave up).

fredag 9 maj 2014

Day 20

Today was spent trying to figure out why my code for the touchscreen wasn't working, and so far no results. I've followed a guide on dealing with touch input, but it seems not to work when implemented in Unity.
Beyond that, I've also begun looking at printing out a visual grid system to aid players in seeing the individual squares on the game map.

onsdag 7 maj 2014

day 19

I've made it so that the player and the NPCs are better synced in movement. What I did was actually rather simple, as the only edit needed was that I set the NPCs' "readyfornextstep" bool variable to true in the beginning. This means that they wait for the player to move first, which makes the entire movement a lot smoother.

We finally got a android tablet from the university! This means I'll be able to convert our game for the mobile media!
I'll be spending most of my time today trying to get this to work, and if I actually manage that, we'll be pretty much good to go for GGC.

I'm now working on a code class that will allow you to control the game through the touchscreen, rather than requiring a mouse and keyboard to run. It's hard work, not as easy as I hoped.
I've managed to make the player able to move by using touchscreen! All that remains is to make the camera move as well.

tisdag 6 maj 2014

18

Today my work has contained creating a "stop" function to make the player's movement stop at the next queued tile.
After that, I worked on making the vision cone for the NPCs. No, not to make them detect the player, but to make the vision cone visible to the player.
I started off trying to make the vision cone with Gizmos (a type of visual debugging system in Unity) but after a hour I realized that it wasn't especially well suited for our needs, so I re-made the system to use a temporary plane that is printed out, and then deleted once the cone has moved on.
(above is the class for rendering and updating the vision cones)

Day 17 - Alpha

Today was spent debugging issues for the Alpha presentation. We managed to get the game pretty much up and running, and went to the presentation.
After the presentation, the day was called off, and we proceeded to take a long weekend.

torsdag 1 maj 2014

Day 16

Today I've deactivated diagonal movement for the alpha tomorrow, and I've re-written the algorithm that checks if the NPC can see the PC to account for this.
After doing this, I have been working with the implementation of the NPC death state and animation. I created a function called KillAI to perform these tasks, triggering the animation and making the NPC 'dead'.

After this, I've been put to work updating the NPC models to include bows, since the basic enemy we planned to include was the archer enemy.

onsdag 30 april 2014

Day 15

This morning was interesting, having slept through both my alarms I awoke just before 11, more rested than I have any weekday the last month, and hurried off to work.
the work on the project was far less eventful, though, as more time was spent chasing down annoying bugs so that we have a functioning prototype to show off on friday.
During the day, most bugs were luckily eliminated, and the game now works pretty much as intended.

tisdag 29 april 2014

Day 14

Today I'm continuing work with the item gui support. I have an idea how I am to get the data between scenes. Apparently there's a native function in Unity called "Player prefs" that might be suitable to our needs.

Though progress with the items have been temporarily halted as bugs in the existing code have been unveiled, and need to be fixed.

day 13

Today ended up being a half day as I got a splitting headache after Lunch.
I got started with the basic gui support for the game, but I didn't get far due to the headache.

fredag 25 april 2014

day 12

We finally managed to solve the annoying (yet not gamebreaking) NPCRotation bug.
we found out that the editor was complaining about our check to see if a list was null or not, and we changed that to a check to see that there were more than 0 elements in the list.

And after finding a bug in the Attack behaviour of the NPC we finally found the issue and resolved it. I had forgot to reset a variable at the end of the function, making the AI freeze up.

(above is the fix needed to make everything work, which is resetting the MovingToPlayer variable to false)

My next assignment is to make the in-game items usable for the player, starting with making GUI support.

Day 11

Spent today at home, sick. Headaches and nausea made working... less than pleasant.
After noon, the nausea disappeared almost entirely, and at 11pm the headaches finally lifted.

onsdag 23 april 2014

day 10

Today my main focus has been on Enemy alert and attack behavior, and I've been (mostly) successful with implementing these states. I've also divided up the code for detecting the player in light and dark environments in order to reduce the size of an already large function.

Currently, a number of bugs with the attack behavior has revealed themselves, and I will proceed in working with resolving these.

tisdag 22 april 2014

Day 9

Finally found the big bug that had been making the player detection nonfunctional.
After all this time, it was just because I had accidentally put "if(gameManager.U_player.transform.position == tile.transform.position" instead of "if(GameManager.U_player.transform.position.x == tile.transform.position.x)"
For clarification, the former will NEVER be true, as the player's Y-position is set to be 1.5f higher than that of the tiles.

I've also made an alternative function for dark environments, narrowing down the field of view of the NPC to a single line.

I've also started work on the NPC attack pattern

Day 8

Continued work with the vision cone for the NPCs, and found a few bugs in the cone logic making it far larger than intended.
I worked that out, remaking the code so that the vision cone now is the intended 3x3 field.

tisdag 15 april 2014

Day 7

So, today my focus will be on continuing work with the NPC, and hopefully get most of the work done before I over to Stockholm for the easter. I'm currently pretty much the only programmer actively working with the Unity project, and I'm not overly happy about that.
But I'm hopeful the other full-time programmer will be able to take over all of the item-related coding, so I don't have to.

I have now finished up the patrolling of the Enemy, and implemented alternative states (although they can't be triggered yet, because the player detection code has yet to be implemented).

The game now keeps track of the way the enemy is facing (narrowed down to four directions) and I've moved on to working on the NPC vision cone.

måndag 14 april 2014

Day 6

Monday again! well, back to office hours after being sick on saturday and taking Sunday off.
I've already made it so that there's the option to create thin walls that block access between two specific tiles, without otherwise inhibiting movement using these tiles.

I am now working on the enemy, since the other full-time programmer that was supposed to do this went back to the mainland for Easter. Myself, I'm going on Thursday morning.
Halfway through making a state framework for the NPC I got a flash of brilliance, and I made the turn system, which wasn't exactly what I was supposed to do, but it was something vital that needed to be done in order to finish the project.
Well, it was mostly because I wasn't satisfied leaving all the fields empty in the NPC patterns that I started dividing up the movement into smaller pieces, and realized I could get it to work into the turn system if only I did a little more division.
A couple of hours later, I've made a functioning turn system.
Now the player and the AI move simultaneously, and will move one square before the AI performs a (unimplemented) check to see if the player is in its' field of vision. If it is, it will stop moving, and the player's current movement will stop.
if it doesn't see the player, it continues to the next turn.

fredag 11 april 2014

Day 5

More work on the pathfinding today. There's a lot to do, but hopefully it'll be worth it in the end.

I've made it so that each Tile keeps track of its' neighboring tiles. This will (probably) make it easier to do the rest of the pathfinding, as well as to create a better tile-to-tile movement system.

A basic pathfinding system is now complete! But apparently (unknown to me) the lead design had added the possibility of moving diagonally to the design. Though my own efforts were shifted to making the movement available to NPCs as well as PCs. Though the lead design dealt with it himself (by adding the diagonal tiles to my earlier pathfinding system's movement options).

My work is now to construct a movement system for the NPCs so that they're allowed to move as well.
I've now created a means for the game to assign Waypoints for the NPCs that they will automaticly walk to, and made a specific command for the NPC's movement system! Progress!

torsdag 10 april 2014

Dag 4

Today the morning was spent creating proper project documentation.
As a part of this, a physical SCRUM was created to create a easily accessible planning medium, in exchange for the digital ones under the jurisdiction of the producer alone.
I got Yellow. So sneaky.


Next up I converted all the Lists previously used in the generation of the playing field to a two-dimensional array, making the Data more easily accessible in the code.

Following that, I made it possible to tag blocks as "Impassable", which took a little while because I had to debug an issue where every block turned impassable when I meant for only one to be. It ended up having been the result of a minor oversight on my part, and was remedied. Progress!

An additional thing I finished was to lock the camera scrolling and zoom as to not be unlimited, which took a couple of hours due to the need of debugging the Z-axis.

Returning to work on the Pathing system after fetching a locker and some screens for the office.
first time using double screens. There is so much space for activities! Sadly, I have work to do.

onsdag 9 april 2014

Day 3

Today my main focus has been Pathfinding, and I've discovered that the A* algorithm might be suitable for our needs.

When I decided to run the code that had already been implemented, I rapidly noticed that the camera controls I created yesterday weren't working, and I spent about half an hour debugging them to no avail,
and when I was trying to debug it using the Debug.Log() function native to Unity it suddenly started working flawlessly again. I have no idea what the issue was, or why it started working again, because there SHOULDN'T have been an issue to begin with.
Weird shit.

Returning to the pathfinding. I've found a free project that might help me speed up the implementation of the A* algorithm in out project.
It's located Here

The project server has been set up, and I'm trying to migrate my work to that server, so far to little success.
I try to Export the scene I've been working in, which is successful, but attempting to import it to the shared project on the server meets nothing but faliure, citing that the package (which is a .unitypackage file created in Unity a minute earlier) has a unknown format. Apparently Unity cannot read its' own format. Isn't that a joy?
I need to get my work on the server, and will keep trying to solve this issue.

Most hours have been spent reading in on the principles of the A* pathfinding algorithm.
I've also started researching the other projects created by the man who made the grid-based strategy game that I based the foundation of my work on, as he starts handling pathfinding in  his toutorials. They can be found Here

tisdag 8 april 2014

Day 2

I've been working on being able to dynamically reshape the size of the grid, with some... interesting results.
As you can see in the picture here, the grid automatically starts at the upper leftmost corner of the rendering field, but the player pieces don't. They end up centralized, and thus spawn outside of the current playing field.
I've solved the previous issue through setting the X and Z of the player token to the X and Y of the absolute first tile, which is the one in the uppermost left corner.
here's a picture of the code as it is now (fairly ugly, but it serves my needs)


Additionally, I fixed the camera movements on the X, Y and Z planes, so the player is now capable of moving the camera around the playing field. Once I found a suitable solution I found that the camera movements were very easy to fix.


Day 1

Today I produced a simple grid with clickable squares and a couple of player "pieces" that are movable around this grid.
After doing this I adapted the grid so that you're only able to click the squares next to the player character (Up, Down, Left, Right) in order to make the grid movement akin to what's intended for the final product.

There were some minor issues with the square-to-square movement acting weird, but it was resolved.
(I figured out I was using the wrong variables (X and Y rather than the accurate X and Z) and it was swiftly resolved.)