Thursday, June 6, 2019

Still plugging along on coding the Server

I've just managed to finish coding how the server loads the world after all initial communication with the client is finished.  I took the time to do it right, so terraforming will be easily implementable in the future.

There are a few other things on the serverside that I want to add, but I'm starting to itch at all of the extra code I've made without properly testing it.  Until I get the client side coded to mirror what I've written on the server side, I'll be in the dark a bit as to whether network communication is working the way I think it will.

This has been a bit tricky, as I'm building my own protocol on top of TCP for Spacemind, but I'm positive it'll be worth it, as it should scale extremely well out to millions of players.



Btw, I did think about the conundrum in my last post of where to start multiplayer clients, and I think the best solution for now is to have a center spacestation where all new players arrive.  From there, they can apply to join people's pre-existing spaceships, or they can take one way lifeboats that will hyperjump them to a planet so that they can get started on their own.  It may not be the best solution, but I need to start somewhere, and that's what I have coded at the moment.

Monday, June 3, 2019

How do we start a multiplayer game?

So I'm now programming the multiplayer server part of the game, and I've (mostly) gotten through the name/account authentication part to where I now have to decide how new players will start when they join a server.  At first glance, this seemed very straightforward, but as soon as I started thinking about it more deeply, I fell headfirst into this endless rabbit hole of how Spacemind should be experienced for the first time.

Where a player starts in the Spacemind universe will dictate the initial experience/impression they have, and I know from StarQuest Online that even if you have an entire universe waiting for the player, they'll still uninstall within a few minutes if their starting spot doesn't make sense (i.e. stuck on a random planet with no goals and no understanding of anything).

If I just plunk a newly connected player on a random planet, then they're probably going to feel lost and frustrated very quickly, especially since the space aspect of the game won't become apparent to them until much, much later.  (Outside of the very small ones, spaceships are going to take serious resources to create)

On the flip side, if you start everyone on the server character's ship, then the difficulty of finding/boarding/building a ship is lost, and if the server is public, then you might not want random people suddenly appearing on your ship to grief it.

For single player, I have a good story-based initial experience that will give you a taste of a real spaceship, a broken spaceship, your place in the story, and an initial planet to explore before you can continue on your journey.  For multiplayer, that doesn't make as much sense to produce that for each connected client.

I just need to think long and hard through this problem of how new multiplayer players should begin their journey on someone else's server before I write even a single line of code about it.  I don't feel like I've wrapped my head around the ideal answer to this problem yet, and I'm worried that this decision will have an enormous impact on Spacemind itself.

Time to go think in the dark.  I'll let you know when I've come up with something.

Thursday, May 30, 2019

1st generation of payment Store is finally working

I got sick, so this was the first week since May 1st where I didn't work on Spacemind very much :/   I  definitely won't let this become a habit.

Either way, I think I finally have a solution in place for my web store where players can purchase Spacemind credits (or whatever they will be called).  That will be the microtransaction currency that will allow you to buy things in-game.  Ideally, I'll put the webstore interface into the game itself, but the most important hurdle has been overcome.

Now that I'm convinced I can have the server keep track of microtransactions, it's time to use this newfound knowledge and get back to multiplayer development.

Tuesday, May 21, 2019

Payments

As I worked through starting my networking code, it quickly became apparent that my authentication bit was also going to have to take payments into account unless I wanted to tear it all down at a later date.  At first, I had thought I would use Playfab, as it seems to be the most straightforward way for a game dev to monetize without spending too much time on it, right?

Wrong.

As I actually started trying to code a solution, I was immediately struck by how awful the Playfab codebase is. It's not just me, they actually apologize for the mess in some of their documentation! Now I understand why Microsoft bought it out. They saw the awful codebase and felt right at home!

Regardless, I was intent on pushing through it and making it work, until something happened.

I realized that Playfab had intentionally made it difficult for a developer to login, authenticate, and deal with users unless the players logged in with Facebook, Google, Kongregate, Steam, etc, etc. To add salt to the wound, one document then went on to lecture me about how paying users had to give their email address to get started, or else you should consider that as lost revenue.

To say I have strong feelings about privacy is a huge understatement.  I've been tracked before in ways that adversely affected my life in very tangible ways, and I am NEVER going to give any company the benefit of the doubt again when it comes to letting them have information about myself or my players.

Once it became clear that Playfab was intentionally steering me towards giving up as much information about my players as possible (I guess they found some revenue stream by doing that), that's when I gave the Playfab website my middle finger and closed those tabs with extreme prejudice.

Let me make it very clear that Spacemind is not just another company out to get your data/info. I have a strong moral compass, and I have to look myself in the mirror every morning. I have suffered through privacy nightmares, so I cannot tell myself white lies about doing anything with your personal information, because most companies have zero ethics and have zero respect for your information, and Spacemind will end up having to work with other companies, so here's the deal...

I am not comfortable with Spacemind having your personal information.  Not now, not ever.  Spacemind may end up logging some of your personal tells/whispers/in-game emails, but if it does, I am going to encrypt the hell out of it so that NO ONE, including me, can ever figure out what it means except you and your intended recipient.  I don't want your credit card information, and I don't want to know who you are, what ads you've clicked on, what you've bought recently, etc.  I only want to know those things if you find me in-game and decide to tell me all of that stuff in person (so to speak).  Otherwise, it's not my business to know any of that.

All I want is for you to enjoy Spacemind as a virtual life you never knew you wanted and to buy a few items/things to support the game that will also enhance your enjoyment of Spacemind. Some of you might want me to store credit card information so that your purchases will be faster/easier, but I really don't want to do that.

To top it off, I'm also not ok with requiring an email address for someone to have a Spacemind account. Spacemind should stand on its own, and it can't do that if I'm forcing you to tie your virtual self to some real-life baggage.  Why can't your Spacemind character have their own email address in the game?  Shouldn't that be more than enough?

Spacemind needs to feel (and BE) private, safe, and secure for everyone. How else are you ever going to feel at home there?

Suffice it to say, I'm having trouble finding a well-programmed payment processor that I'm happy with after I realized that my goals aren't in alignment with financial entities that have coded some middleware for taking your money.  I have considered so many now that I'm going cross-eyed. None of them seem good, so I guess I'll have to continue working on it as Spacemind evolves.

For the moment, I'm going to integrate Paypal payments directly into the game (which is definitely not the easy/quick solution, but it's the least morally disgusting one), and then we'll see what to do from there. I was thinking Xsolla, but too many gamers have had shady issues with them. Maybe Bitcoin will be good enough for players who can't access Paypal in their country/situation.

We'll see.  This is definitely a topic that Spacemind's community is going to have to address (and change) more than once.  For the things in Spacemind that have some moral grey area, we are *always* going to have the community decide how to proceed.  I am just one person with a vision, and I live to serve you, the players.  Not the other way around!

Networking

Figuring out networking has been a serious pain that is already starting to get me angry before I even begin to explain it to you. Maybe I should keep this one short so that I don't fall into another spiral of hate aimed at terrible software.  Ehhhh who am I kidding, I *always* hate terrible software. It always makes me angry when people are terrible at their jobs.

As I started rebuilding Spacemind with multiplayer in mind, it quickly dawned on me that there were so many pieces I had to figure out in order to get the ball rolling, and I definitely felt overwhelmed. However, as I started looking into various types of networking middleware, I didn't like what I saw. First, it seems like developers of middleware don't seem to understand that their products are going to be used by PROGRAMMERS. Why bother to have a decent tutorial, documentation, or example code? It's much better to just poop out crappy, nonsensical code and then wrap sleek marketing around it, right? *Growl*

Even after I'd gotten over the fact that most people can't write and/or explain decent API interfaces to save their lives, there was an even bigger problem: Spacemind's multiplayer doesn't work in same stupid/bloated way that most games do!  I'm not sure if I should go into the details about that yet, but suffice it to say that once most games do multiplayer in a certain way (be it FPSs, MMOs, or RTSs), then almost everyone follows along and does the same thing, even if it makes no sense to copy it. (I *hate* the herd mentality of human beings)  In the interest of making Spacemind globally scalable, I can't mindlessly do it that way.  I've thought about the multiplayer protocol of Spacemind for over 2 years now, and I have a very clear understanding of how it *must* work, and after 2 days of working on several very different types of networking middleware, it was painfully clear that I was going to spend more time unraveling and undoing the middleware to do what I wanted than to just do it myself from scratch.

At that moment, I realized from my code dives that despite what I keep reading, game networking isn't magic. There was no reason to be afraid of it or to even call it hard and complicated like everyone says. People are just finding the hardest way possible to bring a multiplayer experience to human beings when the internet is structured the way it is.

Like so many times in my life, if you want something done right, you've got to do it yourself. That's why money is somewhat worthless, because those green pieces of paper get you nothing if you're just waving them in front of mouth-breathing, knuckle-dragging monkeys.

So yeah. That's right. I'm basically going to have to code an MMO from scratch. Fortunately, I now have a clear idea of how I'm going to do it, and I feel empowered now that I've seen all of the crappy implementations that everyone else has cobbled together. If they can make a game work, then I certainly can.

Animation

So you might have noticed that v0.0.8a's animations weren't exactly well timed, and that wasn't coincidence. In my rush to get something out in time for May 17, 2019, I had to scrap something together for animations that didn't betray the internal engine I made for Spacemind. In doing that, animations could not be...well...smooth.

I really struggled over how I could have 100% smooth animations and still get the timings of all the internal workings to fit in. The problem in a nutshell is that the game's internal timings can't run too fast because the internet has lag (and we want billions of people to be able to play together on other sides of the planet). On the flip side, we can't have the timings too slow, or players will start to notice input lag, which could be frustrating in player vs player situations.

Between smooth animations, no input lag, and making Spacemind global MMO-friendly, I felt overly constrained and didn't see a solution. Fortunately, I know an engineer that I've worked with in the past who's helped me out of many a bind in many different industries and situations, and she did not disappoint, even though on paper, this should've been greek to her. After about 10-15 minutes of laying out the entire technical problem, she was quickly able to tell me why I was an idiot and how I had to do things in order to get smooth animations 100% of the time with no jumping at all while also having no input lag and still being global internet-friendly. Granted, her solution strains the client's computer a bit more than I'd planned on doing, but I had to admit it was doable.

And so that's why I decided to scrap nearly all of Spacemind's architecture up to this point and start over. Most of the guts of my code will survive this change, but it made it clear that I have to always start from the global MMO perspective when I design and code this thing, or getting this delicate balance between so many competing factors will fall apart later on as the codebase grows, and we can't let that happen.

And so from there, I resolved to completely figure out the networking side of things before any more single-playerish features could be added to the game.

Life

I've been hard at work in many different directions to the point where I forget to update you all on what I'm doing. I'm not the kind of person who draws attention to myself, so I need to get better at this blogging habit. Otherwise, I might give off the mistaken impression that I haven't been working at Spacemind anymore.

Life

On the contrary, I've been working so hard that my partner is extremely upset at me, and they have pointed out that despite all of the jobs (including where I'm my own boss), I've *never* worked this long and hard on something every. single. day. like this before.  Don't worry about my personal life, I will find that balance where I and my family are happy whilst I still push forward with incredible momentum.

But as I thought about it, I had to admit that my partner was right.  Of all the things I've worked on, something is different this time. The moment I wake up, I'm automatically at this computer, banging out code or trying to wrap my head around the latest problem in Spacemind. Whenever I'm not maintaining my or my family's life in some way, I sneak away back to this computer and get back to Spacemind creation. The weird thing is that I'm not even realizing I'm doing it. For some weird reason, I'm automatically compelled to do it. It's like Spacemind itself is this external force that is drawing me towards it. I never been this motivated or obsessed before.

While I'm amazed at this, I'm not really surprised. Spacemind is the culmination of my lifelong dream, and I'm not letting this slip away.  I *will* succeed at making this, or I will die trying. This is my life now, and it's become my life's mission to bring it to all of you. I know it's going to be a long, thankless, hard road, but blast it, I can't live any longer without a game like Spacemind. Now that I know what it's supposed to be, I can't enjoy any of the other crappy games out there!

Still, despite how much I know about what Spacemind should be, I can't forget to record life as it goes on, as most of you won't read this and understand what it was really like until much later. I owe you all a history, and I will fulfill that obligation, just as if it were a crucial part of building Spacemind (because it kinda is).

I have a few things specific to Spacemind development to get off my chest in followup posts, as these past few days have not been fun.