All Questions
Tagged with architecture javascript
37 questions
1
vote
1
answer
134
views
How should I share the states amongst all the executions of a Behaviour Tree triggered from all ticks?
I'm still learning about Behaviour Trees and my understanding of the "blackboard" is essentially a state object. When passing the state object through the ticks to the function calls (which ...
0
votes
3
answers
331
views
How to prevent a huge backlog of physics calculations from freezing browser when tabbing out of browser game?
I'm developing a browser game and am using the timestep implementation from the famous Fix your timestep! article.
It works perfectly, but there is one problem. If you tab out of the tab and then come ...
3
votes
1
answer
276
views
Storing stateful function-based actions in a JSON
System: My game uses an "ECS + event queue" architecture where every tick, various events change
the state of JSON-able data. Plain JS objects.
Problem: I want to be able to save the game-...
0
votes
1
answer
116
views
How to design a system that allows for custom equations of movement?
I'm developing a top-down shooter and I currently have a PhysicsSystem which operates on TransformComponents. Basically, it ...
1
vote
1
answer
177
views
Should state and behavior be combined for Buffs? Cannot decide between data-driven and OOP approach
I'm writing a 2D roguelike that uses an Entity Component System and I'm having trouble deciding between the traditional OOP approach versus a data-driven approach to implementing buffs and debuffs. ...
0
votes
2
answers
4k
views
What data structure do I use to store Archetypes in ECS?
I am implementing an ECS with "archetypes" similar to how they are defined in Unity:
A unique combination of component types is called an Archetype. For example, a 3D object might have a ...
0
votes
1
answer
342
views
How to decide whether a Buff should be a component or a Buff object in an ECS?
I'm developing a top-down 2D game in Javascript using an Entity-Component-System architecture and I'm struggling with the question of exactly how to implement temporary buffs / permanent passives.
For ...
0
votes
1
answer
126
views
Should abilities have their state and functionality separated?
I'm developing a top-down game using Javascript and Canvas in an ECS architecture.
I'm wondering, which of these is better from a design / elegance point of view?
Method 1: Combining the ability ...
2
votes
0
answers
1k
views
Idle game: calculating resource generation/consumption
I'm making an idle game in the vein of Melvor Idle and I've run into a problem calculating the yield and consumption of resources while the user is away. For those who don't know, many idle games have ...
0
votes
0
answers
112
views
Handling "nested" user actions in client/server card game
I'm developing a card game in JavaScript in a functional programming style and I'm unsure what is the best way to implement the flow of player actions that require other player actions for their ...
0
votes
1
answer
3k
views
Tips on how to architect your JavaScript game with classes
OK, so I'm creating a <canvas> game using JavaScript (ES6+) features like Classes. It's straight from the vue-cli and <...
0
votes
1
answer
92
views
How to save and update modifications done by the player in my procedurally generated JavaScript game?
I am making a game and I need the world to be generated and saved. I used Perlin noise to generate the terrain (and other stuff like trees), but cannot figure out the best way to save and recall ...
5
votes
4
answers
962
views
What is the best approach for networking a basic HTML5 pong game?
I'm working on the design of a basic multiplayer HTML5 pong game, and I have a very basic question about architecture.
The implied physics is very basic, and the movements are not a problem. The ...
3
votes
2
answers
1k
views
Handling input through callbacks or through game loop?
I've tried to figure out how to handle player input properly, but without luck so far.
As far as I have figured out, I can either:
Call the respective methods directly through the callback fired ...
2
votes
1
answer
147
views
Targeting logic for 100.000 units army
I am making an army fight for my website armyfight. There can be fights of hundreds of thousands units. I am looking for better unit targeting. in jsfiddle is an example.
...