ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Tue Nov 12, 2019 4:28 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Jun 03, 2019 6:34 pm 
Offline
Higher

Joined: Wed Jun 06, 2018 10:53 am
Posts: 61
Short description.
World map patrols may spawn ambushes with enemies from a different patrol.

Actual result.
Ambush map generates with wrong enemy units.

Expected result.
Ambush map generates with correct enemy units.

Steps to reproduce.
A. Human patrols, normal play (see comment).
1. Create a magic character.
2. Find adventurers party and attack them to start ambush.
3. Exit to the World map.
4. Find ziguranth patrol and attack them to start ambush.

B. Human and orc patrols, normal play (see comment)
1. Get to the point where you have portals to travel East->West and West->East.
2. West. Find and attack human (adventurers, ziguranth) patrol. Exit to the World map.
3. Go to Last Hope and use the portal to travel East.
4. East. Find and attack orcs patrol.

C. Human and orc patrols, debug mode (see comment)
1. Create a magic character.
2. Find and attack human patrol. Exit to the World map.
3. Use Ctrl+LMB to get to Far East.
4. Find and attack orcs patrol.

Game version.
1.5.10 for windows from ToME site.

Comment.
I believe A, B and C are the same issue.
Terrain also seems to be affected. Example: sand tiles instead of grass.
This issue disappears after save and load. It also seems to go away after doing several dungeons (needs more testing).
It appears to be related to persistent zones. Changes: file engine/Zone.lua, function _M:init(short_name, dynamic), excluded ambush with 'if' condition. Seems wrong to do this in engine, but I couldn't figure out how to do that in mod.
Code:
function _M:init(short_name, dynamic)
   __zone_store[self] = true

   if _M.persist_last_zones and _M.persist_last_zones[short_name] then
        -- TEST: Exclude ambush to prevent reusing possibly inappropriate
        -- persisted version that may differ from the required version.
        if short_name ~= 'ambush' then
            local zone = _M.persist_last_zones[short_name]
            forceprint("[ZONE] loading from last persistent", short_name, zone)
            _M:removeLastPersistZone(short_name)
            self:replaceWith(zone)
            _M:addLastPersistZone(self)
            return
        end
   end

Maybe it is possible to check what parts of persisted ambush data can be reused and what parts need to be loaded to update the persisted data.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Blue and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group