### A Foresty Game

#### Fayabella

• Posts: 163
This depends on the balancing (how expensive it is to build a mine and how long it takes).
Ah. Yes, I shall try to make it balanced. And if it isn't, then I'll tweak it.

But I've thought of a solution that combines both of my ideas (probability and Perlin Noise):

Each ore type has a Perlin Noise image for itself. When the mine mines a level, it gives you ore based on the perlin noise, using the probability as constraints.

This way, my idea of Perlin Noise and one area having more of a specific ore than another can still be used, while also having ores appear more frequently at certain depths.

So, you don't know what ores you're going to get when you place the first mine, but based on how much you got, you can determine if there's a vein of a specific ore there.

#### Fayabella

• Posts: 163
On another note, I've added stones and they behave exactly like trees. What's more, I made a simple way to discern whether an object behaves like that or it just disappears when clicked.

Basically, if it's a stone or a tree, it will trigger an event in that actor, otherwise it kills it. This means I can add as many of these resource objects as I want.

Right now a stone gives you between 2 and 6 stone, with a 1 in 3 chance of also giving you 1-4 coal and a 1 in 7 chance of giving you 1-2 iron ore.

Edit: I've found that for some reason, breaking the rock doesn't remove it from the map of objects, meaning you can't place something in a place where a rock once was. I had this problem with trees but managed to fix it, and I'm using the same thing for rocks but it's no good. How odd.

Edit 2: Now my trees aren't working properly! They act like torches now. How very odd indeed.

« Last Edit: March 16, 2019, 01:20:17 pm by Fayabella »

#### Fayabella

• Posts: 163
So I figured out the problem.

If you look at the attachment in the previous post, i have two if-statements and an otherwise.

So basically, even if it's a tree, it's overridden.

I've spent multiple hours trying to find the issue and that was all it was.

Welp, everything's back to normal now.

#### Fayabella

• Posts: 163
Code: [Select]
`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.`Released 1.4.0! See changes above.
http://www.stencyl.com/game/play/39890

« Last Edit: March 17, 2019, 07:03:16 pm by Fayabella »

#### Bombini

• Posts: 1267
Wow! This is already pretty cool!"
Very good progress...one thing i would ask for...please replace the arrow with a placeholder character/person It would make such a difference

#### Fayabella

• Posts: 163
Wow! This is already pretty cool!"
Very good progress.
Thanks!

Please replace the arrow with a placeholder character/person It would make such a difference
hmm well um
I've searched for something that looks alright but can't find anything that fits, and I can't do pixel people.
I'll see about it though. Eventually I gotta find something right?

#### Fayabella

• Posts: 163
skidaddle skadoodle you're now a pony

No, not actually, but I was just messing around with the movement behaviour and found you could set animations for each walking direction. I didn't know that and that's one of the reasons I've put off having a character for so long- I thought I would have to edit the behaviour myself to get it to do that and I really didn't feel like it; I'm not the best at editing code someone else made.

So when I actually find (or make) a player animation, it'll be much simpler than I thought to add.

Odd how I miss some of these simple things.

#### Bombini

• Posts: 1267
I'm not the best at editing code someone else made.

You will get better and better and some point replace the  code form someone else with your code

#### Fayabella

• Posts: 163
You will get better and better and some point replace the  code form someone else with your code

Ah, yes. It's really a matter of a difference in thought processes. And usually, everyone can have different ideas on how to go about something. And if they don't comment, (I don't!) then it's even harder to see where they were going with something.

I often think of really odd ways to do things, and then someone else tells me something so simple that I don't know why I didn't think of that in the first place.

#### Fayabella

• Posts: 163
Look! A forge!

Used for smelting raw ores into bars.

Anyways, I'm working on a huge update right now. It includes crafting and a UI, and a couple other things I still need to iron out.

#### dekilana

• Posts: 11
This is awesome, i have in mind a very similar game, and i wasnt sure Stencyl was the right engine, but seeing this, has changed my mind.
Also let me know if you need help with art and sprites. Although im a traditional  artist, i have started learning pixelated art.

#### Fayabella

• Posts: 163
Thanks! Good luck with your game!

And I'm just now getting into pixel art too. I've never really done it before; the workbench, torch, forge and mine and the only things I've ever made.

#### Bombini

• Posts: 1267
Look! A forge!
Used for smelting raw ores into bars.

Very cool! The player understands without having to read text.

#### NerdinaNutshell

• Posts: 170
Interesting little game. I myself have done a little procedural generation in the past, but it could get laggy, there was some weird paths sometimes, and it was kinda basic.
Plot Twist... I'm a ghost

#### Fayabella

• Posts: 163
Yeah, mine's pretty laggy too. In fact, in the Flash player (which is what I test it in), that little part that says 'generating level' is really just a placeholder while the program goes into 'Not Responding' for like fifteen seconds. A small price to pay for selective percentages of certain tiles- that is, generating only between 50-75% of the tiles in the map as dirt, or only letting water generate if less than 10% of it is overlapping dirt, for example.  Even these small things can give you a lot more control over your generation.
I have an idea on how one could generate structures, too, or at least specific configurations of tiles. But I'm not that far yet.

In other news, I don't have access to my computer right now, but when I get back to it, I only have a few more things to add for the next update. It's starting to actually turn into a game now, instead of just chopping trees.