A Foresty Game

Fayabella

  • Posts: 239
This is my first game I've ever made with Stencyl, and I'm still working on it!
Consequently, it's also the only game I've ever put so much effort into without giving it up.
I've been working on it since the end of November 2018, so I decided I should make a journal of it. I may keep this, or I may not.

So, here's my idea for the game:
You spawn in a procedurally generated forest, in which you try to survive. You can gather resources from the forest and build stuff, like a house, and workbenches for different crafting. You can farm, too. Basically, it's a top-down survival game. More features will come, of course.
 
So far, I've got quite a bit done. Look at the changelog/latest posts to see what I'm working on.
I'm using placeholder graphics at the moment, because I'm not the greatest at pixel art and I just want to focus on the programming. (Some of the art is actually mine now.)

Also, of course, I began coding this when I first started Stencyl, so a bunch of my code is super messy. Not sure what I'm gonna do about that. Guess it's like leaving a tangled ball of Christmas lights for future me to deal with.

You can test the game here: http://www.stencyl.com/game/play/39890

I'm attaching the changelog I have on the game's page here, and I'll update both when I release updates.
Changelog:
Code: [Select]
1.0.0
Just a test of procedurally generated worlds using Perlin Noise.
WASD to move around, [Enter] to generate a new world.
Shift-click to place items, click to delete items.

1.1.0: Jan 30 2019
-Fixed graphical glitches with some of the dirt tiles. Autotiling should account for corners now.

-You can now chop trees! Click on their stumps.

-There is now also a cursor that highlights the tile your mouse is on. Note: If it goes off screen, it may get stuck.

-You can now get rid of grass by clicking on a grass tile! Underneath is dirt. Note: There are a few bugs with this, including random glitches with autotiling and being able to turn water edges into dirt.

-Trees are now aligned to grid properly, and also have slight variation to their position.

1.2.0: Feb 5 2019
-Fixed the bug with autotiling issues.

-Added lighting system and day/night cycle. (You can't place torches yet, as you don't have an inventory, but they do work.)

1.3.0: Feb 18 2019
-Added basic inventory system. I will expand on it in the future.

-Chopping trees now gives you wood, which has no function as of yet.

-You can now place torches! Shift-click to do so (as long as they're in your inventory.) Note: As they're the only item that you can place, I haven't made a system to place different items/select item to place from hotbar, so torches are shift-click's only function.

-Fixed bugs with the water being glitchy by manually replacing the corrupted tileset.

-Fixed an error with the lighting system.

-Game now completely resets when you generate a new level (before, day/night cycle and player position wouldn't reset).

Added a loading screen when generating a level.

1.3.1: Feb 18 2019
-Fixed a small graphical bug where the edges of the screen wouldn't be darkened by the night cycle if the player was moving.

1.4.0: Mar 17 2019
-Improved the inventory: You can now cycle through your items (E or Shift-E) and can place the selected item (if it is a placeable item).

-Added workbench. It serves no purpose as of yet, but will be used for crafting in the future. For now, you get a few in your inventory for placing.

-Made day cycle longer, now 6 minutes long (4 seconds per second).

-Added rocks, which give you stone, iron, and coal.

-Made trees fade when you walk behind them, so you can see the player.

-Made the cursor tween instead of immediately snapping to the grid.

-Fixed light masks spawning 5 pixels left and 5 pixels up.

-Fixed cursor getting stuck on edge of screen.

-Plenty more bug fixes.

2.0.0: May 15 2019
-Added new level generation screen.

-Added a UI. You can access/rearrange your inventory, craft, and generate a new level from it. Hit 'E' to open it, and within it, Z and X to select and cancel.

-Added crafting. You can now craft a variety of items, from tools to workstations.

-Added tools. You now need the right tool to do something. You can upgrade tools. So far there are basic, stone, and copper tools.

-Added 2 more inventory slots.

-Added Mines. Shift-click them to mine down one level. Some patches have more of a certain ore than others!

-Added the Forge. You can craft bars from ores with this.

-You now only have a range of 4 tiles.

-Plentiful bug fixes

-Also probably added some bugs

-You now scroll your inventory with up/down arrow keys, and you cycle tools (separate from inventory) with left/right.

-Stones now give you copper instead of iron, iron is now the 2nd tier metal, found only in deeper levels of mines.

-Added the hoe, with which you can till dirt. Tilling serves no purpose as of yet (but farming shall come).

-You can now click and hold to continuously mine something.

-More small features that I'm sure I forgot to mention.

2.1.0: November 25 2019
-Increased map size.

-Reduced player speed.

-Increased player inventory to 30 slots.

-Added lanterns and lantern posts. Lanterns give off light when held. Press R to rotate lantern posts before placing.

-Revamped the day/night cycle: The colours are new and the transitions are improved.

-Switched shift-click and click in controls.

-Added in useable items; however, none are currently obtainable.

-Added plants: clovers and wildgrass. Clovers are pickable, while wildgrass needs a scythe to cut. Neither have any use yet.

-Added stone scythe for cutting down wildgrass.

-Normal grass now regrows over dirt.

-Added fences.

-Changed cursor; when holding a placeable item, a preview of that item is shown. Normal cursor only visible when holding shift to use tools.

-Added pinecones, with which you can replant trees.

-Fixed lots of bugs, probably creating more in the process.

-Probably a few other things that I forgot to mention. I should really start keeping notes of what I add.

2.1.1- May 9 2020
-Added scroll controls to hotbar. Scroll up/down to cycle through your hotbar, and use shift+scroll to cycle through your tools.

-Added scroll controls to inventory and menus. In the inventory, use shift+scroll to move horizontally, and normal scroll for vertical. The rest are pretty straightforward.

-Switched from arrow keys to WASD for menu controls.

-Trees now take over a day to grow, instead of an hour.

-Removed FPS counter because I'm probably the only one who needs it.

-Other minor tweaks.


Feel free to let me know what you think and point out any bugs I should fix or things I should add!
Suggestions are appreciated!

« Last Edit: May 09, 2020, 09:53:59 pm by Fayabella »

iii

  • Posts: 194
You might want to use a different image hosting site other than Cubeupload.

Some antivirus blocked that site,
because in the past someone upload a virus infected .exe disguised as an image file on that site.

I was wondering for a while now, why my antivirus detected a malware every time I go to a thread you post.

merrak

  • *
  • Posts: 2738
This is looking pretty cool so far! I like the change in time-of-day effect... although I would prefer a bit slower progression.

Also, of course, I began coding this when I first started Stencyl, so a bunch of my code is super messy. Not sure what I'm gonna do about that. Guess it's like leaving a tangled ball of Christmas lights for future me to deal with.

Yep, been there! I'm currently pulling apart a tangled mess myself.

Fayabella

  • Posts: 239
Thanks!

 And yes, I know the days are too fast right now. I just have them short for testing purposes, so I don't have to wait 12 minutes to see it turn night-time. Eventually I will balance the day cycle, though.

Fayabella

  • Posts: 239
I keep putting this off, but next I want to make an inventory system.

In other games, you have your items and tools in the hotbar. I want to do something a bit different.

I want to have the hotbar for your regular items, like torches and workbenches and food, but for tools, I want a separate slot and a separate inventory. So you have the hotbar and the inventory for it (tools do not go there) and a separate slot for the tools, which you can cycle through. Left click could use the tool and right click could use the hotbar item.

Seems simpler than filling up your hotbar with tools you need. Now the hotbar will have more room for other items. I do plan on keeping weapons in the regular inventory, however, and not in the tool slot.


My only problem: I'm not completely sure how to go about this. I've tried a bunch of times but haven't gotten anywhere. However, I'm at a point where there really isn't much else I can add to the game without inventory, so now I have to do it.

Bombini

  • *
  • Posts: 1400
Very good stuff!
The concept reminds me a bit of Crashland (iOS).
Congrats!

I would like to share a thought.
Obviously you need an inventory for this game. But try not to get lost in complex features like the day and night cicle which are fun and make your world immersive but dont add yet to the core game play fun. Again, i think you are doing it but there is alwys the risk of getting lost in those projects. "Try to focus on the bare minimum fun/gameplay first" is i guess what i am trying to say ;)
Let me chop trees and build stuff.
One more thought: Think about how you can stikc out of the other games. Have one idea that is unique.

Sending you a lot energy!
Btw, no need to be an artist. there are a lot cool and not very expensive game art sets on itch.io for example to get started.

Cheers!


« Last Edit: February 11, 2019, 07:00:11 am by Bombini »

Fayabella

  • Posts: 239

Very good stuff!
Thanks!

"Try to focus on the bare minimum fun/gameplay first" is i guess what i am trying to say ;)
One more thought: Think about how you can stikc out of the other games. Have one idea that is unique.
Yeah, I kinda have no gameplay at the moment and all I've worked on so far is world generation and fancy graphical stuff like lights and autotiling, but no gameplay.
And I'm not entirely sure how I should make my game unique, but I'll get there eventually. At the moment I'm just making a game that is playable, and then I'll just add more as I go.
Btw, no need to be an artist. there are a lot cool and not very expensive game art sets on itch.io for example to get started.
Yep, just getting most of my sprites from random sites like opengameart and such. Only sprites done by me are the torch and cursor.

Now, I'm beginning to work on actual gameplay stuff, little by little.

I'm gonna release an update soon that has an inventory- chopping trees gives you wood, which at the moment does nothing, but hey! You can collect wood! But more importantly, you get a stack of torches each time you generate a level, and you can place them. It's very simple, but I can expand upon it and add other things to build.

Actually, I kinda want an opinion on my way of going about building:

The way I have this set up right now, I have a separate map attribute for each type of object (so far, trees and torches).
When a tree is generated, it adds the coordinates as a key in the format col.row (for example 13.6) to the map attribute, and with the specific actor saved as the value of that key. Same goes for torches and their map attribute.

When I click, the game checks both of those maps to see if they contain a key with the col.row of the cursor. If not, then it digs dirt tiles at the clicked spot. Otherwise, it deletes the torch at that spot/damages the tree.

When you place a torch, it checks if either of those maps contain anything at that spot, and if not, add torch.

So my question is, is this super inefficient or should I keep it?

« Last Edit: February 17, 2019, 08:02:29 pm by Fayabella »

Fayabella

  • Posts: 239
I've released 1.3.0. (In case you're curious, my version numbering convention is major, minor, patch.)

You can play the new version here: http://www.stencyl.com/game/play/39890

Here are the changes:
Quote
1.3.0: Feb 18 2019
-Added basic inventory system. I will expand on it in the future.

-Chopping trees now gives you wood, which has no function as of yet.

-You can now place torches! Shift-click to do so (as long as they're in your inventory.) Note: As they're the only item that you can place, I haven't made a system to place different items/select item to place from hotbar, so torches are shift-click's only function.

-Fixed bugs with the water being glitchy by manually replacing the corrupted tileset.

-Fixed an error with the lighting system.

-Game now completely resets when you generate a new level (before, day/night cycle and player position wouldn't reset).

Added a loading screen when generating a level.


Getting somewhere!

« Last Edit: February 18, 2019, 01:14:05 pm by Fayabella »



Fayabella

  • Posts: 239
Just added a small fix:
Quote
1.3.1: Feb 18 2019
-Fixed a small graphical bug where the edges of the screen wouldn't be darkened by the night cycle if the player was moving.

merrak

  • *
  • Posts: 2738
Looking good so far. I like the torches and day/night cycle. The only problem I ran into with it is lag--I was able to place 19 torches before the game slowed to a crawl.

Bombini

  • *
  • Posts: 1400
Very cool progress!
Reg. your question:
Quote
When you place a torch, it checks if either of those maps contain anything at that spot, and if not, add torch.
So my question is, is this super inefficient or should I keep it?
Avoiding collisions (sounds like you do) is always helpful in regards of perfromance although it seems like a bit extra work. I would keep it.

Cheers!

Fayabella

  • Posts: 239
Looking good so far. I like the torches and day/night cycle. The only problem I ran into with it is lag--I was able to place 19 torches before the game slowed to a crawl.
Ooh- thanks for noticing that. I'm not actually sure what to do about it, though, as I'm not very good at optimization.

I can tell it's the lighting, but I'm not sure how to fix it, especially because I didn't make that behaviour.