Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Steamworks.gml example

Sample project for Steam-based networking for GameMaker. · By YellowAfterlife

mistake in cheat sheet?

A topic by Chingine created Apr 11, 2022 Views: 222 Replies: 2
Viewing posts 1 to 2
(1 edit)

there seems to be a small mistake in the cheat-sheet guide for using this extension. I understand YAL is busy with the current real world issues and this isn't a major issue report moreso just a heads up

the documentation for steam_net_packet_send(steam_id, buffer, size, type) seems to be incorrect. it says to use it like this

steam_net_packet_send(steam_id, b, buffer_tell(b), steam_net_packet_type_reliable);

I believe it should be buffer_get_size(b) instead of buffer_tell(b), based on it's description. 
this did cause an issue for me until I fixed it, so hopefully this helps

Developer

It is not a mistake - the usual approach is that you rewind the buffer with buffer_seek, write your data (which shifts the buffer position reported by buffer_tell) and then send that exact amount of data. Using buffer_get_size means that you’re sending the whole buffer every time - however large that is.

huh, okay. I appreciate the response :)