AscensionGameDev / Intersect-Engine

Intersect provides a complete game development suite for creating 2d mmorpgs with no programming experience required!
https://www.freemmorpgmaker.com/
Other
222 stars 360 forks source link

feature: store global variables elsewhere #997

Open Cheshire92 opened 3 years ago

Cheshire92 commented 3 years ago

Is your feature request related to a problem? Please describe. Currently, all global variables are stored in the game database. This is no problem if you never intend to have a development and live server, however it also means you can't blindly copy the database from development to live to push out updates because it won't retain the correct live variables.

Describe the solution you'd like Store global variables in the player context in their own table maybe? It should definitely not be something you can overwrite by copying your test database with new content over to your live server though.

WeylonSantana commented 3 years ago

If moving to the player context, when we delete the player.db, the global variables will also be deleted?

Cheshire92 commented 3 years ago

Yes.

Why would you keep deleting your player database though? Especially on a live game.

jcsnider commented 3 years ago

The opposite issue is that you can create and set values for global variables within the editor while developing.

If this change is made, when you copy out the updated game db, your game will then have the wrong variable values and potentially break stuff too.

Cheshire92 commented 3 years ago

Basically this situation has caused a pickle and it's a problem either way.

jcsnider commented 3 years ago

Yes. A wholly separate global vars db might be the best of both worlds.... I never wanted to add the additional complexity though. I'm okay with moving it to the playerdb. That just won't be fully intuitive to devs either in my opinion.

Cheshire92 commented 3 years ago

What if we add a way to export global variables that you can load back into the server?

jcsnider commented 3 years ago

That's my least favorite idea XD

But it would work...

Cheshire92 commented 3 years ago

I'm not entirely sure how to keep it simple but effective either. I think this might require some thinking.

WeylonSantana commented 3 years ago

Yes.

Why would you keep deleting your player database though? Especially on a live game.

Especially in a live game not, but while development some time people delete player.db before launch, i saw a lot people do, then delete global variables too, could be a issue.

Also, i never see or barely see game db have issues. In otherwise player db give more bugs, for any reasons, sometimes have need to delete, so, i'm a little concerned.

Cheshire92 commented 3 years ago

You could still truncate every table aside from global variables to delete all players so I don't personally consider that a valid argument to not do it.

WeylonSantana commented 3 years ago

I understand, I think not all people will know how to handle this well

AlexVild commented 3 years ago

What if the server variables table had two value columns - one for "production" and one for "dev" or something?

In your server config, you could configure which column should be used for values. Then, anything that interacts with those values would pull from that specified column.

That way, the editor can still pull in values, change values, and, most importantly, create NEW variables while not overwriting the values that your live-players have modified in your prod server. When you push up your new gamedata.db to your hosted server, the hosted server knows to pull from the alternate column, but also now has any updated variables you've added?

I don't think it needs removed from gamedata, because ultimately, that still doesn't solve the problem of replacing it when you've added new server variables that you want pushed out to your players.