Dinhero21 / game-engine

Fully Open Source Game and Game Engine
0 stars 0 forks source link

Crafting #5

Open Dinhero21 opened 1 year ago

Dinhero21 commented 1 year ago

So here are my ideas for the crafting system.

I don't want to follow a Minecraft-like crafting system because tbh I don't really like it and it would be too hard to program.

The game with a crafting system the closest to the one I am planning is Satisfactory. A crafting system where you don't have to put the items into the "crafting grid" and where you are actively punished for crafting.

Wanting to punish my players for crafting, a core part of any game might sound weird at first but by doing that I will incentivize automation which is something that I really want for my game.

The way I am thinking of doing this has a tile that when clicked will force the inventory into its "open" state and replace it with a container that will have a button that will need to be continuously pressed for the crafting to occur (maybe that's too much, having the UI open might be enough).

I will try to explain the UI with text which is probably going to be hard to visualize but whatever. A vertical bar with a list of Items (icon + name) with a square divided into two horizontal sections on the left where the first section has Item Info, Required Items, Result, etc, and the second section has a button that needs to be continuously pressed for the crafting to occur on top of a progress bar that shows for how much time you have to press the item for it to be crafted.

Dinhero21 commented 1 year ago

I tried to show what I meant using ASCII art

+----------------+----------------------+
| Example Item 1 |  Example Item 1      |
| Example Item 2 |   Lorem Ipsum Dolor  |
| Example Item 3 |  Requires    Crafts  |
|                |   Example     1x     |
|                +----------------------+
|                |███████               |
|                |████[Hold to craft]   |
|                |███████               |
+----------------+----------------------+
Dinhero21 commented 1 year ago

One thing I have not yet considered with my idea is how I am going to craft the tile used for crafting.

The options I can currently see are:

  1. Spawning the player with the necessary things for crafting
  2. Making the player craft basic items without a crafting tile

The first option sounds a bit "forced". You are not born holding a cube that can magically craft stuff (video game logic is a bit quirky tho).

The second option sounds more appealing to me but if we are going with it then it might be better to redesign the inventory.

Dinhero21 commented 1 year ago

For the second idea to feel natural, I would have to make the crafting included in the Inventory which might cause some UI problems.

This is how I would imagine the UI would look like:

+----------------+----------------------+--------------+
| Example Item 1 |  Example Item 1      | +---+  +---+ |
| Example Item 2 |   Lorem Ipsum Dolor  | |   |  |   | |
| Example Item 3 |  Requires    Crafts  | +---+  +---+ |
|                |   Example     1x     |              |
|                +----------------------+ +---+  +---+ |
|                |███████               | |   |  |   | |
|                |████[Hold to craft]   | +---+  +---+ |
|                |███████               |              |
+----------------+----------------------+--------------+

If this Inventory is centered then I feel like it would not be a great experience to need to look right to see your items and left to craft.

If the Inventory part of it was centered then the might feel inconvenient for the same reasons.

Dinhero21 commented 1 year ago

Ok so here is an interesting but weird idea. What if the Inventory and Crafting areas were disconnected but trigered by the same hotkey?

In the closed state the Inventory could be centered horizontally and only showing its top items (hotbar) while the crafting area would be completely invisible.

In the open state the Inventory could be in the center of the screen while the crafting area is in the top left corner.

Dinhero21 commented 1 year ago

Another idea I just had is for the crafting area to "pop out" of the Inventory. So, for example, when the user clicks on the left corner of the Inventory the crafting area could expand from there while the Inventory shrinks.

(tbh doesn't even sound that hard to code)

Edit: I tried to illustrate what I meant

Item State

+----+--------------+
|    | +---+  +---+ |
|    | |   |  |   | |
|    | +---+  +---+ |
| /- |              |
| \- | +---+  +---+ |
|    | |   |  |   | |
|    | +---+  +---+ |
|    |              |
+----+--------------+

Crafting State

+----------------+----------------------+----+
| Example Item 1 |  Example Item 1      |    |   
| Example Item 2 |   Lorem Ipsum Dolor  |    |
| Example Item 3 |  Requires    Crafts  |    |
|                |   Example     1x     | -\ |
|                +----------------------+ -/ |
|                |███████               |    |
|                |████[Hold to craft]   |    |
|                |███████               |    |
+----------------+----------------------+----+
Dinhero21 commented 1 year ago

An idea that I had yesterday was to use a (future) quest/advancement system. For example, there could be a quest called "Crafting" or something which would take some breakable by-hand material (sticks or rocks on the ground for example) and would give the player the crafting tile.

Dinhero21 commented 1 year ago

I just had an idea that is so crazy it might work, so example when you right-click or press some hot key when your mouse is on top of a storage tile it would open up an interface centered at the tile's position that would be "locked" to the tile's position (child of world).

Dinhero21 commented 1 year ago

This is probably the one I will go with (because it is the easiest to code).

A crafting area that is toggled via the same hotkey as the Inventory that when closed is completely hidden but when open is visible in the top left area of the screen.

The interface will look like this.

When spawned the only item you can craft is the crafting tile which would require materials that can be gathered without any tools.

When the player gets close to a craftable tile it will add the items craftable with it to the player's crafting area.

Dinhero21 commented 1 year ago

The crafting system is basically done.

Here is what it currently looks like:

image

I will close the issue once I make it look good.