Hey guys so im working on a MP survival Game, and ive been doing some research for a few hours now, Does anyone know of any current up to date SQL or SQLite Plugins for UE4 that are free?
All of the ones i found Stopped being updated between 4.10-4.17, If not i guess i will be saving up for a marketplace plugin.
Hello.
There seem to be only some non-free plugins that seem to be up-to-date:
https://www.unrealengine.com/marketp…ts?lang=&q=sql
Although direct SQL server integration might seem like a good idea for storing server side data, I think it is too much effort to create and maintain SQL integrations, considering how many different database engines there are (MySQL/MariaDB, PostgreSQL, MS-SQL, Oracle…). Also, there are SQL C/C++ library licenses incompatible with Unreal Engine license. One workaround might be to use ODBC, which seems to be also working on Linux systems, but only if the database engine offers ODBC connector library.
I think that using some kind of a proxy system (a simple web server) would be a better approach because then your Unreal Engine side wouldn’t depend on any specific database engine. It is much easier to deal with the database in a web application than in C/C++ or blueprints, especially because there are many web frameworks with ORM tools that map your entities automagically so you can just serialize your game objects without writing any SQL at all. Coming from web developer’s world, I imagine that it would be easier to deal with the database from a PHP / .NET / nodejs application. Laravel / Lumen is one of my favorites. And also you could do some other cool stuff with your web API directly on the database. You could implement a flexible routing where some parts of the web API are directly accessible by the clients (login, profile info, statistics, reports etc.), no matter if through UE client or web browser, and some other parts of the web API should be protected (for example, by simple IP filter) to allow only master server connection to prevent cheating.
Good news! it’s possible to create and use such a web API through the awesome free vaRest UE plugin!
And it is open sourced:
Of course, you still have to be careful how often you call the API (or the database, if you still want to go that route) and dealing with atomicity of operations.
You don’t want to update users’ locations on every move but you want to update stat changes as soon as possible, but still not in some tight server-side game logic calculation loop. It would require careful planning with a worker thread and maybe two queues - one for ASAP execution and another one for execution on idle or at scheduled intervals. For more efficiency, it would be nice to have message redundancy control. For example, if user’s position or stats change twice while the worker thread was still busy processing other items, it might be possible to throw out the older update. If implemented correctly, this should be efficient enough to handle many concurrent users, no matter if you connect directly to the database or through JSON REST-like API.
The server could crash or could be restarted and if you have to lose the data, you want to minimize the losses and ensure the data integrity on the DB side, which means that you have to use transactions for operations that deal with multiple logically linked records. For example, user A gives an item to user B - transaction is mandatory here to avoid having both users still possess the item in case if server side fails in the middle. So, if you go the web API route, you have to create game-specific functions to call on the web server and deal with transactions there. If you go direct DB route, it might be easier, but again - only if the UE plugin implementation offers transactional APIs where needed. You have to do some research on every plugin to make sure that it supports everything you might need.
Also, a lot of performance and data integrity depends on data structures. There are multiple approaches. You could go old-fashioned relational and strict data-typing way, which gives you data integrity almost for free (if you normalize the data) and also makes it easier to use statistics and filtering tools on the data. Or you could store your object properties as JSON blobs, which would be simple and easy but losing some of transactional / filtering functionality (but making it possible to add simple NoSQL or memory cache in between). Or you could go the middle way and store your entities as dynamic property bags. Or even make it completely data-driven, which, most probably, is an overkill but still an educational read: http://t-machine.org/index.php/2007/…opment-part-1/
Try this SQLite3 UE Plugin:
Check my tutorial. No 3rd party plugins required.
在哪