L2JMobius

High Five Introducing Ghost Services

mastermind007 · 35 · 1290

Online GuruGel

  • Knight
  • ***
    • Posts: 91
I also noticed that if you try to sell several items to a merchant, nothing happens. If you sell one item at a time, everything is fine. I don't think that's how it should be.


Online mastermind007

  • Heir
  • **
    • Posts: 20
I pushed a fix to the repo. Shops and wanderers are now fully removed when there time is up.

No sure about the merchant issue. The ghosts do not touch that part of the core.
If it ain't broke, you're not trying hard enough.


Online GuruGel

  • Knight
  • ***
    • Posts: 91
I pushed a fix to the repo. Shops and wanderers are now fully removed when there time is up.

No sure about the merchant issue. The ghosts do not touch that part of the core.

Everything works like clockwork now! A very good solution for servers with low online traffic. Thanks for your work.
It would also be great to introduce combat characters who run around the locations and level up. And you can PvP or PK with them. ))) But that's just a rant.


Online GuruGel

  • Knight
  • ***
    • Posts: 91
A new problem has arisen. I set Max_Batches to 100, and I have a total of 900+ merchants and walking customers. When it's time to replace merchants and walking customers, they are deleted faster than they are replaced, and eventually, within 24 hours, the number drops from 900+ to 150-250. The settings require a minimum of 1 minute before adding a new merchant. This is a lot... they delete faster than they add new ones.


Online GuruGel

  • Knight
  • ***
    • Posts: 91
I changed the value Respawn_Delay=1 to Respawn_Delay=0.01 and accordingly in the kernel I also changed the value to double, but it did not help, the deletion occurs the same way, and there are practically no new additions.


Online mastermind007

  • Heir
  • **
    • Posts: 20
I changed the value Respawn_Delay=1 to Respawn_Delay=0.01 and accordingly in the kernel I also changed the value to double, but it did not help, the deletion occurs the same way, and there are practically no new additions.

Wow 900+. I can honestly say I never tried that many. Think around 300 was the most I ever tried. I am surprised most of them spawned. There is a location aware method in the code that keeps a little separation between players and other ghosts. They will try to find an open spot 3 times and then they give up. You could be running into a situation where there are many not finding a spot and never spawning. That kills the schedule replacement so over time the server is find a balance. If you get enough of those the population number will drop. I bet you are seeing a fair amount of tried 3 times and failed messages in the log.

If it ain't broke, you're not trying hard enough.


Online GuruGel

  • Knight
  • ***
    • Posts: 91
Wow 900+. I can honestly say I never tried that many. Think around 300 was the most I ever tried. I am surprised most of them spawned. There is a location aware method in the code that keeps a little separation between players and other ghosts. They will try to find an open spot 3 times and then they give up. You could be running into a situation where there are many not finding a spot and never spawning. That kills the schedule replacement so over time the server is find a balance. If you get enough of those the population number will drop. I bet you are seeing a fair amount of tried 3 times and failed messages in the log.

In this situation, there's a solution: eliminate character replacement altogether. They will only be replaced after the character has sold everything they were selling.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19655
Any chance this system can be done only on datapack using listeners?


Online mastermind007

  • Heir
  • **
    • Posts: 20
Any chance this system can be done only on datapack using listeners?

In theory, Yes.
The system is mostly self contained as it is. The only part I am not sure about it the purging of old data from the offline trade tables in the even of a server crash. If the "OFFLINE_GHOST" are not removed before the core's native offline shops they will spawn. I guess in the Init() they could be purged and no one would really know as the game server would not be connected to the login server yet.

I have been out of the L2 scene for a long time and I am new to Mobius. Still getting a handle on the changes and the massive refactor and optimizations that have been done.
 
I will certainly look into it make this more of a datapack module to get it out of the core.
If it ain't broke, you're not trying hard enough.


Online mastermind007

  • Heir
  • **
    • Posts: 20
In this situation, there's a solution: eliminate character replacement altogether. They will only be replaced after the character has sold everything they were selling.

See the first post regarding major changes made.
If it ain't broke, you're not trying hard enough.


Online mastermind007

  • Heir
  • **
    • Posts: 20
Any chance this system can be done only on datapack using listeners?

As requested I converted the GhostServices to a standalone module.  Even the config is contained in the module folder.
Drop the GhostService folder in the  data/scripts/custom folder.
Edit the GhostServices/config/GhostServices.ini  to enable the shops and wanderers (set to false by default).
Start the server as normal.

Should make much easier to test with other chronicles.

Updated the original post with new link to the repo.
If it ain't broke, you're not trying hard enough.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19655
As requested I converted the GhostServices to a standalone module.  Even the config is contained in the module folder.
Drop the GhostService folder in the  data/scripts/custom folder.
Edit the GhostServices/config/GhostServices.ini  to enable the shops and wanderers (set to false by default).
Start the server as normal.

Should make much easier to test with other chronicles.

Updated the original post with new link to the repo.
You did more than what I expected :D

Updated so it somewhat follows https://l2jmobius.org/forum/index.php?topic=6556.0 and https://l2jmobius.org/forum/index.php?topic=13048.0 if you are ok with it.
Some variables could be static and not be re-instantiated in methods, but my time was limited.

https://limewire.com/d/yYyXd#fIRNdfEgwf


Online mastermind007

  • Heir
  • **
    • Posts: 20
You did more than what I expected :D

Updated so it somewhat follows https://l2jmobius.org/forum/index.php?topic=6556.0 and https://l2jmobius.org/forum/index.php?topic=13048.0 if you are ok with it.
Some variables could be static and not be re-instantiated in methods, but my time was limited.

https://limewire.com/d/yYyXd#fIRNdfEgwf

Thanks for sharing the programing style. I will work to get the code cleaned up to match this standard.
I am find with the switch from GPLv3 to MIT.
If it ain't broke, you're not trying hard enough.


Online mastermind007

  • Heir
  • **
    • Posts: 20
Fixed an issue where the shops respawn delay was using minutes instead of seconds.
Lots of code cleanup to keep in line for l2JMobius code standards.
If it ain't broke, you're not trying hard enough.


Online mastermind007

  • Heir
  • **
    • Posts: 20
I create a very simple no frills tool for editing the shopitems.xml file.
See the link in the original post.

From the ReadMe:

Code: [Select]
The ghost shop items are in the GhostServices/data/shopitems.xml.
To make it easier to edit, add and remove items from the list, I created this simple editor.

Run the "L2J_Mobius_Shop_Editor.jar".
Click the "Browse XML" button in the top left.
Select your XML file (Optional: Make a backup first).
The item will be listed in the left panel.
Select an item and the min/max counts, buy low/high, sell low/high and level values will be displayed.
Make you changes and click the Save Changes to XML button.

You can also Add and Remove items using the buttons on the bottom left.

To remove, select and item and click the remove button. You will get a confirmation.

To Add, click the add button.
Enter the item id, Name, and select the category from the dropdown.
This is add it to the list.
Now select the new item and populate the min/max counts, buy low/high, sell low/high and level values.
Click the Save Changes to XML button to update the file.
If it ain't broke, you're not trying hard enough.