Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Advanced runtime level editor advice

Discussion in 'Game Design' started by J-Roossien, Apr 13, 2016.

  1. J-Roossien


    Sep 3, 2013
    I had an idea for a multiplayer 2D game that would feature a in game level editor.
    But I'm not quite sure if it's possible and how terrible it would be for performance.

    What I want is to provide multiple tools to design levels.
    1. Polygon/mesh creation by placing dots and filling that with a texture. (stretched or tiled)
    * Possibly also some edge detection for having a different texture on the edge.
    2. Primitive shape creation with texture fills (squares, circles, polygons etc)
    * Will have rotation and scaling etc. (Or maybe even allow vertex editing for customizing the shapes)
    3. Drop sprites in the level probably on a tiled mesh to prevent having hundreds of separate sprites.
    4. Paint textures on top of created meshes and objects.

    The first and second won't be an issue but then for the third I have some questions and the fourth I'm pretty much lost.

    Basically what I hate about level editors is that it doesn't feel proper it either feels tiled or the textures are just ugly with stretched/tiled textures on custom meshes.
    So I'd like to have the ability to paint on top of the objects to add more details and such.

    Some things I had in mind were:
    1. Split the entire level up in like 5*5 unit areas and have a texture of 256px for each of those tiles with a pixel ratio of 51.2.
    2. Create a quad/mesh around each object that needs to be painted on with a texture that matches the size of that quad with like 50px ratio to have half the size.

    For the second I'm not sure how to approach it with uv mapping.
    Basically if a user creates a polygon and paints on top of it and then he moves vertices around I'm not sure how I would handle the uv mapping for that. I guess I could leave it as it was and the texturing would be stretched and the user would have to fix it manually but not sure if that would be good enough.

    Now the main concern is that the levels will be for a multiplayer game.
    So if there are gonna be a ton of detail textures I assume the loading of all those textures would take a long time and have quite a lot impact on the server. The textures would be cached probably so it's only downloaded once but I still think that it would take long for people playing a level the first time and that it would still be heavy on server load.

    For the third option with a tile system I have some concerns too.
    Mainly how to do it with multiple textures.
    Is the only way of doing it to have all the textures on a spritesheet or something?
    Basically I'll have a texture submission system so that artists can submit textures for the game to use in the level editor.
    Those would be separate textures and I'm wondering how to uv map a mesh with quads to use different textures.

    Another question regarding the tile system is texture sizes.
    Basically what I would like is that when placing a texture on the grid with a dimension of 128*128 it would overlap on the quad if the pixel ratio is 100/unit and the tiles are 1 unit.
    So basically it would extend 14% on each edge of the quad.

    To sum it up these are basically my questions:
    1. Is it better to have a texture for the entire level you can paint on or add quads for all the objects a user paints on with it's own texture?
    2. Is it possible to UV map a custom editable shape with a custom texture you can paint on? (If so how about when a user edits the mesh and so on)
    3. Is there an alternative for mesh painting without creating a texture all the time? (The painting will be with textures and brushes and not just colors)
    4. Is it possible to have multiple separate textures on a tilemap mesh?
    5. Is it possible to have a tilemap mesh with dynamic texture sizes that overflow the tiles.
    6. Just some general advice in this topic would be very helpful