#How to set up a mod table for a loot game?

1 messages · Page 1 of 1 (latest)

candid adder
#

I am making an idle game involving loot collection, crafting of items, and outfitting heroes.

I want the items to be somewhat complex for depth of gameplay/planning. Think Diablo/POE. The mods must have a stat type (e.g., health), value (e.g., 5), range (e.g., 0-10), level requirement (e.g., 1), string for displaying text on the item (e.g., "adds X to maximum health"), tier (having a different range), etc. and more. Some of these are necessary for the crafting features of the game, e.g., reroll the value within the mod range or change the mod for the same mod type but a different tier.

I always though I'd have an excel-like large table of mod data. I can write simple functions to select random rows of that table to generate a mod, or filter the mod table based on conditions (e.g., drop zone, level requirement, etc.). However, I have no clue how to set up a data table in C#/unity and cannot find any tutorials for that.

My questions:

  1. am I going about it in the wrong way? Should I not be thinking about an excel-like data table? I suppose I could alternatively make each mod as a scriptableobject and add them to a list of modpool, but would this be easy to manipulate (e.g., to filter the mod pool)?
  2. if a data table is a viable approach, how can i set one up? I am aware of multidimensional arrays [,,,,] but am I relegated to manually writing up each row of mod data in the array?
  3. where should I store my mod pool data? right now, i dont know where else i would store it except in a script attached to a gameobject or scriptableobject as mentioned above.

I am a beginner, so please let me know if I'm not even asking the right questions.

jaunty kestrel
# candid adder I am making an idle game involving loot collection, crafting of items, and outfi...

There is many, many way of doing what you want to do. The easiest would be to start from the actual implementation and than think about how to generate them.

That being said, it is a really complex subject. There is no good answer and sometimes a good implementation is not good in another context. I believe you should start by creating an Item : MonoBehaviour with [SerializeReference] private List<Mod> mods.

distant sandal
#

Mm... I'd also suggest starting with the functional implementation, and just storing the data in SOs or something simple and editable. The thing is, you only need a fancy tool later on, when you're happy enough with how things generally work, and want to scale up.

As for the fancy tool, if Excel would make you happy, you can also make import/export buttons in Unity that translate the in-game usable data to and from excel. 🤷‍♂️

candid adder
#

Thank you both for your comments. I shall return... post functional implementation Unity