michaelcalkins Posted June 28, 2016 Share Posted June 28, 2016 I'm wondering if it's possible to run a multiplayer Box 2D game while remaining very performant. Game characteristics: 2d platformer shooter Online multiplayer Map is about 4000px x 2500px 6 - 10 players at a time NodeJS and Socket.io Right now I create the maps with lots of rectangles but I'm interested in creating arenas similar to Soldat example here The Arcade physics are highly performant and if I switch to Box2D how significant is the performance difference? Are there any stress tests out there that demonstrate this? Link to comment Share on other sites More sharing options...
Cudabear Posted June 29, 2016 Share Posted June 29, 2016 The way I understand it performance from best to worse goes Arcade -> Box2D -> P2 but the complexity of what you can do also increases. In theory, the client shouldn't need to calculate physics on the other players, so I would think the performance impact of either system is pretty small. Is your map 4000x2500 pixels, or tiles? I saw performance hits with about a 250x50 tilemap on weaker devices using P2 physics. Arcade didn't see hits until I approached about 250x250. If your map is 4000x2500 tiles, I can't imagine you won't see lag with any system. michaelcalkins 1 Link to comment Share on other sites More sharing options...
michaelcalkins Posted June 29, 2016 Author Share Posted June 29, 2016 @Cudabear I meant pixels for map size. Do you know if you can utilize the AABB system for most of the game objects and just use the Box2D polygon shape to draw the map around it? (like the image I linked above) Link to comment Share on other sites More sharing options...
Cudabear Posted June 29, 2016 Share Posted June 29, 2016 Yup, you can use multiple physics systems. Just make sure to enable all relevant sprites in each system (no way to collide bodies with AABB system with bodies in Box2D system, or vice versa). michaelcalkins 1 Link to comment Share on other sites More sharing options...
VitaZheltyakov Posted June 29, 2016 Share Posted June 29, 2016 PC or mobile? Link to comment Share on other sites More sharing options...
michaelcalkins Posted June 29, 2016 Author Share Posted June 29, 2016 @VitaZheltyakov PC at first very a long while and eventually ported to mobile. Link to comment Share on other sites More sharing options...
VitaZheltyakov Posted June 29, 2016 Share Posted June 29, 2016 4 hours ago, michaelcalkins said: @VitaZheltyakov PC at first very a long while and eventually ported to mobile. Arcade, Box2D, P2 have good performance on PC. On mobile - only Arcade michaelcalkins 1 Link to comment Share on other sites More sharing options...
Recommended Posts