Disclaimer: Art, gameplay, sound, music etc. is not final work and all subject to change.
Read the Week 2 Update
Welcome back to the third update of our development efforts on our current project, “Platformer” (working title). This week has definitely been a good one as we were finally able to add a basic enemy AI (I wouldn’t call it intelligent), start of level building and even touched up movement and a few other small things.
What went well this week:
- Enemy made with health that can be shot and then dies (disappears for now)
- Added new exit functionality so exits can choose what screen they teleport to
- Player movement fixes and tweaking – closer to final
- Starting the level building process, two pieces stitched together appears seamless in game
- Added tilemap with parallax and camera panning on title screen. No more screens with any renderer clear color visibile.
- Changed tutorial level to be more compact
- Added the first persistent save data for whether or not the tutorial complete
- Starting game from title screen will go immediately to hub world if player completed the tutorial
- Players can revisit the tutorial from hub world
- Achieved almost all of the “next steps” from week 2 even if it’s just starting
What did not go as well:
- Had to revisit the exit logic almost immediately so we can control where the exits go dynamically
- Had to also set proper collision layers on all my levels so we can use the same tiles on different layers without worrying about it always having collision
- Went back to fix up the player movement because we do not want to go back and adjust level features later
- Never got to adding a second weapon to swap between yet
- Finalize player movement
- Make the Enemey AI actually a little more intelligent (Finite State Machine)
- Add another handgun and ability to switch between weapons
- Continue level design
One of the first things I wanted to touch on this week was level generation. And the very first step I wanted to achieve in level generation was piecing two level “chunks” or small rooms together to make a bigger room. This concept is the foundation of our level generator. The level generator’s goal will be randomly sorting out rooms and corridors to make up a full random level layout. It’ll also take these rooms and determine randomly which enemies and items go in them.
After quickly creating two small tilemaps in Tiled, I went to work on piecing them together in a new scene. It wasn’t long before I realized our background parallax layer actually had collision on it still. Although I think this could be useful as some game mechanic somewhere, it wasn’t desirable for our needs. This was an issue with me using the “default” layer as my collision layer in Unity and adding the collision to that tile type meant it will collide with the user no matter what layer it’s on. To fix this I went and made a new layer in Unity named “Ground”. I assigned the Ground layer to the tiles I wanted the player to collide with and made sure our backgrounds stayed as the “default” Unity layer which no longer collides with the player.
Doing this meant I had to go back and fix all the tilemaps so the player collides properly. Here’s what happens when I had collision on the first chunk working, but, the chunk to the right didn’t have the new “Ground” layer yet.
Background parallax layer is actually collidable, whoops.
Forgot one last “Ground” layer change on the second test chunk.
After I had the collision fixed up and the exit portals switching between the hub world and intro level, it was time to move on to some “AI”. Being already pretty late in the week, there wasn’t too much time to work on this feature. But, taking a single frame of a work-in-progress animation I was able to throw in a new enemy into the game. I applied a basic script that checks if the player is within 15 tiles away and then the enemy just makes a “B line” straight towards the player. This lead to some fun results with Unity’s basic physics. Without a rigid body, the enemy was flying towards the player. And with one, you get some mixed results like this not so smart dino.
Not so smart enemy “AI”
Seeing some of these basic movements definitely lead me to the thought of needing to get our player movement precisely nailed down. And then apply similar physics to the movement of the AI. I also want to make it “smarter” by adding a “finite state machine” to the AI so it can do more than just try to run at the player at all times.
That’s it for this week. Join us again next week as we continue our level generation, enemy AI, and player movement efforts. Thanks again for following along with our development process.
Read the Week 4 Update