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

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

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

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

Post by IIIO_METAL »

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
Forum Moderator
Posts: 3330
Joined: November 24th, 2010, 6:30 pm

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

Post by Konrad2 »

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: 202
Joined: January 18th, 2017, 5:03 pm
Location: japan

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

Post by IIIO_METAL »

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: 202
Joined: January 18th, 2017, 5:03 pm
Location: japan

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

Post by IIIO_METAL »

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: 1093
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

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

Post by white_haired_uncle »

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.
Speak softly, and carry Doombringer.
white_haired_uncle
Posts: 1093
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

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

Post by white_haired_uncle »

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 346 times
Speak softly, and carry Doombringer.
white_haired_uncle
Posts: 1093
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

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

Post by white_haired_uncle »

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.
Speak softly, and carry Doombringer.
white_haired_uncle
Posts: 1093
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

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

Post by white_haired_uncle »

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 419 times
Speak softly, and carry Doombringer.
User avatar
IIIO_METAL
Posts: 202
Joined: January 18th, 2017, 5:03 pm
Location: japan

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

Post by IIIO_METAL »

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: 1093
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

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

Post by white_haired_uncle »

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.
Speak softly, and carry Doombringer.
User avatar
Ravana
Forum Moderator
Posts: 2933
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

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

Post by Ravana »

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: 202
Joined: January 18th, 2017, 5:03 pm
Location: japan

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

Post by IIIO_METAL »

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: 202
Joined: January 18th, 2017, 5:03 pm
Location: japan

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

Post by IIIO_METAL »

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
General Code Maintainer
Posts: 777
Joined: July 17th, 2010, 7:40 pm
Location: Austria

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

Post by octalot »

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