84 votes
Accepted

Why is it bad to hard-code content?

There are several reasons for that. I'm just gonna touch on a few: It makes your source code a mess. If you have a lot of dialog (trees), a huge part of your codebase is just text that has nothing to ...
user avatar
  • 2,056
66 votes

What's the performance benefit of saving all logged in characters in MMOs in regular intervals?

This is not for performance. This is a failsafe. If the world saves every few minutes, then if something happens to the server and it shuts down everyone will only lose a few minutes' progress. By ...
user avatar
  • 605
40 votes

How can I implement an inventory that stores different types of items?

When you are comming from non-game application development, then you need to be aware of a couple things. Relational databases have a niche role in game development. You really only need them when ...
user avatar
  • 112k
32 votes
Accepted

How can I efficiently load huge volumes of star systems?

The trick Elite likely uses is that they don't pre-generate the whole galaxy and store it in a database. They likely generate most of the galaxy at runtime when it is needed. I would do this using a ...
user avatar
  • 112k
26 votes
Accepted

Should I use a database for storing game content?

Only use a database if you need a database. That is: If you need to perform complex queries often. If you have complex data relationships. If your data is huge and is not likely to fit in memory. ...
user avatar
  • 356
10 votes

Would it be better to use XML/JSON/Text or a database to store game content?

Im late to the party here but I spent A-LOT of time researching this. First why I don't use the following: XML: Excessively verbose. Tons of redundancy. Repeating field names? GROSS JSON: I think ...
user avatar
  • 233
9 votes
Accepted

What is the reason that people avoid PlayerPrefs to store character data and coins etc?

As implied by the name, PlayerPrefs is mostly intended for storing config options. But it can also be abused to store savegame data, if that data is rather small. If you target platforms without write-...
user avatar
  • 112k
7 votes

Why is it bad to hard-code content?

As always, as always, it depends. But first, I would like to argue that hard coding is not bad by itself. I have hard coded content, specifically dialog text, in some simple games, and the world didn'...
user avatar
  • 13.2k
6 votes
Accepted

How can I handle game-state updates in an MMO while the player is logged out?

Your server would have some kind of background process (could also be implemented as a timer or a thread) which runs at regular intervals and updates all players. The process would run daily, hourly ...
user avatar
  • 112k
5 votes
Accepted

How should I store grid-based character inventories in the database?

I would probably start with the following schema: Slot (ID, CharacterID, SlotID, ItemID) where Slot is the name of the table ID is the table's primary key ...
user avatar
  • 312
5 votes
Accepted

how to store game state for a multiplayer board game eg. poker

From a performance standpoint, having data in memory is orders of magnitudes faster than having it in a database. There are two reasons to put data into a database instead of storing it in memory: ...
user avatar
  • 112k
5 votes

Should I use a database for storing game content?

I really like MongoDB for game develpoment, it has a really good performance and it's really flexible, easy to use and json-based. You can just add any field you need in any collection due it's NoSQL ...
user avatar
  • 745
5 votes

How should I implement a timer in a strategy game?

I'm inclined to assign this task to the server for security and integrity reasons, but i'm not sure on the way i can accomplish that. Yes, definitely; never trust clients. Clients sometimes "predict" ...
user avatar
  • 3,624
5 votes
Accepted

realtime multiplayer game database design

Databases usually only make sense for data "at rest". As in data which someone might or might not look at at a much later point in time and which you want to be searchable by different keys. If you ...
user avatar
  • 112k
5 votes

What's the performance benefit of saving all logged in characters in MMOs in regular intervals?

Early systems that saved only on disconnect tended to also save periodically while the player was active. In those systems, typically MUDs (Multi-User Dungeons), the character was maintained in memory ...
user avatar
  • 236
5 votes
Accepted

How to efficiently store a large amount of data?

First of all, consider if it is actually necessary to break down the world into units of storage. 32x16x32x16x16x16 = 67,108,864 blocks. When each block is a 2 byte integer representing the type-ID, ...
user avatar
  • 112k
5 votes
Accepted

How to connect to a server without hard coded passwords?

Don’t. You cannot secure your password indefinitely. What you can do is restrict access remotely. I don’t know anything about trello, but if it allows multiple logins with multiple permissions, you ...
user avatar
  • 5,189
5 votes
Accepted

Workflow for authoring Pokémon-like game database content

I would generally not use a SQL database (not even SQLite) for handling static data in a singleplayer game. The only exception would be if I had so much data that it won't all fit into RAM. But when ...
user avatar
  • 112k
4 votes
Accepted

RPG: store dialog

The content creation perspective: RPGs tend to be quite text-heavy so you and your team will spend quite a lot of man-hours writing, proof-reading and maybe even translating the dialogs. It might pay ...
user avatar
  • 112k
4 votes
Accepted

Is Google's Protocol Buffer viable for the serialisation of game data?

It is suitable, though perhaps not ideal. First, do note that ProtoBufs are no longer state of the art in its class. Consider Cap'n Proto, Fast Buffers, or Flat Buffers. I'm personally a fan of Flat ...
user avatar
4 votes
Accepted

Modeling an inventory system in SQL

You will need three tables: Player, PlayerInventory and ItemType. ...
user avatar
  • 112k
4 votes
Accepted

Strange issue with bool comparing ToString always false - unity c#

Quick Answer: What your code actually currently does is compare references to check that they are the same, not the values of those references. Try changing ...
user avatar
4 votes

How to store and retrieve user data in a multiplayer game

Unity does not include a server side persistence solution out of the box. As far as I can tell the only storage solution Unity includes is PlayerPerfs, but that is client side. However that does not ...
user avatar
  • 18.5k
4 votes

Game communicates with MongoDB in the Editor but not in WebGL build

What you are trying to do here unfortunately can not work. The MongoDB protocol is based directly on TCP/IP. But a web application running in a web browser can not create raw TCP/IP connections. There ...
user avatar
  • 112k
4 votes

Workflow for authoring Pokémon-like game database content

Multi-user concurrent transaction support will be required if you have multiple designers who are not actively deciding who will work on the data at such-and-such a time. Without this, data can be ...
user avatar
  • 29.1k
3 votes

Why is it bad to hard-code content?

A big reason for storing in text files is reusability. Creating a text game framework that reads your maps, dialog, and other resources from a text file allow you to reuse your framework for other ...
user avatar
3 votes

Why is it bad to hard-code content?

I think it is too easy to be the 'wither-than-white' guy and recommend warmly using an external text resource file. Why? Because there's a choice here that's about balancing each solution's cost/...
user avatar
3 votes

Why is it bad to hard-code content?

I think a key phrase is separation of concerns. If your code doesn't include the text than the code get's less complex. The programmer writing the code doesn't have to think about the specific text ...
user avatar
  • 209

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