Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/406856987235065856
Removed unnecessary clutter
Source Link
akaltar
  • 1.7k
  • 14
  • 26

To clarify things a bit: I want to create a kind of database for my game, that simply is a class that stores all game-state information like object positions, player scores, etc.

The main problem I am facing, that the whole game is to be scripted, to the level of the (lua)script controlling what members should the database have.

The reason for this is that I want to create a game that gives modders complete access to the game via lua scripting.(its one of the core features) For this to be viable I need to be able to add custom elements to the database.

I want to avoid using a 'real' database and roll my own solution.

For example I want to be able to do the following in the script file:

-- In function init...
Engine:AddStateEntry( "Score", TYPE_INT )

-- In function update...
Engine:SetStateEntry( "Score", 12 )

My engine would then synchronize data between players and render things accordingly.

How could I:

  • Efficiently store arbitrary types of data?(including arrays)
  • Set up custom interpolation functions

Efficiency and ease of use are my main priorities.(I dont care if the implementation is complex)

Completely unusual and crazy ideas are welcome

TL;DR: How to efficiently store arbitrary data that is defined by lua scripts and stored on the c++ side?

To clarify things a bit: I want to create a kind of database for my game, that simply is a class that stores all game-state information like object positions, player scores, etc.

The main problem I am facing, that the whole game is to be scripted, to the level of the (lua)script controlling what members should the database have.

The reason for this is that I want to create a game that gives modders complete access to the game via lua scripting.(its one of the core features) For this to be viable I need to be able to add custom elements to the database.

I want to avoid using a 'real' database and roll my own solution.

For example I want to be able to do the following in the script file:

-- In function init...
Engine:AddStateEntry( "Score", TYPE_INT )

-- In function update...
Engine:SetStateEntry( "Score", 12 )

My engine would then synchronize data between players and render things accordingly.

How could I:

  • Efficiently store arbitrary types of data?(including arrays)
  • Set up custom interpolation functions

Efficiency and ease of use are my main priorities.(I dont care if the implementation is complex)

Completely unusual and crazy ideas are welcome

TL;DR: How to efficiently store arbitrary data that is defined by lua scripts and stored on the c++ side?

To clarify things a bit: I want to create a kind of database for my game, that simply is a class that stores all game-state information like object positions, player scores, etc.

The main problem I am facing, that the whole game is to be scripted, to the level of the (lua)script controlling what members should the database have.

The reason for this is that I want to create a game that gives modders complete access to the game via lua scripting.(its one of the core features) For this to be viable I need to be able to add custom elements to the database.

I want to avoid using a 'real' database and roll my own solution.

For example I want to be able to do the following in the script file:

-- In function init...
Engine:AddStateEntry( "Score", TYPE_INT )

-- In function update...
Engine:SetStateEntry( "Score", 12 )

My engine would then synchronize data between players and render things accordingly.

How could I:

  • Efficiently store arbitrary types of data?(including arrays)
  • Set up custom interpolation functions

Efficiency and ease of use are my main priorities.(I dont care if the implementation is complex)

TL;DR: How to efficiently store arbitrary data that is defined by lua scripts and stored on the c++ side?

Source Link
akaltar
  • 1.7k
  • 14
  • 26

How to store generic data in game database?

To clarify things a bit: I want to create a kind of database for my game, that simply is a class that stores all game-state information like object positions, player scores, etc.

The main problem I am facing, that the whole game is to be scripted, to the level of the (lua)script controlling what members should the database have.

The reason for this is that I want to create a game that gives modders complete access to the game via lua scripting.(its one of the core features) For this to be viable I need to be able to add custom elements to the database.

I want to avoid using a 'real' database and roll my own solution.

For example I want to be able to do the following in the script file:

-- In function init...
Engine:AddStateEntry( "Score", TYPE_INT )

-- In function update...
Engine:SetStateEntry( "Score", 12 )

My engine would then synchronize data between players and render things accordingly.

How could I:

  • Efficiently store arbitrary types of data?(including arrays)
  • Set up custom interpolation functions

Efficiency and ease of use are my main priorities.(I dont care if the implementation is complex)

Completely unusual and crazy ideas are welcome

TL;DR: How to efficiently store arbitrary data that is defined by lua scripts and stored on the c++ side?