Prince 1 and 1/2 - a new mod

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 »

Some fun with skeletons.

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: March 14th, 2021, 6:45 am Some fun with skeletons.
[video]
Funny! Is it because the guard logic?
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
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 »

Is the GitHub link broken? Or dmitrys, you took deleted the repository? I wanted to view the source code. Where can I get 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 »

The source code is a part of the mod archive

https://www.popot.org/custom_levels.php?mod=0000232

Or this one (contains background music)

https://github.com/dstarosta/Prince15di ... 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 »

Thanks. Actually I wanted to see code of some of the custom things that you did in the mod. Can you tell me at what files I should look into? Seems like you made a lot of changes...
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 »

Yeah, I have made a lot of changes to the logic.

For inactive guard logic search for the "inactive_guard" array. All related logic is going to reference it.

There are 3 extra slots for dead guards "dead_guard1", "dead_guard2" and "dead_guard3" along with 3 "outbound_dead_guard" slots in case they die between rooms.

There is a "dynamic_guard" variable that tracks information about dynamic guards (that enter from the side of a room). It get dynamically initialized when kid enter a room from a method with hardcoded values. Maybe there is a way to store this in LEVELS.DAT.

Kid as shadow mode is determined by "is_kid_shadow" variable. Kids dead body gets stored in the "Dead" slot which is 1 per level to avoid the PoP2 bug where you can have multiple dead kids. It makes the kid render as shadow, lifes are treated differently, he becomes immune from falls/spikes/chompers/falling tiles and most guards do not see him.
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 have done some improvements to inactive guards. They can now block sword strikes and strike prince in the back.



I also added an animation that explains how kid loses his sword on level 6. :lol: Interestingly in the original game when a loose tile falls onto a sword tile, it does not turn into debris like a potion tile does.

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: April 18th, 2021, 6:09 am I have done some improvements to inactive guards. They can now block sword strikes and strike prince in the back.
[video]
Wow! Great job! But I think the prince shouldn't die even if the inactive guard hits him (similar to PoP2).
dmitrys wrote: April 18th, 2021, 6:09 am I also added an animation that explains how kid loses his sword on level 6. :lol: Interestingly in the original game when a loose tile falls onto a sword tile, it does not turn into debris like a potion tile does.
[video]
Yes, the sword can be turned into the debris tile, this feature can be turned on in SDLPoP although I don't know where it might be useful.
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 »

Having kid losing a hit point when an inactive guard hits him presents a few difficulties that might not be immediately obvious.

1. You have to trigger a sequence that pushes kid forward. I am not sure if it even exists because in the sword fight (when both swords are drawn) they always face each other in PoP 1. Mechner mentioned in the PoP 2 Bible (I think) that they completely redone the fighting logic in PoP 2 because the Char/Opp logic did not work well with multiple active opponents. That is also why kid dies instantly without a sword. That part I have actually changed. If kid faces the opponent, he automatically draws the sword when he is hit so he loses one point and gets bumped back with the sword drawn. Technically you can just move kid a few pixels forward but it would look unpolished compared to the rest of the sequences. And it still would require making sure he is not falling through wall/gate/doortop tiles.

2. You have to have a set of variables for inactive guards that ensure they do not keep hitting kid every 2 frames, which is 5 times a second, if he was not bumped far enough. Otherwise, it will end up being extremely frustrating to play, ala goblin heads in PoP2. For an active guard there is a variable that does that.
https://github.com/NagyD/SDLPoP/blob/83 ... 002.c#L970 But you do not want both guards to keep hitting kid at exactly the same frame if he gets caught between them because it looks weird.

As for the sword, it makes sense for the broken tile to cover it. It can be used for puzzles where a sword is difficult to retrieve.
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 are a few more videos.

Guards are following prince much more aggressively as long as he exits the room from the same row as the guard.




Also, the closest guard to prince in another now becomes active if a guard in the same row has been killed to reduce guard inactivity.



There is also ambient music that changes between combat and regular modes.
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 »

Great improvements! :)
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 »

I believe I have understood most of the mechanics in the game as far as prince and guard movement and tile behavior is concerned.

So I decided to complete the graphical piece that I feel like the game was missing. So I created a flaming sword that turns shadow into the flame character (or kills kid) using dynamic palette changes to the sword and the prince spite along with a custom placed torch animation.

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 »

Someone posted a question here:
https://www.popot.org/custom_levels.php?mod=0000232
You made a new commit, it looks like.
https://github.com/dstarosta/Prince15dist/commits
The source code is only on GitHub in the package?
dmitry_s
Developer
Developer
Posts: 148
Joined: July 27th, 2021, 7:22 am

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

Post by dmitry_s »

Yes, I have made a few small changes.

The source code is available in the zip as well. The github 7z file stores the version of the game with ambient music because of the popot.org 10 MB limit.
dmitry_s
Developer
Developer
Posts: 148
Joined: July 27th, 2021, 7:22 am

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

Post by dmitry_s »

I have implemented another guard using a separate sequence table instead of timers. The second guard can now advance to land strikes from behind, strike back after blocking and use a full set of frames for striking. I just need to tune striking distances.

Post Reply