Search Unity

[WIP] Hoarding - Voxel FPS/RPG - Survival

Discussion in 'Works In Progress - Archive' started by Hynopsis, Feb 25, 2015.

  1. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Hey folks, after watching all these cool games in progress I felt it was finally time to post something about mine. I started out knowing nothing about game development, but after 4 years of messing around I'm pretty comfortable with Unity, Photoshop, Blender, etc. In reality I'm finally posting so get some fresh ideas and perhaps some motivation.

    Gameplay: This game is kind of a strange beast, what is way larger in scope than is smart or probably even doable, but it is mostly for experience sake. It will be an infinite voxel world, where the player controls and recruits henchman to build a city and defend themselves from the world. The player will place "nodes" around the world to direct the actions of the NPCs, never having the ability to tell them directly what to do. The NPCs will have a variety of priorities than can be set (tree-cutting, mining, terraforming, building, farming, hunting, etc) and they will complete work based on these priorities balanced with their own wants and needs. The terrain is smooth voxels, and buildings will use minecraft-style blocks (with various materials and shapes). The catch is that players and NPCs can only hold one block at a time. It will attempt to be more a simulation game. The player will control the NPCs to get the heavy lifting done, which leaves him/her time to explore, scavenge, scout, recruit, defend, wage war, etc. Even if the player is far from the NPCs, they will continue their work - the world doesn't have to be loaded for them to function.


    Main Features:

    Smooth Voxel Terrain

    • Infinite in all directions
    • Multi-threaded saving and loading
    • Procedural placement of trees, rocks, grass, etc.
    • 3D caves for exploration
    Bloxel Building System
    • Multiple block styles(cylinder, blocks, stairs, etc) and materials(wood, stone, etc)
    • Structural Integrity system for cool destructions
      • When strength is removed pieces clump up and fall with physics
      • Updates strength when terrain is dug and when block are removed
      • Rather low memory(3 bytes per block) - strength, last direction, length
    RTS NPC Control
    • GOAP AI for enhance NPC realism
    • Skills and levels for NPCs for specialization and strategy
    • Many details to be determine this is major current focus
    If anyone has any suggestion or ideas feel free to share. Keep in mind graphics get done last, in most videos there will only be one tree, one type of rock, one type of bush. The animation and sound effects will probably not be there or any other fancy stuff. Also I can always use help, if interested let me know.

    Shows off basic digging, removing of surface details, building system, detailed tree destruction, etc.
    See post 6# for destruction stress test.


     
    Last edited: Mar 22, 2015
    NickHaldon likes this.
  2. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    You're right that's kind of a "not done so much" idea for a game. After watching your video though, it looks pretty interesting. Being able to modify the terrain and have trees and other stuff react to the terraforming looks kind of fun.

    I'd be interested to see how the NPC's that you direct actually operate though. Are they going to be like "peons" in World of Warcraft, that basically just collect resources from who knows where for you?
     
  3. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    I'm hesitant to nail down the key features till I get the terrain and block modifications working right...so yeah its pretty loose for now. It's tricky getting everything to respond to the terrain right, but its pretty much done. I can interchange models for variety but this is still a prototype.

    The peons work by opening their menu and assigning a list of priorities. Until they level they only have a couple slots. When looking for something to do the will review their priorities and do what they can if there is work available. I also plan to have original dragon age type conditional AI, for a little more control. You will be able to form a team, where a group of peons will follow you and take more direct orders.

    I will post some more videos soon, some of the features of that old video got broke...so a little cleanup to do. Thanks for the input.
     
    Last edited: Mar 8, 2015
  4. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Finally updating with a newer video of the features. It took me forever(30+ hours), to fix the bugs I created over the last years since that last video. I'm using a rigidbody first-person character controller which makes the camera shake sometimes, super annoying. I recompress it later to get a higher resolution, 360p is pretty terrible...
     
    Last edited: Mar 8, 2015
  5. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Updated video to HD. For some reason fraps only shows 30 fps, when I was recording at 60. In game I never get less than 130/second. Appears this is a small error in the block strength system. This is the next thing to focus on. The newer video also showcase the options menus, world terrain settings, day and night cycle, a functional inventory with drag and drop, equipable items, etc. The is a NPC that follows the player around, but doesn't do anything in this video. If anyone has an idea on why the rigidbody controller shakes let me know. It seems to flicker up and down, its really annoying.
     
  6. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    So finally got some work done. I had one of my testers build something big so I could test some the block strength system. It lagged hard, but after a little threading and a yields it works pretty good. Too bad the game I'm working on won't really use this till the endgame when you can build seige equipment. Here's a video!
     
    Last edited: Jun 5, 2015
  7. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Last edited: Mar 22, 2015
  8. ImAldu

    ImAldu

    Joined:
    Mar 6, 2015
    Posts:
    64
    Well this is actually pretty cool looking! Hope it goes farther. :)
     
  9. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Thanks! Much appreciated. I spend like 6 months working on a destruction system using unity gameobjects. Later I learned about voxels, and 3d arrays...and redid everything. It literally probably took me a year to get this working, but I didn't even know how to program when I started. Persistence pays off i guess.
     
  10. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    575
    are you using a specific voxel package
     
  11. MagicZelda

    MagicZelda

    Joined:
    May 1, 2013
    Posts:
    90
    youve done great keep at it, proves what can be done with time and the willingness to learn, well done :)
     
  12. GGElias

    GGElias

    Joined:
    Jun 27, 2014
    Posts:
    43
    I dont know if you got the solution for the shaking RB, but in my game, it happens usually when the capsule collider's height to radius ratio is too high. For exemple, in my case, my collider is 1.8m tall, and shakes in that way if the radius is less than 0.25m. Try to make it thicker, and see if it solves the problem. Cheers :)
     
  13. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    I'm not using an existing asset store package if that is what you are asking, but used a combination of free assets and cobbled them all together. Gotta love the internet:cool:

    Thanks, much appreciated. You gotta be okay sucking at something for a while before you get any good.

    I ended up turning the rididbody interpolation to NONE, and that seems to have fixed the problem. I also disabled collsion between some objects at the same time, but pretty sure it was turning off that interpolation. Thanks for the help though will keep that in mind.
     
  14. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Working on some volumetric water for my game, totally rough around the edges. Needs transparent shader, needs surface smoothing, needs to work better between chunks. Seeing as though I'm not going for total realism it should work okay...

     
  15. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    I added directional attacking that I didn't show. So you click then drag and release to attack in a direction. The longer before the release, the fast the attack is and more damage it does. Once you attack from the right, you are queued to attack from the left for combos. Again you can charge on this side. Currently you can only attacking side-to-side, down-up, and diagonal. This should allow for targets attacks to damage specific armor or body parts.

     
  16. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Making some serious headway on the water system. I was averaging the surface data and doing workaround and realized I had some fundamental mistakes. Everything water cell that was checked marked itself as though it passed water, which usually wasn't the case, and prevented water from spreading evenly. I was surprised it even worked in the first place really since it is so fundamental to water simulation. Anyhow I will post a new video once I get most of the between chunk stuff working and have water respond to digging the terrain. On paper seems easy, but we will see...

    For a great link on water simulation, with code, check this out:
    http://w-shadow.com/blog/2009/09/01/simple-fluid-simulation/

    Or this one, which is equally sweet...
    http://www.gamasutra.com/view/feature/3549/interview_the_making_of_dwarf_.php?page=9
     
    Last edited: Jun 5, 2015
  17. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Wow, that was way more difficult than I though it would be. Had to so a bunch of work on making it look better, which didn't work too well. Anyhow it know works pretty well between chunks and the water responds to digging on the terrain. There we a couple small bugs that made this take so much more time...but that is coding I guess. I just wanted to post a new video showing the water flow and and its response to digging. Tons of little bugs, but you should get the point. I am now finally going to update to Unity 5. Most of my shaders (triplanar, foliage) were broken on the upgrade a while back so I waited a while. I'll make an after video after showing the difference of Unity 4 vs 5.

     
    Last edited: Jun 21, 2015
  18. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    I love Unity 5. Now I get all the sweet image effects for free, makes a world of difference. Notice the stats though, draw calls are double from shadows, but those vertices are tripled. I may have something wrong but appears SSAO double the vertices drawn, then something else brings it to triple the value.

    If anyone has any idea how that works let me know. I hit max 1 million vertices with no effects on, averaging around 700,000. Not too bad with no optimization or lod. I have a threaded mesh creator that wraps terrain in to one mesh, grass and leaves to another mesh, (trunks, rocks, and blocks) to another - each with respective atlas. Since they all use different shaders, this is as efficient as it can be for draw calls. I understand SSAO double the vertices, but can figure out what makes it triple the vertices (from 1.0 to 3.1 million).

    Keep in mind there is only one type of tree, one type of bush, 3-4 types of grass. My crappy, but fully destructible trees don't look to bad with all those image effects. I am using RTP which is pretty amazing. Since the terrain is transplanar, it probably looks different than unity terrain or a plain mesh, but looks good enough for me.
     

    Attached Files:

    Last edited: Jun 23, 2015
  19. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Just a bigger view range, have to disable SSAO since fog doesn't work with it. Guess I try global fog and see how that works.
     

    Attached Files:

  20. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    I have updated to unity 5 for the most part. Rtp is pretty amazing, same with all the pro effects. Transparent triplanar does wonders for the water. Currently working on terrain lod...we will see how long that takes.

     
  21. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    This is the video I thought I uploaded, shows things a little closer up.

     
    Last edited: Jul 8, 2015
  22. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Been working on lod for terrain and surface details. Currently I have doubled the distance of the terrain by reducing surface meshes (first level lod 80% reduction in triangles), and simple billboards. The billboards look kind of bad, but it works for the time being. As for the terrain it gets tricky, as you page around the world, it produces a basic heightmap representing a column of chunks for farther lod , then uses marching cubes for close terrain. In the end, for chunk columns that can't be reduced to a heightmap, it will draw full res, so details remain preserved at a distance. Overall, distance has increased 50%, which reducing vertices about about 70% for the whole scene, pretty crazy for a little work. Next I am working out some terrain structure problems, then another level of lod, which should double the current distance easily. 7.8Screen.png
     
  23. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    It's been forever since I have posted, but I am still working on this. Just got married, had a child, and in my last semester of college for web programming. I finally produced a official website that I programmed. If anyone has some time, check it out and see what you think. I would love to get some objective website opinions. The link is in the signature.

    In the last 6 month I have completely optimized the majority of my code, reworking poolers to reduce garbage, and minimized the memory usage. I have modeled several new tree models, all made in blender, that follow a template system to I can easily make different types and keep them completely destructible piece by piece.

    I implemented LOD using several cameras for a smooth fade between terrain resolutions and billboards. It works pretty well. I have a little testing to do with building construction and demolition, then I will start working on block templates. I will be able to import any shape as a mesh and break it up for proper culling, strength passing, and water blockage. Eventually users will be able to do the same. I have a little work to do on getting water to work between chunks, then just need to updating saving of water and creating water on world load. I have the biome system written out, will implement that when I lose some motivation.

    I will update with a newer video or some screenshots soon, things look quite a bit different now-a-days.

    If anyone has any voxel questions please feel free to ask, perhaps I will add a blog entry about it.
     
  24. SirStompsalot

    SirStompsalot

    Joined:
    Sep 28, 2013
    Posts:
    112
    Love the concept. Would love to see it updated more.
     
  25. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    There are actually a couple concepts, you should check out my website on the about tab, I am undecided on exactly the direction this is going to take, but they all have the same features. But you are right I should post more often with updates, but most of them are boring and technical, but maybe I should just post them anyway. I have all my working and progress tracked on paper, I should probably just use this as a medium to track my todo list.

    What I would really like to work on is more modeling, adding new trees, bushes, grasses, detail objects. But it is really time consuming. At some point you have to decide what is important. I can buy some models down the line, but can't really pay for the coding.

    So currently I'm finishing the water system:
    - Chunk edges issues, chunks need to communicate their types - solid, air, water, and other details for water to flow properly and renderer properly. Seems easy but is really time consuming to code for each condition between chunks. Also have to finish adding a cache system for neighbor chunk references and finally setup all water code for threading, which means removing all Unity specific stuff (.transform, RayCast, GetComponent)
    - Review water leveling, once I have all the proper water levels I have to adjust the marching cube density values to make them appear correctly, This still needs a little tweaking to make it look as good as I can for now, later may move to using more
    particles and fancy shaders to make it look like real water.
    - Water Saving, currently all other changes save (blocks, digging, removal of trees etc)
    - Water on world load - I might put this on hold until I work on biome generation, already have code completely done just
     
  26. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    anotherMain.png Oh, its starting to look better after working with textures and shaders to make things look better, I would say it is coming along when compared to the above screenshots.
     
  27. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Good work. Your time and dedication will hopefully pay off for you, and it looks like your getting the hang of this stuff! Good luck!
     
  28. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Thanks, it is amazing the motivation comments generate. Literally I've got a ton of stuff done, even while being in school and dealing with a 4 month old. Normally during school semester I don't get much done, burnt out coding I guess. But as long as one person gives a crap (other than me), gives me something to work for. I have water pretty much finished like I outlined, but then had to fix some billboard lod issues before I shot a video of water working with building and such. I should get to that tonight hopefully.

    Next I will start working on water generation on load, instead of just being place-able. Then I need to work out water saving, neither of which is hard, but certainly time consuming. Thanks again for the comment.
     
    MD_Reptile likes this.
  29. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    Attack of the bugs. My god..there have been a number of obscure bugs that have cost me nearly 30 hours over the last couple weeks. In the end I figured them out, but not without losing some hair in the process. I still have some work to do on the water mesh shape, but look passable for now.

    I added a couple new tree types, and developed a cool workflow in Blender that lets me make trees which can be created as a visible model, but also a damage model where each branch and section of trunk can respond to damage. My older video showed how it works with branches breaking when falling, these are just nicer looking ones and a documented work flow to pump our more of them fast. I might even consider this as a asset store purchase. I think there are people would like a drag and drop solution for tree decimation.

    I played with the water particles, but it is so time consuming, so many options, sliders, etc. The Bootcamp demo had some nice water splashes but it appears they don't have it available anymore, that a shame. If anyone know where to get the bootcamp demo, please let me know. There are lot of handy assets in that demo.

    Next things to work on:

    • Getting water to respond completely to block and terrain changes
    • Generating water on world load, including lod versions
    • Saving water data with chunk data
    • Impliment persistant chunks - chunk that remain loaded when far away

     
    Last edited: Mar 21, 2016
    RavenOfCode likes this.
  30. Hynopsis

    Hynopsis

    Joined:
    Oct 25, 2012
    Posts:
    60
    I cant believe it has been two years since I have posted anything! I've still been working this whole time, but two small kids leaves for only < 6 hours per week I can really work on this.

    Big changes:

    Working biomes (dessert, savanna, forest, tropical forest, plains, etc)

    - Each using it's own random grass and bushes
    - Trees are currently all the same since using SpeedTree and need to buy some
    - Smooth biome blending, both textures and vegetation
    - Non-traditional biome generation method
    - Instead of using height as a proxy for tempurature...
    - I am generating the terrain based on chances
    - Then using random temp and moisture compared against the terrain type
    - This allows for tropical mountains and other things you don't see if using height/temp proxy

    Water on world load

    - Auto-generation of rivers and lake through random noise
    - Works like any other water and responds to additional water and terrain changes
    - Water lod versions just like terrain produced from simple heightmaps

    Block building

    - Create custom importer from Blender to Unity to product custom block shapes
    - Automatically determines triangles to cull based on vertex positions
    - just means when two blocks are placed together it will not draw inner hidden triangles
    - Quite a few new block shapes
    - Thin blocks, smaller cylinders, stairs, roofing pieces, fences, etc
    - Going to add just enough models to make decent variety, though the impulse to keep making them
    - Structural integrity of blocks works between multiple texture types
    - Texture determines max strength: Brick > Cobble > Wood

    Updated Animation System

    - Still using older animation system, but animations have been updated for
    - Attacking directions based on click, drag, release -> resulting direction is attack direction
    - Charging up that increases animation speed
    - Blocking animation
    - Smoother blending

    There are tons of other elements that have been changed and updated. I moved to RTP for terrain texturing, which is amazing. Tons of code optimization and other boring stuff.



     

    Attached Files:

    Last edited: Feb 22, 2018