Tag Archives: database

Database tables

Recently I’ve been modifying the domain model layer. As I said, the system is divided into different projects by Maven. The domain objects are the basic project. To date, there are database entities and rich entities. The rich model has objects organized with rules and methods for operating the game, considering non-functional requirements such as performance, coupling, heritage and composition, and the communication between objects.

Today, the entities of communication with the database are built with Hibernate. I have not decided if I will keep the Hibernate. Why? I’m thinking about the performance of communication between the client application and the server. I want to keep this link with a Java Socket (client side) with stateful communication with a Socket in Node.js (server side), but I would in a single request to perform many transactions in the database with store procedures. This in practice means that queries and changes to the database will be through stored procedures. Hibernate will only serve to facilitate the communication between Server Project (Maven) and the database when upgrading the game objects without stored procedures. I’m still thinking about it … later post here my decision 🙂

Now I am creating database tables of the game, like this…

tables

Of course that the model is not complete. This is only the first version, where I intend to allow players to walk for a map online, as with the rules of collision between them. Hope it works.

The basic idea is that each player (client project) open a stateful socket with the server (Node.js), changing its position (x and y axis) in the database during the walk. Each transition between tiles need a query to the server (Node.js) to see if another sprite (player) is blocking the way. Node.js scripts will communicate directly with MySQL through the Store Procedures. Note that at this time the Project Server does nothing. It is only necessary when other sprites (enemies or NPCs, for example) walk along with the other players.

Well, it is. After I tell if it worked