Jump to content
  • Advertisement
crmbzy

Artemis ECS + Kryo network sync

Recommended Posts

I'm using artemis-odb for my prototype. I have managed to get the "KryoArtemisSerializer" to work and serialize my world (or just a few selected entities). I now want to transmit this data to another peer (I am doing this with Kryonet). The de-serialize is working, the only problem I ran into is, that I can't seem to tell the "WorldSerializationManager" to update my entities instead of always creating them.

I use

world.getSystem(WorldSerializationManager.class).load(inputstream, SaveFileFormat.class);

to load the data from my byte input stream that was created by Kryo. Is there another way to de-serialize the entities and process them manually?!

Any insights highly appreciated!!

Share this post


Link to post
Share on other sites
Advertisement

Hi, a bot twitter account retweeted this under jobs ;)

There's unfortunately no straightforward way of deserializing entities without creating new ones. It could *probably* be done with a custom serializer based on the Kryo one, but I'm not sure how much work it'd entail + might require some changes to the underlying artemis code.

The culprit is the EntityPoolFactory - which always creates new entities when deserializing; but even if entities are matched against existing ones, new components would be instantiated during each deserialization, which may be somewhat costly in terms of performance/GC - depending on how frequently entities are updated.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
  • Advertisement
  • Popular Tags

  • Similar Content

    • By N Drew
      I am working on a 2D SideScroller game in my own made game engine using SFML and C++.I am searching for 2D artists,especially pixel artist for making and animating characters,backgrounds and other props that can be made in any Drawing Program.The artist will become part of the team of Hammer Studios and he got a part of the Revenue Sharing.If you are interested send me a mail at:ghiurcutaandrei@gmail.com .If you are not an artist but you want to be a part of our Team,Soon we will be recruiting an C++ AI programmers that worked in SFML/OpenGL.
      We work together using Discord.

    • By Inbar_xz
      I'm using the OPENGL with eclipse+JOGL.
      My goal is to create movement of the camera and the player.
      I create main class, which create some box in 3D and hold 
      an object of PlayerAxis.
      I create PlayerAxis class which hold the axis of the player.
      If we want to move the camera, then in the main class I call to 
      the func "cameraMove"(from PlayerAxis) and it update the player axis.
      That's work good.
      The problem start if I move the camera on 2 axis, 
      for example if I move with the camera right(that's on the y axis)
      and then down(on the x axis) -
      in some point the move front is not to the front anymore..
      In order to move to the front, I do
      player.playerMoving(0, 0, 1);
      And I learn that in order to keep the front move, 
      I need to convert (0, 0, 1) to the player axis, and then add this.
      I think I dont do the convert right.. 
      I will be glad for help!

      Here is part of my PlayerAxis class:
       
      //player coordinate float x[] = new float[3]; float y[] = new float[3]; float z[] = new float[3]; public PlayerAxis(float move_step, float angle_move) { x[0] = 1; y[1] = 1; z[2] = -1; step = move_step; angle = angle_move; setTransMatrix(); } public void cameraMoving(float angle_step, String axis) { float[] new_x = x; float[] new_y = y; float[] new_z = z; float alfa = angle_step * angle; switch(axis) { case "x": new_z = addVectors(multScalar(z, COS(alfa)), multScalar(y, SIN(alfa))); new_y = subVectors(multScalar(y, COS(alfa)), multScalar(z, SIN(alfa))); break; case "y": new_x = addVectors(multScalar(x, COS(alfa)), multScalar(z, SIN(alfa))); new_z = subVectors(multScalar(z, COS(alfa)), multScalar(x, SIN(alfa))); break; case "z": new_x = addVectors(multScalar(x, COS(alfa)), multScalar(y, SIN(alfa))); new_y = subVectors(multScalar(y, COS(alfa)), multScalar(x, SIN(alfa))); } x = new_x; y = new_y; z = new_z; normalization(); } public void playerMoving(float x_move, float y_move, float z_move) { float[] move = new float[3]; move[0] = x_move; move[1] = y_move; move[2] = z_move; setTransMatrix(); float[] trans_move = transVector(move); position[0] = position[0] + step*trans_move[0]; position[1] = position[1] + step*trans_move[1]; position[2] = position[2] + step*trans_move[2]; } public void setTransMatrix() { for (int i = 0; i < 3; i++) { coordiTrans[0][i] = x[i]; coordiTrans[1][i] = y[i]; coordiTrans[2][i] = z[i]; } } public float[] transVector(float[] v) { return multiplyMatrixInVector(coordiTrans, v); }  
      and in the main class i have this:
       
      public void keyPressed(KeyEvent e) { if (e.getKeyCode()== KeyEvent.VK_ESCAPE) { System.exit(0); //player move } else if (e.getKeyCode()== KeyEvent.VK_W) { //front //moveAmount[2] += -0.1f; player.playerMoving(0, 0, 1); } else if (e.getKeyCode()== KeyEvent.VK_S) { //back //moveAmount[2] += 0.1f; player.playerMoving(0, 0, -1); } else if (e.getKeyCode()== KeyEvent.VK_A) { //left //moveAmount[0] += -0.1f; player.playerMoving(-1, 0, 0); } else if (e.getKeyCode()== KeyEvent.VK_D) { //right //moveAmount[0] += 0.1f; player.playerMoving(1, 0, 0); } else if (e.getKeyCode()== KeyEvent.VK_E) { //moveAmount[0] += 0.1f; player.playerMoving(0, 1, 0); } else if (e.getKeyCode()== KeyEvent.VK_Q) { //moveAmount[0] += 0.1f; player.playerMoving(0, -1, 0); //camera move } else if (e.getKeyCode()== KeyEvent.VK_I) { //up player.cameraMoving(1, "x"); } else if (e.getKeyCode()== KeyEvent.VK_K) { //down player.cameraMoving(-1, "x"); } else if (e.getKeyCode()== KeyEvent.VK_L) { //right player.cameraMoving(-1, "y"); } else if (e.getKeyCode()== KeyEvent.VK_J) { //left player.cameraMoving(1, "y"); } else if (e.getKeyCode()== KeyEvent.VK_O) { //right round player.cameraMoving(-1, "z"); } else if (e.getKeyCode()== KeyEvent.VK_U) { //left round player.cameraMoving(1, "z"); } }  
      finallt found it.... i confused with the transformation matrix row and col. thanks anyway!
    • By Ike aka Dk
      Hello everyone 
      I am a programmer from Baku.
      I need a 3D Modeller for my shooter project in unity.I have 2 years Unity exp.
      Project will paid when we finish the work 
      If you interested write me on email:
      mr.danilo911@gmail.com
    • By HawkDeath
      Hi,
      I'm trying mix two textures using own shader system, but I have a problem (I think) with uniforms.
      Code: https://github.com/HawkDeath/shader/tree/test
      To debug I use RenderDocs, but I did not receive good results. In the first attachment is my result, in the second attachment is what should be.
      PS. I base on this tutorial https://learnopengl.com/Getting-started/Textures.


    • By Cello Gaming
      Hello I am looking for a team who are willing to work on a Realistic, Large, Story-based, Open-World, Survival, Horror game. I'm looking for a team that is willing to stay with me through the whole project. 
      For this project I will be needing:
      3D Modeler: Somebody who has a good understanding on how to create 3D models through Blender, Maya, 3DS Max, or any other Modeling programs of their choosing Animator: Someone able to rig and animate humans, non-humans, and machines. Artist: Someone able to make art for loading screens, GUIs, and Cover art. Environment Artist (2-3): Someone able to create a large open world for the players to explore Writer: Someone who has experience writing story-lines and can write dialogue for this project Sound Engineer: Somebody who can create sounds for character movements, environment, and animals     Ideas for The Project: - Shipwrecked on an island after getting caught in a storm out on the ocean - Start on the boat with all your friends and a bunch of NPCs where the ship doesn't crash until you talk to the captain - Able to search wreckage to find food, water, and a basic tool. - Locked areas in the wreckage that you need special tools or codes to open. - Secret chests you can find on the island through maps that you can find in abandoned houses, shacks, and wreckage of pirate ships. - Fishing rods to go fishing for different kinds of fish. - Cooking system to cook food on a grill or campfire which requires propane tanks or wood to continue burning - Underwater and land caves with plenty of resources - Mutant bosses that you can fight above or under water - Underwater life (Sharks, Fish, Large underwater Squid boss)   These are just ideas they may or may not be implemented in the final product. Any feedback on ideas for the game would be appreciated.   We will be setting up a kickstarter for people to support this, if this project gets up going, so watch for that.  
    • By Luca Falco
      https://www.youtube.com/watch?v=UMoc52DEoC8     ABOUT THE GAME: Room54 is a first-person Horror/adventure  Videogame for pc,mac and linux users. the game is currently under development by a very small team, we put so much effort in this project and we are keep doing our best for that we are going to launch a kickstarter campaing in order to reach our ideal budget to complete the project, we hope the GameDev community can help us a lot                      STORY:   Daniel is a family father like many other, one day he decide with your wife and his daughter  to spend her winter holidays at their mountain house that they have recently buy in  mountain ,a  wonderful place surrounded by the nature of the woods,  Completely far away from the caotic city life. During their holidays Daniel and his family will understand that they are not welcome there and they will discover an  hided and disturbing part of the valley that they have never seen before                       GAMEPLAY:   You will play as Daniel, a father that will try to save his family, your gameplay will be focused on discovering secrets places around valley,investigating and trying to survive, you will find object that will help you solve enigma and to stay alive. The immersive audio and  environment will make you feel constantly follow by an high anxiety dose  during the game.                         SOCIAL PAGES:     Follow us to get the latest development news and insights     IndieDB:     http://www.indiedb.com/games/room54   Twitter:       https://twitter.com/Room54Thegame   facebook:   https://www.facebook.com/Room54/
    • By this. games
      [Free]
      Looking For: 2d Artist and Animator.
      Requirements: Experience in 2d art and ability to commit to 1-2 years of work.
      Payment: Rev-Share (Think Free as the product may not end up being sold)
      Description: An 3/4 view 2d game with a Sci-fi style. The game is based on a man who was put into stasis for punishment for his crimes. He has woken up 100 years later and must now regain his position at the top of the criminal underworld by killing his opponents. There will be a "Hub World" city and then PCG gang hideouts where you fight enemies. The assets required will be tile sets for the different hideouts, assets for the city ie buildings streets etc. and characters both the player and a number of enemies.
       
      Send resume and portfolio to thisdotgames@gmail.com if you are interested.
    • By Hive Entertainment
      Hey everyone we are looking for a 2d artist for health bars, inventory, items, weapons ect. Unfortunately I can not pay at this point in time however if you are interested please let me know and I am sure we can work something out. I am also looking for landscape modelers in 3d message me for more details or email me at hiveentertainmenttech@gmail.com




    • By Gold_fox
      While I’m VERY aware how illegal is is to steal game programs, there are so many cool ones so I have two questions, can all these cool mods for other games be stitched together, and is it legal to do so so long as it’s just for me and I NEVER share it.
    • By Hawkblood
      Just as the title implies, when I make a small change such as "x=4;" now to read "x=5;" the compiler doesn't build that part of the code and leaves me with the old value. It correctly compiles when I select "rebuild solution"....
      How do I fix this?
  • Advertisement
  • Popular Now

  • Forum Statistics

    • Total Topics
      631350
    • Total Posts
      2999478
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!