Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Items design, how you do it?

Author
Message
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 6th Jun 2010 17:01
I`m working on inventory system and slowly build arround items now because at this stage i need to make few functional so i can see how it look in game later.

For now i use few dummy images and i have item descriptions for them in separate files, as item name, description, type, main attribute(damage for weapons and etc.) with their own colors

Items i work on need to serve my RPG(once i make it playable).I need to know how you do make your items, do i must continue adding actuall item attributes,bonuses and boosts in the file i use for description or i need to make separate one for this purpose and link all together?

It may be hard to implement it that way because there would be many different items, some can be regular without bonuses, and some can have few, some can add abilities to the player and have different boosts accordingly to their upgrades there could be upgrade system added in the future which can make it more complicated.

The task become hard to achieve because of routine that should apply equiped item attributes, i can make all items to load empty values for attributes they do not boost but this can lead in too much loading of unnessecery stuff , which can be painfull.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th Jun 2010 20:34
You can always use scripting. But this is quite intensive.

Really, if you're bothered by the loading, then just load it only when the player equips the item or something. There's no need to load everything at startup.

Cheers!
Sven B

luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 6th Jun 2010 23:59
IDK about scripting in dbpro because as i know it`s not scripting language.

I know that i need to load stuff only when something is equiped but the routine that need to load it can`t read something that`s not in the item.It`s hard to explain the problem.

I thought about some item table or something instead of using separate files for each.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 7th Jun 2010 01:32
Scripting is just parsing a string into functions.

Rawwrr. Sig Fail.
Newcastle is awesome
Xsnip3rX
19
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 7th Jun 2010 09:18 Edited at: 7th Jun 2010 09:19
Or you can load it in the background while playing your game, all that DBP is, is basically a Wrapper for DX9.0C
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 7th Jun 2010 19:56 Edited at: 8th Jun 2010 03:03
I`m no good with parsing, i`ll try to find more about it.

@Xsnip3rX:
What can be loaded in background?

EDIT: I have an idea, let`s see.If i have for example 20 diferent attributes for items of any kind and i save them in string into the item file of any item then read this string parse it to words and pass the values to array then check every item in the array into the loading routine that need to apply the attributes when item is equiped and if it`s not NULL for example then the attribute apply for this item and it`s value is added corresponding where it matches else the routine goes further.Can this work good?

Where there is a will, there is a way.
I often edit my posts, that`s who i am
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 9th Jun 2010 19:34
The theory works good on practice.This is something simplified i started with.

There are few attributes which add or substract parsed values from the string, if the value is "null" then attribute is skipped.

For now this is all.

Thank you all that pointed me to this solution!

I need to build more stuff before i`m ready to test all.It`s becoming really annoying sometimes, there is nothing that can be completed at 100% because everything depends on something else.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 9th Jun 2010 21:13
Before you continue with that method, could you show us what the item file would look like please.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 9th Jun 2010 23:38


This is simple item i made for testing purposes, it`s pretty much descriptions and word can open it, but i don`t care because messing with it in word make it imposible to work in the game.

This is the code of the program i writed to make the item.Not very advanced for now.



I attach picture of the item.For now it read the descriptions only, which aren`t something big.It`s some random WoW item image downloaded from internet because i`m bad with the brush and i`m alone in this for now.Attributes are not loaded anywhere because i`m not that far in the project, i`m testing with my inventory system because there isn`t working engine yet.But the post above Sasuke`s is proove of concept, it works in the example it will work when i`m done with player attributes.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 10th Jun 2010 02:21 Edited at: 10th Jun 2010 02:27
Not bad so far. Though just an idea, you want to make it as customizable and dynamic as possible. This is an example of what i've made in the past:



Here, I only add what the weapon needs, anything left out is automatically generated via default templates in the engine. Just means less parsing. Also this is easy to read and clear to edit (though I'd use an editor to create this), especially for others that are invited to work on your project.

Though this is just my method. You should continue with yours and see how it turns out, though I have one issue about this line:



Why not:



That would speed up parsing, even if it's by a tiny bit.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 10th Jun 2010 11:51
It was like second snippet you showed and i alligned it with upper line so i know what i`m editing.Once i improve my item application it`s gona be again like this.

Your item is very nice, good job!

Where there is a will, there is a way.
I often edit my posts, that`s who i am

Login to post a reply

Server time is: 2026-07-25 16:21:44
Your offset time is: 2026-07-25 16:21:44