Prince 1 and 1/2 - a new mod

User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Prince 1 and 1/2 - a new mod

Post by atrueprincefanfrom18 »

Hmm, Interesting, there's a lot of work to do :D
So do you want to update these changes in this mod and update it on the site?
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Prince 1 and 1/2 - a new mod

Post by dmitrys »

Here is a fun video testing a guard falling through many screens. Hit points are not taken off when fighting but they are taken off during 2-story falls.



This type of level is not very realistic for quite a few reasons.

1. Guard does not necessarily falls 1 tile at a time and any 2 story drop is worth a hit point. The important part of the logic here is each part of the fall between temporary landings counts a separate one. A 3-story fall would have killed him immediately.

2. There is not enough time not to get killed by the guard when you land close to each other.

3. There is a nasty bug where if you land from a tile above to the next tile below where the guard is standing next to the wall, the guard disappears into the wall. This bug can happen with the last guard in POP on level 11 if you drop the guard 1 level and jump to fight him. It has to do the logic that bumps kid off the wall. Maybe David can take a look at that since he fixed quite a few similar bugs.

4. There is another bug where if kid and guard fall off the same tile into the next room the guard disappears. There is no music/sounds whatsoever so I doubt that is related to my changes. I will try to troubleshoot this one when I get the chance.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Prince 1 and 1/2 - a new mod

Post by atrueprincefanfrom18 »

Nice! Yes, guards survivng two storey-fall, that's perfect. It should be like that actually.
Logically, if the Kid can survive, the guards should too!
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Prince 1 and 1/2 - a new mod

Post by dmitrys »

The guard fallout logic now works when kid is off screen. In this video (in the second half of it) kid turns into shadow on brittle tiles. Loose tiles from above cause those tiles to drop down a room along with kid's body.

The video also shows "totally loose tiles" (per Mechner's POP2 bible) that are in the ruins part of POP2, as well as a guard dying when a loose tile hits him.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Prince 1 and 1/2 - a new mod

Post by Norbert »

dmitrys wrote: November 26th, 2020, 7:16 amThe video also shows "totally loose tiles" [...]
Currently, the only loose floor variant (modifier) that is in use, is 0x00. A totally loose variant might be an interesting addition for SDLPoP/MININIM, that I could add to apoplexy's native tiles screen ("x") if there's agreement it should be added to the legacy list.
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Prince 1 and 1/2 - a new mod

Post by dmitrys »

Norbert wrote: November 26th, 2020, 1:08 pm Currently, the only loose floor variant (modifier) that is in use, is 0x00. A totally loose variant might be an interesting addition for SDLPoP/MININIM, that I could add to apoplexy's native tiles screen ("x") if there's agreement it should be added to the legacy list.
Modifiers 0x80 and higher are being used to shake loose tiles that would use the lower bits. I guess that is why Mechner used bits in the foretable for the "stuck loose" tiles that only fall than another loose tile hits them. Maybe adding an additional value to those bits make more sense?
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Prince 1 and 1/2 - a new mod

Post by dmitrys »

Now guards can follow kid when he drops to the room below and survives.



The next logical step is to have additional slots for dead guards so previous guards would not disappear (up to a limit like 3). That is a big undertaking which I am probably not going to tackle yet because I have a few projects to finish in December.

Maybe there is going to be some progress with the multi-player version of SDLPoP that would probably have to deal with multiple princes or guards on the same screen.
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Prince 1 and 1/2 - a new mod

Post by dmitrys »

I finally learned to use PR to add another frame to the birdman guard. Now they bow when you unite with shadow.


I updated the mod archive with the latest changes.
https://raw.githubusercontent.com/dstar ... r3_mt32.7z
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Prince 1 and 1/2 - a new mod

Post by atrueprincefanfrom18 »

dmitrys wrote: November 26th, 2020, 7:16 am The guard fallout logic now works when kid is off screen. In this video (in the second half of it) kid turns into shadow on brittle tiles. Loose tiles from above cause those tiles to drop down a room along with kid's body.
Nice improvements!
dmitrys wrote: November 27th, 2020, 7:10 am Maybe there is going to be some progress with the multi-player version of SDLPoP that would probably have to deal with multiple princes or guards on the same screen.
I guess if it's possible to have some modifier for the normal tile, so after you kill the guard, just change the modifer of that tile where the guard is dead and then whenever new guard appears, the dead guard won't be removed from the screen. I don't know if it's possible or too difficult to add this without breaking existing things that work.
dmitrys wrote: November 28th, 2020, 12:12 am I finally learned to use PR to add another frame to the birdman guard. Now they bow when you unite with shadow.
Yes, PR is very great and now that we have SDLPoP, I think many new frames can be added into the DAT files and then custom code can read and do interesting things with it!
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Prince 1 and 1/2 - a new mod

Post by dmitrys »

atrueprincefanfrom18 wrote: December 2nd, 2020, 6:27 am I guess if it's possible to have some modifier for the normal tile, so after you kill the guard, just change the modifer of that tile where the guard is dead and then whenever new guard appears, the dead guard won't be removed from the screen. I don't know if it's possible or too difficult to add this without breaking existing things that work.
I would not tie dead guards directly to tiles as tile types/modifiers can change (button states, fallen loose tiles, animated tiles).

There is a "level_type" struct that contains everything for the each of the 24 rooms including attributes for a single guard - (tile, x, direction, sequence, etc). I would an array called "dead_guards" of type "char_type" (with a max number of around 3) that contains all the information about the dead guard (type, x, row, col) and add them to the object table so they get rendered as background outside of the active guard.

As soon as a guard dies, the "active" guard tile would be changed to -1 and the dead guard would be added to that array. This logic seems to work for my current mod (see the image below). I will only be tracking an additional "guard" which would the dead kid when he separates from the shadow. This way he would be able to separate from the shadow in a room with a guard. When joining the shadow the coordinates would have to match and the direction would be set to "none", hiding kid's dead body.

attachment=0]dead_guards.png[/attachment]

In a future mod I can add a method that could create additional guards that would keep walking in using auto control until the dead guard array is full. That method would create an active guard once the dead guard moves into the dead guard array leaving the active guard spot open for the new guard.

And to deal with multiple dead guards on the same tile I would be guards 2 and 3 a few pixels to the left or right and maybe a pixel or 2 up/down so you can see them all (or at least parts of them).

So that sounded straight forward. Well, there is always a catch. Guards don't always die on solid floors. They can be pushed off a cliff or die on brittle tiles that can be knocked off using loose tiles. So the fallout logic would have to be adjusted to account for dead guards, which is the more difficult part.
Attachments
dead_guards.png
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Prince 1 and 1/2 - a new mod

Post by atrueprincefanfrom18 »

dmitrys wrote: December 2nd, 2020, 8:44 am I would not tie dead guards directly to tiles as tile types/modifiers can change (button states, fallen loose tiles, animated tiles).
I still think it's a good idea. The reason is simple: there can be unlimited dead guards each dead because of different reasons. Yes, the modifier would change per tile type, but maybe the code can handle it properly. By that, I mean it can check the tile type and the available modifier, and if the modifier is the same as the one that we want to show the dead guard, just use the dead image from GUARD.DAT file. Although it would be a lot of work and testing involved.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Prince 1 and 1/2 - a new mod

Post by dmitrys »

In addition to multiple guards there is another problem. Guard's position is not stored as a tile number but as a combination of the "x" coordinate and the row number. While that coordinate can always be linked to a specific tile, the location of the guard on the tile is not fixed. It can move or be bumped a few pixels to the left or to the right and basically end up on any part of the tile. The "x" coordinate requires a full byte + another bit for the row number + another one for the guard's direction. I am not even sure how that could be stored in the modifier.
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Prince 1 and 1/2 - a new mod

Post by dmitrys »

One thing that can probably be done through a tile modifier is to store how many guards would enter the room through it after you kill the first guard. It would only work if the tile is at the edge of the room and it would only work for 1 tile in a room.
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Prince 1 and 1/2 - a new mod

Post by dmitrys »

I finally implemented an ability to have dynamic guards like in PoP2. But you can only fight 1 guard at time, as it has been expected. You can have 1 or 2 additional guards coming from a side of the room and they have 1 less hit point than the first guard.

Having separate slots for dead guards actually solved a few bugs such as disappearing dead guards when another guard enters the room and fallen spiked guards landing in wrong rooms.

User avatar
yourantumayel69
Calif
Calif
Posts: 565
Joined: November 12th, 2019, 9:53 am
Location: Indonesia
Contact:

Re: Prince 1 and 1/2 - a new mod

Post by yourantumayel69 »

dmitrys wrote: December 20th, 2020, 9:05 pm I finally implemented an ability to have dynamic guards like in PoP2. But you can only fight 1 guard at time, as it has been expected. You can have 1 or 2 additional guards coming from a side of the room and they have 1 less hit point than the first guard.

Having separate slots for dead guards actually solved a few bugs such as disappearing dead guards when another guard enters the room and fallen spiked guards landing in wrong rooms.

Very good!!! :D
Pengkhotbah 3:1 (TB) Untuk segala sesuatu ada masanya, untuk apa pun di bawah langit ada waktunya.
Post Reply