Search Unity

[RELEASED] Survival Engine - Complete Project Template for Survival Games

Discussion in 'Assets and Asset Store' started by IndieMarc, Sep 18, 2020.

  1. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    You're right! Thank you for reporting, the rotation is a new feature so i think i forgot to save it in the file.
    Will be fixed in 1.06, hopefully next week.
     
  2. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    258
    I mean as an easy building system (Integration)
    and firearms would be great
     
  3. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Firearms should work already, just add your own shoot animation, and firearm model, and use exactly the same script than the bow, slingshot, or nut-gun.
     
  4. RadioactiveBullfrog

    RadioactiveBullfrog

    Joined:
    Jul 8, 2017
    Posts:
    55
    Something that might be really helpful is if you were to add integrations with other popular assets as opposed to reinventing the wheel and writing your own way of doing things as part of this asset.

    For example, EBS, HAP, Quests and Dialogues from Pixel Crushers, and so on.

    This wouldn't work for everything, but it might be a good way to give people some of the features they are wanting without you having to do everything yourself.
     
    Adrad and IndieMarc like this.
  5. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Hey thanks for the suggestions. The maker of Emerald AI already said he would add integration for Survival Engine, so I probably won't develop any advanced AI.

    For dialogues system, I already planned to take my 2D dialogue system asset, and make it work for 3D and update it (because its a bit old), in a new asset package that will be compatible with Survival Engine. And also probably add features to it like quests.

    For other assets I will see which would be worth to integrate. I will have look at them and also see if other people ask for any specific integrations!
     
    Last edited: Oct 20, 2020
  6. Tegleg

    Tegleg

    Joined:
    Jun 10, 2013
    Posts:
    79
    this is a great asset. thanks for the tutorials and the updates!
    i second the request for EBS if you feel the need.
     
  7. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    In the case of EBS, since building is such a core component of the asset, I think it would be much simpler to just improve the build systen instead of having two different possible systems that would complicate the code and conflict each other.

    Which part of EBS do you think is important or missing from the current asset? Can you explain a bit how the build system could be improved.?

    Im fine with adding integrations, but I would do mostly if they can be easily integrate and not completely replacing a core system. Things like AI, mobile features, cinematic tool, animations system, would fit better this category. For example HAP or Emerald AI seems better candidates. (No garantee yet though, i have other priorities on my list for this asset, but I will consider integrations eventually ).

    But I really doubt I will add integration to replace the core systems like building, I would prefer to improve it instead. Let me know how i can improve it for your case because I don't really know ebs. Are you making top down or tps?
    Thank you.
     
    Last edited: Oct 20, 2020
    SpyrosUn and L82093 like this.
  8. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    New in Version 1.06!

    1.06 is mostly bug fix and code restructuring, to make it easier to use the code and make it more consistant across scripts. Here is what is new:

    Plants placement
    -When sowing seeds, plants can now manually be placed on the floor in the same way constructions work
    -New script Buildable.cs that manages the placement of Constructions and Plants

    Ranged Weapon update
    -New property to shoot multiple bullets at once when attacking, if you set "strike_per_attack" to 2, that means you will shoot 2 bullets per animation.
    -The new nutgun is now shooting 2 bullets per attack to demo this feature.

    Tree growth
    -A new prefab in the plant folder to show an example on how to make tree grow back
    -New property on plants 'regrow_on_death' means that the plant will go back to stage 1 on death instead of being destroyed

    Selectable Surfaces
    -Selectable surfaces are objects that can be interacted anywhere along the collider, instead of interacting only at the pivot point.
    -This makes it possible to drink anywhere on the river or pond, instead of drinking just at specific spots.

    Various bug fix and improvements:
    -Fix TPS camera to work with a button hold instead of toggle
    -Animal code cleanup to give it orders more easily
    -Fix Fish shader
    -Made Beehive honey limited, using the ItemProvider
    -Fix building rotation so that the rotation is saved in the save file
    -Fix melee attack with ranged weapon, before it was doing full weapon damage when you have no bullet, now if no bullet it will do damage as if you have no weapon.
    -Restructured code and added multiple functions to make it easier to call specific actions in the code (ex: function to Harvest a plant, function to craft a CraftData, ex)

    Note: If you experience runtime issue updating from a previous version. This may be because you need to add the new script Buildable.cs on Plants and Constructions prefab.
    You can do this automatically by runing the new tool: Tools->Fix Project Version
     
  9. psy89

    psy89

    Joined:
    Apr 2, 2018
    Posts:
    5
    Hi there,

    I love your asset! Very clean, very smooth - just awesome :).

    I have a small question: Is it possible to easily integrate an auto save system every x minutes?
     
    ArtemX1 and IndieMarc like this.
  10. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Sure, you can do that easily by calling the Save() function from PlayerData, every x seconds in C#. You could have a timer that is updated every frame and reset to 0 when reach a value, then Save().
     
  11. Tegleg

    Tegleg

    Joined:
    Jun 10, 2013
    Posts:
    79
    yes i completely understand.

    its the modular nature of EBS. rather than a tent or a hut ready made you would craft foundations, walls, roof etc and build to your own design. anything from a single room cabin to a sprawling mansion.

    on a similar note, how about beds?
    when you sleep now you just lay on the floor outside the building which is a bit odd.

    i got this for a future project so have not really played with it much.
    anyway, you do whatever you want with your asset, its great.
     
    IndieMarc likes this.
  12. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    I'm thinking of adding new thing to the build system, you'd have 3 ways of building (you set which for each prefab), first is the current one just on the floor, second youd be able to place it anywhere, even on a wall or on top of existing buildings, and third one would be grid based.

    May not be as advanced as ebs but will probably allow much more possibilities than currently.
     
  13. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Can you please add a mount? Riding a horse or something? :D
     
    BioStudio58 and IndieMarc like this.
  14. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Its not planned at the moment, i need to focus on progression systems and the map first. And also improving build system.
     
    mcstuber, SpyrosUn, EN_Games and 2 others like this.
  15. Glock113

    Glock113

    Joined:
    Sep 6, 2013
    Posts:
    14
    Adding snapping points to a buildable would be good. That way you could add floors and walls that would snap together when trying to build them. Just a thought for the building system that would make it more versatile like EBS
     
    IndieMarc likes this.
  16. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    144
    Bear in mind that there already exist great solutions for that in the store.
     
    BioStudio58 and IndieMarc like this.
  17. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    Can you please add a npc seller and fall damage?:)
     
    Last edited: Oct 29, 2020
  18. Mr-Martino

    Mr-Martino

    Joined:
    Dec 6, 2017
    Posts:
    1
    Been currently trying to make an Inventory UI and have original Inventory UI as a hotbar.. Can't seem to figure it out. Any Suggestions?

    Thanks
     
    IndieMarc likes this.
  19. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    The UI should be easy to edit, you have the UI prefab in Prefabs/UI.
    You could add the UIPanel script to the inventory bar (its under gameplay ui) and then have it Show() when you click on the toggle.
    If you have more questions about this, maybe ask on discord so its easier to reply and we dont make a long thread about it here. And let me know if you figure out.
     
    Last edited: Nov 1, 2020
    Mr-Martino and BioStudio58 like this.
  20. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    Marc can you please add purchase and sale system?
     
  21. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Just created a new tutorial (onboarding), this one is more an introduction of all the basic concepts, and doesn't really go into details.

     
  22. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    when will the update come out???
     
  23. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Any specific features you are waiting for?
     
  24. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    I will be glad to any update!!!))
    but most importantly, I'm waiting for a grid building system and a trading system with npc
     
    Last edited: Nov 8, 2020
  25. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    There should be one upgrade really soon, but it wont have npc trading. I will see if i can include grid build.
     
  26. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    Marc, Thanks for the asset!!!
     
  27. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    144
    Biomes ! :D
     
    RadioactiveBullfrog likes this.
  28. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    What do you mean by "biomes"? It's not really in the planned list at the moment. But you could have your own biomes by just putting different kind of objects in different areas of the map? When you create your map.
     
    Last edited: Nov 9, 2020
  29. SpyrosUn

    SpyrosUn

    Joined:
    Nov 20, 2016
    Posts:
    144
    I am basically referring to map generation really. Think about it like don't starve. Separated map locations, let's say a snowy terrain or a volcano type terrain where different mobs reside. It could include a spawner too for generating trees/mobs/items on the ground etc. Based on a seed generator would make sense too.
     
  30. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Yes for the map gen youll be able to have different zones that spawn different kind of objects, provided that you have your own models that fit that specific zone.
     
    Glock113 likes this.
  31. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    Hi Mark! Will there be a cooldown for crafting in the future? For example for a cooking fire or a workbench. Very necessary please !!! Thanks!!!
     
  32. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Thats a good idea, will check if I have time to add this in a future version.
     
  33. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Scene generated with my new world generator system (coming in 1.07)

    WorldGen.png
     
    SpyrosUn likes this.
  34. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    Thanks for the answer!
     
  35. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    Looks very cool!:)
     
  36. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    New in Version 1.07

    World Generator
    -Can generate random maps
    -Editor mode: create a world in the editor and save it as a scene
    -Runtime mode: create a random map everytime you start a new game.
    -World generated will be saved in the save file.
    -Biomes allow you to define zones that spawn different types of items

    Character script
    -Generic character script to code your own npc, pets, allies
    -Wild animals now use this script for movement and attacking
    -Call functions like MoveTo or Attack, to give it orders
    -Is a craftable type like Items, Constructions and Plants
    -Can be created with Character.Create()
    -Position saved in the save file

    Dog Pet
    -Uses the character script
    -Will follow the player
    -Can attack enemies
    -Can dig at dig spots

    Learn Crafting Recipes
    -You can now have the player learn crafting recipes with items (like scroll, book...).
    -Set 'craftable' param to off on the recipe to learn, then add the Learn Action to another item (like a scroll) to learn that recipe.

    Improved Build system
    -Mode: floor or anywhere (floor is like before, anywhere allow to build on top of other things)
    -New flag item to demo the new "anywhere" mode.
    -Set a layer mask to determine on which type of floor it can be built
    -Grid mode: if on, construction will snap to a grid when being built, grid size can be changed

    Destructible Update
    -Attack group: Can be set to Ally, Enemy, Neutral, or Cant Attack, this will determine who is able to attack this destructible. (replaces the 'attack_by_default' param).
    -HP now saved in the save file

    Hammer
    New item, when equipped the character can destroy built constructions

    Other small updates
    -Jumping on the player character (off by default, need to be turned on)
    -Chest will drop items they contain when destroyed
    -Wild animals can now attack other wild animals, unless they belong to same groups
    -Wild animals can now attack constructions and pets
    -Script to make objects transparent when you are behind them (not applied to any object by default)
    -New tool to duplicate a prefab (and all its data files) in the tools menu.
    -Exit zones, a zone you put on the map that allow you to change scene.
    -Items will snap to the group when spawned in the air (instead of floating like before).

    Note: if update from a previous version and you added or edited animals, make sure to run Survival Engine -> Fix project version, to add the Character script automatically to animal prefabs.
     
  37. Andrew203

    Andrew203

    Joined:
    Apr 23, 2018
    Posts:
    43
    Hey, could you please tell me, is integrity kept between scenes ? im asking because its pretty bad for performance on mobile to keep one big map and wanted to buy your asset, so is it possible to switch between scenes and keep progress on all scenes ? For example buildings.

     
  38. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Sure you can have multiple scenes. And there are Exit Zones to go between them. Objects are saved by scene so they should be saved in the correct scene.

    The world generator put everything in one scene though, but you could use the editor mode to generate smaller ones and save them in separate scenes.

    Edit: also when i profile performance, most of the calculations are from the graphic card, and not the script, so it could be improved by removing real time shadows or changing lighting settings. Load time is the one thing that could be slower on bigger maps though.
     
    MorpheusXI likes this.
  39. storkych

    storkych

    Joined:
    May 10, 2020
    Posts:
    10
    Hi Mark. Why don't you use terrain for the floor? The boundaries of the biomes would look much better I think.
    Please add saving slots if possible)
     
    Last edited: Nov 18, 2020
  40. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Maybe ill add terrain in a future version will see if possible, but i want to finish other features first.
    Save slots should work with your own ui, you can choose filename in script when you create new game or load, so you could call it slot1, slot2....
     
    Last edited: Nov 18, 2020
  41. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    Hi Mark, is there any way to set up walking on slopes and stairs as in character controller ???
     
  42. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Hi, im not sure about character controller, but I know some used a smooth collider (box/plane) on top of stairs to help make the slope more smooth. Or is there an issue? I'm not sure what you are trying to do.
     
  43. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    there are times when the character is too heavy and slowly climbs on small slopes and he always climbs too steep slopes
     
  44. Bagdat94

    Bagdat94

    Joined:
    Dec 26, 2019
    Posts:
    11
    mark, what features will you now work on the next update ???
     
  45. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Will check if I can improve the slope movement in next update, the next update will probably be about the map and/or integration with some 3rd party asset.
     
    Glock113 and SpyrosUn like this.
  46. storkych

    storkych

    Joined:
    May 10, 2020
    Posts:
    10
    Hi. Can you please fix the construction on the grid in a certain direction? (if you turn the camera and build on the diagonal of the grid, the buildings do not match each other)
    I recently wrote about the terrain. There is such a problem. Buildings can't be placed on the terrain if they have a Collider, and such structures can't be placed on top of each other (as an example: I can't put a chest on the floor of a building)
    I Would be very grateful if you decide to do this.
    Thank you for a great asset!)
     
  47. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    Hi, I will fix the grid on rotation.

    About the other questions you can fix in the Buildable properties, if you put it to Anywhere it doesnt need to be on the floor and you can build on top of other things. Make sure that the obstacles layer mask dont prevent you from building there too.

    Building can he placed on Unity terrain if you set the terrain layer to Floor because the PlayerControlsMouse script need to know what is the floor to detect where you click.
     
  48. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183

    Here is the fixed buildable script for the grid.
     

    Attached Files:

    storkych, BioStudio58 and Glock113 like this.
  49. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    New in 1.08

    A lot of scripts have been changed in 1.08, so make sure to do a backup before updating. Once you managed to merge with your project and there are no compile errors, run SurvivalEngine->FixProjectVersion to update the data in the prefabs for version compatiblity.

    Integration with other Unity Assets
    -Integration with 2 other Unity assets.
    -InControl by Gallant Games, for gamepad support
    -Dialogue and Quests by Indie Marc, to create your own events/dialogues/quests. (Pending Unity Approval)


    Build System Update
    -You can define on which type of floor each building can be built on.
    -Its possible to build things on top of each other and create bigger structures (see new video)
    -Grid mode now rotates by increments of 90 degrees
    -Detects valid build spot better and more flexible parameters
    -Much better controls on mobile: now while holding the finger you can position the building and it will only build when you release it.


    Various other updates
    -Helper functions in TheGame for load/save/newgame
    -Rework save system to be able to save/load any custom class
    -Spawner that you can place on the map to respawn animals or other
    -Climbing slopes feels much better, there are no more friction.
    -PlayerCharacter script has been split into multiple scripts (popular demand)
    -UI scripts have been reworked for clarity.
    -Fix the trap that could trigger while in build mode
    -Escape animals (birds, rabbits, ...) will now also escape from agressive animals (bear, wolves...)
    -AddFuel and Cook actions can now also be performed from the action selector (to make them possible with gamepad)
    -Its now possible to rotate the camera on mobile (with 2 fingers)


    Christmas Bonus!

    Christmas.png
     
    DarrenBrnt, ArtemX1, SpyrosUn and 2 others like this.
  50. IndieMarc

    IndieMarc

    Joined:
    Jan 16, 2017
    Posts:
    183
    We had a discussion on Discord and also a vote. Just wanted to say that we changed a bit the planned list.
    Instead of having the map feature directly in the engine, i've replaced that in the planned list by other things like backpack, craft station, building requirements (and possibly more). And the map would be another asset integration instead.

    I wanted to make a map asset anyway, that is a bit more complex and that works with other things, not just survival engine. This would allow me to add more feature for the map like fog of war in unexplored areas, custom markers, and a way to auto generate the map art. And I would add integration for that asset with Survival Engine. People on Discord seemed to like the idea, I just want to mention it here too!

    And don't worry my plan is not to make tons of add-on. Anything that is directly related to core gameplay I want to keep it directly in the main asset (crafting, building, inventory, survival mechanics). This is a special case for the map because I can see it work with other games too (not just the ones using survival engine), the way I imagine it. And also the fact that since its all in a separate panel (could be a map panel that you open, or a minimap in the corner), it would be really easy to integrate. And I've added so much too on the planned list for survival engine since release. Much more than I was supposed to! (At launch there was just world gen and map on the plan list, but I had no idea of all the feature requests I would get).

    Anyway, I hope you like this plan too!
     
    Last edited: Dec 1, 2020