Jump to content

Setting Drop via Mysql Tables


Recommended Posts

  • Developer

M2 Download Center

This is the hidden content, please
( Internal )

I think the title should explain all.
The system give way to set mob's drops via tables (Database) instead to use mob_drop_item.txt, common_drop_item.txt, drop_item_group.txt which can be buggy (easly, just a wrong space) without trace any error in your game expirience.

WARNING : The System doens't disable the txts so you can use the txts and the tables without any problems.


I have inserted "/reload d" command to reload the drop tables without restart channels.
i will code a small tool in python to convert the txts to tables (i will be added to the repository).

The drop chance by default is set to 1/1000 (so in table you should set it to 1000 to give 100% drop chance 'base' , it will change via the ymir's algorithm depend on the levels killer/victim).

you can chance this scale to use 100 instead 1000 basically changing  in lenght.h the value of DROP_SCALE_TABLE 

This is the hidden content, please
you can find the repository.

 

MySkype: live:ikarus.developer

 

 

update:
Added a small part to install only if you are using __SEND_TARGET_INFO__ to show the drop in the target board

 

WARNING:

i noticed some people think this system is a realtime database reading based system.

i want explain it better , to make sure every body know how  this system works.

This system works using cache, it read the tables once on boot, then the db core setup all core during core boot using cache.
Only if you want to reload (refreshing the cache) the db core will read again the tables and will send to every core the "update".

Edited by Ikarus_
  • Metin2 Dev 114
  • kekw 1
  • Dislove 1
  • Angry 2
  • Think 3
  • Confused 1
  • Lmao 1
  • Good 29
  • Love 8
  • Love 83

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • Premium

Personally I would not suggest you to move your data from .txt files to database tables. 

Keeping the data in a file like .txt or .csv or whatever allows you to integrate it in a versioning system like Git, which is a great advantage. If your simply don’t like the txt file parser written by Ymir, you can anytime convert to a different markup language like json or xml.

  • Love 3
Link to comment
Share on other sites

  • Developer
On 5/11/2019 at 11:27 PM, HuNterukh said:

Personally I would not suggest you to move your data from .txt files to database tables. 

Keeping the data in a file like .txt or .csv or whatever allows you to integrate it in a versioning system like Git, which is a great advantage. If your simply don’t like the txt file parser written by Ymir, you can anytime convert to a different markup language like json or xml.

The reasons to use table instead of sample file can be various.

For example:

1. I think every body makes periodically database backup to save the data, well you can save the drop data too...

2. You can use query to get filtered information or to edit multiple lines in one shot.

3. They are easier to edit.

4. You can connect these infornations with a wiki in your web site every time 100% uptodate because you are using the same table loaded from game...

Ad more..

If you need to integrate the tables in the Git Repo, you can also do it using a dumped file (.sql for example)

Edited by Ikarus_

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

16 godzin temu, HuNterukh napisał:

Personally I would not suggest you to move your data from .txt files to database tables. 

Keeping the data in a file like .txt or .csv or whatever allows you to integrate it in a versioning system like Git, which is a great advantage. If your simply don’t like the txt file parser written by Ymir, you can anytime convert to a different markup language like json or xml.

kek, did you hear about something like eg liquibase?

  • Love 1
Link to comment
Share on other sites

On 5/9/2019 at 10:47 PM, Ikarus_ said:

I think the title should explain all.
The system give way to set mob's drops via tables (Database) instead to use mob_drop_item.txt, common_drop_item.txt, drop_item_group.txt which can be buggy (easly, just a wrong space) without trace any error in your game expirience.

WARNING : The System doens't disable the txts so you can use the txts and the tables without any problems.


I have inserted "/reload d" command to reload the drop tables without restart channels.
i will code a small tool in python to convert the txts to tables (i will be added to the repository).

The drop chance by default is set to 1/1000 (so in table you should set it to 1000 to give 100% drop chance 'base' , it will change via the ymir's algorithm depend on the levels killer/victim).

you can chance this scale to use 100 instead 1000 basically changing  in lenght.h the value of DROP_SCALE_TABLE 

This is the hidden content, please
you can find the repository.

 

MySkype: live:ikarus.developer

 

 

update:
Added a small part to install only if you are using __SEND_TARGET_INFO__ to show the drop in the target board

help. can you upload the convecter.exe ?

Ekran-Al-nt-s.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Developer

The common_drop_item.txt conversion works
you can build and use the drop converter now.

left : 
       mob_drop_item.txt
       drop_item_group.txt 

 

i will code the other conversion in the next days

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • Developer

WARNING:

i noticed some people think this system is a realtime database reading based system.

i want explain it better , to make sure every body know how  this system works.

This system works using caching, it reading the tables once on boot, then the db core will update all core during core boot using cache.
Only if you want to reload (refreshing the cache) the db core will read again the tables and will send to every core the "update".

  • Love 1

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

12 hours ago, Ikarus_ said:

WARNING:

i noticed some people think this system is a realtime database reading based system.

i want explain it better , to make sure every body know how  this system works.

This system works using caching, it reading the tables once on boot, then the db core will update all core during core boot using cache.
Only if you want to reload (refreshing the cache) the db core will read again the tables and will send to every core the "update".

The system is not bad. When is full working then I will add in my files and you become a thanks :)

  • Love 1
Link to comment
Share on other sites

Hello @Ikarus_, i'm interested in the cache part you used designing this system and have a few questions, performance-wise is it better than allocating stuffs on heap and freeing? cache is shared thourgh out every core? and last and more important do you mind if I take some parts of your code for a different system? I will neither sell anything nor copy/paste releasing contents.

Link to comment
Share on other sites

  • Developer
1 hour ago, OtherChoice said:

Hello @Ikarus_, i'm interested in the cache part you used designing this system and have a few questions, performance-wise is it better than allocating stuffs on heap and freeing? cache is shared thourgh out every core? and last and more important do you mind if I take some parts of your code for a different system? I will neither sell anything nor copy/paste releasing contents.

I agree to give you license to get a part of my code.

Anyway i used STL containers (map, vector) to store data in the cache. The stl containers using heap to store data.

  • Love 1

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.