Search Unity

World Building Voxel Play - infinite world generator

Discussion in 'Tools In Progress' started by Kronnect, Jan 2, 2018.

  1. JesusMartinPeregrina

    JesusMartinPeregrina

    Joined:
    Nov 2, 2013
    Posts:
    44
    Hi there!
    I would like to know if it is possible to make something like a 2.5D version of Terraria, not only using 16x16x1 chunks but having water and lighting with a 2D behavior.
    Thanks!
     
  2. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi,
    No, this is full 3D. You can create a terrain generator that only renders to one z coord (creating content that’s 16x16x1) but the system including water and lighting works in 3D space.
    Regards
     
  3. m4ng4

    m4ng4

    Joined:
    Apr 17, 2013
    Posts:
    9
    Hi!
    I'm interested in your solution instead of writing my own, but don't know if i can use it.
    I have a game that I am working on but i would like to have massive destruction where almost everything is destructible.

    What I need it to be able to do.
    Performant destruction, would it stand a bullet hell
    Create and load a prebuilt world without generating "terrain" generating prebuilt assets like trees is ok, but is there a limit in dimentions of those prebuilt assts?
    world will almost always be of a cave type so it will not try to read terrain data that is not there.
    All data will neeed to be loaded in small chunks in one axis, but very large chunks in the other 2
    What would be tha max with high fps 1000x1000x16 (i saw somewhere that chunksize was hardcoded)

    Also would want that feature to switch axis.

    Is this doable? Or is there anything here that is going to be troublesome?

    Edit: Is there also a function to combine mesh example(2 cubes to a rectangle) to save saving and loading space/times but will refracture when destroy or building upon?

    Br,
    Daniel
     
    Last edited: May 26, 2021
  4. fjqanlan

    fjqanlan

    Joined:
    Nov 30, 2021
    Posts:
    5
    Hi!
    Kronnect
    I want to make a game with more than 1000AI on a battle field.
    What AI plugin do you suggest me to use?
    And I want to make vehicles such like planes and tanks.
    And a stragetic map for player to control all his units.
    And a random map generator can generate random map just like heroes 3.
    I want to know what are the best plugins match voxel play and can help me make this game quick.
    And at last,May I have a account on https://kronnect.freshdesk.com/support/home
    so I can ask you there?
    Thanks!
     
  5. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Sorry for late reply, didn't have notice of your post until another notification got in. Voxel Play is designed for speed which comes handy when want a complete mess or destruction scene. Check this video.
    More useful videos on Youtube: Voxel Play playlist.

    Hi! Feel free to join our Discord (link on my signature) and ask there about AI assets.
    Regarding the strategic map, take a look at our World Map Strategy Kit 2 asset.

    That site is only for the online manual of Voxel Play. Please join our Discord for casual chat/community interaction or create an account on our Support Forum where you can download latest beta vesions, extensions, and post support/suggestion requests. The support forum is at https://kronnect.com/support

    Merry Christmas!
     
    fjqanlan likes this.
  6. fjqanlan

    fjqanlan

    Joined:
    Nov 30, 2021
    Posts:
    5
    Hi!Thank you!
    I'm now going to create voxels with GUI and nbt data.
    For example,work bench and chest.
    Here are 2 questions:
    1.Should I do this by using prefab type voxel just like door and edit the script?
    2.How to save the data a chest contains when saving game?
     
  7. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes. Chests should use custom voxel types as doors.

    There're a couple of ways you can save the data related to the chest:
    Look for "Save GameObjects and custom data" and/or "Storing Data in Voxels" in the online documentation.
     
    fjqanlan likes this.
  8. fjqanlan

    fjqanlan

    Joined:
    Nov 30, 2021
    Posts:
    5
    Hi!I might found a bug about texture voxelizer.
    I have 2 pictures named qwe.png and Res_01.png.
    I generate Item Definition from qwe.png,succeed.
    I generate Item Definition from Red_01.png,failed.
    I deleted 2 files and change order,still only 1 generated successfully
    It seems generate Item Definition can only work once.
    If that is a bug,can you fix that?
    If not,can you tell me the right way of using it?
    I got thousands item to generate,that tool is important to me,thanks!
    upload_2021-12-28_22-33-48.png
     
  9. fjqanlan

    fjqanlan

    Joined:
    Nov 30, 2021
    Posts:
    5
    Hi!Now I'm researching UI system.
    I want to make a item drag system just like minecraft did.
    So I managed to add a show crusor function at where the inventory is shown.
    But it didn't work.
    Can you tell me where I can add this function?So I can show crusor and drag items.
    Thanks!
    upload_2021-12-29_1-20-44.png
     
  10. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    When you create the first prefab, rename it so the next item doesn't try to create another prefab with same filename.

    Use this code:
    Code (CSharp):
    1. Cursor.visible = true;
    2. Cursor.lockState = CursorLockMode.None;
    3. env.input.enabled = false; // pause camera control
    4.  
     
    fjqanlan likes this.
  11. fjqanlan

    fjqanlan

    Joined:
    Nov 30, 2021
    Posts:
    5
    Hi!Currently I’m researching the world generating system.And I got 2 questions.

    1.I want to make a world with limited chunks but no border.That means when you travel to the right border of the world, chunks near left border will be loaded and just placed near the right border.So player can’t find the border of the world,just like this world is a sphere.So,how can I manually modify the script to make chunks loaded like this?

    2.I want the world generated base on a picture,for example,a world map.Maybe 2*2 pixels correspond to a chunk.I want to know how the world generator work so I can insert this script to the right place.Can you take a look?

    Thank you!You really helped me a lot.I bought Pirates of Voxel Play as well.
     

    Attached Files:

    • 111.png
      111.png
      File size:
      191.1 KB
      Views:
      256
  12. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
  13. DromoDesigner

    DromoDesigner

    Joined:
    Mar 27, 2016
    Posts:
    73
    Hello, I am thinking of buying Voxel Play for a city building game I am making, and I wonder if you could answer a question please?

    I need a way for cars to be able to move from one level to a higher or lower one, so I would need slopes as well as cubes (so that I could build roads on the slopes).

    Is it possible to have voxel that are slopes (a cube with a diagonal)?

    Thank you.
     
  14. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes. They're called custom voxels and are supported by the engine. Basically VP let you define a voxel which optionally can use a prefab and in that case it uses that prefab instead of rendering regular voxels during the meshing stage.
     
  15. DromoDesigner

    DromoDesigner

    Joined:
    Mar 27, 2016
    Posts:
    73
    Hi - Thank you for your reply :)

    It sounds like Voxel Play is the system I need.

    I just have a couple more questions:

    1/ If you use a prefab to define a voxel, can it keep the prefab's original collider, or will it have a cube shaped collider (so that the cars can go up the slope).

    2/ If I wanted to place buildings at runtime that are bigger than one voxel (for example a runway for planes) could this be done? Could it be done as a line of voxels that replace the terrain voxels?

    3/ I saw your video for Terrain Far Chunks - in my game I would like players to be able to build their city on an island and also fly around it in planes - with the Terrain Far Chunks system would it be possible for them to fly a plane and see land in the distance like in the video?

    Thank you again for all your help!!
     
  16. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    1) It will respect the prefab collider.

    2) Yes. Using either Model Definitions or prefabs that are bigger than 1 voxel.

    3) Yes. The Terrain Agar Chunk extension just renders the voxel terrain at large distance by using path tracing. It blends seamlessly with real voxels in the scene as you fly/move around.
     
    DromoDesigner likes this.
  17. DromoDesigner

    DromoDesigner

    Joined:
    Mar 27, 2016
    Posts:
    73
    Hello, I am writing to ask about custom voxels - in 2019 someone on the forum asked if you could use custom voxels when generating the world, and the answer was no (they could not be placed massively).

    Could you tell me if this has been changed in any updates? Can custom voxels be used now to generate terrain in the latest version of Voxel Play?
     
  18. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    It's still not recommended. Placing them massively with colliders will cause performance issues. If you don't need colliders on them, then it can be right, as VP would render them on the GPU alone.
     
  19. DromoDesigner

    DromoDesigner

    Joined:
    Mar 27, 2016
    Posts:
    73
    I just need the mesh to be rendered for the custom voxel, and don't need the collider from the mesh. If I do this will the custom voxel behave like a standard voxel (for example can be destroyed by the player, and work with the navmesh)?

    If custom voxels are used when generating terrain, are there any performance issues even if they don't have mesh colliders?

    Thank you for your help.
     
  20. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Custom voxels do not benefit from certain optimisations like smart voxel/face culling but still they render fast thanks to GPU instancing. They can be used to mass plant vegetation, trees and rocks or surface features like roads for example. But they shouldn’t be used to fill underground terrain for example.
     
    DromoDesigner likes this.
  21. marcjammy

    marcjammy

    Joined:
    Aug 26, 2019
    Posts:
    13
    When using Random.Range(0, 10) in any scripts, if the Voxel Play environment is in the hierarchy, any use of Random.Range() is broken! It always returns the same number. When the Voxel Play objects are deleted, the function works! Super-annoying and hard to find bug - how can I fix this and use Random.Range?
     
  22. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    This is probably due to the seed parameter in the world definition of Voxel Play. The engine calls Random.InitState with that seed to ensure world is recreated exactly based on that seed.

    It's not broken, it's just that your Random.Range functions will return the same serie of values according to the world definition seed. If you change either the world definition seed or call WorldRand.Randomize((int)System.DateTime.Now.Ticks) to initialize the random generator with a random pattern.
     
  23. kylaCpp

    kylaCpp

    Joined:
    Dec 10, 2021
    Posts:
    4
    I want to make a function similar to minecraft ic mod
    How to make wires and generators and appliances connect them and be able to find each other
     
  24. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Most stuff like this could be implemented through custom voxels. A custom voxel let you assign a prefab which can also contain scripts to provide functionality. Feel free to ask about this in our Discord server, other developers might give you some suggestions.
     
  25. kylaCpp

    kylaCpp

    Joined:
    Dec 10, 2021
    Posts:
    4
    in multiplayer VoxelSetProperty VoxelGetProperty Is it useful how can i do it if not
     
  26. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    VoxelGetProperty/VoxelSetProperty methods store extra information about a specific voxel in a hashed dictionary of the chunk (chunk.voxelProperties). The contents of this dictionary is included in the savegame format thus data is preserved when you save/load the game.

    However, the chunk.voxelProperties contents are not included in the raw data returned by GetChunkRawData/SetChunkRawData optimized functions usually employed to send/fetch data from client to server (or viceversa). We can add an overloaded method to GetChunkRawData/SetChunkRawData that includes the properties of the voxels of the chunk. Please sign up on our support forum or join our Discord server and register your copy to get access to the beta boards where you will be able to test any improvement in this area.
     
  27. kylaCpp

    kylaCpp

    Joined:
    Dec 10, 2021
    Posts:
    4
    When I use custom voxels
    I place custom voxels on custom voxels
    will overwrite the original custom voxels
    I noticed the possible problem is here
    upload_2022-6-23_16-54-16.png
    It seems that
    VoxelOverlaps
    doesn't work with custom voxels

    But non-custom voxels placed on custom voxels work fine
     
    Last edited: Jun 23, 2022
  28. kylaCpp

    kylaCpp

    Joined:
    Dec 10, 2021
    Posts:
    4

    I know where the problem is
    upload_2022-6-23_17-15-52.png


    Now he works fine,
    But I don't know what the consequences of this will be
     
  29. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Well, we would need to better understand the issue here. But please note that this we keep this thread for more general questions. For custom support, please join our dedicated support forum or Discord. Thanks!
     
  30. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    I'm interested in this kit is there a survival gamemode that is included or can be downloaded separately?
     
  31. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    No, but we created a sample project (separate purchase) showing how to use the voxel engine with Mirror.
     
  32. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    You have to buy that on top of the $120 for the voxel engine?
     
  33. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    No, you don’t have to buy it. You can code your game with just Voxel Play engine, which already does a lot. But if you’re interested in developing with Mirror, that sample project is a good reference.

    Feel free to join our Discord channel to engage with the community as each team uses VP in different ways and using different networking systems.
     
  34. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    Basically I want something like Minecraft, from the demos Voxel Play 2 is great at world gen, is stuff like health, death, re spawning a part of Voxel Play 2 or is that with Pirates of Voxel Play? I'm looking at Pirates of Voxel Play more for the Minecraft features than for mirror as I don't care about networking. Also are mobs included or is that only in Pirates of Voxel Play?
     
  35. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Health UI, wield weapons, death, mobs or menus are not included. There are some sample components included in VP like character controllers and demo scenes that show how to spawn enemies that track player using Unity AI, a simple inventory and console, navigate and interact with the voxels, etc. but these components are provided as a starting point or examples that you can replace or modify completely - Voxel Play is not a game template so you will have to code or implement your game logic (eg. Spawning mobs). It’s a powerful voxel engine (with years of development!) which in essence just requires with a single camera - so you can just plug your own controllers, UI, scripts, etc.
    Pirates is aimed towards devs that want to use Mirror with VP. It has more game oriented features because it’s a sample project (including main menu, etc) but the point of this project is to learn how to integrate Mirror. Most of its features are not template based albeit they allow certain degree of customisation. It’s a project for more advanced developers that knows about Mirror.
    I’d recommend checking the available demos and the VP playlist on our YouTube channel.
     
  36. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    Is there no demo for Pirates of Voxel Play?
     
  37. TIMO4KA

    TIMO4KA

    Joined:
    Jul 8, 2017
    Posts:
    1
  38. Yaya2503

    Yaya2503

    Joined:
    Jan 13, 2023
    Posts:
    13
    Hello, is a weather system available in the asset? Is it possible to use mmo assets like ummrpg or mmorpg kit with this asset ? Is it possible to save a map and put it on a server? Are map editing options available?
     
  39. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi,
    Voxel Play is focused on the voxel engine. It lets you save the current map into memory buffer or string, which you can store anywhere. It comes with many features to implement map editors although currently there’s no default map editor such as voxel snipper. As of today there’s no weather system or integrations with those game systems as we are focused on the voxel engine. Check the online documentation and demos for description of current features and API.
    Regards
     
    Last edited: May 13, 2023
  40. Yaya2503

    Yaya2503

    Joined:
    Jan 13, 2023
    Posts:
    13
    I saw your documentation in league and it seems to date and only concerned voxel play except the version available on the asset store is named voxel play 2... I also saw that of the wish lists there was the addition of a weather system hence my question about it but I think I can add a weather system by myself but it would have saved me time. I read all the description of your project and it seems that it is the optimization your priority something that I appreciate very much especially for an online game, my question is to know if these optimizations are the same for the custom Block or at least if it benefits from any optimization, reading your previous response I thought I knew that no but it dated from 2018 or 2019 I do not know. I thank you for your answer, I would also like to know if you will add a weather system in a future update or not
     
  41. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    The documentation always refer to latest Voxel Play (which is 2 currently).
    There're some feature requests in the wish-list which we might add at some point in the future but there's no ETA nor guarantee that they will be added. It's just a list of nice-to-have features suggested by the community. At this moment there's no plan to add a weather system.
     
  42. Yaya2503

    Yaya2503

    Joined:
    Jan 13, 2023
    Posts:
    13
    Hello, I'm about to start a voxel game project and your assets seem to be the most suitable, I'd like to know a few things,
    1 Can I generate very large voxel Islands (1000 block) and still have a floating island shape?
    2 can I generate voxel trees different from those on the image you've put on the unity assets store? (Make models on majicaviwel like the root, trunk and leaves, then add collintion and use these models to make voxel trees different from those you'd find on minecraft, while still being able to break them).
    3 can I make sure that the cracks when I mine the blocks don't disappear if I stop breaking them? And can I adjust the mining time for each block so that, depending on the object you're playing with, certain types of block can be mined more quickly (e.g. mining earth and sand more quickly with a shovel? Or how about mining rocks more easily with a pickaxe and making them unmovable with your hands?)
    4 Can I replace the skybox with a custom skybox? I'd also like to disable the voxelplay2 clouds.
    5 Your water system seems too cool but I'd like to replace it with another one (like this: https://assetstore.unity.com/packages/tools/physics/zibra-liquids-200718) is it possible to replace the voxelplay water with the one I've just shown you?
    6 What are the performance levels for a mobile device (Android ios) from what I've seen your assets seem more optimized for pc, will using your assets on a mobile be recommended especially with the water system I use which is a central element of my game.
    7 And just to be on the safe side, can I use game kit controllers on your assets?
     
  43. Yaya2503

    Yaya2503

    Joined:
    Jan 13, 2023
    Posts:
    13
    For the procedural generation of the islands I am looking for a result like this:
    and for the tree I would like to generate custom preferably one can like this
    otherwise if it is not possible in this kind the

    And for the water, can you slow down your flooding system? If so, I think that will be enough and I won't need to change all the water in voxel play 2.
     
    Last edited: Aug 21, 2023
  44. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Voxel Play includes a Model Editor called Constructor which let you build trees using different blocks. See: https://kronnect.freshdesk.com/support/solutions/articles/42000033382-model-definitions

    Then you can use those models in the terrain detail generator to plant them randomly (like houses, trees, etc.) or place them manually using the API or place in play mode if the item is in the inventory (yes, you can place trees and houses from the inventory if such item / model is in the inventory of the player).

    Floating islands are doable but that requires you to write your own terrain generator class. There're many projects being built in Voxel Play which uses a custom terrain generator. You have more info about terrain generators in the online guides: https://kronnect.freshdesk.com/support/solutions/folders/42000013088

    Water flood rate is customizable, yes. For example, there's also a lava voxel type which expands very slowly.
     
    Yaya2503 likes this.
  45. Yaya2503

    Yaya2503

    Joined:
    Jan 13, 2023
    Posts:
    13
    thank you for your reply, but can you answer questions 3, 4, 6 and 7?
    to be clear I would like to know if I can control the destruction speed of the block and deactivate the fact that it returns to its normal state if we stop breaking it.
    I'd also like to know if I can deactivate voxel clouds and have a customizable sky system.
    as well as performance on mobile devices and compatibility with devices like Game kit controller.
     
  46. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Although these aspects are not truly the core of the engine, each voxel definition can have different hit points and each weapon can have different damage setting. All of these are included in the asset but you can override this behaviour. Damage is temporary, voxel "health" will return to default value after certain time. However, you can store your own voxel data using the API and annotate how much hit damage has a voxel received and destroy it manually using the different events (there're events when voxels are hit or damaged).

    The sky system can be replaced.

    The asset is compatible with mobile. Performance will depend on view distance, quality options (there're many rendering options in the asset such as smooth lighting or integrated AO) and of course, the mobile device itself.
     
  47. Yaya2503

    Yaya2503

    Joined:
    Jan 13, 2023
    Posts:
    13
    Is the voxeplay 2 water system similar to this?

    If not, can you describe how it works?
     
  48. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes, this is an example from Voxel Play:
     
  49. Yaya2503

    Yaya2503

    Joined:
    Jan 13, 2023
    Posts:
    13
    Puis-je baisser le niveau d'eau comme celui que je vous ai montré ? (par exemple faites un barrage comme sur la vidéo et l'eau descendra jusqu'au niveau du trou au fur et à mesure que la zone se remplit et atteindra un niveau d'équilibre, je ne sais pas si cela est compréhensible mon anglais est vraiment mauvais) et désolé Je dois être vraiment ennuyeux avec toutes mes questions.
     
  50. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Yes. Water is just a voxel type and can be placed at any altitude or position manually (as you would place any other voxel type) or in the case of terrain generators, the example included has a water altitude for the ocean initial placement.
    In build mode, water doesn’t fall so you can place it as you wish (build mode is a Voxel Play mode that allows you to place any kind of voxel).