Monkanics: A D-I-Why, Sci-fi arena shooter about crazy cyborg lab apes (Devblogs)

WOW. I just learned a ton.


#1: I learned that I can serialize data with Godot’s built-in methods.

For strings, there’s to_utf8_buffer(), which was the example used in the documentation.

UTF stand for Unicode Transformation Format. I read the provided Wikipedia articles from the docs and it’s super interesting, as 99% of the internet is encoded using UTF-8, which cover 8-bit values across nearly all languages.


#2: I learned about serialization and deserialization as a concept.

Essentially, serializing data like strings and variables turns them into bytes to send over the network.

Deserialization is converting them back into useable information.


#3: I figured out why the Godot docs specifically say “DO NOT SERIALIZE OBJECTS”

For one, the object is likely too big to send in one packet and costs a lot of performance.

And two, it’s a massive security risk, as players can send anything directly into another player’s computer. Yikes.


#4: Sending a single packet is surprisingly simple. And a lot more interesting than a standard, abstracted RPC

I feel like the lower level I go and the less I let the engine abstract, the more power I truly have.

I felt the same way when I learned to use RPCs instead of the multiplayer spawner & synchronizer.

The best way I can describe it is using individual LEGO bricks instead of prebuilt pieces. With those smaller pieces, I can create what I want from them.


Ok, what PacketPeerUDP, I’ve created a new client/server setup.

My goal is to punch through one of my playtester’s routers to send a simple print message. The code is the following (Minus my IP and selected port):

var Server_Packet_Peer : PacketPeerUDP
var Client_Packet_Peer : PacketPeerUDP
func _ready() -> void:
	
	set_process(false)
	
	if OS.has_feature("dedicated_server"):
		
		Server_Packet_Peer = PacketPeerUDP.new()
	
	if not OS.has_feature("dedicated_server"):
		
		Client_Packet_Peer = PacketPeerUDP.new()
		Client_Packet_Peer.bind(Demetrius_Port)
	
	set_process(true)
func _process(delta: float) -> void:
	
	if OS.has_feature("dedicated_server"):
		
		send_packet()
	
	if not OS.has_feature("dedicated_server"):
		
		receive_packet()
func send_packet() -> void:
	
	if OS.has_feature("dedicated_server"):
		
		Server_Packet_Peer.set_dest_address(Demetrius_Server_IP, Demetrius_Port)
		Server_Packet_Peer.put_packet("Message Sent".to_utf8_buffer())

func receive_packet() -> void:
	
	if not OS.has_feature("dedicated_server"):
		
		if Client_Packet_Peer.get_available_packet_count() > 0:
			var array_bytes := Client_Packet_Peer.get_packet()
			var packet_string := array_bytes.get_string_from_ascii()
			print("Received message: ", packet_string)

It works on my end, but I’ve learned that statement means NOTHING without other people’s input.

Now, I need to contact members of the Monkanics discord to test it. I’ll provide the client file to testers, while I spin up the server file.

I’d recommend all interested readers join the discord here:

Not only will you be able to test Monkanics when I have a build ready, but it’s also a chill place to hang out, talk about anything on your mind, and meme around. :tractor:

3 Likes

The test didn’t work.

HOWEVER, I’m not devastated by it, since I tested mere minutes after I got the version ready and not after an entire year of buildup. (A lesson I harshly learned)

I’m going to ask a few knowledgeable people questions to get more info, as this base is enough for them to work with.

And hey, if none of my attempts work, I can always use the Netfox/Noray plugins or GodotSteam. Silver linings, people.

3 Likes

Just created a new help topic for this:

1 Like

New (not bad) Update

Welp, after a few days of anguish, I’ve learned that connecting clients directly is pretty much impossible and I can’t use my computer as a server either.

I’m glad I got help figuring this all out. Especially the members on the Monkanics discord. It’s actually pretty active nowadays.


Anyways, NEW PLAN!

I’m going to be creating a virtual machine on the cloud. More specifically, through Oracle cloud, which provides a public IP address.

Then, I’ve created a new Godot project called the Monkanical Relay Server. This relay server will be used for matchmaking only, and does not deal with gameplay logic.


(Side note: I got the terms “relay server” and “signal server” mixed up. But what I’m trying to do is called a network relay, so I’m going with that name)


Once 2-6 players are in the matchmaking queue, the relay will choose 1 player to be the host, then have all other players connect to that host.

This so that there’s only a singular source of truth and only one router to get through. The method of getting through that router is currently unknown.

I’m learning how to do all this at the moment. So, wish me luck.

The Monkanics trello board has also been updated accordingly:


If you’d like to participate in playtests (whether they’re successful or not) and have a chill place to hang out, join the Monkanics discord:

The server is pretty active now and we have a lot of interesting (and non-tractor related) conversations. The best time to join is now!

3 Likes

Also, I will NEVER EVER EVER EVER try to connect clients directly between routers EVER AGAIN!!!

Literal trauma I went through. Use a relay server, for god’s sake.

4 Likes

I wonder what I wrote there

2 Likes

I can’t remember.

1 Like

Ah I know “Firewall Issue” not that its important

1 Like

HOLY SCOPE!

So, I’m still working on getting that VM up and running. Exploring different cloud platforms, looking up new words every 5 seconds, hating the command line, etc.

However, something I’ve realized now is the sheer scope of Monkanics. Even though I have a minimal amount of content planned, the things I have to do are still numerous and have come very unexpectedly.

None of this is relevant right now, obviously, but I want to put it into perspective and reflect a little.


A big one is the need for localization.

This sounds obvious, but the Monkanics community discord is VERY international. There’s people in almost all continents and people who do not speak English natively.

So, I’m required to design around that, plus my budget limitations as an indie developer. So all text has to be translated into a myriad of different languages, requiring MANY different native speakers.

Monkanics can’t have any voice acting either, because I have to translate it. I can only do emotional gibberish with text bubbles. (Which was likely the plan regardless, because the monkanics are monkeys, but still)


Then, there’s porting to the 3 major OS’ Windows, Mac, and Linux.

I’ve learned that Windows and Linux are EXTREMELY EASY. I can easily make ports to these platforms quickly and for free.

Mac… Holy crap… is a NIGHTMARE!

First, in order to properly release a game, or any other piece of software on Apple hardware, you need to have it notarized. Essentially a mark of the “Apple Standard”.

But to notarize, you need an Apple developer account, which costs $100 PER YEAR to maintain. WHY?!?!?!

Then, I have to buy a $800+ computer with closed hardware to notarize it.

And guess how many Mac users are in the Monkanics discord?

1

One SINGLE user. The rest are on Windows 10/11, Linux, or don’t have a functioning PC. At least I don’t have to pay for that last option.

I can find some workarounds for that Mac user while the game isn’t released on itch, but I don’t think I’ll be able to afford a Mac port of Monkanics. That may change, but I doubt it.


Another thing I want to talk about is how crazy all this netcode has been.

Like, I’ve implemented movement sync, projectile sync, interpolation, gamestate management, position checks, networked hit detection, everything needed to make a multiplayer game work…

EXCEPT for actually connecting players together!

Literally, I’ve done everything BUT the thing that makes a multiplayer game a multiplayer game. I just think that’s crazy.

What’s also crazy is that this networking oversight is the thing that jumpstarted the Monkanics community.

That first test of v0.1, a game that didn’t even work, was enough. Now that REALLY blew my mind.

I thought I would have to have a polished game to get people interested, but it turns out, you just need to start, tell people about it, and give them a space to congregate.

As I progress with the netcode, and eventually, the game, I’m sure the Monkanics community will grow.


Speaking of, you oughta join the server yourself if you’ve read this far:

It’s pretty chill, networking nightmares aside.