-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it feasible to use Entitas in the backend? #1078
Comments
Bump |
To me Option 2 means rewriting everything, you need to think differently when you want to handle multiple matches. there's a risk of interference between matchs... scaling is a pain also. Option 1 is probably your best bet |
Entitas works fine in console application and don't need unity. Also, you can have as many copies of context in one instance as you want. In our project we have two copies of contexts in one game at same time for local and global data. You just need to manage that copies by hand or dependency container. If I have to make a multiplayer game, I will choose 1 option. |
Thank you for your thoughts! My second issue is physics, as it's a shooter game with collisions. It's got to be server authoritative but also I have to move core gameplay there as well, while at the same time having it in singleplayer game modes too. Should I have a pure C# collision library both backend and frontend? |
You can use a UI-less Unity instance as a server, handling multiple games at once, tag each networked entity with an id what game it belongs to and only broadcast those that belong to the game the current player is in. You can load multiple maps, aslong as you offset them by a generous value so their physics objects do not collide |
you can use Unity in headless-mode I think, my understanding is that it will simply work without rendering anything. |
@mchamplain Ha, I remember rubberbanding in shooters. Due to large amounts of physics layers, I probably would have to create a new instance for each match, rather than all games in the same instance |
Context
We currently have a singleplayer game. Diablo perspective but guns as weapons (for both player and enemy), goal is to clear each room out of X max and get loot at the end.
Old gameplay: https://youtu.be/ck-nqOgGjXo?t=79
Apart from guns & bullets, player characters have abilities, 3 active and 1 passive.
We have / want typical RPG spells and special attacks, distilled to just "abilities" that have a wide range of unique effects, such as: life drain, mind control, hp / damage / speed / etc. boosts, as well as the opposite effect to debuff enemies.
Problem
Since we are using Entitas for the client, but we want to introduce PvP and Coop, the need to move Entitas to a C# backend solution arises.
Option 1 (Ideal, clean):
I would assume that for each match, we would create a micro-instance with a separate Entitas running in order to isolate Entities and Systems from other matches, then either recycling or destroying / recreating them on demand.
Option 2 (Risky):
I don't think, at any point, did our entity count within a game level surpass or came close to 100 Entities, so if 1000 matches are running, and somehow we do have EVERYBODY AND EVERYTHING in the same 1 Entitas instance and we isolate them by matches, it might work but that means 100,000 Entities, a few dozen Systems operating on them. Don't know about thisone.
Option 3 (Unlikely):
Some sort of P2P but since there's a certain amount of Physics involved, I can literally feel my soul leaving my body having to deal with any of this. Plus, the game is mobile first, so any lag, disconnect will be / feel unfair. Also client authoritative is cumbersome to check for cheating.
The text was updated successfully, but these errors were encountered: