this post was submitted on 16 Dec 2024
19 points (100.0% liked)

Game Development

3534 readers
2 users here now

Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.

Community Wiki

founded 2 years ago
MODERATORS
 

I'm making an RPG in C++ and the items (loot/gear) will have immutable base versions, but then the player can get instantiations of them which can change with use and modification. These mutable instantiations will be saved in the DB. But I'm wondering if the base versions should be defined in JSON, or a separate DB (with the same schema), or maybe the same DB (seems dangerous), or if I should just hardcode them in C++ in the ItemFactory.

How have you approached this problem in your games? How do game engines do it? I'm using SDL2 so I'm doing most of these systems from scratch.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 6 days ago* (last edited 4 days ago)

For now, all items in my game use Godot's Node3D as the base, and I am moving towards having all their respected scenes contain component nodes and scripts for their functionality, to keep it clean.

There's a lot more inheritance at play, but its been months since I touched the project, I should look at it and get more details. In reality, composition via nodes and types is going to be easier to maintain.