V
V
vovaaar2019-11-17 20:14:07
JavaScript
vovaaar, 2019-11-17 20:14:07

What technology is better to choose for creating a browser game map?

Good evening.
There is a map on which there are: buildings, paths, and points of players.
Mechanism of work:
Loading of buildings + loading of paths + movement of many points along paths at certain speeds. The average speed of one segment of the path is 5 minutes.
Map data (background, buildings, paths) will be loaded with json + dom drawing
What technology is better to do this?
While stopped on konvajs. + canvas, but the constant redrawing of movement points (of which there can be 1000+) confuses.
I am also interested in loading data: if you constantly load json and synchronize points, what is better to use? For example, the update will be + - 5 seconds or when a person stops sitting in the current tab.
5dd17db4e38f9095906977.jpeg
Thanks everyone!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lostero, 2019-11-18
@lostero

I won't say anything about konvajs. Through webgl you can get more performance than from a 2D context, but is associated with additional. dancing, if you missed lectures on the computer. chart.
Although, if you forget in some places about the readability of the code, then you can unscrew good performance from the 2D context.
For frequent data synchronization, it is better to use web sockets - they will save you from sending unnecessary data with each request. I suggest taking a look at https://github.com/uNetworking/uWebSockets. Written in C/C++, there is a version for NodeJS. If none of the versions fits your set of technologies, look for analogues.
PS Itself did not use sockets from this, only http the server. It performs slightly better than nginx when serving static cached in RAM in a Centos 7 virtual machine, 1 cpu 2.6Ghz, 1Gb RAM (it is quite possible that I did not configure nginx correctly), 5.7-6k rps versus 5.4-5.6k rps. On two http cores, the server from uWebSockets for NodeJS squeezed out 14-15k rps, but here the 100Mbps channel was periodically clogged, and I didn’t test nginx. decided that rps comparable to nginx for a node is already good.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question