Thanks Bobsobol ;)
Printable View
Thanks Bobsobol ;)
Hello everyone=)
I need your help!
PriTaTor will manage all monsters/items and maps with SQL database.
This is a good idea, because its easy for everyone with some
SQL & webdesign skills to use this database to make a monster/items list on his webpage. it can even use for make some
statistics like chance of item drop in a map etc.
My problem is now, some values in monsters/items and maps can have
2 values(Min and max)
I need to now all propertys that can have 2 values. (monster/items and maps)
Thanks =)
(lucky im almost ready with studing and will go earn money soon)
In monster files the only low-high values I'm aware of are Pack(How many spawn at once), Attack Power, Special Hit Damage, and the drops.
Your are welcome to my Monster DataBase CSV, attached.
I have a basic program that produces it. Well, kinda 2 actually, one to turn all the little files into one long file with some translation and another to turn that into a CSV.
Still love PriTaTor.:thumbup1:
Cool xD
Thats nice
I work with SQL now, because its easyer to manage like search & filters.
and less errors for sure!
because i was working with very big array variables. its so complex atm thats hard to fix errors and add new functions.
i hope with database the coding will be more easy =)
My PriTraTor never worked so I just kept doing everything root files, however I noticed you guys where talking that PriTraTor requires sql databases to work? ...Explain some more please? :)
The old version dont need SQL =) But there are a lot of bugs hehe
Now i will try to manage all monsters, items and maps with SQL database.
im sure there will be less bugs in PriTaTor =)
I will work with foreign keys to link monsters, items and maps to each other xD
Since we already have an MS-SQL database for the game, are you using that?
If I needed SQL queries, I'd probably run a little SQLite system, but I'd really like to:-
a) Liberate PT servers from MS-SQL (so you can use any DB_Engine)
b) Liberate PT from the Korean Text files (so all data is stored in whatever DBMS you choose to use with it.
If PriTaTor standardises a dataset for NPCs, Items, Monsters etc, I will probably follow that form for the main server.
The CSV was an attempt to see all the monster files in a single table without loosing any (used) data... I do loose the comments, but they are Korean anyway. XD
I'm sure server startup will be faster and less buggy accessing this data via SQL too.
I always look forward to new PriTaTor releases... and that says a lot for a .net-o-phobe like me. XD
Well atm i use SQLite xD
I like it, because it dont need big installation and its very fast hehe.
MSSQL need Passwords and have a lot of security problems like (Login to database fail) etc. hehe
Thanks bobsobol=)
I think that's a good choice.
It avoids the program putting any of the rest of the game database at any risk, and because SQLite is a small (embeddable, even) SQL engine, and not another full fledged DBMS, users don't have the hassle of trying to install MySQL or something as well as MS-SQL without conflicts.
If you wanted to use the MS-SQL engine that (at the moment) we all have to have anyway, you can create a new database instance, separate from the main game one. That keeps the game safe from PriTaTor and vise-vesa, but I agree that it's a pain in the bum to do. Both for you as the developer and in terms of end user support.
I've already said I probably wouldn't do that if I where in your shoes. XD Wanting to understand MS-SQL programming would be the only encouraging point of the exercise.
I notice that a lot of early posters here are very confused between MySQL and MS-SQL, not to mention the fact that most of us probably have one or two programs with SQLite or another mini-SQL embedded in them. So it's probably worth pointing out that your SQL usage isn't connected to the game, or clan systems SQL database, and that there are good reasons why it shouldn't be. :wink:
Here is my first version of my database.
Just a preview, (Monster and Items)
Atm im not sure, how to manage the monster drops (foreign keys)
Its n:m and more than that lol, the monster drops are tables in tabels.
Its a SQLite Database, can view with "SQLite Database Browser" =)
Attachment 76279
Tables within tables is what relational databases excel at. XD
Monster drops... Example, Sen:-아이템카운터 = Number of items dropped per kill (IMS)Code://몬스터가 떨어뜨리는 아이템 설정 블럭
*아이템카운터 1
*아이템 2100 없음
*아이템 4000 돈 8 14
*아이템 1000 pl101 ps101 pl101
*아이템 1500 da102 da202 wa101 wh101 wm101 ws101 wp101 om101 pl101 ps101 or101
*아이템 800 da103 da203 wa102 wc102 wh102 wm102 ws102 ws202 wp102 om102 or102 oa102 os102
*아이템 400 da104 da204 wa103 wc103 wh103 wm103 ws103 ws203 wp103 om103 or103 oa103 os103
*아이템 200 wa104 wc104 wh104 wm104 ws104 ws204 wp104 om104 or104 oa104 os103 gp109
아이템 = Drop item set. Chance followed by item list.
If the item list entry is 돈 then that's a gold drop, followed by Maximum and then Minimum.
If the item list entry is 없음 then nothing is dropped... that the chance of getting no drop.
Other than that, the server should add all the chances together, roll a random number between 0 and the total, and depending on what number it gets it will pick 1 item from the row which corresponds to that chance weight.
2100 + 4000 + 1000 + 1500 + 800 + 400 + 200 = 10000. So in this case (and I think most of the original jPT monsters add up this way) you can consider the chances 21%, 40%, 10%, 15%, 8%, 4% and 2%You already know how to look up an item name from it's item code, because PriTaTor already does this.
If you want to dip out of using full relational-database functionality, you can store the items as a string with separation character... you know how in Basic you can turn a string into an array so that you get an array of 5 Integers from "5|3|2|1|4"... depending on the dialect you can select the element separator character. The Basic normal is a bar symbol "|", but common alternatives are a comma "," a semi-colon ";" a tab character or a space.
If vb.net is ghey enough not to support a built in you can make a UDF pretty easy, I'm sure. XD
However, you can have a table of Drop Lists, and a table of linked lists.... Linked lists indexed against monsters, listing each drop list (all items of the same drop chance / weight), Drop Lists equating to a single weight value (or drop chance) and a list of item codes.
The biggest problem with this is that, in the standard jPT release server, there are not many items in a row, and the same item never appears twice in a single row, and no row has the same chance / weight.
Custom server files are usually a complete mess, and do not follow these guiding philosophies. :s
Alternatively you could have a very large table with very few columns, containing "monster", "chance", "item". You can SELECT on "monster" and reconstruct all the drops of the same "chance". This is probably more work for the SQL engine and less work for PriTaTor. eg. not exactly optimal in CPU time, but logically easier to manage.
I know when I looked at it, I was in a quandary as to whether to preserve the exact rows in the text file, or just their meaning. So if there are 2 rows both with a chance of "2100" should I store two rows, or just store all the items in one record, as their weight is the same.
What does this dropcode means?!
*¾ÆÀÌÅÛ¸ðµÎ
It doesn't mean anything.
I think that line of smeg is *아이템카운터 in the wrong code page though. XD
*아이템카운터 is explained in my previous post.
A fair translation of 아이템카운터 would be "Item Count"
thanks =) so i will ignore this code hehe
in most of the monsters it´s just a comment //*¾ÆÀÌÅÛ¸ðµÎ .
Reading monster and items files into database take almost 1 minute (700 items 300 monsters) lol
beause i have to clean so many things lol.
Some txt files use tab, some use many space chars. so i have to clean all
lines, but its working xD
so sad i dont have more time hehe, so tired when im home from work and then need to learn and then some (1-2) hours for PriTaTor. hehe
I wouldn't "ignore it" as such. Presumably the default drop count is 1, so if the line isn't there, or is commented out there is 1 drop roll for a kill of this kind.
Almost all of the * options in monster files have some default... and when I wrote my program I started with a set of default values (usually 1, 0, "" or something of the sort) and if I find * commands which override them, then I fill in the true value from that.
Yes, the files are messy.. but you can skip any line which starts "//" or "#", or you can simply process only lines which start "*"
Of those lines string search and replace Tab for Space, then Space Space for Space (excluding any space characters in double quotes) and it gets clean pretty quick.
Would you like me to knock up a PT file cleaner in a Basic dialect? It won't be vb.net, but I imagine you know enough by now to make any minor adjustments.
It's a shame they didn't use a standard Windows INI file format though. :(: That would make processing a lot easier, as there are already many handlers for this format.