Discussion: Roleplay Frameworks

Hi!

First of all I should probably introduce myself. My name is Jaymo. I run servers, sometimes develop scripts and have been a part of the FiveM community for quite a while.

In short, I feel that the whole Essential Mode + ESX framework combo, while it works and enables roleplay on FiveM, is fundamentally flawed. From deprecated events to unnecessarily long code, ESX is a mess.

ESX and it’s various job scripts are the cause of many things people find annoying about FiveM. Many common issues such as random crashes, session splitting, economy manipulation, abysmal client performance and FiveM just being broken are 9 times out of 10 caused by the same sloppy, broken and copy-pasted code that just so happens to be running on nearly all popular servers.

This negatively reflects on FiveM as people associate these problems with FiveM itself rather than the actual issue of cause being ESX. Furthermore the element’s are not able to easily fix these issues and attempts to work with the developers of ESX have been in vain.

Many people, including myself, have all attempted to build our own frameworks in hopes that they will replace ESX. We get to a point where we just stop and think that due to how seemingly ubiquitous ESX is, our own framework will never get used and would just be a waste of time. We lose all motivation to continue working and give up. This is where all of you server owners come in!

If there was a collective effort to create a completely brand new role play framework, would you use it? What features would you like to see in it? Would you be willing to contribute to its development? Please, if you would like to contribute in any way to this discussion, leave your thoughts below!

Rough feature list/wishlist

  • Universal data storage API that stores everything
  • Moving away from raw db queries
  • Building the framework with onesync compatibility from the get go
  • Multi character support
  • More built in features
  • Easy to use wrappers for things like scaleform
  • OO implementation
  • Deeper permission support
  • Emphasis on server-sided scripts to mitigate potential vulnerabilities
15 Likes

The biggest problem is that most servers already have various of scripts which are all writen especially for ESX for example policejob, scoreboard, shops and 100 other jobs.

Most people who would want to switch probably don’t want to suddenly provide less content to their players which means most scripts need to be already done before but that would require lot of work and as probably nobody wants to use it as first you wont have much conbributors.

So it should probably be compatible with ESX scripts at first but that would mean the API can’t have an unique logic design

2 Likes

Complete compatibility would be excellent and quite possible in theory but, in practice, due to the use of MySQL queries that interact with the essentialmode database directly (see esx_garage for an example), it’s not possible without also using the same data storage structure as ESX does. (and forcing the use of MySQL for data storage in the first place)

Yes the sql queries seem like a bad practice, and that will probably make lot of the resources not compatible.

There should be some sort of in memory storage to for example add custom data to a user like cars, houses or anything

2 Likes

I do have a concept (which I should update the original post with at some point) but don’t want to commit for many reasons including the uncertainty of if it’s even worth investing time into. Anyways, the basic idea would be each player gets a kvp storage that is persisted (similar to client kvp but stored on the server) and the framework handles all the storage stuff itself. You could store anything in there if you can stringify it. That should cover everything you would want to store about a player.

In terms of making it compatible with old resources, it seems there is no simple route to take on that one. Data migration, sure! Complete compatibility, not really possible.

The problem with this design is that data isn’t easiliy accessible from outside, for example now you can just browse your MySQL database and access all data easily.

There’s probably not a lot wrong with the table design right now and maybe https://github.com/blattersturm/fxmigrant can be used too

But that would mean sql queries in your resource would still be a thing which should be handled on a different way i see your problem

1 Like

This was the whole point of this thread to see what the community wants xD
Seems like they don’t want anything and are happy to have their servers be constantly buggy :frowning:

I would love to see/use a new framework.

2 Likes

I agree there would be definitely demand for new, up to date a easily modifiable framework.

I am not a programmer, I learn everything on a go and already have been fixing and optimising (to me surprisingly) significant part of ESX in general.

I would love to contribute to a new framework, but I wouldn’t really know where to start. All I can think of would be testing and giving feedback from my side.

1 Like

You said what should have been said ages ago.

As for features, the basic ones are what’s needed, jobs, private companies, emergency services, and implementation of economy… Other than that, it’s extras, which people should make.

3 Likes

I would really just say, create some similar functional base as ESX in it’s original form, just make it more optimized and with up to date code.

For me, ESX represents really everything I would want from a RP framework. Just make it better

1 Like

I would love seeing some more “competition” on the market.

To be fair, our server is one of the most visited german servers and we are also running esx.

BUT we realised long ago, that it just doesn’t work for such a huge server. More and more errors (99% probably caused by outdated esx plugins, because we cannot update them because we changed so many things in them).
We started to develop a lot of custom scripts (e.g. I have created a new garage script from scratch including parking on the street and so on). But at a certain point it just becomes a hustle always needing to use server scripts for every tiny bit of player interaction.

I decided to create a new framework from scratch (some of its functions are already pretty successful on our live server).

The framework in its newest version runs only on my OneSync testserver with basically all custom made resources. The only other scripts running are the default FiveM scripts, NativeUILuaReloaded and MySQL Async.

Currently at 90% finished is a proper character creator, inventory system (including proper ammunition and weapon management). Everything that needs server scripts in esx is completely possible in a client script because my framework manages the server interaction.
Currently working on vehicle managing and instancing of players.

I plan on releasing it, once its main functionality is finished and I have at least a few working scripts using it in. (e.g. cops, medics)
(well and if it is working properly on our server first of all)

2 Likes

very interesting

Also, incomporation of 4 characters for one FiveM account right from the beginning would be hugely desirable as well. In similar fashion as Kasharacters is for ESX!

I am not really sure, if “competition” would be the best path we could take from here. How about from the opposite direction - open source (like FiveM is) and let’s encourage developers to help directly build completely new framework instead of several small ones? And in theory, the more work force, ideas and fresh perspective on ine place, the better the result!

If you mean how many characters you can create, then I got you. You can basically create infinite characters per player. But I want to tie that down to config options and permissions (e.g. a normal user who just joined can only create one, but someone like a gamemaster can create as many as he needs).

Yea, it doesn’t really need to be competition… just a lack of words on my part :wink:

2 Likes

Thanks for all your suggestions and comments! I can’t promise anything yet but I’m going to start putting your suggestions in a section at the top of the thread. I hope to turn this post into sort of a plan for making a new framework and for communicating with the people who will actually be the ones using it to figure out what everyone want/needs.

Working with the community instead of trying to shape it seems to be the best option here!

I do not know how to code, but I will definitely lend my time to help test anything out.

1 Like

As a server owner (even if it is not too big) I would like to use a completely different framework. ESX and vRP have several bugs, and the way ESX is programmed makes me really sick, but I don’t have the time or knowledge in Lua (or C#) to build a framework from scratch. I’ve tried some other frameworks so far, but they didn’t meet the needs of the players. NFive even sounded quite interesting at first, but is still too confusing for me personally at the moment. Object-oriented programming is a common practice in web development for me and I would be happy to implement this knowledge in Lua / C#.

@TheIndra - A direct compatibility would make the project less interesting in my opinion. The database structures of essentialmode and ESX are too complex and sometimes cause enormous overhead. It would certainly be better to rely on new structures and if necessary to offer the possibility to migrate old data sets. Although this probably would require the porting of some ESX scripts.

If it comes to the development of a framework, I would love to contribute. - And if anyone needs a server (VPS) for development, I can provide them as well - just send me a DM. :slight_smile:

1 Like

As much as I want to be balanced and hear every side, this is very much my standpoint on the matter. Full compatibility would hinder the functionality but a new framework will need to support everything ESX does currently.

1 Like