Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Post What's on Your Mind

Oh right, standard practise is to just write the number of bytes into an int before the start of the string's bytes.
So your packet would look like:
{ String.getBytes().length, String.getBytes() }

nextInt() now tells you how many bytes you need to read for the incoming string.

Alternatively, if you're able to read each UTF8 character at a time from the stream then you can do a C style string and read until you hit a zero terminating character, which is a single starting byte of 0 in UTF-8. A bit more complicated, but saves 3 bytes of packet space.
 
Xilef":1fhl1hmu said:
Oh right, standard practise is to just write the number of bytes into an int before the start of the string's bytes.
So your packet would look like:
{ String.getBytes().length, String.getBytes() }

nextInt() now tells you how many bytes you need to read for the incoming string.

Alternatively, if you're able to read each UTF8 character at a time from the stream then you can do a C style string and read until you hit a zero terminating character, which is a single starting byte of 0 in UTF-8. A bit more complicated, but saves 3 bytes of packet space.
put the length before the string holy shit im a retard thankyou
 
Finally got "Google Sign In", "Facebook Log In" and "Twitter Log In" finished for my game, so you can use any account you have with those 3 services to log in.

Google was piss-easy to do. Dead simple, nothing complicated.
Facebook took multiple attempts and sucked all the way through.
Twitter is the absolute worst. It's a miracle developers even use Twitter. It's so horseshit, I can't believe Twitter gets away with it. Their stupid API "helpful" service could never detect my app (Fabric, which is actually pretty good when it works and you want to use it; I don't want to use it, but it's a requirement for Twitter as they own it...) so I had to dig around in their shit looking at old database websites and tracking down how their API evolved and eventually I found their hidden repo URLs, so I sneakily hooked into that and that was about 90% of the journey. The last 10% is a piece of trash nightmare in itself.

Also, Facebook Log In doesn't let you resize the button? And Twitter's Log In button is a fucking picture and the rounded rectangular border loses its shape if you resize it even slightly. Ended up applying a 0.6 scale to Twitter so it's the same size as Facebook's button and now they're sitting at the bottom of the log in options as "By the way we support these". Google is way better, no wonder Pokemon Go only supports Google.

EDIT: Like wow it's 20 past midnight here and I was up since 9am getting Facebook and Twitter log in to work.
 
Go to bed it's 1am. Your last screenshot actually looked really good by the way, it feels like a hint at how big the game's scope is going to be
 
Wikipedia":ueodrbk0 said:
Threads is a 1984 BAFTA award-winning British television drama, produced jointly by the BBC, Nine Network and Western-World Television Inc. Written by Barry Hines and directed by Mick Jackson, it is a docudrama account of nuclear war and its effects on the city of Sheffield in Northern England.
 
Absolutely livid with Microsoft. LIVID.

For the past three weeks when I boot my PC, Windows 10 has been attempting to update only to fail at the last moment of installation, revert all changes and restore the previous build before finally starting Windows. All that combined it takes me about 30-45 minutes to boot up.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top