post suggestions here

Windows and Linux editor of PoP1 (for DOS and SNES) and PoP2 (for DOS).
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: post suggestions here

Post by David »

dmitrys wrote: March 14th, 2021, 5:32 am The feature should probably be enabled if debug cheats are enabled.
Done: https://github.com/NagyD/SDLPoP/commit/ ... e780124bfa
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: post suggestions here

Post by Norbert »

atrueprincefanfrom18 wrote: April 15th, 2021, 4:08 pmWhat more features?
A basic built-in hex editor, via F12.
Should be available early May.

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

Re: post suggestions here

Post by atrueprincefanfrom18 »

A hacks collection that allows Apoplexy users to alter their exe file in a single click with a desired hack.
So, for example, an hack that fixes some graphical glitch shall be then possible to use by mod authors in their exe in a single click.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: post suggestions here

Post by Norbert »

atrueprincefanfrom18 wrote: June 17th, 2021, 10:38 am A hacks collection that allows Apoplexy users to alter their exe file in a single click with a desired hack.
So, for example, an hack that fixes some graphical glitch shall be then possible to use by mod authors in their exe in a single click.
I'm guessing that while you wrote that, you had fixes for graphical glitches in mind. :)
(Because apoplexy already has several single-click hacks, such as allowing triggering of any tile, and making the demo level playable. And because you mention the glitches as an example.)
What would you suggest are the most useful single-click toggles not yet in the application?
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: post suggestions here

Post by atrueprincefanfrom18 »

Well, not really anything in my mind right now.
As a basic hex editor is available, there definitely will exist some function that changes the bits. So I thought why not connect the function with a repository/collection so the author (btw why isn't he called a modder? :)) can use the hack/fix and the exe will be altered rightaway.
To be honest, I haven't yet messed around with the hexedit. It might be easy, but I'm still afraid that something on my pc will break :|
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: post suggestions here

Post by Norbert »

atrueprincefanfrom18 wrote: June 17th, 2021, 3:16 pmWell, not really anything in my mind right now.
All right, that makes it easy for me; I can continue replaying Stardew Valley. ;)
atrueprincefanfrom18 wrote: June 17th, 2021, 3:16 pmTo be honest, I haven't yet messed around with the hexedit. It might be easy, but I'm still afraid that something on my pc will break :|
The hex editing functionality of apoplexy? It only ever touches the EXE file (or ROM for SNES). It won't break your PC. Although, of course, the application's license includes a warranty disclaimer. It constantly 'hex edits' PoP files.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: post suggestions here

Post by atrueprincefanfrom18 »

Norbert wrote: June 17th, 2021, 4:56 pm
atrueprincefanfrom18 wrote: June 17th, 2021, 3:16 pmTo be honest, I haven't yet messed around with the hexedit. It might be easy, but I'm still afraid that something on my pc will break :|
The hex editing functionality of apoplexy?
No, the DOSBox app. Apoplexy should be safe, of course.
Norbert wrote: June 17th, 2021, 4:56 pm
atrueprincefanfrom18 wrote: June 17th, 2021, 3:16 pmWell, not really anything in my mind right now.
All right, that makes it easy for me; I can continue replaying Stardew Valley. ;)
Well, was just an idea. I don't think it would take a lot of time actually. Just need some Web URL XML/JSON based API (maybe apoplexy.org) to return what hex-edits are possible with the name, hex edits and some other info about it. And in Apoplexy pull that URL and show all the available hacks. And on click, apply them and that's it.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: post suggestions here

Post by VelCheran »

Sorry if this was already suggested, but could it be possible to implement a way to invert two levels with each other? For example switching level 2 with level 3.
I guess it would mess up with special events, so that may not be a great idea, but still...
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: post suggestions here

Post by Norbert »

VelCheran wrote: October 11th, 2021, 2:03 am[...] invert two levels with each other? For example switching level 2 with level 3.
I've added it to my to-do list.
For now, you could either use this or Ctrl+c/Ctrl+v (to copy/paste) rooms.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: post suggestions here

Post by Norbert »

I was really close to having DOS to SNES conversion implemented, but have still given up. The final straw, after having already tackled various issues, was iModifierA being set in SetLocationSNES() through UseTile() calls, which messes up in-editor DOS modifiers. In theory, I could've worked around that, but the editor simply isn't suitable for working with two ports at the same time.

Months ago, I actually started creating a standalone program for this, because that makes more sense. But I noticed I had to (re)use massive amounts of apoplexy code. So, I gave that a try, and - as I wrote above - it failed. Now that I'm back to square one, I've changed my mind once again. If I create this, it'll have to be a standalone program after all.

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

Re: post suggestions here

Post by Norbert »

Norbert wrote: October 15th, 2020, 7:55 pmUndo functionality... maybe one day.
I dread implementing it, because I'd want to do it properly with multi-level undo, which would require a linked list.
Regarding undo functionality...
Anyone have thoughts on what would be a good cross-platform linked list library to use?
I do know about glibc (GNU's implementation of the C standard library) and sys/queue.h (BSD libc), but both are only for Unix-like systems. I did find clibs/list at GitHub, which might be cross-platform.

If I'm not mistaken, I should store the following per undo level:

Code: Select all

720 iThingA
720 iModifierA
256 sFirstDoorEvents
256 sSecondDoorEvents
96 iRoomConnections
64 sUnknownI (first byte for remapped modifiers, the rest is multiplayer information)
3 luKidRoom, luKidPos, luKidDir
4 sUnknownIIandIII (just 3 bytes in potions level; unused and includes "SwStartScrn" and "SwStartBlock", so was most likely once meant for the shadow; II is used by RoomShaker to store its Debug Start)
24 sGuardLocations
24 sGuardDirections
48 sUnknownIVaandIVb (IVa is auto-initialized when the level is loaded, based on sGuardLocations; when the prince leaves the room, IVb and IVc are respectively GdStartSeqL and GdStartSeqH, will store what the guard is doing, and IVa the x-axis position)
24 sGuardSkills
24 sUnknownIVc (see above)
24 sGuardColors
16 sUnknownIVd (unused, merely pads level data)
2 sEndCode
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: post suggestions here

Post by Norbert »

Also, it's unclear to me how I can fix a certain compiler warning. Namely, the detection of a possible overflow in a string operation on line 36180 of apoplexy 3.16. There, I'm passing COMPATIBLE_NATIVE as argument 3 to function DisplayTextLine(), which expects char sText[MAX_TEXT + 2]. I get that COMPATIBLE_NATIVE is smaller than 102 bytes. But I don't see that is a problem if the string I pass is null-terminated. As I understand it, MAX_TEXT + 2 is the maximum size. Either way, my question is how I can get rid of the warning by code modification (as opposed to suppressing the warning). Anyone? (By the way, the warning also shows up for similar code, where I pass a non-#define'd string to the same function, such as the text "Jump to which room?".)
FluffyQuack
Vizier
Vizier
Posts: 80
Joined: June 6th, 2004, 7:05 pm

Re: post suggestions here

Post by FluffyQuack »

Norbert wrote: December 15th, 2022, 3:04 pm
Norbert wrote: October 15th, 2020, 7:55 pmUndo functionality... maybe one day.
I dread implementing it, because I'd want to do it properly with multi-level undo, which would require a linked list.
Regarding undo functionality...
Anyone have thoughts on what would be a good cross-platform linked list library to use?
I do know about glibc (GNU's implementation of the C standard library) and sys/queue.h (BSD libc), but both are only for Unix-like systems. I did find clibs/list at GitHub, which might be cross-platform.

If I'm not mistaken, I should store the following per undo level:

Code: Select all

720 iThingA
720 iModifierA
256 sFirstDoorEvents
256 sSecondDoorEvents
96 iRoomConnections
64 sUnknownI (first byte for remapped modifiers, the rest is multiplayer information)
3 luKidRoom, luKidPos, luKidDir
4 sUnknownIIandIII (just 3 bytes in potions level; unused and includes "SwStartScrn" and "SwStartBlock", so was most likely once meant for the shadow; II is used by RoomShaker to store its Debug Start)
24 sGuardLocations
24 sGuardDirections
48 sUnknownIVaandIVb (IVa is auto-initialized when the level is loaded, based on sGuardLocations; when the prince leaves the room, IVb and IVc are respectively GdStartSeqL and GdStartSeqH, will store what the guard is doing, and IVa the x-axis position)
24 sGuardSkills
24 sUnknownIVc (see above)
24 sGuardColors
16 sUnknownIVd (unused, merely pads level data)
2 sEndCode
I can quickly mention the system I wrote for a level editor for one of my old projects, which was a fairly straightforward system. I didn't use a linked list, but rather a linear array where each entry contained the same quantity of data.

Code: Select all

enum
{
	UNDOACTION_TILE, //First 2 bytes are room num and tile num. Last 5 bytes are tileType and tileSpecs
	UNDOACTION_PLAYERSTARTPOS, //3 bytes: room num, tile num, and direction
	//Etc
};

struct undoStep_s
{
	int action; //The type of data to revert when processing this undo step (see above enum list)
	int data[7]; //The data used when reverting any kind of data (the size of this should correspond to the maximum needed for any unique undo action)
	bool undoMore; //If true, we'll automatically continue to next undo step (this is useful when undoing big user actions, like copying and pasting an entire room)
};

static undoStep_s *undoList = 0;
static int undoListSize = 10000; //This is starting size of undo list
static int undoPos; //Current position we're at in undo list (goes up by one with each action user takes and gets reduced by each undo)
static int undoHighest; //Max position we can redo to (gets reset each time user manually paints or changes a level setting)
Hopefully, rest of the system is fairly self-explanatory. Each time the user takes an action, you add a corresponding step to the undo array (the type of action and whatever data is needed to restore the tile (or other data type) to the previous state). If the user does a big action (ie, copy and paste an entire room), you add many steps to the undo list and make sure to set undoMore to true so that the code knows to process multiple undo steps when user clicks once on "undo."

If I recall, that kind of system didn't take a lot of work to implement and it was pretty robust. Thought it might involve quite a bit of work if you have a very long list of unique types of data that can be modified.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: post suggestions here

Post by Norbert »

Thanks for the feedback, FluffyQuack.
I'll try to understand it, and if it's something I can use.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: post suggestions here

Post by Norbert »

Norbert wrote: December 17th, 2022, 10:43 am Also, it's unclear to me how I can fix a certain compiler warning. Namely, the detection of a possible overflow in a string operation on line 36180 of apoplexy 3.16. There, I'm passing COMPATIBLE_NATIVE as argument 3 to function DisplayTextLine(), which expects char sText[MAX_TEXT + 2]. I get that COMPATIBLE_NATIVE is smaller than 102 bytes. But I don't see that is a problem if the string I pass is null-terminated. As I understand it, MAX_TEXT + 2 is the maximum size. Either way, my question is how I can get rid of the warning by code modification (as opposed to suppressing the warning). Anyone? (By the way, the warning also shows up for similar code, where I pass a non-#define'd string to the same function, such as the text "Jump to which room?".)
I think this is just -Wstringop-overflow misbehaving. Compiler gcc - I'm using 11.3.0 - has all kinds of bugs about false positives. Possibly related reports here and here. I'm fixing this with -Wno-stringop-overflow. And I don't see that as a workaround, but a fix.
Post Reply