3D Roguelike and Terrain Questions...

Hello,

I am evaluating Unity after seeing it in Game Developer and so far I must say it seems like a very nice engine for the price! Up to this point I have been using DarkBasic Pro, but I want something I can publish to both Mac and PC.

Anyway, I am thinking of making a simple 3d roguelike as a test project, and I have a few noob questions before I begin:

  1. Can collision be enabled on trees placed in the terrain editor, or is that not practical?

  2. I am assuming that large numbers of buildings on a large terrain would kill performance, especially if they have stuff in them, but also that anything outside of camera range would be less taxing to the engine. Can I have a reasonable number of buildings on a terrain that you can enter without changing to a new scene? Dungeons and stuff would obviously be in separate scenes.

  3. I am wondering where I would put an item database for treasure and other stuff. As I understand it, everything in Unity must be attached to an object, but that objects get destroyed when you leave a scene. I know there is a command to “save” an object from destruction, but I am a little confused about what ultimately happens to the object.

  4. Finally, I am wondering how to save a large-ish gameworld. In games like Nethack and Morrowind, the save file seems to contain every change in the world up to the save point, and I have never figured out how that was done. This kind of save would obviously be necessary for a roguelike game. Besides, I would really like to learn to do this. :slight_smile:

Thanks in advance for any help or advice, and I apologize if this is the wrong forum, I thought the questions might be too general for the Scripting forum.

-Matt

  1. That works fine. If you see no collision in the island demo, thats not how it has to be. We had some trouble with some trees like the palm trees that have multiple trunks. That can be handled with a scipt though.

  2. You can add a bunch of buildings to the terrain. You would render them from far away as very low res and then swap in high resolution models for close up.

  3. Basically you would attach an item screen GUI script to the player. There is a function “DontDestroyOnLoad” that makes an object persist throughout scenes. Basically you want to spawn those objects in a scene that is only loaded once.

  4. You will iterate over every object in a scene and look for a component that has savable data on it, then write that data to a file. Then for loading you would read the data file and recreate the saved state of each object.

Many thanks for the quick reply! In regards to #4, would it be more efficient to add a “saveable” flag to items so that the engine only has to check one variable per item?

Thanks again,
Matt

Loading and saving won’t be slow unless you have giant scenes. How the loader and saver works can be adjusted however you want to, tags, components or whatever else.