Foundations, Optimization and School...

This week we arrived back in school after our half term. Unfortunately, this does mean progress is slower as we only have an hour or so a day to actually work on the project. But nevertheless, some work has been done, mainly in preparations for future development, so nothing on the front end. This has mostly to do with ship generation, and cleaning up player moment.

Posted by on

### Foundations, Optimization and School...

Week 3 - Back to School
So this is our brilliant development blog, detailing all our struggles and mistakes along this seemingly endless journey we call Neversky. Hopefully it'll be enjoyable.

This week we arrived back in school after our half term. Unfortunately, this does mean progress is slower as we only have an hour or so a day to actually work on the project. But nevertheless, some work has been done, mainly in preparations for future development, so nothing on the front end. This has mostly to do with ship generation, and cleaning up player moment.

### Foundations and Optimization

As I sort of said last week, I wasn't happy with how player movement turned out, and was probably going to remake it. This week, I sped up ship generation, and created a new system to reference ship tiles on each floor. Previously, I had accessed tiles though a unique number I had given them depending on when they were placed by the player. But this proved to demanding when I wanted to access them from the player class. I would have to loop through every tile on the current floor, comparing each tiles number, and then checking if its solid or not, and checking surrounding tiles, and... ENOUGH! This obviously had to be fixed.My solution was to access tiles using a number generated by the tiles positions, because every tile had a different position. This was created with (tileYPos * shipWidth) + tileXPos.
By doing it this way, I could ask for the tile with the number (playerYPos * shipWidth) + playerXPos and it would return the tile the player was standing on. In addition to this, each tile knows the position of the tile next to it, and can therefore be used to optimize player movement further. Predetermining if the player can move left is much better then checking every time the player presses the left key.This also solved a few more problems I would have faced in the coming weeks, including interaction, which relies on the mouse position, and ship rotation, which would have required some heavy lifting on the computers end to calculate trigonometry every frame...

### Base Tiles and Detail Tiles

A simple problem William realized a few days ago was how different types of tiles would be treated if the entire floor was on a single sprite. For example, say a computer console was on top of a floor tile. If the entire floor was just one sprite, how could the game show the console was broken or if the floor was damaged but not the console? Overlaying another sprite was an idea, but would have gotten to messy if both were damaged. The other idea was to separate base tiles from detail tiles. Base tiles are what makes up the ship, like floors, walls and armor tiles. The details would be things that are interactive or variable in texture, like computer consoles, doors and cargo boxes. Details can be manipulated without affecting the base floor sprite.

There aren't too many images this week, so here are two pieces of art I made over the week, give this page a more scifi feel...

As you can see, I wasn't joking about irregular updates. Pray to the time gods that we can squeeze in more development during school days, or this really could be an 'endless journey'.This next week, I'll finish any inconsistencies with the player movement and finally move on to interaction. We'll see how that goes. Meanwhile, William is creating some concept art to give you a bit of an idea into what we want the game to look like when it's done. With those images, I'll be able to list the game on a few game development sites, like IndieDB, GameJolt and Itch.io properly. And hey, thanks for reading!

Ted Johnson - Cardboard Factory