Project: More Saves, ModSaves

Show off your mod creations or just a work in progress.
Post Reply
Eric
Posts: 7
Joined: Sun Mar 22, 2015 9:49 am

Project: More Saves, ModSaves

Post by Eric »

So, I'm pretty new to Unity and C# (java is my "motherlanguage"), and I never "published" code before, so the following will seem very bad programmed :D I've created this not as a solution but more as something that should start discussion about the topic saves. Interkarma said that he will bring up the feature very soon and thiswhile I think it is nessesary to talk about saving, loading and a way for Developers to save stuff for their mods, too.

Lets start with a screenshot:

Image


So I created a simple tool that allows you to have more then 6 save files, and also little modsave support (it is possible for a mod to save strings). Since I dont know how Interkarma plans to implements saves, I tried to make it as generic as possible and even crossplatform (Windows, Android, iOS, Mac) but I'm not sure if the ziputil I use supports Linux by now.

ZipUtil? Yeah, you readed right. The thing I'm basicly doing is that I zip every save into a custom save directory and then unzip it into the Daggerfall save directory structure (with SAVE0 ... SAVE5) if needed. This is NOT an UI mod, just something to copy/zip data. Why using zips at all? I'm dreaming of implement crossplatform cloud save one day (one day after we agreed on how saving will work^^) and having one file instead of many is very helpful then.

The usage is really very simple (from my point of view, but maybe for skilled programmers its not that intuitiv :lol: ).

First set up a correcct DAGGERFALL_SAVE path in SaveLoadManager. It dont has to be your original Daggerfall save path, just a folder with read/write permissions. If its your original Daggerfall save folder, make sure you backup your saves first!
If there are no saves in CUSTOM_SAVE folder (which will most likly be the case if you start the tool for the first time) the tool will genereate some sample saves...

You need to add 3 buttons to the menu (additional to the standart Load/Save and Cancle button), namely "Delete", "Next Page" and "Pervouis Page". Once you want to show your loading UI you need to cale SaveLoadManager.Show(bool) BEFORE you show your UI. "bool" is ture if you are going to show the load menu, false otherwise. Your "Delete","Pervoius Page" and "Next Page" buttons just forward to the methdes in the SaveLoadManager, (for delete you need to provide an index) but you need to reload your UI afterwards, because these methodes copy the next/pervoius saves into the plain SAVE0 .... SAVE5 structure.

I'm not sure if my explanation is good, as said I'm doing this for the first time. Please take a look into the code, maybe things get clearer then (even if the code is not very good documentated as well :? )

There is also an exaple UI there, but since I havend figured out how to do propper UI sacaling jet, try to match the 595x372 resolution :D

I'm glad for every feedback/critic/etc...

Oh and something very importent: I havent testet the modsave feature enought yet I guess, but I'm in a hurry right now, but want to share this before I leave for holiday (since I'm not sure if I got internet connection there :D )

So finally, here is the Unity project folder:
https://www.dropbox.com/s/0czx4176vr3hb ... d.zip?dl=0

User avatar
Interkarma
Posts: 7242
Joined: Sun Mar 22, 2015 1:51 am

Re: Project: More Saves, ModSaves

Post by Interkarma »

Cool! Great work Eric. I've download your project to take a look. :)

From my end, I'm only planning on simple Unity save/load as part of the demo classes (basically a starting point), so any efforts you've made here are definitely useful. In fact, it could form the basis of a more complete Unity save/load system all DFTFU developers might benefit from.

I'm also creating a Daggerfall-native runtime UI as part of the demo namespace. Again, this will be for simplicity only and will function more-or-less exactly like Daggerfall's UI. You can see it parsing real Daggerfall saves in Unity in this tweet. That's about all I can show now, I'm still working on all this as part of the 1.4 update.

User avatar
LypyL
Posts: 512
Joined: Sun Mar 22, 2015 3:48 am

Re: Project: More Saves, ModSaves

Post by LypyL »

Exciting stuff! I love the direction DFTFU is heading! :D
There is also an exaple UI there, but since I havend figured out how to do propper UI sacaling jet, try to match the 595x372 resolution :D
It is a bit of a pain, I always find myself fighting with that myself. Some simple advice:

1. Set your canvas UI scale mode to scale with screen size and adjust the reference resolution and screen match mode how you want it.

2. Put stuff inside of panels, rather than just all together.

3. Use Layout components - (layout element, content size fitter, layout groups etc.) These will do most of the work for you!

4. Finally, and maybe the most difficult to understand, set the anchor / pivot points appropriately.

http://docs.unity3d.com/Manual/UIBasicLayout.html

Post Reply