More render questions

  1. Can you render a seperate part of the world on top of your current screen? (Like a Minimap)
  2. Can you zoom out the camera in script?
  3. Is 100% transparent sprites still being rendered or just ignored in by renderer?
  4. Can you detect if the game is frozen and reboot it before it crashes?
  5. Can you lower the quality of a draw call? (Make it more pixelated)
  6. When you start the game is is completely black. (Because you have to load the entire game) But can you make it load a loading bar first? (And how do you make it so it tracks the progress?)
2 Likes
  1. Yes, look at @britzl 's split screen render script example https://github.com/britzl/publicexamples/tree/5e3b9ac12df836efeba1a370a9d09434ccfb7f29/examples/camera/camera
  2. Yes, in @britzl 's fixed aspect ratio render script example if you lower or increase the zoom factor it will zoom for example https://github.com/britzl/publicexamples/tree/5e3b9ac12df836efeba1a370a9d09434ccfb7f29/examples/fixed_aspect_ratio
  3. Still rendered unless you give them a material and render predicate which is never used in your render script
  4. https://www.defold.com/ref/crash/
  5. You have some control over quality and accuracy with shader programs
  6. You can set a very small collection as your main collection with small amount of assets and then have it async load your next collections with whatever in it you need, then you can increase progress bar based on callbacks - check out https://www.defold.com/manuals/live-update/
7 Likes

When I posted the question about zoom and minimap, I did not ever think that I whould be able to do it and just abandoned the project. Today I decided to just try it out and thanks to the zoom and splitscreen examples I made a decent looking minimap.

But the question I have is, will it make it framerate drop by half just because it has to render everything twice or dosen’t it have any effect on the framerate at all?

3 Likes

It won’t make framerate drop by half. It will take a lot going on to even begin to reach framerate issues. If you do have a ton of things going on in your game it may have some performance problems but there are still options. What you can do in that case is to, for example, add sprites to your game objects with a custom sprite material that has a unique render predicate which is only drawn in your minimap view . Then you can still have a minimap but only draw the few sprites to show the minimap world, and draw icons instead of the actual ship sprites.

2 Likes

Yup, this is a nice approach. I am using a static texture containing the current world map with icons for the minimap in my game (effectively bypassing having to use the renderer for the job). Just create a routine to calculate the relative positions of ships to your position and synchronize rotation then manage the sprites using a factory :slight_smile: