Skip to content
Image with logo, providing a link to the home page
  • United Stated of America flag, representing the option for the English language.
  • Bandeira do Brasil, simbolizando a opção pelo idioma Português do Brasil.

Ideas, Rules, Simulation: Motivation

Example of source code for the JavaScript, Lua and Python programming languages, that were presented in the pages describing development environments set-up.

Image credits: Image created by the author using the program Inkscape; icons by Font Awesome.

Video Version

A video version of this content is available on YouTube (Portuguese audio; Portuguese and English subtitles). If you wish to share the content, you can use the hashtags #IdeasRulesSimulation and #FrancoGarciaCom.

The text version on this page is more complete and in-depth.

Learn Programming By Creating Simulations and Digital Games

The introductory material in Learn Programming is complete and detailed. Thus, it is a good reference for consulting. On the other hand, it can be complex and concept-heavy in some parts. In fact, some examples and concepts can be new even to experienced programmers. For instance, many professionals have never created images or sons programmatically, especially without using libraries, as it has been done in Files and Serialization (Marshalling).

Although I am satisfied with the material detailing, the examples could more interactive. Since Libraries, a few examples started using graphical libraries. In Command Line Input, some examples also used ncurses to create interactive interfaces for console or terminal. Furthermore, Godot Engine provide built-in resources for programming simulations and digital games without requiring external libraries. Nevertheless, they have not been used yet for such purpose.

Programming requires learning concepts and techniques, as well as practicing them. If this is your first time accessing this website, you are, in potential, a beginner programmer. Learning concepts and fundamentals is important for beginners. As such, teaching them was the goal of Learn Programming. If you do not know the material, it is free.

If you have followed the material of Learn Programming, you have learned essential programming fundamentals and concepts that can be used on any programming language. If you have reached Files and Serialization (Marshalling), you are a beginner anymore; in fact, you have adequate programming knowledge. You have the basis and the fundamentals to program complex systems, though you still need experience.

Experience comes from practice; there is no other way. Therefore, it is time to program to practice. You can keep using a console or a terminal. Albeit perhaps you wish to explore new computational resources.

How about creating interactive applications, such as digital games and simulations?

Challenges of Programming Using Interactive and Multimedia Content

As it has been commented in the introduction of Learn Programming, many people want to how to program to become able to implement dynamic and interactive systems for their devices. The device can be a computer, an Internet browser, or a mobile device (such as a smartphone or tablet); the creation of multimedia applications (with images, videos and sounds) is a common desire of beginners.

Learning to program is hard. It is even harder to create a simulation or a digital game without programming knowledge. Even simple simulations can be complex for beginners, especially when one wishes to include graphics, sounds and animations. There are tools that help to create specific systems, such as games of some genres or simple mobile applications. In fact, there is a research area called End-User Programming (also known as End-User Development) that investigates how to empower end-users to create or modify systems, even if they do not have programming experience. Coincidentally, this was one of the research areas of the author's PhD.

Nevertheless, the creation of a simulation or a game without a tool, as in using a programming language, can be complex for several reasons. For instance:

  1. Many programming languages require using external libraries to present multimedia content;
  2. The required knowledge to use the libraries and multimedia resources is significantly greater than that of using a subroutine such as print();
  3. Beginners do not have experience to estimate the complexity of a project. Typically, they want to create a system that is incompatible to their current skills, or a project with a too large scope (that, thus, can take a long time to complete, even with sufficient experience).

As such, a typical result is that beginners face the difficulties, feel overwhelmed, and give up. The problem is not a lack of capacity. To start programming and creating systems, dedication, curiosity, discipline and perseverance suffice. In reality, a common reason is the incompatibility between the abilities and current skills of the person, versus the complexity of the implementation.

What is lacking is a planning that balances the current skills with the required knowledge required for the implementation. A map, a script, or a plan, if you prefer. In the case of a human figure, a guide or a tutor.

This website can serve as the map; the author, as the guide. Therefore, it is time to start the next programming series of this website: Ideas, Rules, Simulation.

Possible Paths to Create Simulations and Digital Games

To start creating simulations, there are two potential paths:

  1. Creating a larger and more complex project slowly. A project over a long period of time;
  2. Creating simpler projects, with smaller scopes. Many projects created faster.

Programming beginners tend to choose the first option. The chosen project (practically) inevitably has a larger scope and complexity than the current programming skills and knowledge that the person possess. Consequently, the project is seldom completed.

From a didactic purpose, the first option also has some limitations. Although a single (large) project can be convenient for the author, it demands greater dedication and time availability from the beginner. Design and architecture decisions require experience to be applied and understood. Similarly, the created features can be too complex for beginners. Although following a tutorial or copying code can generate instant gratification, the learning can be limited.

To learning, it is more interesting to observe, understand, apply and create your own solution. It is easy to use an existing solution. It is harder to modify it. It is even harder to create a similar solution. It is much harder to create an innovating project.

Yet, the difficulty is incremental. To learn, it is more useful to understand the whole process a journey -- or a ladder. Each part is a level or a step. It can be impossible to jump from the first to the last one, though it is gentler to progress to the top over time.

Thus, my intention is not making you copy source code and delude yourself. My intention is helping you to learn and become able to create your own innovating technologies. A step at a time, with gradual, interactive and continuous progress. A journey, in fact.

Therefore, although the first option requires much more work from my part, it will be (very likely) much better for you.

Programming Languages for the Series

Hence, in this website we will choose the second path. Smaller projects with smaller scopes, with new concepts and complexity introduced over time. In other words, a continuous and incremental learning, on which your own programming and problem-solving skills will improve every project.

My intention is exploring JavaScript, Python, Lua and GDScript as the programming languages for the simulations. From the four languages, GDScript is the easiest to begin, as it only depending on install Godot Engine. JavaScript is the second, due the embedded canvas and audio support in modern browsers. Python and Lua require additional set-up.

For the text version, a page per topic (as it has been done for Learn Programming) can work well. However, I believe that the video version would become unnecessarily long for people who are interested in learning a single programming language (which is valid and interesting for beginners).

Possible alternatives for shorter videos include:

  1. Create split playlists per programming language. I could reuse the common content on all videos;
  2. Choose a single programming language for the video contents, adopted as the official one for the video series. The other languages would only have text entries;
  3. Switching among programming languages on the videos. After all, programming languages are tools. From a professional perspective, this would be the best option: selecting the most suitable language per project. However, from a didactic perspective, it would be the hardest for beginners. In practice, you would need to learn how to use all languages, libraries, interpreters / compilers / IDEs.

A priori, I will try the first alternative. If the video content for a given programming language becomes significantly more popular than the others, perhaps I switch to the second alternative.

Requirements

The material for Ideas, Rules, Simulations promotes project based learning (interactive simulations and digital games) using multimedia resources. As such, it is complimentary to the material of Learn Programming, which introduces fundamentals and basic programming techniques for programming, with examples for JavaScript, Python, Lua and GDScript (for Godot Engine).

For Ideas, Rules, Simulations you will need a configured development environment for one of the previous languages:

JavaScript (for browsers) and GDScript provide built-in support for multimedia content.

I am also considering improving the online programming editors provided in this website, to support an interactive course. Currently, the page with tools provide options for:

The editors support images in the browser. However, Python and Lua use the JavaScript syntax for the canvas. If I create an abstraction and add support for audio, they could become valid tools (at least for the first activities).

However, it is worth configuring an Integrated Development Environment (IDE), or a combination of text editor with interpreter as soon as possible, to enable you to program using your machine with greater efficiency. Online environments are practical, though local environments are potentially more complete, efficient, faster and customizable. If you want to become a professional, you will need a configured development environment. The sooner you do it, the better.

Next Steps

Are you ready to start?

This time, I will not provide a complete list of future topics. I will add a few possible next entries, based on the current content. The first reason is that the reason has not a planned end. The second reason is that it allows for a more flexible curriculum, because it allows modifying the order of topics according to the identified challenges and difficulties. Not mine; yours.

On my master and PhD's, I have co-oriented undergraduate research students in game programming activities. For instance, I have organized and presented workshops to teach digital game programming for students. Nevertheless, every participant was a Computer Science or Engineering student. Thus, although I know some difficulties faced by beginners, I certainly do not know (nor I can anticipate) them all.

In particular, perhaps you, the read, have never programmed before or are just starting. In other words, your difficulties probably will be different from my own and from those who I had co-oriented. Therefore, your opinion about the series will be fundamental to enable me to create a material that is more accessible and simpler for more people.

If you wish to contact me or have any questions, you can chat with me by:

Information about contact and social networks are also available at the footer of every page.

If you wish to share the content, you can use the hashtags #IdeasRulesSimulation and #FrancoGarciaCom.

Finally, this is the current list of topics. It will be updated according to new entries.

Ideas, Rules, Simulation

  1. Motivation;
  2. Introduction: Window and Hello World;
  3. Pixels and drawing primitives (points, lines, and arcs);
  4. Randomness and noise;
  5. Coins and dice, rectangles and squares;
  6. Drawing with drawing primitives (strokes and fillings for circles, ellipses and polygons);
  7. Saving and loading image files;
  8. ...

This material is a work in progress; therefore, if you have arrived early and the previous items do not have links, please return to this page to check out updates.

See you soon!

  • Video
  • Informatics
  • Programming
  • Beginner
  • Ideas, Rules, Simulation
  • Python
  • PyGame
  • Lua
  • LÖVE (Love2D)
  • Javascript
  • Godot
  • Gdscript