Promiseland

User avatar
Fetian
Posts: 3968
Joined: Sun Jun 26, 2022 7:33 pm
.oO: Look at me, still talking when there's science to do

Re: Promiseland

Unread post by Fetian »

Screenshot 2025-03-05 at 00-30-19.png
You do not have the required permissions to view the files attached to this post.
User avatar
Fetian
Posts: 3968
Joined: Sun Jun 26, 2022 7:33 pm
.oO: Look at me, still talking when there's science to do

Re: Promiseland

Unread post by Fetian »

Up At Eight AM Because Coding Is A Nightmare

User avatar
Fetian
Posts: 3968
Joined: Sun Jun 26, 2022 7:33 pm
.oO: Look at me, still talking when there's science to do

Re: Promiseland

Unread post by Fetian »

Alright! So! I have been working on a thing. It's not the Top Secret Thing I've also been working on, but I did want to have something solid to show for it before I said anything about it -- and now I do!

It's here. It is an ~*interactive experience*~, and while nothing happens in it yet it is going to be a porn, so there's implications of the direction it's going. But right now it doesn't go anywhere.

This is the source code: here. Obviously I think it is a better experience to play the game and find the things it has to offer organically, but once you've exhausted everything you can think of to do and want to see what else is in there, or if you want to dig around in its guts and just see how it works, there you go.

Now. As mentioned I was up until 8 this morning working on it because jesus christ. Jesus christ. For a start the documentation for Inform is just, not very good, and I spent a lot of time digging around trying to figure out how to do things I knew the programming language could handle -- for example, the player character is carrying a wallet. I wanted the wallet to contain coded objects because I wanted the program to react if the player tried to interact with the wallet's contents, but I also wanted to list the contents by hand in the wallet's description. By default, Inform will list contents of containers after the container's description, so without intervention looking at the wallet would result in something like this:

Code: Select all

> look at wallet
It's a leather wallet with your license, two credit cards, and a $20 bill inside.

It contains a license, credit cards, and twenty dollars.

The appropriate way to stop Inform from listing visible objects after a description is to declare those objects "scenery", but scenery can't be in a container the player is holding because scenery isn't supposed to move. The less appropriate but acceptable way is to declare the objects "undescribed", which did work until the player attempted to interact with any of the wallet's contents because Inform will ""helpfully"" remove the undescribed property from objects that are directly or indirectly in the player's possession. I fought this one for ages trying to reapply undescribed or searching for a different property that would do what I needed -- I am positive I read about a way to "omit" things, but what ended up being the correct way to handle it was to

Code: Select all

The examine containers rule does nothing when examining a wallet.

Which is just so. Ugh.

I also had a hell of a time preventing the player from removing clothes when another character isn't present (that is, allowing it when the character is) because everything in the documentation pointed toward a phrasing like "Instead of [verb] when in the presence of [noun]" and I couldn't get Inform to understand a negative version of that -- what I needed, it turns out, was "Instead of [verb] when [noun] is not in the location".

The error messages Inform throws are also so incredibly unhelpful. They really want to be, but 99 times out of 100 they don't actually point at the actual problem.

Anyway I did get all that working and wrote out the whole thing, and at about 3 AM was ready to wrap it up, put it online, and go to bed. All I had to do was make some text underlined, because I wanted to clue the reader in that that text is reactable in some way -- you can type in that text and the parser will respond as though you asked about it. I didn't want bold because that's too obtrusive and I wanted to be able to use italics as emphasis (in the same passage, even). Underline would be ideal because users are already primed in the 'this is interactable in some way' direction for hyperlinks, but I'd also take a change in the font or background color -- something to make the user think 'there is something different about this text and I should investigate it'. Unfortunately! The developers of Inform have an enormous stick up their butts about being able to underline text, or indeed change the appearance of the text at all!

There are two extensions that should have helped -- one of them doesn't have underline but it can change text color and was less complicated-looking to implement than the other, which does have underline and other CSS-related options. Unfortunately the text-color-changing part conflicted with a different extension, so I tried the other option and ran into a bug where including code from that extension in a specific part of the program (where I needed it to be, specifically) it would cause the program to hang where the text was supposed to appear. Not quite crash, just never load the text. I fought this for hours before I figured out what was wrong, because deleting a chunk of the relevant text would fix it -- regardless of what was in that text or where it was in that section.

I found a single person talking about it in June of last year -- the issue is that the code will cause the program to hang when asked to display text greater than 1026 characters. I tried for hours to figure out a workaround here -- maybe if I inject CSS into that section instead of using the style code, no that still breaks it. Maybe if I break the text into two sections -- no, it relies on "if first seen" code and it won't be "first seen" anymore in the second half. Maybe if I prevent the "has now been seen" code from firing and then fire it manually -- no, inform really doesn't like me trying to do that.

I ended up just putting brackets around the relevant text. I'm going to see if I can come up with something else for that, later but for now it's fine. And now I have a foundation on which I can build the rest of the game -- though naturally there are still some complicated features I want to implement. But I'm excited to continue working on it, despite the nightmare that is working with computers. I hope any of that -- especially the thing itself! -- is interesting to other people!

User avatar
Fetian
Posts: 3968
Joined: Sun Jun 26, 2022 7:33 pm
.oO: Look at me, still talking when there's science to do

Re: Promiseland

Unread post by Fetian »

Yeah like

I want to create an action that will update the player's description (a "preening" command that will touch up makeup, for example). So I try

Code: Select all

Preening is an action applying to nothing. Understand "preen", "check appearance", "touch up appearance", "touch up", and "check self" as preening.
Carry out preening:
	say "You pull out your compact, re-apply your rouge, and touch up your lipstick."
	now the player's description is "You look devastating, and devastated. Surely no one could accuse you of murdering your husband now!"

Inform doesn't like that! The error is completely unhelpful except insofar as indicating that Something about what I've written is wrong! I try googling all kinds of 'how to change a description mid-game' and get absolutely nothing useful out of it! Finally I discover the problem is that it needs to say "the description of the player" and not "the player's description".

The is the kind of inversion that I want the error codes to point me toward. It should be able to tell that because I've used all of the words "now" "description is" "player" a rough idea of what I'm trying to do, and suggest 'it looks like you're trying to update a description, here is the manual page for that. It looks like you're trying to do something with the player's description, here's the manual page for that.'

This is the error you actually get:

Code: Select all

Problem. In the sentence 'now the player's description is "Test description"'  , I was expecting to read a condition, but instead found some text that I couldn't understand - 'the player's description is "Test description"'.

Because of this problem, the source could not be translated into a working game. (Correct the source text to remove the difficulty and click on Go once again.)

And that's the vast majority of errors I get. "I couldn't understand that, please try again".

The programming language wants so, so, so badly to be human-readable and to sound like natural language but that just means I'm constantly getting tripped up by trying to write something in natural language that the compiler can't actually understand. Give me "player_description == 'test description';" any day.

User avatar
Fetian
Posts: 3968
Joined: Sun Jun 26, 2022 7:33 pm
.oO: Look at me, still talking when there's science to do

Re: Promiseland

Unread post by Fetian »

If I could actually search the manual for this sort of thing that would be one thing, but I'm finding that the things I know I've read about being able to do I simply cannot find again for the life of me.

User avatar
Fetian
Posts: 3968
Joined: Sun Jun 26, 2022 7:33 pm
.oO: Look at me, still talking when there's science to do

Re: Promiseland

Unread post by Fetian »

I'm an adult and that means I can eat candy I found abandoned in a parking lot if I want to

User avatar
erikavonkaiser
Posts: 2281
Joined: Tue Jul 12, 2022 8:39 pm
Pronouns: she/her
.oO: power of friendship 🐀👑

Re: Promiseland

Unread post by erikavonkaiser »

Fetian wrote: Sat Mar 08, 2025 10:59 pm

I'm an adult and that means I can eat candy I found abandoned in a parking lot if I want to

Mags behavior

User avatar
Fetian
Posts: 3968
Joined: Sun Jun 26, 2022 7:33 pm
.oO: Look at me, still talking when there's science to do

Re: Promiseland

Unread post by Fetian »

Went shopping! Mostly uneventful except that groceries have gotten so fucking expensive. They did have a bunch of varieties of orange, and since I live in California produce is one of the cheapest (but still too expensive) things I can buy so I got a couple kinds I've never had before -- cara cara oranges and blood oranges! And mandarins since I know I like those.

When we were leaving I saw what looked like a present laying on the ground near our car, so I picked it up. It turned out to be a balloon weight sans balloon, and I figured if it was just garbage it would still be good to take it home and throw it away, but it also turned out to be full of candy when I cut it open. They're little hard candies in blue wrappers with footprints on them, so I figure it was for a baby shower, and the one I have eaten so far was a weird sour bubblegum flavour. I will have another in a minute here to find out if they're all the same.

Since then I have been Monster Hunting (I am enjoying Rise, though not as much as World, and I'm frankly kind of disappointed in the fashion options) and poking at Inform coding. Today's adventure has been in making failure messages not consume a turn while still allowing 'on every turn do x' rules to pop. I have succeeded and am now going to go hang out with ash.

User avatar
Fetian
Posts: 3968
Joined: Sun Jun 26, 2022 7:33 pm
.oO: Look at me, still talking when there's science to do

Re: Promiseland

Unread post by Fetian »

I'm having a blood orange for the first time and I was not prepared for just how goth these things really are

This orange is black the juice is so dark. It's bleeding purple. It's also delicious

User avatar
Fetian
Posts: 3968
Joined: Sun Jun 26, 2022 7:33 pm
.oO: Look at me, still talking when there's science to do

Re: Promiseland

Unread post by Fetian »

These must be 'moro' oranges, from what I'm reading

Post Reply