Skip to main content
38 votes
Accepted

Value of describing game mechanics in a data file instead of hardcoding?

The problem with building an architecture that is optimized for making certain predicted changes is that such an architecture usually makes unpredicted changes more complicated. Which is a problem ...
Philipp's user avatar
  • 121k
9 votes

Value of describing game mechanics in a data file instead of hardcoding?

You can start by having no data files. And by pursuing a single source of truth, your code might evolve to have sections where it calls a method multiple times in a row with different data for ...
Theraot's user avatar
  • 27.3k
7 votes

Value of describing game mechanics in a data file instead of hardcoding?

Obviously, going with this dynamic, data-driven approach is much slower than having native code directly describe the behavior of the system. Performance-wise, hard-coding wins, hands down (both for ...
Dewi Morgan's user avatar
6 votes

Value of describing game mechanics in a data file instead of hardcoding?

A minor supplementary answer: many games help to separate mechanics from the engine with the use of a scripting language such as Lua. So for example, the core engine may be programmed in C++, but the ...
Kevin's user avatar
  • 6,544
5 votes

Value of describing game mechanics in a data file instead of hardcoding?

The project being described here sounds very similar to my Arena program for OSR-style classic D&D that I've maintained for about ten years now. Reflecting back on that, here's a few ...
Daniel R. Collins's user avatar
3 votes

How to create data driven effects/abilities for collectable card game

When you have complex logic in the mechanics of individual cards, then it might be best to express that logic with a scripting language. But if you really want to go for a completely domain-driven ...
Philipp's user avatar
  • 121k
3 votes

How can I create and load models with additional information?

This is not going to be as easy as you think it would be, because only the Unity Editor can load Blender files. When you import a Blender file, it is converted to Unity's internal format. This is the ...
Philipp's user avatar
  • 121k
2 votes

How to store data and behaviour for what happens within a level?

There are fundamentally two parts to anything in a video game; data and behaviour. An example of data would be the speed of the player, how high they can jump, how many enemies should spawn in a ...
Charanor's user avatar
  • 7,870
2 votes
Accepted

How to securely store xml/json information about actors in a game?

You could use JSON and zip it with a password (encrypt), then use a runtime zip library like DotNetZip to extract it for inspection by the game only, no-one else. Or you could access it on a secured ...
Engineer's user avatar
  • 30.2k
2 votes

Value of describing game mechanics in a data file instead of hardcoding?

A data file is less expressive than code. Oddly enough, this can be an advantage, if you want to get things "right." There's a theorem in Computer Science called Rice's Theorem. It states ...
Cort Ammon's user avatar
  • 1,247
1 vote

Value of describing game mechanics in a data file instead of hardcoding?

One of the most challenging aspects of game development is balancing. It is very difficult to compile, yet alone change, your code every time you increase damage of a single ability, only to increase ...
Cem Kalyoncu's user avatar
1 vote
Accepted

Data Driven Design and Game Screen Resolution

I think you want to put them in world coordinate position instead of screen coordinates; instead of the values relating to a position on the screen and thus changing; make, it say the position x=30 y=...
Adam Dunmars's user avatar
1 vote

How to create data driven effects/abilities for collectable card game

I will expand on this in a bit when I have more time but essentially, as you say, are going for a data driven design approach for your game. This means you are defining your cards in XML or JSON ...
lozzajp's user avatar
  • 780

Only top scored, non community-wiki answers of a minimum length are eligible