Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

[DevLog] Dream Forest

A topic by theanomaly created Jul 23, 2017 Views: 840 Replies: 12
Viewing posts 1 to 12
Submitted (1 edit) (+1)(-100)

Title:
Dream Forest.

Engine:
Unity

Premise:
You are a young adventurer who wants to find legendary treasure of the Dream Forest. Many have tried, but no one was successful before. Would they be successful?

Gameplay:
It's going to be 2D platformer. Aim of each level is to get to exit. Main mechanic is that you can fall asleep and enter a dream world. In dream world everything from normal world still exists and can be interacted with. However while in real world some action would result in death in dream world you cannot die, only wake up. There are also additional thing that don't exist in real world, and can help player achieve their goals (like moving platform that takes player to stitch that reveals exit).   Player should also watch out to not let anything hurt his real body while they are dreaming.

My goal at jam:
Make game in 2 weeks alone, and make working 2D platformer that is fun to play. I don't to make bad game when physics works strangely (like player being stuck to the wall when hitting it while jumping), but something that even though wouldn't probably be original nor good looking but will play decently. I have many ideas for additional mechanics for the game (wall jump, double jump, enemies with AI), but I'll see if I'm going to have enough time for any of them.

Link to draft of the Dream Forest:
https://theanomaly.itch.io/dream-forest?secret=KKpksMoztWkWJGveGKxLTFic3EI

Link to the git repositiory:
https://bitbucket.org/anomaly2/firstgamejam2017

Submitted

-7 hours:

I'm so excited about this Jam. It starts tommorow at 6 am. I'm going to start coding right from the beggining.

Next day, 8 am:
Five more minutes, mom...
ZZZ...

Yeah, my first day on gamejam was rather lazy.
The only things I've made was to import some utils classes from my past projects, and simple 2D platformer assets from assets store, so they can be my prototype, or maybe final sprites for the game.


I've also started to design some levels in my One Note after some brief battle to make my drawing tablet work.


Tomorrow I'm going to make main menu and some early prototype of the game.

Submitted

Day 2:

Today I've finally done some serious work.


I've made a main menu. Currently it's just for starting a new game, selecting language and quitting the game (not on webGL). The most difficult part of these are of course translations in different languages. They are kept in streaming assets as json files. I'm using Jsonutility class which is rather simple to use, though it has its own disadvantages (For example it doesn't handle nulls. It doesn't crash - it just makes object with default values on fields.) however they are not important here. What is important is the fact that I decided that my game is going to work in webGL. On Windows checking for available translations is easy: just use DirectoryInfo class to search for files that match the pattern *.json, obviously this doesn't work on webGL. Instead I've created additional file index.json with list of available languages. Additionally class WWW which is used to get file from url is getting the file asynchronously. I'm using callback function and have loading screen to wait for file. That sound complicated. Good thing that I've already faced these problems in my other game I'm making, and pretty much copy-pasted code from there.


Next step was to create simple first level using assets I've downloaded yesterday. After some time I've managed to get character to move and jump. I've considered using either adding force to rigidbody 2D or changing velocity. First I tried adding force. While it makes sense for jumping, walking looks really artificial for me. I considered using force for jumping and changing velocity for horizontal movement, but forces are discarded by manual velocity changes. For now I'm changing velocity for both vertical and horizontal movement.

My character was moving and jumping, but there was a problem. They get stuck on the side of the wall while jumping. After searching for solution  I added platform effector 2D to the platform, and made collider to use it. It worked partially, my character was still stuck on upper corner. Fortunately after I changed their collider from capsule to capsule on down end and box on upper end everything seemed to be working smoothly...

...until I exported it to webGL and playtested. For some reason character doesn't want to jump when their are on effector collider. It only happens on webGL. This is probably connected to the way I'm checking whether character is grounded. I know two ways of doing that. First is using raycast with layer mask. I didn't do this. Instead I've made small trigger collider under the feet of character and I'm checking whether it's crossing any collider with layer mask. I've checked browser console and there are no errors or warnings, it just doesn't detect that character is grounded.

This is all I've done today. I've uploaded current state of game to my draft page, and I'm going to bed. Tomorrow I'll see whether I'll fix it or just give up on either detecting grounded state this way or having webGL version of the game.

That all sounds complicated, I'll just wish you good luck!

Host

the concept of interacting with stuff between worlds to advance is really interesting and i'd love to see how its implemented. i'm not too familiar with webGL to offer any solutions so i wish you the best of luck :Oc !

Submitted

It looks like it's webGL bug connected with platform effectors. I've just replaced collider under character with raycast to check for ground. I hope I won't encounter more webGL bugs cause it's easier for player when there's version to play in browser.

Submitted

Day 3 and 4:

After seeking help on discord it turned out that webGL just doesn't like platform effectors. I've changed detection of collisions to raycast, and it helped. Still, getting working version on webGL is now lower priority. If it works then great, but I'm not going to waste time much to find what's wrong.

I've also started to implement mechanic of entering dream state. Currently it's working as long as you don't fall asleep while jumping. I guess it's not advised in real world too.

I didn't make much in these two days, but tomorrow I plan to fix bugs, and implement first puzzle.

Submitted

Day 5:

I implemented the core mechanic of the game. Entering dream world. Currently it's implemented with disabling and enabling different player game objects. There are 3 player gameobjects: normal, sleeping and dream. At the beginning of the level only the normal one is active. When X is pressed, player is falling asleep. Normal character is deactivated and other characters are place where normal character was and activated. When player presses X again, normal character is placed where sleeping character was and is activated while other characters are deactivated.
While it's rather easy to implement it has one disadvantage that is going to bite me later. There are two copies of the player scripts. One on normal player, one on dream player. That means that handling player states is problematic.

Day 6:

I didn't do anything. I'm lazy. :(

Day 7:

I implemented bottom boundary. Now player won't fall down infinitely, but when hitting invisible wall they will either reset level (when not dreaming) or wake up (otherwise).

I started implementing moving platforms and I faced problem. Character is slipping from the platform. I saw a few different solution on the web and decided to fix it the next day.


First half of Day 8:

Since it's Saturday I have a lot more free time to do things. :)
First of all I've checked solution to moving platforms and decided to go with adding platform velocity to velocity of player while they are on platform. Other solution either didn't work (parenting) or were unnecessary complicated. After that I've decided to implement a switch that will activate moving platform. Currently sprite for a switch is a cloud that is going red when activated. I'll make proper sprites later. I had another decision to make about switches: how to detect whether player is in switch collider when player is pressing use button. The simplest approach would be to call function that detects if either of player colliders intersects any switch collider (there's always a possibility that player may interact with two or more objects at once). However after webGL acting funny with that function decided to try another approach.

I've made switch a trigger collider, with function OnTriggerEnter2D and OnTriggerExit2D. Player has list of switches they can use right now. Each item on list has reference to switch game object, action to do when switch is off, and action to do when switch is on. On trigger enter switch adds itself to player list (Frstly checking if it wasn't added already. Player has two colliders.) On trigger exit switch removes itself from the list. This looks not that complicated and rather efficient.
Unfortunately this is the place where multiple copies of player scripts make things not work.

Nevertheless I quickly finished everything, added few texts and after 8.5 days I have a demo where player has to go to dream mode, jump to switch, and cross the gap to go to another platform. With placeholder sprites and no sound effects at all. What more can you want? This is the best game ever!



Yeah, when I stared the game jam I thought that I will be more advanced right now, but it's still some progress.

I still want to:
Clean my code

I was rushing to make it work somehow, and code doesn't have the best quality. I want to refactor and comment it. I also want to find a better way to deal with dream world. Instead of deactivating whole character I'll probably want to just replace child sprite elements, and change tag and layer of parent gameobject that contains all logic.

Make player gain ability

While originally I planned to have many small levels now I think that better idea is to have one level where player explores the level and gain abilities that allows them to backtrack and access previously unavailable area. Main idea for ability right now is wall jump, but if it proves to be too difficult to implement then I'm going to end up with double jump.

Get rid of placeholder sprites

On sunday I plan to have most coding done and focus on making level bigger and prettier. I want to replace sprites and add my own. Even if they'll have paint quality it's better than generic placeholder sprites. I'm going to add some animations, at least for: switch, player movement, falling asleep and waking up. I'm going to add some sound effects and music.
If I'm going to have some free time then I will make option to customize controls, but it's not top priority right now.




I've updated files in my project so you can see my progress.
Submitted

I like it so far! I tried out the demo and it worked completely for me, I got to the end. I did notice that I could jump through from the bottom of platforms in dream mode, is that correct? It would make sense on one hand because it's a dream, but that's the only feedback on the demo I could give haha. The concept seems really awesome and you obviously have the mode switching down which is really cool!

Submitted

The rest of day 8 and day 9:

I've refactored code and fixed every bug I managed to find. Platforms moving up still work a little funny (you "jump" at the top end of pattern), but I think that it's not that bad. I've changed level, so now it's longer. There is also first sound in the game. Currently it's switch sound, but it's going to be more soon.

Tomorrow (Well, actually today since it's past 00:00) I want to finish level using placeholder assets. Next 3 days I'll be working to make some assets so people don't have to guess that cloud is really a switch. On last day(s) I'll just make some finishing touches.

Submitted

Day 10:

After some thinking I came to conclusion that I have to change the physics of the game a little. Character is jumping like on the moon now, and there's too much control in air. If I want to implement wall jump then player can't just climb on one wall by that. I've raised gravity and made player add force to rigidbody while in air instead of changing velocity like on ground. That revealed another flaw in my design - I've checked for ground using one raycast downwards while collider had some width. That caused character to be stuck on upper corners of platform because added force was too small. To fix this now I'm doing two raycasts on both horizontal edges of collider.

Submitted

Day 11:

It's 37°C (98.6°F) here right now and both me and my laptop are melting. Nevertheless that didn't stop me from coding.

I've made simple prompt displayed when player can activate switch.

I  implemented player abilities and double jump. It works surprisingly well.

And I published and submitted game to the jam. It's right here - https://itch.io/jam/my-first-game-jam-summer-2017/rate/161253

In next two days I'm going to try to draw my own assets, so I'm going to search for Bob Ross on youtube. Wish me luck.

Submitted

Day 12 and 13:

I didn't do anything. Didn't have time.

Day 14:

Since I wasted two days it became obvious that I'm not going to replace most placeholder characters. Instead I've decided to change the most important things.

- Switches now makes sense. There are two lever switches and one piece of wood that need to be pushed to strike bee hive.

- Instead of coin there is now symbol of an ability.

- Moving platforms have an indicator that they are moving, and I've added one more to the level to make players familiar with them.

- Character sprite now turns back.

That's all for this jam. I have 5 hours left, but I'm too sleepy to do anything constructive. There is still some weird physics there, especially moving platforms, but IMO it's not the worst try for the first 2D platformer. Tomorrow I'll start playing other games to look how my game compares to them.