Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

0 votes

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

Data vs behavior Example: Sins of a Solar Empire defines most of its ships and abilities in terms of JSON files. These JSON files will define, say, the list of individual weapon mounts equipped on a ...
Flater's user avatar
  • 656
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
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,237
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,150
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
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
  • 120k
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
  • 27k

Top 50 recent answers are included