Can I create a help system using local html files?

Can I create a help system using either a Windows Helpfile or local HTML files? I noticed that Application.OpenUrl() can be used to open a web browser, but not with local files. I also looked at Webview but it doesn’t support Windows, and I’d like to try to ship a Windows Version of my game because I want to gauge user reaction to it, and then estimate the value in spending more time on it–shipping it to other platforms.

Thank you,
Rosco-y

what are the other platforms? (because it might be much more difficult there)

in windows you can do pretty much anything, like launcher default viewer (browser) for .html file (with process.start)

3 Likes

Thank you very much for your prompt reply! I will give it a work-out!

If I’m encouraged to continue with my game project, I’d like to also publish it on Android and IOS.

that’s where it gets more interesting, especially ios… :slight_smile:

i’d probably try opening file into some webview then. (asset store has some webview plugins,
or this free one https://github.com/gree/unity-webview

but haven’t used those, so check if they can view local files…
other problem is that if you have multiple html files (it probably cannot open local hyperlinks then?)

planB could be converting your guide into single pdf file, and view that.

1 Like

You are right, Process.Start([path to HTML file]) works great for me.

I do have one more question though: I don’t know where I should put the root of my helpfile directory structure in my Assets folder so that I can access via something like:

if(Input.GetKey(KeyCode.F1))
{
     Process.Start("HELP/index.html");
    // instead of
    Process.Start("C:\\PROJECTS\\SUDO_LTS\\SUDO_LTS\\Assets\\HELP\\index.html");
    // which is currently what I'm doing.
}

Right now it’s working with an absolute path to my help files, which is OK for making development progress, but I need a deliverable solution.

Thank you again for turning me on to “Process.Start” :slight_smile:
Rosco-y

PDF is another possibility that I haven’t considered.

It would have a huge advantage because everything could be in a single file. I also thought a Windows help file could be a good option, as it can be done in a single file. But I haven’t messed with windows helpfiles in almost 20 years, and I don’t relish the thought of re-opening that can of worms.

In honesty I’d have confess I’ve never been proficient with HTML, but it’s coming along slowly with my nose constantly snorting the w3schools website. I think it’s coming along well, but it has problems that I don’t have answers to:

I can access the HTML files in Application.persistantDataPath, but I’m just starting to write the help files and I already have 13 files I need to place there (including image files.) I don’t know how to dynamically place them there on user installations. I wonder if I could place them as resource files in the Assets folders, and then do a one-time move files to Application.persistantDataPath on system startup (maybe the copy files could be done the first time the user asks for them, so opening the game the first time wouldn’t be an exercise in waiting for something to happen.)

Rosco-y

you can use relative paths too (but note it might be different in Editor and in Build, so need to use #if unity_editor stuff)
or those regular Application.* paths.

if its for desktop, then StreamingAssets/ folder is pretty useful. (it gets copied with the build, as regular folder, so can do anything with the files easily).

2 Likes

What kind of app / game do you make which requires (external) help files?

Most players these days are “lazy” they will not read external help files, they want ingame tutorials with pop ups and step by step lessons which tell them exactly what to do.

But if you really want to go this route, then I would highly suggest to show these files directly in the app, like the other person also mentioned

2 Likes

Thank you. I will take another look at the StreamingAssets folder, I believe that may be very useful for me.

rosco-y

Thank you for your constructive criticism–it has given me something to think about.

Cheers, rosco-y

After thinking about it for a while, I realize you are right. I’ve trimmed down my help-file writing effort and now my help files have only 5 pages and resemble the “simply show the user how to do things” approach.

My game is a Sudoku variant, and I was starting to write a book (in HTML) on “how to solve Sudoku puzzles.” There are no doubt hundreds of books with nearly that same title. I like to write, but I need a paycheck–if I ever solve that problem, maybe I can afford the luxury of writing books.

Thank you again, kind friend, I really appreciate your advice!

Rosco-y

if its “simple” casual game, i definitely wouldn’t want to read multiple pages…: )

is there any way you can explain it with few paragraphs / images or gifs (embedded in the game help panel itself?)
or having simple tutorial level that guides you 1-click at a time…

for example check Clash Royale game,
it has quite good tutorial for new user… (but also annoying that it cannot be skipped if you already know it)

1 Like

Note that Unity’s UI Toolkit has the concept of UXML files which are somewhat similar to html files but create UI elements that Unity can directly handle. I never build anything complex with the new UI Toolkit, but as it’s quite similar and also has a somewhat equivalent concept of CSS files (called USS), the overall approach should be very similar. In addition UIToolkit can incorporate other Unity related things which actually breaks down certain boundaries which should result in a better user experience.

Unity also included an UI Builder right in the editor. It’s certainly not the best WYSIWYG editor, but it may help to setup the content.

1 Like

I spent three months with it for a card game before eventually ripping everything out for UGUI. It doesn’t scale very well at all. If you’re just planning on using it for static pages it should work but if you need to bulk change elements at runtime you’re going to hate it. We were measuring seconds to rearrange cards when clicking a sort button.

Are you talking about a different Webview than the one on the Asset Store?

https://assetstore.unity.com/packages/tools/gui/3d-webview-for-windows-and-macos-web-browser-154144

1 Like

I think UIToolkit is a great improvement over UGUI, but, in my opinion, both UI Toolkit and UIGUI are Unwieldy compared to writing raw HTML and CSS. My exposure to HTML and CSS has been minimal, so I’m enjoying learning HTML and CSS, which will be handy in my future use of UIToolkit, which I have used to create my in-game GUI content. (I have a “floating” user Input number pad and a “static” status bar that I maintain using UIDocument, and this works very well.)

Thanks!

Rosco-y

1 Like

I agree with you–although UGUI must have solved some significant problems for the UNITY team, I struggled with it repeatedly while looking for alternatives. UIToolkit feels like a big step in the right direction: Writing and hooking up to c# is intuitive, but I find it’s cleaner to write static help files in raw HTML and CSS. I also think VS Code’s “Live Preview” makes learning HTML and CSS fun and interactive.

Thank You!

Rosco-y

Unfortunately I have to agree with you :slight_smile:
Though the main reason why HTML seems to be easier is that it is a lot less strict and dynamix as most parsers are the most forgiving pieces of software ever written. Which is probably one of the reasons why most HTML parsers / renderers are kinda huge. This of course has historical reasons as HTML is based on SGML which allows some crazy omissions.

1 Like

No, I haven’t tried the one in the Asset Store. I’m not sure anymore, but I think I was glomming onto code snippets I’d found on the web and ran into problems, and the compiler feedback led me to think it would work in non-windows platforms, but not in Windows. It’s not clear to me now. Looking at the Webview package in the Asset Store makes me think that it might have been a good solution for me, and maybe I did look at it, but I’m operating on a shoestring here and I’m very cost-sensitive–that may be why I didn’t try it in the first place.

Thanks!

Rosco-y