Introduction to Inform Game Engine and PunyInform Library

W
Wilfried ElmenreichUniversity of Klagenfurt/Lakeside Labs
10/10/2021 1
Inform Game Engine
and the PunyInform Library
Wilfried Elmenreich
Many thanks to Gareth Rees for the slides
about the Inform engine mechanisms
10/10/2021 2
Need at Least One Object
Object BroomCloset "Broom Closet"
with
description "You're in the rather dirty broom
closet of The Red Anchor.
Various cleaning appliances line the
walls. There's a pile of fabric
in a corner.",
e_to BroomClosetDoor,
has light;
10/10/2021 3
Initialise Function
[Initialise;
print "^^You wake up with a headache. Yesterday's
events are only a blur. So just another normal day
for you...^^";
thedark.short_name = "Your view is very
blurry.";
thedark.description = "You cannot see much
because of the rag over your eyes. You should
eventually disrobe it.";
player.add_to_scope = PlayerAddToScope;
];
10/10/2021 4
Return Codes
• A routine inside an object returns 0 (false) by
default
• A routine outside of an object returns 1 (true)
by default.
• You can override this default using the
`return', `rtrue' and `rfalse' statements, or by
omitting the `print' instruction from a print
statement.
10/10/2021 5
Meaning of Return Codes
`before‘
`life'
– True (1) means that the routine has successfully
and completely dealt with the player's input, and
the library shouldn't do anything more.
– False (0) means that the usual library rules should
now apply to the player's input (note that this
doesn't necessarily mean that the routine has
done nothing).
10/10/2021 6
Meaning of Return Codes
`after'
– True (1) means that the `after' routine has printed
a suitable response to the player's input, and the
library shouldn't do anything more.
– False (0) means that the usual library message
should now be printed (again, this doesn't
necessarily mean that the routine has done
nothing).
10/10/2021 7
Before and After
• ‘before’
– Should be used to change completely the effect of
a particular action
• ‘after’
– Should be used to change the message
associated with a particular action
10/10/2021 8
Meaning of Return Codes
`describe'
– True (1) means that the `describe' routine has
printed a suitable description. The library shouldn't
add anything else.
– False (0) means that the library should print the
usual description of the object.
10/10/2021 9
Programming Tip
• In an object's `before' routine, it's very
common to want to
– execute some code
– print some text to tell the player what has
happened
– return 1 to prevent the library from doing anything
else.
• A good trick in this situation is to omit the
`print' keyword from the last print statement.
10/10/2021 10
Simple Object
Object -> Note "note"
with
name 'note',
description "The note says 'Be sure to know where your towel is'.",
initial "A note has been fixed to the wall with a knife.",
after [;
Take:
if(Knife hasnt moved && self hasnt general) {
! Use the general attribute to say we've already pulled
! the note from the wall, so we don't print this twice.
give self general;
move knife to player;
"The knife rips a long hole in the note as you pull the
note from the wall.";
}
];
10/10/2021 11
Scenery Object
Object -> Rainpipe "rainpipe"
with
name 'rainpipe' 'pipe',
description "A rainpipe leading down from the roof
and ending right under the balcony. When it's raining,
it splashes water on the pedestrians 10 meters below.",
before [;
Climb:
print "You carefully climb up on the
rainpipe.^";
PlayerTo(TheRoof);
rtrue;
],
has scenery;
10/10/2021 12
Building and Testing the Game
Compile the game using the Inform6 compiler
inform6 -v3 +lib game.inf
Testing under Windows with
Frotz
Building a C64 version with Ozmoo
ruby make.rb -S1 -f fontsdesoftwriter-ger.fnt -dd -rc:8=15 -dc:6:9 -
bc:6 -sc:15 -i houseonahill.kla buccaneers_cache_r2.z3
Z-Code Interpreters for many platforms available
1 von 12

Recomendados

Elmenreich Interoperability between smart and legacy devices in energy manage... von
Elmenreich Interoperability between smart and legacy devices in energy manage...Elmenreich Interoperability between smart and legacy devices in energy manage...
Elmenreich Interoperability between smart and legacy devices in energy manage...Wilfried Elmenreich
3.7K views22 Folien
Machine Learning Techniques for the Smart Grid – Modeling of Solar Energy usi... von
Machine Learning Techniques for the Smart Grid – Modeling of Solar Energy usi...Machine Learning Techniques for the Smart Grid – Modeling of Solar Energy usi...
Machine Learning Techniques for the Smart Grid – Modeling of Solar Energy usi...Wilfried Elmenreich
2.8K views40 Folien
AI Techniques for Smart Grids von
AI Techniques for Smart GridsAI Techniques for Smart Grids
AI Techniques for Smart GridsWilfried Elmenreich
4.9K views32 Folien
Smart Microgrids: Overview and Outlook von
Smart Microgrids: Overview and OutlookSmart Microgrids: Overview and Outlook
Smart Microgrids: Overview and OutlookWilfried Elmenreich
6.7K views28 Folien
Evolving a Team of Self-organizing UAVs to Address Spatial Coverage Problems von
Evolving a Team of Self-organizing UAVs to Address Spatial Coverage ProblemsEvolving a Team of Self-organizing UAVs to Address Spatial Coverage Problems
Evolving a Team of Self-organizing UAVs to Address Spatial Coverage ProblemsWilfried Elmenreich
1K views25 Folien
Evolution as a Tool for Understanding and Designing Collaborative Systems von
Evolution as a Tool for Understanding and Designing Collaborative SystemsEvolution as a Tool for Understanding and Designing Collaborative Systems
Evolution as a Tool for Understanding and Designing Collaborative SystemsWilfried Elmenreich
1.2K views36 Folien

Más contenido relacionado

Último

Supercharging your Python Development Environment with VS Code and Dev Contai... von
Supercharging your Python Development Environment with VS Code and Dev Contai...Supercharging your Python Development Environment with VS Code and Dev Contai...
Supercharging your Python Development Environment with VS Code and Dev Contai...Dawn Wages
5 views51 Folien
How Workforce Management Software Empowers SMEs | TraQSuite von
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteTraQSuite
6 views3 Folien
tecnologia18.docx von
tecnologia18.docxtecnologia18.docx
tecnologia18.docxnosi6702
5 views5 Folien
Techstack Ltd at Slush 2023, Ukrainian delegation von
Techstack Ltd at Slush 2023, Ukrainian delegationTechstack Ltd at Slush 2023, Ukrainian delegation
Techstack Ltd at Slush 2023, Ukrainian delegationViktoriiaOpanasenko
7 views4 Folien
EV Charging App Case von
EV Charging App Case EV Charging App Case
EV Charging App Case iCoderz Solutions
9 views1 Folie
Benefits in Software Development von
Benefits in Software DevelopmentBenefits in Software Development
Benefits in Software DevelopmentJohn Valentino
5 views15 Folien

Último(20)

Supercharging your Python Development Environment with VS Code and Dev Contai... von Dawn Wages
Supercharging your Python Development Environment with VS Code and Dev Contai...Supercharging your Python Development Environment with VS Code and Dev Contai...
Supercharging your Python Development Environment with VS Code and Dev Contai...
Dawn Wages5 views
How Workforce Management Software Empowers SMEs | TraQSuite von TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuite
TraQSuite6 views
tecnologia18.docx von nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67025 views
Dapr Unleashed: Accelerating Microservice Development von Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski15 views
Advanced API Mocking Techniques Using Wiremock von Dimpy Adhikary
Advanced API Mocking Techniques Using WiremockAdvanced API Mocking Techniques Using Wiremock
Advanced API Mocking Techniques Using Wiremock
Dimpy Adhikary5 views
Mobile App Development Company von Richestsoft
Mobile App Development CompanyMobile App Development Company
Mobile App Development Company
Richestsoft 5 views
JioEngage_Presentation.pptx von admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254558 views
predicting-m3-devopsconMunich-2023-v2.pptx von Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app12 views
Understanding HTML terminology von artembondar5
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminology
artembondar57 views
Electronic AWB - Electronic Air Waybill von Freightoscope
Electronic AWB - Electronic Air Waybill Electronic AWB - Electronic Air Waybill
Electronic AWB - Electronic Air Waybill
Freightoscope 5 views

Destacado

Google's Just Not That Into You: Understanding Core Updates & Search Intent von
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
6.9K views99 Folien
How to have difficult conversations von
How to have difficult conversations How to have difficult conversations
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACC
5.6K views19 Folien
Introduction to Data Science von
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
82.6K views51 Folien
Time Management & Productivity - Best Practices von
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
169.8K views42 Folien
The six step guide to practical project management von
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
36.7K views27 Folien
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... von
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
12.7K views21 Folien

Destacado(20)

Google's Just Not That Into You: Understanding Core Updates & Search Intent von Lily Ray
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray6.9K views
Time Management & Productivity - Best Practices von Vit Horky
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky169.8K views
The six step guide to practical project management von MindGenius
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius36.7K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... von RachelPearson36
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson3612.7K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... von Applitools
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools55.5K views
12 Ways to Increase Your Influence at Work von GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.7K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... von DevGAMM Conference
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference3.6K views
Barbie - Brand Strategy Presentation von Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well von Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.3K views
Introduction to C Programming Language von Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.5K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... von Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.4K views
9 Tips for a Work-free Vacation von Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future von SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -... von AccuraCast
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
Beyond Pride: Making Digital Marketing & SEO Authentically LGBTQ+ Inclusive -...
AccuraCast3.4K views

Introduction to Inform Game Engine and PunyInform Library

  • 1. 10/10/2021 1 Inform Game Engine and the PunyInform Library Wilfried Elmenreich Many thanks to Gareth Rees for the slides about the Inform engine mechanisms
  • 2. 10/10/2021 2 Need at Least One Object Object BroomCloset "Broom Closet" with description "You're in the rather dirty broom closet of The Red Anchor. Various cleaning appliances line the walls. There's a pile of fabric in a corner.", e_to BroomClosetDoor, has light;
  • 3. 10/10/2021 3 Initialise Function [Initialise; print "^^You wake up with a headache. Yesterday's events are only a blur. So just another normal day for you...^^"; thedark.short_name = "Your view is very blurry."; thedark.description = "You cannot see much because of the rag over your eyes. You should eventually disrobe it."; player.add_to_scope = PlayerAddToScope; ];
  • 4. 10/10/2021 4 Return Codes • A routine inside an object returns 0 (false) by default • A routine outside of an object returns 1 (true) by default. • You can override this default using the `return', `rtrue' and `rfalse' statements, or by omitting the `print' instruction from a print statement.
  • 5. 10/10/2021 5 Meaning of Return Codes `before‘ `life' – True (1) means that the routine has successfully and completely dealt with the player's input, and the library shouldn't do anything more. – False (0) means that the usual library rules should now apply to the player's input (note that this doesn't necessarily mean that the routine has done nothing).
  • 6. 10/10/2021 6 Meaning of Return Codes `after' – True (1) means that the `after' routine has printed a suitable response to the player's input, and the library shouldn't do anything more. – False (0) means that the usual library message should now be printed (again, this doesn't necessarily mean that the routine has done nothing).
  • 7. 10/10/2021 7 Before and After • ‘before’ – Should be used to change completely the effect of a particular action • ‘after’ – Should be used to change the message associated with a particular action
  • 8. 10/10/2021 8 Meaning of Return Codes `describe' – True (1) means that the `describe' routine has printed a suitable description. The library shouldn't add anything else. – False (0) means that the library should print the usual description of the object.
  • 9. 10/10/2021 9 Programming Tip • In an object's `before' routine, it's very common to want to – execute some code – print some text to tell the player what has happened – return 1 to prevent the library from doing anything else. • A good trick in this situation is to omit the `print' keyword from the last print statement.
  • 10. 10/10/2021 10 Simple Object Object -> Note "note" with name 'note', description "The note says 'Be sure to know where your towel is'.", initial "A note has been fixed to the wall with a knife.", after [; Take: if(Knife hasnt moved && self hasnt general) { ! Use the general attribute to say we've already pulled ! the note from the wall, so we don't print this twice. give self general; move knife to player; "The knife rips a long hole in the note as you pull the note from the wall."; } ];
  • 11. 10/10/2021 11 Scenery Object Object -> Rainpipe "rainpipe" with name 'rainpipe' 'pipe', description "A rainpipe leading down from the roof and ending right under the balcony. When it's raining, it splashes water on the pedestrians 10 meters below.", before [; Climb: print "You carefully climb up on the rainpipe.^"; PlayerTo(TheRoof); rtrue; ], has scenery;
  • 12. 10/10/2021 12 Building and Testing the Game Compile the game using the Inform6 compiler inform6 -v3 +lib game.inf Testing under Windows with Frotz Building a C64 version with Ozmoo ruby make.rb -S1 -f fontsdesoftwriter-ger.fnt -dd -rc:8=15 -dc:6:9 - bc:6 -sc:15 -i houseonahill.kla buccaneers_cache_r2.z3 Z-Code Interpreters for many platforms available