Is this possible?

So I am trying to make a 3d mining game, but before I get deep into developing it, and put a ton of time into it I would like to know if what I am wanting to do is possible in unity.

I’m going to try and explain this as best as I can.

So my world is going to be a smooth none blocky voxel world, where players can dig for minerals with shovels and machines, so here are my questions.

  1. Is it possible to have minerals scattered throughout my world in the ground randomized amounts more in said area and less in others?

  2. Say I dig with a shovel now the shovel has dirt on it with the minerals mixed into the dirt from that spot, am I able to code it to where I can dump that dirt off the shovel and it makes a pile on the ground that retains the minerals that was initially on the dirt that was dug by the shovel and able to repeat the process, so the pile gets bigger and bigger the more u add to it but keeps all the minerals dug up by the shovel???

  3. If number 2 is possible, that means I would beable to use a backhoe fill up a dump truck move it across the map keeping the mineral and dirt contents dump it at a processing plant in a new pile then moving it from the new pile into the plant to separate the dirt and the minerals held in the dirt, correct??

Thanks.

  1. Yes
  2. Yes
  3. Yes

Now grab on Unity and hop on the work.
Be advised, start with pong game first, if you never developed any game yet.

I have a little bit over a year of experience I have made smaller games but nothing Of this size so I’m using this as a learning experience as well It may take me a very long time to do this but I will learn so much as well

So if that is all possible How would that be achieved Like I’m not asking for specific code I’m just asking for a short explanation because I can’t find anything on this

The only thing that is remotely close to looking like this is gold rush and gold hunter But they are not able to retain the minerals when they dig When they dump out a shovel it disappears And they are not able to dig on the entire map they can only dig in specific areas with weird types of material

Yes.

It can be done, but it may require skilled programmer.

Basically, games are made with smoke and mirrors, and nothing prevents you from having a pile on the ground that literally stores list of materails within it, and then making pile bigger. Same goes for transporting it in a t ruck. You don’t need to simulate every speck of material, you just need tostore total.

However, what you describe is “ground manipulation”, this is something that people usually want in farming sim, but the thing is I do not recall a farming sim that offers such feature. The closest to that is Farming Simulator 19, where you cutting grass or harvesting wheat produces physical piles on the ground which you can then collect.

So you may be aiming too high.

Destructible landscape requires voxel terrain (you’ll be able to dig caves) or heighmap terrain (you won’t be able to dig caves)

In its simplest form, dumping stuff from shovel requires you to spawn “pile of stuff” object on ground, attach information regarding what’s inside of it, and make it bigger when there’s more stuff in it. In more advanced form, it can be implemened like heightmap that is poking through the ground in places where there’s a pile of stuff.

3 Likes

Honestly with one year of experience, I’d strongly recommend trying this as a 2D game. It sounds like a concept where 3D would add a lot of development complexity with possibly little additional gain in gameplay fun.
2D will be challenging and fun enough already :slight_smile:

You could use this affordable system here for a headstart: https://assetstore.unity.com/packages/tools/level-design/digable-2d-terrain-200544

Kinda done with 2D games I want to make a 3D game I understand it will be a lot of work and I am prepared to learn, it may take years but it’s doable.

It’s not unlike an inventory system, how you render it is different but same mechanism of adding/storing/removing “items” to containers whether minerals or potions or whatever, and a dump truck and dirt mound instead of a backpack/chest/etc can all be considered types of containers that dirt/materials can be added to.

Even in an inventory you may have a different graphic for a silver coin vs a pile of silver coins assuming coins are stackable and you reach a certain threshold in which it becomes a pile.

For your dirt pile you may have to build a 3d model pile that is made up of segments/nodes/submeshes, and each time you add to the pile it toggles a node on and sets its type of mineral and units of material. When all the nodes have been toggled on the pile is full and can no longer be added to.

From my experience, I can say that going too big, when it comes to side projects can be frustrating, and you may quickly lose motivation. Try to slice your plan into smaller pieces, focus on core functionalities, and once it is done add more features.

Many functionalities that you want to code will take long weeks or even months to make (you will have to learn many other things before you will be able to make it work) and the progress in your project will be little.

I understand that you don’t have much experience with 3d, so maybe work on smaller projects, learn one thing at a time, and once you feel ready, go for the big one

3 Likes

Your account is eight years old yet you only have a year of experience. That doesn’t suggest to me that you’re going to be able to stick to a project for years. Choosing 3D is fine but you don’t want to jump head first into a gigantic project with little experience. Start small and work your way up.

4 Likes

I think this point is what has people concerned. The way you’re talking about this is not generally the way most experienced game devs would think about it.

The way most devs would think about this is something like:

“I have a shovel object, it’s got a dirtType property and a dirtAmount property”

“when the player uses the shovel I’ll spawn a shovelDirtBlob prefab and attach it to the shovel dirtBlob attachment point”

Or something super simplified and dumb like that. The way you’re talking about it sounds much more detailed and realistic, which is why the more experienced peeps are giving you warnings.

2 Likes

OP you really need to pick something of a suitable scope, this isnt it based on your experience and the way you are talking about some very basic things.

I guess what everyone is trying to say here is : if you need to even ask these questions, you are definately not ready to build this yourself. You will just end up having to come back to ask for help for every step along the way. Based on your experience level its going to take a lot longer than you think.

As a rule of thumb: generally things always take at least 2-3x longer than you would expect the actual implementation to take, to account for bugs, testing, package issues, performance issues, etc etc that come up along the way. So whatever time you think this can be done in, is drastically off.

Nobody is telling you these things out of malice, everyone just wants you to suceed instead of fail.

Good luck :slight_smile:

Yes. Except that OP seems to be looking for a way to mix multiple types of ore in a single pile
That calls for a list, at least in the pile.

Below is simple idea could use to get started. I agree with others than if you are asking these questions, the described game is too complicated. However, you can practice making some of these subsystems on their own and learn a lot.

I like to use some mind-mapper application to sketch out my ideas in plain english, then form it into pseudo-code before doing any in-engine work.

It helps me to think in terms of questions. Who, where, when, what, why? Who needs to know what, and why, and how will they communicate with others that are involved, etc.

I’ve described here very simple idea that can get the ball rolling but naturally you will need to modify it as you add additional features. Eventually your data may need to be contained in arrays or maps, and perhaps your interaction tool (the shovel) needs various states defined which handle what sort of animations and events it will perform. But it is good to start simple and only add one new thing at a time. This way when you have bugs, you can solve them.

Try to avoid doing things “right” to start with. You’ll end up confusing yourself. Just get things working in a way that you can understand. YOu will naturally come to face problems, and then when people tell you the “right” way, you’ll be able to understand what they mean. But if you try to apply the “right” methods from the start, you’ll misapply and cause problems that are not easy to solve.

In other words, do work in whatever way you can to create your desired results, then get help from others to refine the code into something that is more maintainable, performant, etc. You have to start by doing the work.

From here you will have to figure out many more questions to ask.
How does one entity identify the other?
Who passes data to who?
Does one entity need to know about the other?
etc. But you’ll be able to ask those questions more specifically once you get to them, and then more useful, less broad answers can be given.

edit:
to get start with this whole setup, just do it with text, like a text adventure game. This will ensure you understand the communications between gameplay objects. Thats the most important part. Then when you get to tacking on visual elements, your mind is free to focus on those details without having to also design the fundamental system at same time.

I agree that tackling this entire project is probably too big, if a finished game is the goal, probably a 2D game would be more likely to be finished with the overall game idea.

OTOH, you could just tackle one problem at a time, like the pile concept. I might try something that uses 3D perlin noise to color/reveal/create the various amounts of minerals. It seems to me that you could normalize the pile of noise from 0 to 1 and assign percentages of each mineral in that range. So, 2% gold + 98% dirt would use the value .02 to clip the 3D noise to represent gold.

Not sure of the mechanics of how to show this, but as others said, you simply need a list of minerals in the pile. Using that, determine if materials/particles/voxels or a mesh would be the best way to represent it. I think refining that mechanic to work and look good in 3D would be quite a challenge and keep you busy for months!

I really appreciate all your feedback, I understand what I am describing might be * too big for my scope * but please bear with me for just a minute, or out of my skill level, but my motivation is extremely high and that will not falter this is something I have really been wanting to do and am very determined to do it.

I will try to explain it a little bit more. Please keep in mind out of the entire game THIS IS the most complex part the rest of the game is nowhere near this complex, so I want to take the time to learn this part.

I want to do an invisible grid on my map that is many grids for example 10x10 or 5x5 1x1 etc grids that have a maximum height and a maximum depth. Within these grids, it spawns randomized invisible minerals ( that are dice rolled on startup for the amount within the grids some will have a higher maximum amount that can be obtained and some a lower maximum amount that are scattered all over my voxel terrain )

So that when I dig with a shovel it takes a piece out of the terrain ( spawns the dirt in the shovel or bucket, etc ), lowers the overall minerals in the said grid, and adds the removed amount to the dirt in the shovel, so when I dump out the dirt in the shovel the small pile it creates has the minerals that were removed from the said grid by digging with the shovel in that pile, and the more I dig and add to the pile the bigger the pile gets, but it retains all the mineral information within the pile that was removed from the grid.

The minerals ( pile of dirt ) that were removed from the said grid have to be able to be moved around after it has been put on the floor maintaining the minerals that were dug up when the shovel spawned the dirt on it out of the grids mineral count.

If I can figure out how to do the above ^ the rest of the game is not going to be as difficult.

I am not asking people to code this for me, I am asking for guidance on where I can read up on doing what I mentioned above because I have been searching and am coming up empty

Thanks in advance.

100000001218704--1121384--clear.png
100000001218704--1121384--clear.png

honestly man I appreciate the feedback, but the only way to learn is to take on challenges, I didn’t use the codes in mine but this is the basics of what I am trying to accomplish, this is the most complex part of my entire game, once I learn this the rest is nowhere near as hard.

8153357--1059272--This.png

yeah i think its good to take on things that are “too hard”.

I think it’s important to start building the system with only text first. Like this:

UnReal World - Screenshots

It can be 2d or 3d, but just set a static camera that looks down on your game objects. Use print logs or setup a super simple HUD to display text.

The print logs will give feedback about logic happening.

First steps is get your game objects in the scene and be able to display text when you click on them. Then display text that tells your their assigned variables when you click on them.

After that you can work out a way to move data around.

Forget about procedural systems and voxels and all that advanced stuff for now. You will see that getting the basic channels of communication and managing data will be plenty to chew for awhile.

If you believe that this is by far the most complex aspect of your game then I’m even more inclined towards this being out of your league. You’ve completely neglected to consider the main difficulties of working with voxels.

Getting voxel terrain to render properly is fairly difficult but it’s not the worst part. You need to be able to generate voxel data, stream it into memory from files, and stream it back out to files after it has been modified. None of that is trivial. Minecraft has a far simpler voxel approach and it struggles with all of this.

There are no third party voxel terrain systems available for Unity that haven’t been abandoned by their developers so you will have to build and solve all of these problems yourself or hire someone to do it for you.

1 Like

I don’t want the voxels themselves to store the data, that’s why I want to use an invisible grid pattern that is like a layer over the voxel landscape, I already have a working voxel landscape that I can put holes into it renders just fine from what I have seen, so I dunno why you are saying this stuff? I mean your comments really just scream you can’t do this give the hell up.

That’s not going to happen, you might see something as too hard or impossible, I see something that is hard and or impossible as a challenge.

My entire life people have been telling me what I want is impossible or too hard I am wasting my time, and every time I have proved them wrong when someone tells me it’s out of my league or my skill level I always strive to prove them wrong, and I have not failed once I put my energy and mind to it.

I will figure this all out, if u are here to just say don’t do it, go do something else, if u think that is hard then this will be even harder, like seriously? is this what you do people ask a question and you try to steer them away from accomplishing what they want?

Do you really live your life like this?

You’re describing factorio/space engineers. From those factorio is 2d, space engineers is 3d.

The pain point is the grid. You’ll have to polygonize that, and that can be painful. See Dual Contouring for smooth landscape. Or you can make it simpler and use minecraft visuals.
Here’s an example:
https://forum.unity.com/threads/dual-contouring-are-there-opensource-implementations.1269281/

You can also make the grid 2d with height. But you’ll still have to polygonize the grid and reflect changes to it.

The actual digging thing is simple.

In your game you’ll have every material defined at some point. It could be “iron ore”, “copper ore”, “uranium ore”, “adamantine” or whatever. The definition will also include its material texture. So t he data on your grid will store which material is present, and how much of it is there.

So, when you dig with a shovel or anything else, you probe the grid, verify which material is there and reduce total of material in the cell. Then you update the landscape to reflect that. On your shovel, you store which material you’re holding, and how much. You update the sholvel to reflect it holding something which can be simple model swap, unhiding a portion of model, etc.

When you dump the shovel onto ground, you spawn a “rubbish pile” object. Actually, when you dump shovel onto ground, you check if a “rubbish pile” object is already present, and instead of making a new one, you use existing one. A rubbish pile object will store a list of all materials in it and their amounts. So it will have a list that it has 100 units of iron ore, and 200 units of uranium, for example. And it will update its own appearance to reflect materials within. That’s if you want to do it easy way.

Let’s say you don’t want the easy way and instead want to make your life difficult, by implementing system of farming simulator, where a vehicle can dump grain onto ground, it iwll form a pile, and that pile will be a smooth pile, not a distinct object, and you also can ride through it, bulldoze it, etc.

In this case, you have an a LAYER of, I don’t know “mineral grain” (what’s the english word for all material composed out of thin particle t hat forms pile? “Dust”?) or “mineral dust”. That layer would be a 2d grid overlaid on top of your world, whether it is 2d or 3d, storing how much stuff you’ve dumped for every single square of the grid. It has to be fairly high resolution, by the way. So, when you dump shovel, you’ll update the “dust map”, and based on data of in the dust map, you’ll update the “dust mesh” which will be geometric representation of the piles. And based on the stuff stored in this particular spot, it’ll have to change its visuals.

But let’s say it is not enough. You really want to make your life difficult, and want to make piles out of powdered uranium and dig tonnels through them! In this case, when you pour things down onto ground, you’ll update the world voxel grid, forming new voxels at the dumping spot.

This is not recommended at all, as it will not let you bulldoze the material easily, and will have a fairly low density compared to 2d layer of dust.


For the record, didn’t I already explain all of this in this thread?

2 Likes