Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : General : Firetraps and Spikes have movement order, too (Did you know?)
New Topic New Poll Post Reply
Poster Message
averagemoe
Level: Smiter
Avatar
Rank Points: 487
Registered: 03-22-2012
IP: Logged
icon Firetraps and Spikes have movement order, too (+2)  
Yeah, it turns out that when floor spikes or a fire trap destroy something, it's prosessed in a specific order. And I was able to figure out this order through checking the movement order of Tar Babies spawned when they destroy blobs.

The rules are remarkably simple. First every firetrap emits it's flame in a wave that starts in the lower right corner of the room, and travels upward in a vertical line until it reaches the top. Then the process is repeated for every column going from right to left. After this, if the threat clock is right, all the spikes spring with the exact same pattern.

So now I have to ask, why this order? It would have seemed more natural to start at the top and go horizontally from left to right first, then move down the rows as if reading a book.

____________________________
There are two types of sheep in the world. Those who jump off a bridge when told to, and those who jump off a bridge when told not to. Don't be either.
07-23-2021 at 06:50 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Firetraps and Spikes have movement order, too (+2)  
I've got bad news for you - tar stabs are queued and processed all at once at the end of the turn:

1. CDbRooms::ProcessActiveFiretraps() calls ActivateFiretrap for every active firetrap
2. CDbRoom::ActivateFiretrap() calls CCurrentGame->StabRoomTile()
3. CCurrentGame::StabRoomTile() calls CDbRooms::StabTar() passing "false" as the fourth argument.
4. CDbRooms::StabTar(), when the fourth argument is false the tar is queued for later removal, which happens...
5. Here

Check steps 16, 20 and 23 in Deadly Rules of Death.

Note: I talked about firetraps here but the same thing happens with spikes. They are actually processed in insertion order, which will be row-by-row from top-left. When new spikes are built/firetraps area activated I am not entirely sure if they are added at the end of the list or not.

You can most likely verify that with a simple setup: one door, two orbs (one set to close, another to open), build the traps/spikes with scripting and see if the door is opened or closed at the end of the turn to know which orb was hit first.

____________________________
My website | Facebook | Twitter
07-23-2021 at 07:53 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
averagemoe
Level: Smiter
Avatar
Rank Points: 487
Registered: 03-22-2012
IP: Logged
icon Re: Firetraps and Spikes have movement order, too (0)  
Well, at any rate, this pattern determines the order that the tar stabs happen in.

____________________________
There are two types of sheep in the world. Those who jump off a bridge when told to, and those who jump off a bridge when told not to. Don't be either.
07-23-2021 at 04:27 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : General : Firetraps and Spikes have movement order, too (Did you know?)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.