RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Discussion and development of scenarios and campaigns for the game.

Moderators: Forum Moderators, Developers

Konrad2
Moderator
Posts: 1866
Joined: November 24th, 2010, 6:30 pm

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by Konrad2 » July 6th, 2018, 12:28 pm

There you go.
Attachments
wesnoth-20180706-142355-14820.log
(5.15 KiB) Downloaded 107 times

User avatar
IIIO_METAL
Posts: 152
Joined: January 18th, 2017, 5:03 pm
Location: japan

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by IIIO_METAL » July 6th, 2018, 1:10 pm

Thank you Konrad 2, for submitting the log.
For now, the cause is unknown, but funny things are happening. In the first received report, it was "Missing closing tag for tag [case]", but in this log it is "Missing closing tag for tag [set_variable]". It seems that the place where the error occurred has changed since last time.

I downloaded data from the add-on server and I tried it again, but no error occurred.
The file may not be loaded correctly?
Please delete the add-on once, download it again and test.
Creator of "Mountain Witch" & "Castle of evil spirit"

Konrad2
Moderator
Posts: 1866
Joined: November 24th, 2010, 6:30 pm

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by Konrad2 » July 6th, 2018, 4:25 pm

I'm getting the error message I reported on page one again. But looking at the cfg, everything seems to be fine, so now I'm blaming wesnoth instead of your addon.
Looking at my logs: Apparently my pc has sometimes (extremely small) trouble with properly reading the content of cfg. That might be the cause of my error.

User avatar
IIIO_METAL
Posts: 152
Joined: January 18th, 2017, 5:03 pm
Location: japan

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by IIIO_METAL » July 7th, 2018, 1:54 am

I suspect it is due to disk write error.
If there are minor disk errors that can be solved by the disk maintenance tool, you do not have to think so seriously, but if multiple errors occur frequently, the hard disk crash may occur in the near future.
You should back up your important data.
Creator of "Mountain Witch" & "Castle of evil spirit"

User avatar
IIIO_METAL
Posts: 152
Joined: January 18th, 2017, 5:03 pm
Location: japan

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by IIIO_METAL » December 22nd, 2018, 6:40 am

A phenomenon that an error appeared and it was not possible to start a campaign was confirmed only in Windows version. There is no problem with Mac and Ubuntu. I have not confirmed other platforms.

For now, the solution has not been found out.
As a future policy, I plan to redesign macros which are too complex.
Creator of "Mountain Witch" & "Castle of evil spirit"

white_haired_uncle
Posts: 404
Joined: August 26th, 2018, 11:46 pm

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by white_haired_uncle » January 9th, 2019, 7:43 pm

C:\Users\Shinigami LTK\Documents\My Games\Wesnoth1.14/data/add-ons/Castle_of_evil_spirit/_main.cfg

I'm not a windows guy, but is that valid (switching to the proper use of / in the middle of a windows path)? Might be a clue as to why the problem is specific to windows.


EDIT: Doesn't look like it. Appears to be more that this is just how BFW reports the path.
WARNING: I suck at BFW, I'm usually barely paying attention, and I often like to try stupid things just to see what happens. Then I cheat. Watching my replays is known to the State of California to cause permanent mental injury.

white_haired_uncle
Posts: 404
Joined: August 26th, 2018, 11:46 pm

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by white_haired_uncle » January 9th, 2019, 8:57 pm

Looks like there's an error in macros/unit_menu.cfg around line 873 (starts with label =). There are two extra line breaks that need to be removed. I've attached a fixed copy.

After fixing that, on a Windows 10 machine with 4GB, it says "reading file and creating cache" for a few minutes, then runs out of memory.

On Ubuntu (2GB), it says same for several minutes until it's using a little over 1.2GB (resident!) then asks me to select a character, etc.

BTW 1.14.5
Attachments
unit_menu.cfg
(71.3 KiB) Downloaded 65 times
WARNING: I suck at BFW, I'm usually barely paying attention, and I often like to try stupid things just to see what happens. Then I cheat. Watching my replays is known to the State of California to cause permanent mental injury.

white_haired_uncle
Posts: 404
Joined: August 26th, 2018, 11:46 pm

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by white_haired_uncle » January 10th, 2019, 9:40 pm

Ran it in a 2GB ubuntu VM on 1.14.4. I got through the beginning, going downstairs. After running out the memory in my VM and swapping for 20 minutes or so, I got these errors:

20190110 16:15:34 error config: Missing closing tag for tag [variable]
expected at ~add-ons/Castle_of_evil_spirit/macros/Items_Weapon_use.cfg:2620
included from ~add-ons/Castle_of_evil_spirit/_main.cfg:30
included from ~add-ons/Castle_of_evil_spirit/macros/Items_Weapon_use.cfg:2601
included from ~add-ons/Castle_of_evil_spirit/_main.cfg:30
included from ~add-ons/Castle_of_evil_spirit/macros/Items_Weapon_use.cfg:1183
included from ~add-ons/Castle_of_evil_spirit/_main.cfg:30
included from ~add-ons/Castle_of_evil_spirit/macros/Items_Weapon_use.cfg:973
included from ~add-ons/Castle_of_evil_spirit/_main.cfg:30
opened at ~add-ons/Castle_of_evil_spirit/macros/Items_Weapon_use.cfg:2622
included from ~add-ons/Castle_of_evil_spirit/_main.cfg:30
included from ~add-ons/Castle_of_evil_spirit/macros/Items_Weapon_use.cfg:2601
included from ~add-ons/Castle_of_evil_spirit/_main.cfg:30
included from ~add-ons/Castle_of_evil_spirit/macros/Items_Weapon_use.cfg:1183
included from ~add-ons/Castle_of_evil_spirit/_main.cfg:30
included from ~add-ons/Castle_of_evil_spirit/macros/Items_Weapon_use.cfg:973
included from ~add-ons/Castle_of_evil_spirit/_main.cfg:30
20190110 16:15:41 error deprecation: MENU_IMG_TXT2 has been deprecated and will be removed in version 1.15.0.
Use the new [difficulty] tag instead for campaign difficulties, or the label/description keys for message options.
20190110 16:15:41 error deprecation: MENU_IMG_TXT2 has been deprecated and will be removed in version 1.15.0.
Use the new [difficulty] tag instead for campaign difficulties, or the label/description keys for message options.
20190110 16:15:41 error deprecation: MENU_IMG_TXT2 has been deprecated and will be removed in version 1.15.0.
Use the new [difficulty] tag instead for campaign difficulties, or the label/description keys for message options.
20190110 16:20:40 error general: Unknown scenario: 'pre_prison'


EDIT: restarted BFW, loaded last save and was able to continue. Then after completing the next scenario:

20190110 17:25:59 error general: Unknown scenario: 'Underground_1'

Again, restart allowed me to continue.
WARNING: I suck at BFW, I'm usually barely paying attention, and I often like to try stupid things just to see what happens. Then I cheat. Watching my replays is known to the State of California to cause permanent mental injury.

white_haired_uncle
Posts: 404
Joined: August 26th, 2018, 11:46 pm

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by white_haired_uncle » January 11th, 2019, 12:39 am

In the attached save, put on the ring you just found. Take it off. Try to put it back on and notice that it is now an amulet.

Also, how do I identify the ring? I have a scroll, but I can't find the menu option to use it on the ring.
Attachments
Coes-Underground maze-Auto-Save31.gz
(997.23 KiB) Downloaded 69 times
WARNING: I suck at BFW, I'm usually barely paying attention, and I often like to try stupid things just to see what happens. Then I cheat. Watching my replays is known to the State of California to cause permanent mental injury.

User avatar
IIIO_METAL
Posts: 152
Joined: January 18th, 2017, 5:03 pm
Location: japan

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by IIIO_METAL » January 11th, 2019, 4:47 am

Hello, white_haired_uncle.
I am grateful for many reports.
This add-on currently has quite a lot of problems. I believe that part of the problem is too many events that were made more complicated than necessary. It is also very time consuming to verify the problem because they rewrite the variables and interact with each other, not to mention that there are many rows.
I am planning to delete events with less important functions and redesign the structure of the event as simple as possible. Since this work has just started, it can not be declared how long to finish, but it is certain that it takes a long time.
Naturally, considering the information you reported, i will plan and work forward.
And the thing that your ring can not be found is due to my mistake that the event refers to the wrong variable name. :oops:
I think that it is very stressful to play the current version, thank you for the report.
Creator of "Mountain Witch" & "Castle of evil spirit"

white_haired_uncle
Posts: 404
Joined: August 26th, 2018, 11:46 pm

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by white_haired_uncle » January 11th, 2019, 8:43 pm

I've never seen a scenario that took so long to load (though part of that is probably swapping) or used so much memory. While I can't find solid evidence, I highly suspect the reason the errors I'm seeing are intermittent is that they are due to running out of memory (since it wouldn't run out in exactly the same place every time).

I found the error messages curious. It looks like main.cfg is including something from Items_Weapon_use.cfg, which is including something from main.cfg, etc, etc. And the line numbers repeat. 973, 1183, 2601, x, 973, 1183, 2601, y. I don't know anything about WML, but it almost seems like it's recursively loading the same things over and over. That might explain why it takes so long to load and uses so much memory.
WARNING: I suck at BFW, I'm usually barely paying attention, and I often like to try stupid things just to see what happens. Then I cheat. Watching my replays is known to the State of California to cause permanent mental injury.

User avatar
Ravana
Moderator
Posts: 2116
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by Ravana » January 11th, 2019, 8:51 pm

It is also interesting how closing tag is expected two lines before opening tag.

Tried it out, preprocessing specified resource: \data\add-ons\Castle_of_evil_spirit ...
Ran out of memory. Aborted.

Added more memory. With wesnoth -p still out of memory (it didnt go over 400MB), with GUI reached [variable] message (didnt go over 1600MB).

User avatar
IIIO_METAL
Posts: 152
Joined: January 18th, 2017, 5:03 pm
Location: japan

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by IIIO_METAL » February 11th, 2019, 9:12 am

Version 0.5.5 has been uploaded. As a result of various fixes, it started to operate quite stably. I checked only on Mac, but it worked until clearing the game without any problems.
I have not confirmed with other platforms, so please let me know if problems occur.
Creator of "Mountain Witch" & "Castle of evil spirit"

User avatar
IIIO_METAL
Posts: 152
Joined: January 18th, 2017, 5:03 pm
Location: japan

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by IIIO_METAL » March 8th, 2019, 12:23 pm

Version 0.5.7 has been uploaded.
The major change in this version is that you can choose the difficulty level from 3 levels when you start the campaign. Although EASY does not change in the past, NORMAL and HARD will not recover player unit even if you move to another floor.
This is the result of adopting one of the ideas that Samonella proposed previously.
Creator of "Mountain Witch" & "Castle of evil spirit"

User avatar
octalot
Code Contributor
Posts: 329
Joined: July 17th, 2010, 7:40 pm

Re: RPG Campaign:"Castle of evil spirit" and "add_creature_pack"

Post by octalot » March 8th, 2019, 6:32 pm

You have a macro that's included in every scenario, and another that's included in almost every scenario; with Wesnoth 1.14 it's possible to reduce it to just one copy by using the [resource] tag. Attached is a Git patch, although I've only playtested the starting area with the first few monsters. The preprocessed WML, with all the macros expanded, drops from 326MB to 25MB.

If you're not familiar with patch format then I or someone else will explain exactly what changed.

Code: Select all

commit 8a2f1bd51efcbf0d85f513b6ac27e3db65aa5f2e (HEAD -> master)
Author: Steve Cotton <steve@octalot.co.uk>
Date:   Fri Mar 8 19:22:04 2019 +0100

    Apply the [load_resource] optimisation to Castle of Evil Spirit
    
    Before: 12404407 compressed, 326417767 uncompressed
    After: 1198714 compressed, 25110977 uncompressed

diff --git a/Castle_of_evil_spirit/_main.cfg b/Castle_of_evil_spirit/_main.cfg
index f51909ee..331a53ed 100644
--- a/Castle_of_evil_spirit/_main.cfg
+++ b/Castle_of_evil_spirit/_main.cfg
@@ -47,7 +47,10 @@ UMC Music Books, West's Chronicles, Epic music are optional.
        [+language]
                range_throw = _"range^throw"
        [/language]
-       
+
+       {COES_ALWAYS_ACTIV_EVENT_IMPLEMENTATION}
+       {COES_DUNGEON_ACTIV_EVENT_SIDELESS_IMPLEMENTATION}
+
 #ifhave ~add-ons/UMC_Music_Book_01/_main.cfg
 [binary_path]
   path = data/add-ons/UMC_Music_Book_01/
diff --git a/Castle_of_evil_spirit/macros/Scenario_Utils.cfg b/Castle_of_evil_spirit/macros/Scenario_Utils.cfg
index a6aead04..20428202 100644
--- a/Castle_of_evil_spirit/macros/Scenario_Utils.cfg
+++ b/Castle_of_evil_spirit/macros/Scenario_Utils.cfg
@@ -2,20 +2,42 @@
 
 ####################### 各シナリオに常駐させるイベント
 #define COES_ALWAYS_ACTIV_EVENT SIDE
-       {EVENT_ACTIVATION_STEP}
-       {CONFIRM_UNIT}
+       [load_resource]
+               id=coes_always_activ_event
+       [/load_resource]
+#enddef
+
+# This will only be instanciated once, from _main.cfg, but it needs all of the
+# macros that it uses to be defined before it is instanciated.
+#define COES_ALWAYS_ACTIV_EVENT_IMPLEMENTATION
+       [resource]
+               id=coes_always_activ_event
+               {EVENT_ACTIVATION_STEP}
+               {CONFIRM_UNIT}
+       [/resource]
 #enddef
 
 ####################### ダンジョン内で常駐させるイベント
 #define COES_DUNGEON_ACTIV_EVENT SIDE
        {DROP_JUDGMENT {SIDE} (Jelly_Monster,Jelly_Monster_1,Jelly_Monster_2,Jelly_Monster_3,Jelly_Monster_4,Jelly_Monster_5)}
-       {PICK_EVENT 1}
-       {LAMP_ACTIV}
-       # {GETLOST_ITEM poison}
-       # {GETLOST_ITEM Anesthetic}
-       # {GETLOST_ITEM Deadly_poison}
-       {DIE_PLAYER_UNIT}
-       {ACTION_AGAIN}
+       [load_resource]
+               id=coes_dungeon_activ_event_sideless
+       [/load_resource]
+#enddef
+
+# This will only be instanciated once, from _main.cfg, but it needs all of the
+# macros that it uses to be defined before it is instanciated.
+#define COES_DUNGEON_ACTIV_EVENT_SIDELESS_IMPLEMENTATION
+       [resource]
+               id=coes_dungeon_activ_event_sideless
+               {PICK_EVENT 1}
+               {LAMP_ACTIV}
+               # {GETLOST_ITEM poison}
+               # {GETLOST_ITEM Anesthetic}
+               # {GETLOST_ITEM Deadly_poison}
+               {DIE_PLAYER_UNIT}
+               {ACTION_AGAIN}
+       [/resource]
 #enddef
 
 #define EVENT_ACTIVATION_STEP

Post Reply