Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411489 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 02:45:00 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsHelp with crafting methods
Pages: [1]
Print
Author Topic: Help with crafting methods  (Read 1312 times)
klyxmaster
Level 0
*


View Profile
« on: October 31, 2015, 03:29:20 PM »

I am making a browser (php/sql)text game, more for personal that commercial, actually I doubt it will EVER go commercial LOL. call me shy or lack of confidence heheh
Anyways, I digress.

Most of my game design is going well. I wanted to add a simple crafting aspect, as that is the thing these days, but more so for my knowledge. I need some advice on how to proceed.

using a basic 3x3 grid, (i am good with many language, so for here, psuedo will work for explanation, or your preferred - i can translate) and a boat load of mats, how do you determine that
1. you have to correct parts in a multiple recipe
2. if they are in the correct location of the 3x3 grid

any other tips on this would be great. I did not see much info on this here n the forum. but as usual I was probably asking the wrong question. LOL

Cheers!!
 
ps
I see there is a devlog here, hmm that might be nice to make sure I keep going even thruogh lulls (know how many projects I started, and never finished LOL)
Logged
Mixer
Level 1
*


I've never really known what to put here.


View Profile WWW
« Reply #1 on: November 04, 2015, 12:44:27 AM »

It sounds like you want minecraft style crafting. No offense, but maybe just proof read your post, it is a little bit difficult to understand.

I honestly have no idea with PHP, but can't you just store a 3x3 array, and then while crafting check to see if every element has an equel ID?
Logged

My twitter is @5Mixer.
I'm currently making a dungeon game, check it out :D
https://forums.tigsource.com/index.php?topic=59139.0
klyxmaster
Level 0
*


View Profile
« Reply #2 on: November 05, 2015, 08:03:20 PM »

Hi thanks for the reply.

MC is a good formula. Look at MMO's grind, quest, level, skills, gear (instance or otherwise), some with crafting as a major role, others with a minor role - rinse and repeat. I've played over 200+ MMO's and still play today (clocked over 5k in wow alone), they all use this "formula".

Yes I want to get a better understanding of how one does crafting systems. Ultima online (1997) had crafting, MC just took it to extreme and is the mainstay. So yes, I want to understand how this works.

Language is arbitrary, use what you like to convey an example, I like php, even psuedo code it is not important (I can convert it),

I understand that you cannot store a 3x3 and check. Which is why I posted here to see how others are doing it. I am sure there are more than one method.

currently I made an array that just stores the item id, and quantity, which is quick to check, and it is simple. But I think players would have more enjoyable experience, that like MC, Terraria etc.. to be able to place them in certain order.

Anyways.. thats really all I am looking for. matrix style crafting, and how others are doing it.

I thought about that, but under many players, that might put a strain on the code - and the server. So seeking experienced devs here to make a suggestion.

ps
Only offense I took was that you did not point out what you did not understand. Because your reply implied otherwise (language php, wanted a matrix crafting system, might be possible to do with a simple array).

Cheers!!
Logged
Mixer
Level 1
*


I've never really known what to put here.


View Profile WWW
« Reply #3 on: November 09, 2015, 02:29:56 AM »

Quote
but under many players, that might put a strain on the code - and the server. So seeking experienced devs here to make a suggestion.
Put a strain on the server? No, no, no way. Ever. Think about modern AAA games that are sending hundreds of events across in realtime, loads of player positions, full player inventories, bullet movements, even analytics like window size, all in realtime. Transferring a tiny ID, or a small inventory, is the least of your issues if you are dealing with servers or performance.  Smiley

Quote
I understand you cannot store a 3x3 and check.
Uhh, yes you can. Let me explain below...
Quote
1. you have to correct parts in a multiple recipe
2. if they are in the correct location of the 3x3 grid
1. Just that all the ingredients are somewhere in there? This will search all recipes and find a valid one.
Code:
var enteredRecipe [1,1,1][1,2,1][1,1,1]
for (recipe in allRecipes) {
    var recipeIsUsable = true;
    for (ingredient in recipe.ingredients){
        //3x3 loop checking each ingredient, vs enteredRecipe. If any ingredients are not found, set recipeIsUsable to false

        if (recipeIsUsable == true) return recipe; //Found a valid recipe.
    }
}
       

2) Well same as above, but where I have my comment that you loop through the 3x3 array, you simply access the element, not loop through it.

*Signing out*
Logged

My twitter is @5Mixer.
I'm currently making a dungeon game, check it out :D
https://forums.tigsource.com/index.php?topic=59139.0
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic