Sins Mod Database Example

A small program showing the possibility of an online database of mods

http://sinseditor.blacklotushq.com/Other/sinsmoddbex.rar

As the subtitle explains, this is a very small program I made when I came home from work today. It is around 30 lines of my own code. The rest is auto-generated and bound to the database.

 

Basically, it shows how easy it would be to make a working database of all mods and their homepages / descriptions / download links. Obviously, it is just using a local database right now; however, that is easily transferred to a server.

 

I do not feel like developing a full blown program on my own, so I welcome a seasoned programmer to assist me.

However, before I even bother, I want to know if people are seriously interested in such a program.

It seemed as though people were interested in Sins Editor, and thus I spent considerable time designing it.

I released a version 1.0.2, which had some useful features and advantages over regular text editors; however, I received no real feedback, and thus ceased development. I now have the source archived on one of my external harddrives.

 

I hate hate hate hate wasting time on something that won't be used. I don't want to make the same mistake as I did with bothering to make Sins Editor.

 

Would you folks be interested in this or not?

 

Download: http://sinseditor.blacklotushq.com/Other/sinsmoddbex.rar

*Requires: Windows XP or higher and .NET Framework 3.5

*Requires: 2007 Office System Driver: Data Connectivity Components

-Ian

 

15,107 views 18 replies
Reply #1 Top

dont work for me but am running vista or am doing it wrong also i have bin looking for a program to help me mod sins plantets ship and all that but with know luck yet >_>  <_<   (iam a noob when it comes to mods lol).

 

but if someone could make a program to do all that then i whould gladly test it :grin:

Reply #2 Top

Would be great for keeping track of versions. I just don't see anybody jumping on it, though.

I did think that at least the 7DS team would love the Sins Editor...

 

:fox:

Reply #3 Top

neo... did you read what this program does? It just tracks versions and mods. It doesn't help you mod. It probably doesn't work for you because you don't have .net 3.5. I packaged .net 3.5 with sins editor; however, I did not do so with this program, since it is just an example.

 

 KitKun, yeah, I don't think this community is active enough for anyone to care. I will probably not bother with this either.

 

Oh well.

 

-Ian

Reply #4 Top

well this comunauty is active .... in silence mods them self except a few ones barely them selves get enof suport tu survive when they post on this forum i had more suport for the andromeda mod posting on other forum than this one lol

an on the other hand it's not like i didn't wanned to use you'r sins editor

and by the way it seam like my systheme is just allergic to you'r program this one also crash throwing some unhandeled exception

Reply #5 Top

The sins editor is pretty cool.

Pros = extremely organized, very informative, safer for making changes

Cons = much slower to make changes (For example, I recently upped the max research level for tons of researchsubjects... having the files set to open with notepad, I'd double click the file, slide the mouse over the number to be changed, quickly type the new number with my mouse hand, then hit a macro button on my keypad for CTRL-S, Alt-F4 (while moving my mouse hand back to the mouse))   using the sins editor, I could change windows to open files in it too of course, but to make the changes I have to double click the line with the value to be changed, then click the text field, then type my new number, then click ok, then I could save and quit... I use it for files I'm not sure of now, and once I understand the file characteristics well enough, I go back to Notepad

I guess my own interest level in the database app would depend on just what you mean?  Is it just a database for information? (meaning It lists all the mods available, their website, etc...),

or is it more like a database for storage? (meaning it actually holds the mods (as well as descriptions and links to websites), and they can be pulled/stored from it whenever?) I'm assuming the first since you mentioned it would have links to the downloads for those mods.

I'd be more interested in the 2nd, but both would be useful if the app updated its mod information automatically... What exactly did you have in mind (sorry if I'm missing the obvious :( )

 

---edit----

P.S.   Are you by any chance able to make your source available for any of your apps?  I ask because I like to play around with programming a bit, but don't know a whole lot... Having examples to study/dissect is very informative :)

Reply #6 Top

granyte, it throws an exception because you do not have .net 3.5, most likely.

So Sins Editor was slower for making changes? If someone like you had given me that kind of information sooner, I could have switched controls to a datagrid or something and let people direct click and edit things much faster. It is all very easy to do. I chose the current way because I thought it was a safer interface, and that it was easier to use. It is too late now, as I have lost my motivation. I wish someone like you had mentioned that in the main thread a lot earlier, when I was actively working on it, so I could have quickly addressed the usability issue. People need to give feedback on aspects of the program, as I will change it to fit their needs. I was making the program for others, not for myself. I don't even play sins or mod sins at all.

I did notice that of the things you mentioned, sins editor can do most of it nearly as fast or as fast: 

**You can save using ctrl+s and quit using alt+f4 in sins editor as well.

**To save changes to a line you do not have to click OK, you can just press enter. 

There are also areas which sins editor is faster than a regular text editor:

**You can delete an entire line just by pressing del. No highlighting by the mouse required.

**You can insert an entry/value pair by pressing enter. No manually tabbing or spacing required.

**You can delete an entire section just by deleting the parent node. No highlighting of the section required.

**You can have multiple files open at once.

**It will auto-complete what you have to type, quite accurately. If you use the auto-completion, you save quite a bit of time from typing. More so than what you lose from having to double click and press enter.

Make sure you get accustomed to doing it that way, since it speeds up editing. However, I do agree that there are areas where it can be made easier to edit. If this is a complaint that a lot of people share, and THEY MAKE ME AWARE OF IT, I can change the control to a datagridview with a treeview embedded in it (not a completely trivial task, mind you), and thus enable quick editing, without the need for an entry box.

To answer your other question,

It would have been a database that held links to downloads and descriptions as and whatnot. Basically like a thread on a forum with all that kind of information; however, it would be able to be updated by more than just the thread creator. I don't feel like working on the server stuff myself, since I don't know much about server services. I doubt anyone will help, so this project is probably dead before it even really got started.

Calienon, I think my source is too messy to be seen by others, for sins editor.

I can release the database source, if you are interested.

I can also help you understand proper programming practices and the logic, as I was a tutor and teaching assistant in college for my computer science major, as well as a top student.

 

-Ian

Reply #7 Top

i can tell you it's not that i just had to reinstall the .net framework 3.5 a week ago

but i'm actualy repairing my install just to be sure

Reply #8 Top

Maybe there is some sort of runtime I missed or something. You are the only one who has complained of an issue, and I cannot recreate your problem, so I am not sure what is wrong. What exception do you get with this program?

Reply #10 Top

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine

this is what i get this time

Reply #12 Top

I was able to find a component that lets me easily do treeviews and datagridview together, which would make editing in sins editor a bit easier; however, I don't really have an intention of doing anything :(

Reply #13 Top

this was the fix it,s nice but how will it work like all the mod team would be able to edit it ? as long as it's not any kind of nobody who can edit it it would be very nice

or at least much nicer than this forum where we don't even know about a mod who as been done 2 days befor

 

also maybe a "work on sins ver" colum would be nice and "entrenchement or standar" column

 

you should try updating the sins editor wit the componement like that it would be much nicer to use if i can someday use it ...

Reply #14 Top

Well, as I said, it is just a small example.

It would be very easy to add an authorization system where only certain users can modify certain parts of the database. I already have a system like that at my place of work.

 

Reply #15 Top

I really must take back my previous post about sins editor being slower.  I made myself use it exclusively all today, and found that I can many entity files onto it at once for quick editing, then save them all at once :)  Also your tip on using enter instead of clicking has really sped things up too!  Speed is key now as I just downloaded Entrenchment and have to re-edit most of my entity files (seems lots of them added new lines to the files...)

THanks for the source of the db app.  It seems though that I can't load the project as it says it's for a version after mine (I have visual studio 2005).  I can still open up some of the files individually though.

If you could help me a bit with an app idea I have, that would be great.  It took me 5 hours today just to make an app to move the 1066 new .entity files from 2.0 into my organized folder tree... Most of that time was spent trying to figure out how to get threading to work (Delegates were a pain in the but to figure out!), However I finally got it :)

An App I want to make is one that will go through a folder of freshly converted txt .entity files, check to see if I have that file in my "mymoddedfiles" folder tree, and if so; to then open both and check for entries that are in both but with different values.  The reason for this is that I have about 400 changed files between the different races, but all of them have just 1 or 2 tiny changes.   Unfortunately, I can't just overwrite the new files with my old ones because they seem to have added extra entries to many of the files, and mine don't have those. 

This app would preserve the new file and just migrate over my changes.  

Here's what I have ready so far for this.  I have the recursive procedures for checking through the chosen directories and subdirectories for matching file names, and I kind of have the progress bars (I haven't tested the progress bar on anything but a folder with a bunch of files yet... not sure if it will work accurately with subdirectories). What I don't have yet and have very little experience with (just like threading and delegates) is reading through text files programatically....

So if you could point me in the right direction/give tips on the below points, that would be awesome!

1.) what's the best way to load up 2 different txt files for the purpose of stepping through each /newline in the master (new 2.0) file, and then finding that same entry (taking into account it might not exist) in the old file?

2.) having found matching entries in both files (in example, MaxNumResearchLevels or defaultAutoAttackOn), what's the best way to then check what is entered for each? (example defaultAutoAttackOn = FALSE  in old file, but TRUE in new)        Should I just do reads between spaces or something else?

3.)This final question is actually in regards to another app I want to make that should be much easier.  All I want it to do is load up every entity file that starts with "Capital" or "Frigate", then look for the defaultAutoAttackOn line and what it's set to, then set it to false if true..... I'm confident I'll figure out the finding and setting to false part pretty quickly, but I have no Idea whatsoever on how to limit my fileopener routine to only open files based on the beginning of the filename.

If you're able to help me with any of those points, that would be wonderful as I'd be able to use these again and again from patch to patch to quickly reorganize and re-edit.

Thanks again for the sins editor. It's been making the manual re-edit process much more bearable.

Reply #16 Top

Hi, I am glad Sins Editor was useful to someone. Maybe if more people actually gave feedback like you, I would implement the features i had planned for v1.1.0 as well as make editing faster with the datagridview + treeview combination component.

As for opening the database project, you need Microsoft VS2008.

To answer your questions:

 

1) You should open the old file and read it in its entirety into a dictionary, where the keys are the entries, and the values are the values (false,true,etc). You should then open the v2.0 and go through each line, doing a ContainsKey on the old file for everything before the first space in a line. If it does contain the key, then you can get what is after the space, the value. You can compare this value to your new value in the 2.0 file.

Doing it this way will take roughly x + n operations. x is the size of the 2.0 file, n is the size of the old file. This is not including the actual stream operations on the file.

Doing it through a standard looping of both files will take roughly x*n operations.

You would get a large performance boost to do it in the x + n manner.

 

2) The basic format seems to be <tabs>entry value. There are never any spaces in the entry field, just tabs, thus you can do something like this:

line = line->Replace(<tab>, ""); // <tab> should be replaced with an actual tab. The editor for this forum doesn't let me use tabs.

int idx = line->IndexOf(" ");

if (idx >= 0) {

entry = line->Substring(0, idx);

value = line->Substring(idx+1);

} else {

entry = line;

value = "";

}

Obviously, you have to take into account when there is no value, and thus no space.  My example code does this.

3) .NET provides a GetFiles operation in the Directory class, http://msdn.microsoft.com/en-us/library/wz42302f.aspx

Using this, like Directory::GetFiles("C:\\MyFiles", "Capital*.entity") should work just fine.

You can use the same kind of method as (2) for finding an entry and its associated value. You should load the file into a dictionary, stripping out tabs, and assigning each entry as the key, with its value as the value associated with that key. After you are finished doing this, you access the index by the key that holds the value you want to change, change the value, then save the file.

 

-Ian

 

 

Reply #17 Top

Thanks a lot for that help jjz.  I'm not going to be able to try it out today or tomorrow (Slipknot comes tomorrow!!!! :) ), but should have these finished Tuesday.... It probably would have taken me eons to discover this dictionary type and how to use it properly without you :(

Thanks again for all of it (sins editor and all the tips)

Reply #18 Top

No problem. I am glad I could be of assistance.

 

You have to make sure you use some sense when you are designing a program. Most loops and other nonsense can be avoided. Most people do not bother, and it generally is fine; however, when they don't bother and the application is one that deals with thousands of data items, the operations you perform really do start to matter. The sins editor is a prime example of this. Loading files in sins editor is bound by the time it takes to add a tab to the tab control. It does not load the files into memory. It only loads one. It also uses purely O(1) data searches when it is active. Thus, everything is very quick to respond.

You do not want to know how slow sins editor would be with 1000 files if it used regular methods most people use, which are relatively slow and lack innovation. :)