Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

[Ynamar Engine] #4 - Weekly Update [Map's, Npc's]

[Ynamar Engine] #4 - Weekly Update [Map's, Npc's]

Zotesso
Zotesso
Ynamar Engine · · 2 min read
1,653 0

Repository: https://github.com/Zotesso/YnamarEngine

Server - Progress

Send the map to the client via TCP

Did it using the protobuf contract previously established, stiil I'm feeling that the packet is too large, using a two dimensional array to the tiles, and having the same amount of tiles in each layer of the map, so it is a mxn matrix, in a 250x250 map I will have 62500 tiles multiplied by the amount of layers in the map, so I will have over 100K register in the database for each map, and will need to send it through the network.
May be a huge problema later, but I'll implement ways to reduce this problem, like a cache in the server and in the client, in order that I just need to send the map the first time and when there is some change in it.
Thinking about to load the map in batches when the player moves, but even that solve the performance problem this may bring problems with network.

Npc's

Created the model of Npc's, and MapNpc's.

Created the method to control the Npc movement in all Maps.

Game Loop

Created the main Game Loop in server, that will control all the game logic, update the maps, update the npc's movements, everything that needs to be automated.


Client - Progress

HUD

Was using Myra to draw UI, but I find out that Myra is very limited as I needed more customization started searching other options.
So find Gum: https://docs.flatredball.com/gum
Great support, active project, fully open-source and works very well with Monogame, and even better very customizable.
The only problem is that, using Gum in my project increased the Client Memory Usage from 60MB to 122MB, so I am kinda worried about it because I just used it for the login screen.
In case it turns out to be a problem, I will have to create my own UI Components Library.
But for now, Gum is being amazing.

Npc's

Created the handler to Npc movement, and included npc movement check in the main client loop (need to refactor, I think that loop is wasting resources, but there is no other way to control the npc movement animation)

Draw the map based on the package received from the Server


Next Steps

Server Side:

  • Refactor the TCP and UDP stream to have a graceful failover
  • Start to work in Npc/Player combat.
  • Start to work on the inventory
  • Start to work on the AccessLevel (Implement some type of authorization level)

Client Side (Didn't change):

  • Refactor the TCP and UDP Classes.
  • Add some type of local database (SQLite) to save information like MapStruct, NpcStruct
  • Refactor the login/register system to be more secure.
  • Draw Items in the map
  • Created the Player/Npc combat
  • Draw Player HUD (to open inventory, see status etc…)

Thank you for reading again, I'll be even more thankful if you could give me some advice to accomplish that journey.

Thanks again,

Zotesso

Discussion

Loading comments...