I am trying to build for myself something like a personal Scrivener. Scrivener | Literature & Latte But much less complex (no text formatting for now for example to avoid those annoying underlying text formatting tags that have corrupt .doc files all the times).
Basically, it will be a simple text editor with tabs, auto-saves and back-up copies for self-usage.
Main priority is SECURITY. Ensuring information does not get corrupted, gets saved multiple times, etc.
Back at Uni 3 years ago, I made a C# calculator using Windows forms in Visual Studio. Haven’t used VS since then.
Would you say I should rather try going back to Visual Studio, expand on my knowledge and make it in on there, or make it with Unity which I know how to use better than VS (but am still terrible at :p) even if it means making use of its libraries/dependencies?
Unity is ideal when you need real time interaction. If your application needs to refresh its output at a reasonably fast pace normally found in games or if it needs to have an interface that is graphically heavy then you may want to consider Unity.
On the other hand Unity is heavier on resources and will drain battery life for mobile targets much more quickly.
@Frpmta It sounds like you’re looking for something like Google Docs If data loss is your biggest concern then you shouldn’t blindly trust that your HDD or SSD will live forever - store your data in the cloud and it will be safe and it will last forever
Thanks @Ryiah for mentioning Si3! @Frpmta writing a serious text editor (even a simple one) is not an easy task and it’s uncomparable more complex than writing a calculator application! I have written a calculator for Unity in around 100 lines of code, and just as an example for comparison, Script Inspector 3 currently counts almost 50K lines of code! Sure, you can take some shortcuts and use Unity’s TextArea and maybe take advantage of tabs in the editor or even the built-in undo/redo system, but trust me, these all come with very limited capabilities and sooner or later you’ll run into something that has no solution unless you rewrite all of that functionality yourself… If you want to try making this only to learn something new and unusual then yes, go for it! But if you want to have something more useful at the end then it’s better to try doing that with Windows Forms… Or just go with Google Docs you’ll save yourself a lot of time!
That’s exactly what I’m asking: I know nothing about VS other than basic Windows Form to build a Calculator, but I know my way around Unity UI and everything Unity documentation overall.
Say, Is there a way to say implement the typical menus:
In an Unity made app?
It is pretty easy in Windows Form.
And would Unity take long saving <1MB text documents? [Word 2013 is so slow at saving after 50 pages even with no formatting.]
I like Google Docs, but that’s exactly my problem:
I have TOOOOOOOOOOOOOOOOOOONS of docs that need to be organized in something say like a Wiki, but Wiki engines do not feature auto-save, are often in web browsers which go around crashing all the time and overall, moving around between different Wiki pages takes more time than I would like it to.
That’s why I linked to Scrivener: I actually want to organize my information.
So, when you @Flipbookee say “But if you want to have something more useful at the end then it’s better to try doing that with Windows Forms”, can you explain exactly what benefits are offered by Windows Form and what makes Unity a bad choice?
And I will be using Visual Studio for scripting when it replaces Monodevelop.
And it is futile to stop me. The more I think in this idea, the more and more I am convinced to go for it.
Why not create the document in Google Docs and then copy it over to your Wiki once it is completed? Or alternatively you could use the Clientside Drafts extension with MediaWiki. It adds support for auto-saving.
I’m not an expert in Windows Forms - it’s been long time since I used that last time, but I believe it’s a better choice for what you want to do. At least you’ll have a ready to use text edit control, something similar to Unity’s TextArea (assuming you planned to go with immediate mode GUI in Unity). Text rendering in Unity’s IMGUI is limited to 16384 characters, so TextArea will serve you well up until you reach that limit, but then you’ll have to reimplement it. You’ll probably want to reimplement it even earlier for performance reasons - TextArea doesn’t render only the visible text in its scroll view but the whole text string at once. Also, once this text string grows more than a few lines, editing it will great tons of garbage since strings in .Net are immutable objects. The garbage is not always that much of an issue - allocating memory is sometimes even more expensive.
So yeah, once you opt out for making your own implementation of the TextArea there’s a whole new set of challenges to deal with! Not only for rendering but also keyboard and mouse handling. Only adding a cursor that can move inside the text control could be a challenge, maybe not that much if that’s limited to only simple arrow keys, but I think that will not be enough. You’ll want to move the cursor word-by-word too, and by clicking the mouse too. Then you have to be able to select it with Shift and arrow keys and with mouse too as a minimum, but if you want something a little closer to modern text editing controls then you’ll have to be able to mouse-drag selection to move text around, right? Or select word by double-click. Or maybe even select multiple words by double-click and drag, etc… Word-wrap maybe? Hehe, good luck with that it sounds simple, but trust me, it isn’t… Oh, maybe you’ll also want to be able to undo/redo changes? Guess what, you can’t use Unity undo system for that even if you make this work as an editor extension! You’ll have to implement your own undo system as well…
Anyway, all that’s doable but it will take you a lot of time to do that in Unity, while in Windows Forms you get it for free. On the other hand, Unity gives you multiplatform-ness for free, but I don’t think that’s your goal… If I was you I would just spend $44 to buy Scrivener
Unity is many things. But a document management system it is not. This is not the usual trying to fit a round peg into a square hole. This is trying to power a lamp by plugging it into your cat. Technically possible, but it would require major rework to the point that it would hardly be recognisable as a cat.
Unity shines where one of the following is true
You need real time interaction
You need high fidelity graphics
You need Unity’s multiplatform capacities
Your use case has none of these. It would do the job worse then any existing doc management system.
Why not use scrivener or ywriter or some other existing solution for the front end. And use server based version control on the back end?
wish Unity was capable of the common formatting in word documents and html in UI text boxes and etc. …
youd have to make it all UI elements and stuff… basically make your own, nothing like that is built in to Unity (which seems kinda odd actually… i mean, old PC games Always (well alot of em) had that on the top or in the game… but yeah idk how old PC games were made lol … i mean like uh… 1998ish?)
I had an idea kinda sorta not really like your idea … as I desired formatting, I have to read in HTML files… and convert .doc to Html (not hard libreoffice does it) … eh i cant remember exactly all i did with it lol i put it on hold after just a couple days messing around looking for solutions to problems