Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Idea for storing world data for a 2d side scrolling metroidvania MMO

Discussion in 'Multiplayer' started by Alex_D_Dunbar, May 15, 2021.

  1. Alex_D_Dunbar

    Alex_D_Dunbar

    Joined:
    Oct 31, 2017
    Posts:
    7
    I have a crazy idea on how to make a mmo I want to get feedback on. First, here's what I want to make.

    Picture a platformer like celeste or ori and the blind forest, with the usual movement upgrades. Combat is started when touching an enemy in the over world. It is a turn based combat like FFVII where you have a meter that fills up between turns. One difference is that depending on what you chose this turn (fast or slow action) the longer it takes till your next turn. Cast a huge fireball spell and your need to wait longer than if you did a quick cantrip. Using a huge two handed axe takes longer than a dagger. When the player is in a party if any player touches an enemy it starts combat for the whole party.

    There will be four classes, warrior, survivor, priest, and mage. Warriors can deal the most damage to a single target. Survivors can add debuffs to enemies. Priests buff allies (don’t heal as such.. The way I see this it has no healing in combat). Mages deal aoe damage. Each class also has what amounts to a business associated with them that replace things that would normally be in town. Warriors can place a chest that charges players to access their stash, Survivors can make a shop that allows access to the auction house (they get a cut of anything sold through their shop). Priests make a statue that can heal players for a cost based on the amount healed, Mages can make a permanent portal that charges per use. The player places these businesses where they feel they will make the most money. The player can’t use their own business.

    This game is built completely around quests. Every spell, movement ability, Health increases, mana upgrade, and power is found at the end of a quest. Everything you normally get from leveling up is done from quests. That’s where the metroidvania comes in. Certain quests may be locked by the needed use of a movement ability. For example you might need the double jump to complete some quests.

    Now that the basic idea is out of the way, here’s the crazy part. Basically I want to use images that I can access from a server to store level data one piece at a time. Picture a 256 by 256 (I kinda picked that size at random) image where each pixel tells things like the background image for the tile, what game object to put at that location, that sort of thing. When you move around the world the game downloads the relevant image from the server then uses it to figure out what to draw on the screen.

    The basic idea is when the player goes near the edge of the screen the game looks to see if the data for that world coordinate is in the current image it has cached. If it isn’t it looks to see if it has the image it is in cached, if not it loads it. Then It just uses the graphics card to look for the pixel that relates to the current world coordinate for the tile and loads the correct assets.

    I think how most people do this is to have it send a message to the server asking it what goes in a specific location that it has never rendered before. My way it loads a bunch of tile data in one post. I feel it should make rendering the world faster and easier. I mean I still need to post messages to the server about dynamic objects like players. Enemies I would like to have it so that it basically uses a global timer that it gets every time you get an update that determines where an enemy is on a route that’s placed in the level data image.

    One advantage to this is that world map updates can be done basically in read time without the player needing to download anything. I mean I don’t really need to even kick people off the server.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    If you just need to download small images, you can just host them on a web server and grab them as needed using UnityWebRequest. You could also include them in asset bundles.

    But an MMO would normally involve a lot of player to player interaction. What you describe sounds like a single player game where you just don't include the entire game world in the base build. In a typical MMO you'd have a fairly robust server solution to facilitate the player interaction and the shared game world the players interact within. However that ends up getting designed, you would probably want to deliver the world data as part of that infrastructure.

    I just want to mention that waiting to ask your question to the bottom 3rd of a fairly long post is going to cause many people to hit the back button even if they might otherwise be able to help. Information about character classes, magic abilities, etc, take up half of your post, but are completely irrelevant to your question about delivering world data.
     
    Last edited: May 20, 2021
  3. Alex_D_Dunbar

    Alex_D_Dunbar

    Joined:
    Oct 31, 2017
    Posts:
    7
    My main question is basically (guess I did kinda ramble) was IF it makes since to use images to store the data for static objects (ie platforms). My theory is that storing static objects in this way would save on band width because I don't NEED to send the world data. It already has all the data for a 256 by 256 (512 by 512 if your near an edge) tile area. That ways when I'm sending messages for dynamic things I don't need to send world data. The hope is to free up bandwidth for doing other things that truly need it. Still figuring out how enemies would work. They need to know the world data to move effectively. Still thinking on it. One idea I have is to make them Quasi static. Basically they move from square to square based on a global timer following a path we give them.
     
  4. IOU_RAY

    IOU_RAY

    Joined:
    Jul 25, 2017
    Posts:
    127
    Stacking on Joe's message here, I would suggest assetbundles.

    I have thousands, and thousands, and thousands of images for icon/monsters/backgrounds/etc in multiple projects and originally had tried the UnityWebRequest route to avoid needing to download bundles containing groups of content, but Unity handles bundles a million times better than individual webrequests, which gets incredibly ugly incredibly quick.

    If you want to be nimble with frequent dynamic updates/changes it does require some assetbundle version control logic but in the end, a lot of issues were squashed.

    Generally individualized image content via UnityWebRequest would be something more along the lines of user generated content verse static image content used as game assets.

    Keep in mind there is a surplus cost to hosting remote content compared to having it built in with the app as well if you have a large audience.

    Best of luck.
     
    Alex_D_Dunbar likes this.