Recommended code/file arrangement for offline workflow

I want to develop my apps offline due to performance reasons. I wonder what would be the best approach. So far I tested 2 of them.
Approach 1. I start a basic project in online editor and then download it and use as a template. The good side is that scripts are arranged in separate files and seems that the project would be easier to mantain. However, it is very difficult to manipulate entities and so on. In general it’s not easy for me to build upon this basic template. Probably the solution would be to have all my assets in place before downoloading it but that’s rather impossible. I rarely know when I start what the game will look like at the end.
Approach 2. I download the latest release of engine from github and build from the scratch. It’s basically similar to this example: Github example. The good side is that I have a better understanding of what really happens behind the scenes. The downside is that it’s far more difficult to arrange the code into separate files. I fear that it will be hard to maintain a clean and modular code in this way.

At the moment I’m testing a 3rd approach. Namely I build a project from a scratch (like in Approach 2) but I use a modular prototype-based code arrangement (like in Approach 1) . So far I don’t know whether it is any good because I cannot get my project running :grin:

Do you have any advices here. What is the best practice or what worked for you personally?

If you work off-tools, then I would recommend few things:

  1. Think how you going to store and load assets. Work with pc.Asset and pc.AssetRegistry to make your life easier.
  2. Think how you going to express scripts, and do scripting. Currently each script has to be defined as separate .js files, there is currently work going on, that would remove such restriction and would allow to organise scripts in any way you want.
  3. Think how you going to store, generate, load the scene data, is it in db, or procedural out of some meta data, or stored in json similar to what you get when you export project, and so on.

It is basically up to you to experiment what works and what not for you. I wouldn’t go Approach 1, as it is meant more to be suitable for Editor workflow.

1 Like