You are browsing as a guest. Sign up (or log in) to start making projects!

Geomatrix

  • 18 Devlogs
  • 92 Total hours

A Brawl Stars like game with interesting geometrical shapes that have real mathematical significance. It is made in C++, using only Raylib for graphics and ENet for network communication. I started this project because I want to learn more C++ for my next app that would require me to have extensive knowledge of it to make a zero-copy video encoder for high-end phones.

Ship #2 ✨ Blessed

What did you make? What was challenging? What are you proud of?
I updated my multiplayer game where interesting geometrical shapes fight each other to dominate the world of maths called Geomatrix. It is built fully in C++ with ENet being used for the client-server communication over UDP and Raylib being used to display graphics on the client side.

In Geomatrix different shapes have their own strengths and weaknesses and players have to leverage them in the best way possible so they can win.

It was quite challenging trying to stay consistent and not get overwhelmed by the loads of things I could add to the game as my time is limited and I easily ended up in a rabbit-hole about AI models that could play my game, which I didn’t end up making.

I am proud that even though I wouldn’t say this is the most sophisticated piece of software, I would say it’s pretty rudimentary compared to other games but I’ve come to expect reliability and modularity from it, which really came in handy when adding the maps and shapes. Even though there were some minor bugs here and there with the new maps and shapes at the beginning, it all ended up working with very small tweaks.

What should people know so they can test your project?

To test the project follow these steps:

  1. Go to releases section of the GitHub repository.
  2. Download the Client and Server executables.
  3. Download the “maps” folder from the root directory of the repository.
  4. Place the Client and Server executables and the “maps” folder inside 1 directory.
  5. Start the Server and then the Client.
    For multiple clients just spin up new instances of the Client.
  • 8 devlogs
  • 29h
  • 13.05x multiplier
  • 462 Stardust
Try project → See source code →
Open comments for this post

2h 0m 45s logged

I added 2 new shapes that will fight for supremacy in the math world. They are the Astroid and the Reuleaux Triangle.
The Astroid is more of a sniper with long range and lots of damage, but smaller ammo.
The Reuleaux Triangle is more of a tank with a shorter range and smaller speed but tons of ammo and damage and also loads of health.
Also I added 2 new maps, one is a team mode map and another is a PVE map in which each shape has to fight to be the only one standing at the end of the match.

0
0
19
Open comments for this post

1h 58m 30s logged

I added the aiming line overlay to make it easier for players to see where they are aiming. It was actually a little bit of spaghetti code involved in the making of this as I use a function to draw the match and another function calculates the last point of the line and returns it but I made it work and it does so beautifully and reliably.
I am thinking of maybe adding 1 or 2 more shapes and 1 or 2 new maps and I’d say the project is ready for another ship!

0
0
8
Open comments for this post

3h 55m 28s logged

After a bit of a pause on this project because I wanted to clear my mind a little and do the Hackpad hardware project I returned and made the Game Over screen a bit nicer and so everything is beginning to tie together. I wrote Reals and Quanta so that new users will know what those icons mean.

In addition I redesigned the map selection screen to show a preview of the map before selecting it.

I am also thinking of adding an aim overview and the players just hold the arrow keys or move the right joystick on the controller.

0
0
11
Open comments for this post

4h 23m 49s logged

These past days I am trying to figure out how to implement the IPC (inter process communication) between Python (where the AI model will be made) and the C++ “megaclient” that acts as 10 clients that connect to the game server. From what I’ve seen one of the easiest ways to implement it is through binary standard streams because I’ll have to move 14KB of data per frame, and because I will unlock the speed of the server physics simulation, it will be like thousands of frames per second, which will add up pretty fast. But the problem isn’t the actual size of data, but the latency, if I would just save it into a txt file my SSD will be hit with thousands of requests every second, so keeping everything in the RAM is why I chose to try and implement the IPC through binary standard streams.
But I didn’t yet get it working and my brain hurts a little cause for the first time since the beginning of this project I have absolutely no idea what to do or how to actually solve this issue and I kinda feel lost and a bit demotivated, that’s why this week I managed a bit over 1hr of coding per day.
But at the same time I’ve been watching more and more videos about how to build AI models and for the first version I’ll build a standard Backprop model as I’ve read in a paper that Predictive Coding approximates Backprop. The problem is this will have to come after the IPC is implemented successfully, which currently it is not.

If anyone sees and reads this I would happily accept any suggestions on how to implement the IPC between Python and C++.

0
0
9
Open comments for this post

3h 55m 17s logged

I’m starting the development of an Predictive Coding AI model that would play my game as a bot.
I’ll make it in Python so I can learn a new language and as it is the standard language used in AI development.
Currently I’m building a kind of “mega client” which acts as 10 client that connect to the server and it displays the whole map on the screen with all the players.
After this I will link the Python project with the “Mega Client” through standard streams as ENet on Python isn’t really a modern supported thing and this will cut down network bandwidth and I think will decrease the CPU overhead while the model trains.
When the link between the Python and C++ program is finished then I’ll start the development of the actual AI model, which will involve reading through some scientific papers on the topic. Right now I have 2 of them bookmarked, but you never know when something new may pop up.

0
0
4
Open comments for this post

3h 43m 5s logged

I designed kinda a rough sketch of how the icons for the game currencies could look like.
The sine waves are drawn in Raylib and they are static, as well as the circle and the border.

The “R” and “i” in the reals and imaginaries’ icon are font characters. Initially I thought about drawing everything, but then I saw a video about game optimization and that it’s very inefficient for the GPU to render small triangles, which eliminated the drawing in Raylib option, and also it would have been a hassle and a half. So this left 2 choices, load the R and i as a font or an image. I chose to load them as fonts because this allows better scalability, as a font isn’t made of pixels. But I didn’t know how much time I will spend making the font implementation to work.

First I had to find the fonts that had my desired characters, which was a little tedious having to download or scroll through the list of characters for each font. For this I had to install Font Forge so I could view every character in the font. After that I had to create a new font and to replace the i and R characters of the font with my special characters and then hook it up to Raylib.
After loading up my special font I had to tell Raylib whicch characters to import, and I had to measure the characters visual height so I could align them properly in the icon.

Each icon is drawn using their specific function, but I am thinking of combining them into one function in the future.

0
0
6
Open comments for this post

7h 7m 3s logged

Currently I’m focusing on UI refinement, currency introduction and “trophy” road implementation.

I introduced to the game:

Reals - the basic currency of the game (kinda like coins in any other game), you win them after a match and they can be used to buy shapes and upgrades. If it wasn’t obvious, the name comes from the set of real numbers.
Imaginaries - they are the “premium” currency in the game which can be used to buy reals. At the moment the game doesn’t really use them or display them.😅
It’s a work in progress so yeah.

Quanta - these are the equivalent of trophies, they would determine the skill of the player. You gain then winning matches and also lose them losing matches.
At the end of the match (or when the player is eliminated) the server transmits a packet in which is specified the amount of reals and quanta received by the player.

At the moment the amount of currency a player has is stored in a txt file in the game directory for simplicity. In the future I think that maybe it could be encrypted somehow with a key given by the server so the player won’t just be able to modify it.

In addition to this, I changed the UI for the main screen, the shape selection screen and introduces the ability to see the shape, it’s level, stats, and to upgrade it.
I’ll be honest that I took a bit of “inspiration” from the Brawl Stars layout, but tried to change some things, and my UI is still not in it’s final form.
Everything is done in Raylib, I still don’t use any PNG textures because I want everything to be vectors cause they are not limited by resolution (which maybe is worse for optimisation) and frankly because I don’t know how and I’m a little afraid to try. 😅

The settings and map selection menu still remained the same, maybe I’ll work on the map selection menu but idk about the settings menu cause it technically works and as the saying goes “if it works, don’t touch it”, and I’m a little afraid of touching it.

Also I’m thinking of introducing a scale variable for text, like the UI elements are defined by the width and height of the window, but the font size of the text is it plain pixels, so I’m thinking of making the text scale based on how it looks at 1080p and if the resolution is lower or higher the font size will multiply with the scale that will be the players resolution height divided by 1080.

After the UI layout is “done”, which hopefully will happen till the end of the week, I’m starting the development and training of the Predictive Coding AI model that will play my game as a bot.

P.S.: I’m trying to make longer devlogs as that was suggested numerous times in the reviews of the first ship.

0
0
6
Ship #1

What did you make? What was challenging? What are you proud of?
I made a multiplayer game where interesting geometrical shapes fight each other to dominate the world of maths called Geomatrix. It is built fully in C++ with ENet being used for the client-server communication over UDP and Raylib being used to display graphics on the client side.
In Geomatrix different shapes have their own strengths and weaknesses and players have to leverage them in the best way possible so they can win.
It was quite challenging getting the client to render and interpolate the packets sent from the server because without taking into account the time difference the players might overshoot, and because the projectiles didn’t have an id at the time, they would flicker in positions where they shouldn’t have been.
I am very proud of my server and the client-server communication because were the most reliable and straightforward things during the development of this project, even though I firstly started to build the server, the collision simulation, aiming, map and shape changes were very intuitive which proved to be extremely reliable. This reliability of the server really did come in handy when debugging the numerous bugs of the client, but most of the bugs that I found in the client are now fixed, but if someone finds more, I wouldn’t be surprised and you can contact me and describe the issue.

What should people know so they can test your project?
To test the project follow these steps:

  1. Go to releases section of the GitHub repository.
  2. Download the Client and Server executables.
  3. Download the “maps” folder from the root directory of the repository.
  4. Place the Client and Server executables and the “maps” folder inside 1 directory.
  5. Start the Server and then the Client.
    For multiple clients just spin up new instances of the Client.
    It is only on Windows at the moment, but in a future update it will be cross platform, even on mobile.
  • 10 devlogs
  • 62h
  • 10.25x multiplier
  • 575 Stardust
Try project → See source code →
Open comments for this post

1h 6m 33s logged

Finally got the settings to work, but the user has to press Enter twice for the change to happen, but hey, it’s not a bug, it’s a feature. 😅

I’m getting ready to ship this first alpha version of Geomatrix. It has been such a journey managing UDP packet types, the server physics simulations, the client interpolation and the Raylib rendering pipeline.

But at the end of the day, it was fun, and I learned a ton about client-server communication and the massive optimizations you can unlock when you find the right architectural abstractions.

0
0
8
Open comments for this post

4h 2m 24s logged

Trying to get the settings menu to work.
Firstly I made a general menu class, then I added to it a submenu vector, and I got it to work when I was only focused on getting the resolution to change. But then I tried to implement the frame rate setting and so the class had to be redesigned and now, let’s say it’s halfway there.

PS: the total time across the 2 Hackatime projects (server and client) linked to this Stardance project is 71hrs.

0
0
4
Open comments for this post

4h 52m 8s logged

Implemented settings and a save file.
Now whenever the user reopens the game it remembers their last used shape and map so they don’t have to reselect them.
The settings UI is only partially made.

P.S.: Hackatime shows the 2 linked project times to be 31hrs 55min and 35hrs 8 min respectively, but the total somehow is 57hrs 19 min.

0
0
7
Open comments for this post

6h 37m 46s logged

Added support for new shapes and levels. Different shapes have different stats and some of them can be upgraded with a leveling up system.
Also added a sine wave animation to a tile.

0
0
8
Open comments for this post

4h 9m 19s logged

Introduced a new tech inspired design into the game.
Now players that are in a “bush” get invisible.
Made the game modular and added support for multiple maps on the server side.

P.S.: In Hackatime I have 54 hours logged on this project, 8 more than Stardance logged, this discrepancy appeared 2-3 devlogs ago and I asked on the stardance-help chat about it, but I got no response.

0
0
6
Open comments for this post

10h 9m 5s logged

I’ve implemented a “fog of war” so the server only sends to the player the data about the other players that they can actually see.
I made the camera follow the current player.
The game now uses interpolation to smooth out the data packets coming from the server, so players can enjoy smoother gameplay. Also the tick rate was increased to 69Hz.
The network packets are now dynamic, they do not have a fixed size, this saves network bandwidth.
What I wanna do next:

  • create some basic UI;
  • create a basic game over screen;
  • introduce new shapes as playable “characters”;
  • maybe introduce a trophy system
0
0
4
Open comments for this post

16h 10m 26s logged

I’ve implemented shooting and health in the game.
Next I have to add a reload and ammo count. After that I could start to focus onto implementing some interpolation in the player and bullet’s movement to make it move at 144FPS not at the 30Hz tick rate of the server.

0
0
2

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…