Welcome to TRiBot Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

adamhumphries5

Programming theory brainstorming for a game im making

5 posts in this topic

Hey guys I have a couple ideas but I was curious of your theorys/methods on how you'd spawn clusters of ore together like terraria or like 2d minecraft, on a 2d array of tiles. Right now I have a system but it groups them together wierd, I'ma try some other things but I was curious of how you all might do this, spawning clusters randomly correctly?

Share this post


Link to post
Share on other sites

You'll need to be more specific than that. Making something like this isn't difficult, but there a bunch of different ways to go about doing it. My advice is if you are going to be making generated worlds (which it sounds like you are), keep everything as simple as possible. The reduced processing time is going to be very important.

 

As a general rule of thumb (which you're probably already familiar with), go with calculations and formulas before loops and lists.

 

But anyways, I do need to know how you want to ores to spawn before I can help you.

Edited by tacomanstan

Share this post


Link to post
Share on other sites

You'll need to be more specific than that. Making something like this isn't difficult, but there a bunch of different ways to go about doing it. My advice is if you are going to be making generated worlds (which it sounds like you are), keep everything as simple as possible. The reduced processing time is going to be very important.

 

As a general rule of thumb (which you're probably already familiar with), go with calculations and formulas before loops and lists.

 

But anyways, I do need to know how you want to ores to spawn before I can help you.

Yes, that is exactly my point and I figured someone would ask, it's just you could do it a million different ways like you said, and I have been keeping things simple and modifiable with weights. But to answer your question, right now my ores spawn in lines with random branches kinda, I want them to spawn in adjacent groups of 4-8, in like a square, rectangle, circle, etc, like actually little clusters not just random spawning. I have ideas but I was curious of my knowledgable peers opinions. Thanks taco

Share this post


Link to post
Share on other sites

A typical 2D game has a tile grid system for tiling such as flooring, etc, and then a separate collection of 2D shapes and objects for entities like players. When you tie in a collision system that would work between these two, you have yourself a 2D game.

 

For your ore dilemma, I'd look into procedural generation. If you already looked into this, you should be easily able to manipulate the algorithm so that you can have groupings of ores spawn. There are also many examples of Minecraft's ore procedural generation where the generation of certain ores are based off of the rarity or percent chance for it to spawn every X blocks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.