[Help] Invention system

got scripts? Need scripts?
Post Reply
User avatar
Last Known Hero
Posts: 807
Joined: Wed Aug 26, 2009 12:28 am

[Help] Invention system

Post by Last Known Hero »

Hey guys, sorry for the lack of posting. Been lurking but not contributing.

For my project I was wondering if anyone knew a way to make an invention system, with the basics to combine objects together and create something new? It's going to be one of the biggest features I hope to implement.
Image
Power3DArt

-Current Project: Fault [Pre-Alpha]
User avatar
vitinho444
Posts: 2825
Joined: Mon Mar 21, 2011 4:54 pm

Re: [Help] Invention system

Post by vitinho444 »

I'm not going to say much, but as coders.. we know that to exist it must be there already (coded) right? So.. you could make a list of items combo that together they can form different other items.. saying out loud i would say using something like the quest system by halls.. you give items and receive a reward..
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: [Help] Invention system

Post by Jackolantern »

vitinho444 wrote:I'm not going to say much, but as coders.. we know that to exist it must be there already (coded) right? So.. you could make a list of items combo that together they can form different other items.. saying out loud i would say using something like the quest system by halls.. you give items and receive a reward..
They doesn't necessarily have to exist as whole combined items if you break it down into components. Say each item has a component that is added to the resulting combination, and some items keep the base model as the model for the combined item, but the combined items can have widely varied components that could act like attributes, mechanics, etc.
The indelible lord of tl;dr
User avatar
vitinho444
Posts: 2825
Joined: Mon Mar 21, 2011 4:54 pm

Re: [Help] Invention system

Post by vitinho444 »

Yeah but we have to code so the item together gives XX + Bonus or something.
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Nihilant
Posts: 47
Joined: Wed Aug 31, 2011 8:24 pm

Re: [Help] Invention system

Post by Nihilant »

This is indeed a thing to think about. I was trying to think of something easy to make once, but I was bent on making it a combination of cards, so after I changed some other ideas about my game I gave up on that line of thought. However, I was concerned with coding side more, and my unfinished solution went something along these lines:

1. There can be for example 10 types of items: item + A,B,C,D,E,F,G,H,I,J.
2. Items can have 10 types of 'values' or 'attributes', whatever you call them: att + 0,1,2,3,4,5,6,7,8,9.
3. Each 'value/attribute' needs 3 different ingredients to build, out of total 10 ingredients ingame: ing + i0,i1,i2,i3,i4,i5,i6,i7,i8,i9.

Thus, defining an idem, on the side of code/database_entry is like:
1. if it's A, having attribute 0 and 2, of which attribute 0 has ingredients i0,i4,i5 and attribute 2 has i0,i3,i9, you write it as:
itemA_att0-ingi0-ingi4-ingi5_att2-ingi0-ingi3-ingi9
in the code/database_entry

Now, at that time I was obsessed with arrays and operations with arrays, so what I thought of doing was splitting that info when called for display in user's interface: splitting at '_' sign gives you the:
1. 'itemA' - which is then used to call the image called 'itemA.png' for example,
2. att0-ingi0-ingi4-ingi5 & att2-ingi0-ingi3-ingi9, as 2 elements in array made from splitting the full name, tell you that you need to load 2 'holders' for that item's attributes,
3. then you split each with '-' and get element at [0] position as attribute name, load it's picture (like 'att0.png' and 'att2.png'), then list ingredients under the picture as it says in the other 3 elements in such array.

For shorter steps (less checking) you can actually give real names to all elements, so that you can not only call the 'imagename'.png, but also display the string as text in user interface. In that situation your starting line would be like:
Aeroplan_Damage-Iron-Sulphur-Coal_Protection-Iron-Wood-Diamond

or for levels of Damage or Protection you can complicate the line more, by adding numbers etc.

The idea was to allow for various combinations (each added option per item/attribute/ingredient adds many new combinations) and still keep it logically simple in handling for OOP approach. Now, all the splitting and joining from arrays might take some time, but I was more concerned about logic, much less about speed of it.

In user interface, it would be simply a matter of 'holders' and drag/drop actions:

1. Available ingredients listed with their images and amounts,
2. Place for dropping a type of item you want to build,
3. Depending on the item, it shows needed slots for attributes (amount) that it can have, with 3 slots per each to drop needed ingredients.
4. When all's dropped/selected, clicking 'accept' or 'build' would just generate a string based on aforementioned system and it goes to database.
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: [Help] Invention system

Post by Jackolantern »

vitinho444 wrote:Yeah but we have to code so the item together gives XX + Bonus or something.
Not really. Any OOP system could have a CombinationItem class that has multiple Component fields which accept a Component object stored in each item in the combination, as well as other fields needed to represent the final item combination. Those could then be stored in a database for reconstruction later :)
The indelible lord of tl;dr
Shihonoryu
Posts: 255
Joined: Sun Dec 12, 2010 7:30 am

Re: [Help] Invention system

Post by Shihonoryu »

What kind of invention system exactly? Like in dead island where you can basically make any weapon? say a electrified baseball bat with nails? :roll: or a more realistic system?
User avatar
Last Known Hero
Posts: 807
Joined: Wed Aug 26, 2009 12:28 am

Re: [Help] Invention system

Post by Last Known Hero »

I'd kind of like it to be open ended on how many items would be needed, that way i can make it complex combinations or basic ones.
Sort of like an a+b+c+d (etc)=new_item

It will be a predetermined list of like gun+flashlight+tape = Gun with mounted light
So from things as simple as that to things way way more complicated eg. actual manufacturing machines

Seeing as all post-apocalyptic games have a very under developed creation system this is my main focus. I'd like it to be hard to find someone with the same things as yourself.

PS. I know nothing about coding so lets keep this dumbed down for the starving artist :lol:
Image
Power3DArt

-Current Project: Fault [Pre-Alpha]
Shihonoryu
Posts: 255
Joined: Sun Dec 12, 2010 7:30 am

Re: [Help] Invention system

Post by Shihonoryu »

HMm, so not "everything" can be combined correct? just things that make sense?

You could have lists of things that go together. also using a "stat" based system would work well like "nails to a baseball bat add +2 damage" and like so. or adding weights to a blunt weapon. etc.

Thats the only realistic way of doing it i see, unless you allow everything to be combined, but then you get crazy unrealistic stuff, like a silencer on a Revolver (They did that Metro 2033)

Also, are you asking for coding help? or just ideas on how the system could work?
User avatar
Last Known Hero
Posts: 807
Joined: Wed Aug 26, 2009 12:28 am

Re: [Help] Invention system

Post by Last Known Hero »

Shihonoryu wrote:HMm, so not "everything" can be combined correct? just things that make sense?

You could have lists of things that go together. also using a "stat" based system would work well like "nails to a baseball bat add +2 damage" and like so. or adding weights to a blunt weapon. etc.

Thats the only realistic way of doing it i see, unless you allow everything to be combined, but then you get crazy unrealistic stuff, like a silencer on a Revolver (They did that Metro 2033)

Also, are you asking for coding help? or just ideas on how the system could work?
I was just asking in general, It'll be a feature I get to later. Just finished penciling out some rough ideas.

Yeah the stats was going to be something included for sure. I think it's definitely possible, I just have to make sure it all fits together with whatever inventory system I have in place and whatever skill system is as well.
Image
Power3DArt

-Current Project: Fault [Pre-Alpha]
Post Reply

Return to “Scripting/Coding”