-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Developer needs help on RE - Trigger entity spawning #67
Comments
Based on the default player_base.xml I created in the past a client_player_base.xml to see a copy of clients minä. |
PlatformShooterPlayerComponent controls which entity the camera follows and where it is positioned, and the GameGetCameraPos, GameSetCameraPos, GameSetCameraFree allow for the camera to be moved with lua, but I don't think they will be useful for what we need to do. |
I assume there can only be one entity with a PlatformShooterPlayerComponent in the world, as the camera can't be centred on two entities. |
How about adding the component and setting center_camera_on_this_entity and move_camera_with_aim to 0? |
As discussed with @ofoxsmith we decided to implement a different approach.
|
@ofoxsmith I created a branch based on develop! |
I thought about, how to implement syncing rootEntities and all below, like children and components. This is my result: local entitiesInRadius = EntityGetInRadius(pos_x, pos_y, radius) or {}
for entitiesInRadius do
if entityInRadius[i] == EntityGetRootEntity(entity_id) then
-- get all attributes of root entity
-- todo
-- get all components of root
local rootComponents = EntityGetAllComponents(entityInRadius[i]) or {}
for rootComponents do
-- store comp type, name and value into a string, table or json
-- I am pretty sure we need a lookup table like: if component type == VariableStorageComponent then field_name = "name" etc pp
end
-- get all child entities
local children = EntityGetAllChildren(entityInRadius[i]) or {}
for children do
-- recursive getAllComponents and store in string, table or json
end
else
--skip children
end So we need to get the root entity, but ignore children. If entity == root, (1)then get all attributes and store those, then iter all components and store type, field_name and value, then get all children and repeat (1). |
[17:08]stefnotch: If we want to clearly communicate that to the players: |
If server is in range ask for spawn, if server isn't in range ask only for nuid. |
Make sure all sendToPeer are put into functions. In addition do checks that parameters aren't empty.
|
…erialisation of entities. Small clean up. Need to add deserialisation and tests!
Make sure entities are send immediatly, when spawned, no matter what tick is set, otherwise it's getting out of sync. |
…ntities. Renamed functions for better understanding. Tweaked CustomProfiler a bit. Changed EntityUtils.processAndSyncEntityNetworking slightly. Would like to rework this again, because it's ugly as shhh. Excluded particles from being synced (FPS nom nom nom)!
…rialize. Added EntityCacheUtils.lua for some checks before using EntityCache. Fixed game crashes, when pointing to components or entities which don't exist anymore.
Add a list of entity names, which only be loaded once, like bosses. Can be modified by modders. |
…rkCache. Formatted md5 hex hash to string without converting as tostring do.
Dextercd |
When needNuid is sent, serialise the entity and send it to the server. Remove then on client. Server will add nuid and sent spawned entity to the client. |
|
|
|
|
Might be that I could use some RE help. I never was depening on RE help so much.
The problem I have is:
My concept is that the server holds the truth. Spawning, moving entities, everything. Thats why I remove all entities on client side.
BUT... There is no Noita API function (or I dont know a specific one), which triggers spawning entities, therefore the client wont see any entitites spawning, when not following the servers player. I have no idea where to look in ghidra or even how to use it or if there is any Noita API function or a specific combination of components, which are needed.
I think I am going to create a 'wanted help' issue on github, because if this isnt fixed, multiplayer would mean to follow the servers player all the time and this sycks.
If I wont remove entities on client side, everything would be multiplied by amount of clients, which is even more sycking!
Anyone out there you can help me?
I still want to have a look on RegisterSpawnFunction, because I dont know it or used it before.
I really hope there will be a solution, because it's a big game changer!
The text was updated successfully, but these errors were encountered: