Have you followed the tutorial on the PunyInform home page?
There are also many PunyInform games for which the source code is available: Search for Games
I believe Garry has published the source code of all his PunyInform games.
Have you followed the tutorial on the PunyInform home page?
There are also many PunyInform games for which the source code is available: Search for Games
I believe Garry has published the source code of all his PunyInform games.
Thereâs a good list of resources on the PunyInform GitHub page. From memory, @fredrikâs tutorials are quite good for beginners.
@otistdog has prepared an excellent list of documentation. Most of this is relevant to PunyInform, albeit with some modifications.
Thatâs true. The techniques you were asking about are in one or more of my games. You can download them or play them online at my itch.io site. You can find the source code, maps and solutions at my GitHub repository.
Hello Fredrik, Hello Garry,
Thank you both for the tips and recommendations. I will look at it all over the weekend and will certainly be able to use it. And if I have any further questions, I can look for and get help here.
Thomas
Hello Gary,
in your description you did not add:
update_moved = true;
Is it always necessary to add this, when an Object ist moved?
Thomas
You only have to set update_moved
when moving something to the playerâs inventory.
If you use PunyInformâs OPTIONAL_MANUAL_SCOPE
and you do something that affects the scope of one or more objects, then you are responsible for notifying the program that the scope has changed using scope_modified = true
so that it will redetermine the scope of all objects. This is intended to save execution time on old 8-bit micros.
If you donât use OPTIONAL_MANUAL_SCOPE
, then PunyInform does all the scope determinations regardless.
I believe PunyInform has changed over time and it is now much more efficient at determining changes in scope, so OPTIONAL_MANUAL_SCOPE
is no longer needed. At any rate, I donât use it, so I donât think I need scope_modified = true
. (Correct me if Iâm wrong @fredrik.)
Itâs true that you donât have to care about setting scope_modified
when moving things around, unless youâve defined OPTIONAL_MANUAL_SCOPE
. Exception: When defining your own action routines, you have to set scope_modifed
= true` when the action routine may have changed whatâs in scope. This is because when an action routine is called, the library has no way of knowing itâs user defined.
While a lot of parts of PunyInform has become more efficient, and figuring out exactly whatâs in scope may be a bit faster now than in the early versions, the basic principle hasnât changed - whenever the library calls user defined code, like a before
routine, or some entry point routine, it has to assume that the code may have moved things around, so the cached copy of whatâs in scope becomes invalid. This doesnât mean that scope is recalculated immediately, but the next time we need to know whatâs in scope, it has to be calculated.
If you define OPTIONAL_MANUAL_SCOPE
, this all changes. You promise to tell the library whenever the cached scope becomes invalid, and the library doesnât have to assume anything.
How much of a difference it makes depends on the game. If the player rarely sees more than say five objects at a time, scope calculation is quick. If, on the other hand, the player drags around an inventory of 30 objects, and then there are 10-20 more static and scenery objects in a location, the scope calculation becomes very tedious on a typical 8-bit machine.
I find it very simple to adapt a game to start using OPTIONAL_MANUAL_SCOPE
, so thereâs very little reason not do so:
move
. Whenever you use move
or remove
, set scope_modified = true
.give
. Whenever you set or clear any of the attributes open
, transparent
or light
, set scope_modified = true
.