CusPop options in SDLPoP

Open-source port of PoP that runs natively on Windows, Linux, etc.
Post Reply
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

CusPop options in SDLPoP

Post by Falcury »

Quite a few CusPop options are being added to SDLPoP in the new release.
However, the options that edit the special events of the game are still missing as of yet.

I have been wondering how we should handle these options...
Most special event options are tied to a particular level in the code using a comparison with the current_level variable, like so:

Code: Select all

// Special event: set checkpoint
if (current_level == 3 && Char.room == 7) {
	checkpoint = 1;
	hitp_beg_lev = hitp_max;
}
So, say that we want to allow using a checkpoint in another level than level 3, for instance:

The easiest option would be to allow current_level to be compared with other values, and add an option to the [CustomGameplay] section of SDLPoP.ini like this:

Code: Select all

checkpoint_level = 3
But, suppose we would like to use a checkpoint in more than one level. We could quite easily add this functionality. We could maybe create an SDLPoP.ini option like this:

Code: Select all

; If desired, you may enter multiple level numbers (separated by commas)
checkpoint_level = 3, 4, 7
One way to implement this would be to use a bitfield (with 1 bit for each level) to store the level information for a specific special event, write a small function to extract the information, and then use that like so:

Code: Select all

// Special event: set checkpoint
if (is_special_event_level(checkpoint_level) && Char.room == 7) {
	checkpoint = 1;
	hitp_beg_lev = hitp_max;
}
So, do we want this (multiple levels for each special event) to be possible? And if yes, would this be a good way to implement it?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: CusPop options in SDLPoP

Post by Norbert »

Falcury wrote:So, do we want this (multiple levels for each special event) to be possible?
I think maybe it's useful to take a step back and look at the project more generally. Maybe "do we want this" can be answered by looking at what mod authors are doing and requesting. After more versatile INI options were introduced, a handful of mods have been created, but none used SDLPoP. Even though, perhaps with the exception of never giving the prince his sword at the start of levels, all core/most-used customizations are available.

If there would be mod authors interested in working with SDLPoP, feature requests would pop up. Such interest might emerge if the application's advantages are more clearly advertised. I've written previously that a starting screen could show important keyboard shortcuts, such as F6/F9 to quicksave/load. Also, I think very few people are aware that SDLPoP supports some additional, unique tiles. I personally barely even remember what the unique potions in your mod were; was there a blue potion that teleported the player? I'm serious, I don't remember, and I don't think these potion customizations ever made it into SDLPoP. I should've made it (even) easier to add custom tiles to apoplexy's SDLPoP tiles screen, but it is what it is.

Anyway, maybe the document that explains how to use SDLPoP (and MININIM) with apoplexy isn't enough, maybe there should be a video about modding with SDLPoP that also goes into the INI options. I also think most people are unaware of what's theoretically possible with SDLPoP. It needs some kind of killer feature to get modders interested. A potion that can display text, a potion that turns back time but leaves gates open, or something similar. A multiplayer option, to have one player touch a button while another walks through a gate.

You're basically missing input from (potential) modders. No doubt, for example, David can give useful feedback to your "do we want this" question, but his primary interest (too) is probably with developing and not modding itself. Maybe there should be a thread where people can (brainstorm about and) make feature requests. And maybe a new administrator should point to that thread on Twitter, Facebook, and the main Princed web page.

I think new custom tiles that can be used with a proper level editor (either external, such as apoplexy, or as part of SDLPoP itself) could breathe new life into the modding scene. We could move away from all the super hard mods and get back to easy but cleverly designed levels. New custom tiles could play a big role in this. Potions are probably key here. And maybe different kinds of swords, like a sword that can remove new custom, differently colored walls.
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: CusPop options in SDLPoP

Post by David »

I have some similar feelings: Does anyone even use these new features?

Another thing is that I don't feel SDLPoP to be as exciting as I did when it was new.
If you look at my recent commits, most are just merges: https://github.com/NagyD/SDLPoP/commits/master

Maybe part of this is that I have a day-time job since 2015, and that takes much of my time.
Not to mention that, like any job, it's about doing things that others ask for.
I'm not sure if I want to do the same in my remaining free time. :|

And then of course I have some other hobbies...
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: CusPop options in SDLPoP

Post by Falcury »

Thanks for your comments, Norbert and David. You bring up good points.

On the topic of SDLPoP's new features and whether they actually get used:
Perhaps I myself have been too hasteful in my own drive to implement new stuff, losing sight of the users? That's quite possible...

I do believe that "zero PR" can be "enough" if the product is simply very very good (as I believe SDLPoP has been from the start!)
I love Tesla's strategy for instance (as described in posts like this one: http://www.referralcandy.com/blog/tesla/)

But yeah, it may be good to get more modders involved.

I have been hoping to be able to port all of the existing mods to SDLPoP - to do a sort of SDLPoP-based Total Pack alternative. For this to be possible, of course all existing mod features need to be fully implemented...

Then after that, the "killer feature" could become the SDLPoP ecosystem as a whole. If we provide the tools for modders to exchange new mods (perhaps... based around popot.org...?), with automatically updated high-scores, etc. all in ways that are way more user-friendly than what we have now, then I think our platform could certainly take off.

But in the short term we could simply work towards the 1.17 release, then take a short break (or a long break)... I agree, it won't do us much good if we plough on even though our hearts are not in this... I know I certainly won't be able to do it myself without you guys.
I am sorry to hear that you are starting to think of SDLPoP as a burden, David. :(
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: CusPop options in SDLPoP

Post by Norbert »

Migrating existing mods to SDLPoP or complementing them with additional SDLPoP ZIP packages sounds like a lot of work. There are 165 PoP1 for DOS mods on popot.org, plus whatever may be created in the future. Manually, for instance by running diffpop on executables and then assembling INI files, this could take days. Creating a program to take care of the job might be even more work.

I do like the idea of doing something with (high)scores. If instances could be launched on the server-side, as the Internet Archive is doing with PoP1 for DOS using DOSBox here, it might be possible to attach (e.g. popot.org) user accounts to instances/progress. This might prevent tampering and could allow official mod winners to show off trophies and whatnot. But this also sounds like a lot of work. I know GTK+ applications can run in a web browser using the GDK Broadway backend. No idea if SDL has something similar; maybe Emscripten could do this.
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: CusPop options in SDLPoP

Post by David »

Norbert wrote:If instances could be launched on the server-side, as the Internet Archive is doing with PoP1 for DOS using DOSBox here,
It seems to me that the linked page runs the game in the browser (using a JS port of DOSBox), not on the server.
They say "Stream Only" and "Free Streaming", though.

(After the game has started, just pull your LAN cable and see what happens. Or rather, doesn't happen.)
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: CusPop options in SDLPoP

Post by Falcury »

David wrote:
Norbert wrote:If instances could be launched on the server-side, as the Internet Archive is doing with PoP1 for DOS using DOSBox here,
It seems to me that the linked page runs the game in the browser (using a JS port of DOSBox), not on the server.
They say "Stream Only" and "Free Streaming", though.

(After the game has started, just pull your LAN cable and see what happens. Or rather, doesn't happen.)
I just noticed on that DOSBox emulator page, if you press Ctrl+Q, you back to DOS and this message appears: "Hope you enjoyed it - R. Bubba Magilicutty/THG". (This is someone who made one of the copy protection cracks, right?)
And after you quit the game, it seems you can do just about anything you want in DOSBox, including relaunching the game with cheats enabled :P
So yeah, it does seem like everything runs locally in the browser...

I suppose if we want to verify high scores, one way to do it would be to upload not only the final time to a server, but the entire replay of the playthrough - that could then be played back faster than real-time on a server that runs a stripped version of SDLPoP (which doesn't even render anything to the screen, but just steps through the gameplay frames).
Norbert wrote:Maybe there should be a thread where people can (brainstorm about and) make feature requests. And maybe a new administrator should point to that thread on Twitter, Facebook, and the main Princed web page.
I thought about this for a bit. If we do want some publicity, we could probably even try to contact some gaming or technology-oriented news websites and ask them if they would like to write a post about SDLPoP. I guess there would definitely be some interest in this. What do you think about this?

(Hm, I'm realizing this goes completely against what I said in my earlier post about "zero PR" and what Tesla is doing :| I suppose maybe the comparison with Tesla is not a good one, because Tesla is so well-known anyway that they don't need to tell people where to find them...)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: CusPop options in SDLPoP

Post by Norbert »

Norbert wrote: October 16th, 2016, 1:52 amIt needs some kind of killer feature to get modders interested. A potion that can display text, [...] Potions are probably key here.
I made this a feature request.

I see I also brought this up in another thread:
Norbert wrote: November 25th, 2015, 8:04 pm Maybe a certain range of potion modifiers could refer to line numbers in a text file, that drinking a potion could display text in the text bar.
With a specific bubble color that indicates the potion is a text potion?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: CusPop options in SDLPoP

Post by Norbert »

Norbert wrote: January 1st, 2019, 8:53 pm
Norbert wrote: October 16th, 2016, 1:52 amIt needs some kind of killer feature to get modders interested. A potion that can display text, [...] Potions are probably key here.
I made this a feature request.

I see I also brought this up in another thread:
Norbert wrote: November 25th, 2015, 8:04 pm Maybe a certain range of potion modifiers could refer to line numbers in a text file, that drinking a potion could display text in the text bar.
With a specific bubble color that indicates the potion is a text potion?
Actually, perhaps these should be full-screen-image potions instead of text potions.
Displaying a(n optionally transparent) PNG image would be more versatile.
It could still be used to display text, but it could also be used in many other ways.
I'll also add this as a comment to the feature request on GitHub.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: CusPop options in SDLPoP

Post by Falcury »

I am thinking, how would I use text potions, or image potions in a level, exactly?
Would it work like a 'caption' for the potion itself, like the letters in the copy protection level? I don't really know how I would use that. I could imagine that you could have labeled potions, as a hint for what the potion does, for example. But we have a limited set of actual potion effects and it's already quite clear from a potion's appearance what the expected effect might be.
Or would it be more like a notification system, and the potion purely acts as a trigger for displaying a text message or an image? If so, the focus should maybe be not so much on potions, but more of a generic 'event triggering' feature, where drinking a potion is just one of many ways in which something can get triggered. For instance, moving into a specific room, leaving a room in a specific direction, pressing a particular button (etc.) might also be interesting to use as a trigger for a notification, or an image appearing, a tile or guard being changed somewhere, or other types of effects.
If texts or images are already going to be stored separately from the levels file, why not store the information about the triggers separately from the levels file, too? (As opposed to using unused potion ids for that purpose)
Incidentally, from there, it's only a small step to a full blown scripting system ;)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: CusPop options in SDLPoP

Post by Norbert »

Falcury wrote: April 3rd, 2019, 9:08 pmI am thinking, how would I use text potions, or image potions in a level, exactly?
The potion would be a trigger that projects a custom 320x200 image onto the screen until the player presses a key. This image may have partial transparency to keep portions of the room visible. It can tell a story, give hints, (visually) change the environment, point out things (e.g. with arrows), etc.
Falcury wrote: April 3rd, 2019, 9:08 pmgeneric 'event triggering' feature
Some thoughts on this. Pragmatically, looking at it from a practical rather than theoretical perspective, I'm inclined to look at available legacy combos when it comes to expanding modding options. The community is small, so resources (e.g. developers) are limited. Small iterations are realistic, limit the workload, and can still bring impactful expansions. How many modders will program scripts, and how much more can scripts do that variants (modifiers) can't (tile ideas). I don't see myself adding a front-end to apoplexy for complicated scripting features either, and SDLPoP's "editor" branch hasn't been touched for years. One - I would say, important - plus is that by sticking with legacy combos (without scripting) what things mean (e.g. potion colors) when playing mods remains consistent. Also, media, such as images, are already stored outside LEVELS.DAT; information about the triggers is not. Creating a scripting system could be an interesting challenge, but so is carefully selecting and using legacy combos. Plus, constraints breed creativity. I enjoyed, for example, looking at 6-bit RGB for the colored torch flames to keep 2 bits available for possible future use. I'm one of the more active developers, and I see a lot of potential in the legacy combos. I'm ready to work on the level editor side of them, it's just a matter of finding volunteers to take on SDLPoP's side.

[Edit: Hm. All posts in this thread about these custom potions should probably be in another (or their own) thread...]
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: CusPop options in SDLPoP

Post by Falcury »

Norbert wrote: April 4th, 2019, 1:17 amThe potion would be a trigger that projects a custom 320x200 image onto the screen until the player presses a key. This image may have partial transparency to keep portions of the room visible. It can tell a story, give hints, (visually) change the environment, point out things (e.g. with arrows), etc.
Both text and images have their uses, right? Might as well do both?
I remember experimenting with a 'hints system' at some point, where the idea was that you would get a text popup similar to what happens at the start of the copy protection level.
Norbert wrote: April 4th, 2019, 1:17 amI'm inclined to look at available legacy combos when it comes to expanding modding options.
Taking a step back, in the case of potion effects in particular, I am not so sure that a specification of which potion ID is associated with which effect should be rigidly enforced. Consider, this might happen: what if another interesting idea for a feature comes along, but all the IDs necessary for that have already been allocated to another idea? Then that new idea can no longer be implemented. Or, what if someone decides to fork SDLPoP for a mod and wishes to use different ID combinations for custom potion effects? Then they will have no choice but to break compatibility with modding-aware level editors like apoplexy.
To allow maximum future flexibility, maybe we could choose to leave the custom potion ID's 'undefined', or to be more precise: the specification of 'which potion does what' could be part of the level design. SDLPoP could implement some potentially unbounded set of custom potion effects (among which, displaying a text message or an image). Then, SDLPoP could read some extra information (maybe encoded somewhere in LEVELS.DAT) that specifies the mapping of potion ID <=> potion effect. As a modder, you could decide for yourself which potion effects you want to have in the mix. Either you could manually pick them, or a level editor could present a list of choices from which you could choose which ones you want enabled in your mod, and the editor could then automatically generate the mapping. Edit: or, as long as there are more IDs available than possible potion effects, a level editor could also just pick its own default mapping and stick to that.
(Incidentally, in the same way, you could maybe allow customizing which potions are big or small, and their colors. And in that way, the custom potion appearance can also be displayed directly in the editor.)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: CusPop options in SDLPoP

Post by Norbert »

Falcury wrote: April 6th, 2019, 10:12 pmBoth text and images have their uses, right? Might as well do both?
On the one hand, images can cover (include) text, and will automatically 'force' modders to be creative with fonts and such.
But, on the other hand, some modders might find it a hassle to modify images to display text.
I guess both image and text potions might be useful, yes.

As for potions and such: on the one hand, flexibility brings freedom, but on the other hand, if e.g. a potion can mean anything, then modders will make them do random stuff, which means players never know where they stand (Dutch: waar ze aan toe zijn). The latter is the exact opposite of what games, including PoP1, generally try to do. For example, in the first room you learn that loose floors exist, aren't immediately visible, and fall down if you walk on them. Small potions with red bubbles heal 1 HP. So, I'm thinking, give modders lots of tools, but define what the tools do. This in turn will allow players to generally know what they see, with only minor exceptions (such as the fake tiles). In theory, everything could be made incredibly modular and versatile, but it's not necessarily the best choice to travel that route.

I think you are right that we'll want more than just the tile group+variant combos for storing information. But I still think the legacy combos can be sufficient to figure out what kind of extra information is available and where it is stored. In theory, we could simply introduce a new file that stores all kinds of information, but isn't it more interesting and challenging to treat the legacy combos as precious?

Again, just some thoughts. I certainly don't want to stop any awesome progress by creating artificial limits, which, I'm aware, I'm somewhat doing with my reasoning and suggestions.
Post Reply