T
T
Timofey Bulgarian2019-07-30 19:20:46
.NET
Timofey Bulgarian, 2019-07-30 19:20:46

How to build a modifiable object system in the game?

I'm making a game that has loot, buildings. These objects have properties like texture, mesh, weight, quality, spawn chance, spawn locations, etc. If you sew it right into the code, you get a hierarchy of classes with different initial properties. Am I speaking correctly?
But I need to be able to read conditional xml files at startup and use them to build classes derived from the base class that I described.
PS. Or it can create one base class and create objects at startup and store them in an array, for example. And then copy them wherever you want.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2019-07-30
@xmoonlight

Option 2, only a little differently:
1. Create a base blank class in advance in the code (hardcoded).
2. After loading - create a class heir with the necessary parameters and properties.
3. Create 1 object based on the derived class.
4. Clone the created object as many times as you need visual objects.
5. Arrange positions for placement (coordinates, etc.) on each of them.
6. Render in scene.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question