DEV Community

Discussion on: Writing a Game in Typescript

Collapse
 
drsensor profile image
૮༼⚆︿⚆༽つ • Edited

Congratulations and well done!
You deserve a medal 🥇
Also nice diagram 👍

💯 Lighthouse!?
When someone bring me that metrics I've always question how Lighthouse calculate those scores 😆

For the next step maybe you want try using ECS. Here some list

Any ECS library should be fine (except ECSY). Speaking of WebRTC, here an example combining ECS with WebRTC

Collapse
 
iamschulz profile image
Daniel Schulz

Lihhthouse scores are easier to get to 100 when you try to not mess up things instead of adding performance features :)

I haven't heard of ECS yet, but I'm no real game dev either. It sounds like I'm already halfway there. It would mean e.g. to put all positioning data into its own structure, right? I can see how that would be beneficial in games with a high number of players, but how would that pattern be batter than what I have now with only a handful of players?

Collapse
 
drsensor profile image
૮༼⚆︿⚆༽つ

Bullet-hell is one type of game that work best when using ECS even though it's single player. Every type of bullets and obstacles are modeled as ECS components. For example modeling them based on the effect and damage then we can model it as component fire, ice, poison, and physical. Ice will have parameter slow down in percent and ice damage per hit. Poison will have random move chance and poison damage per second. And so on. After that you just need to put each logic/implementation in different ECS systems.

Even if the game only has small amount of entities, it can still benefit from how easy the data can be serialized. Make it suitable in multiplayer game for states synchronization.

Thread Thread
 
jidayyy profile image
Julien hey

agree !