Posts Tagged ‘CMake’

April 2018 Development Update

Tuesday, May 22nd, 2018 by fireclaw

Welcome back to our monthly developer news. This month we don’t have much interesting to offer on the current developments. Most time has been spent to fix bugs and iron out existing functionality. So we decided to provide you with some outlook on which future developments you can expect to see next.

New app framework

Behind the scenes, much discussion has taken place regarding future developments of Panda3D.  In this post, we will discuss one of the plans on the table, namely to redesign the high-level application layer of the Panda3D library.

The current design of the ShowBase class as a monolithic singleton makes it easy to get started with prototyping a game in Panda, but it does have some downsides. It is cluttered with methods and variables that may not be needed by every application. It also makes running two instances of the application within the same process harder, and because it is implemented in Python, it is not available to C++ developers.

Our intent is to introduce a replacement for ShowBase that not only resolves these issues, but also encourages best practices and makes it easier for developers to write games for non-desktop platforms, such as mobile, web and VR.

For example, the ShowBase design gives the application developer complete agency over the lifetime of the application.  This is a great fit for traditional desktop applications, but not so great for mobile apps, where the operating system needs to be able to suspend and resume applications at any time in order to free up resources when needed.  Doing this today in Panda3D requires developers having to specifically detect these states, whereas we would ideally make this an intuitive part of the game structure.

Another example is virtual reality, where there is not really a meaningful “window” in the traditional sense, but the content is rather projected into a virtual 3D environment, with any GUI being superimposed into the scene in layers.  We would like to represent these concepts in a way that makes it easy for developers to develop applications for both VR and desktop, while giving them full control over the additional possibilities that virtual reality offers.

While the intent is not to remove control that game developers might need, we want to make a framework that encourages best practices that work well for all platforms.  We will follow up on this in the future with more concrete plans, but rest assured that ShowBase will remain available for the foreseeable future for any applications that rely on it.

CMake

CMake has in recent years rapidly become the de facto standard build system for open-source projects. As we have reported on before, we are working on replacing Panda’s own build system “makepanda” with it. This work is still underway on the cmake branch in GitHub.

For Panda3D developers, the integration of CMake in IDEs and other tools is far better than that of makepanda. This also allows us to better integrate the testing framework and code checking tools. Using CMake also simplifies building and directly running a built Panda3D instance (without installing) from the build directory using the rpath feature on Linux.
Another benefit is the simplified cross-compilation and exotic compiler support for mobile or ARM-based systems. In the future there might be support for CMake’s “exported targets” feature, meaning C++ users of Panda3D would not have to configure their libraries/includes/search path if they’re using CMake as well. Another exciting benefit is that CMake can lower the build times by roughly 30% dependent on the system and setup.
A little side effect of using CMake instead of makepanda is that we have less code to maintain and we get the benefits of the CMake community’s development efforts as a whole. That also means we get to focus our resources exclusively on making the engine itself awesome as we’re not distracted with the build tools.

The CMake branch is currently in a good enough state where it works great on Linux/BSD, and macOS support isn’t far behind. Windows support is slightly trickier and needs some more work before it gets up to that level of support. Mobile platforms are not yet supported.

If you run Linux or macOS feel free to grab the branch and try it for yourself. Whenever you find any bugs, just fill a report on the GitHub issue tracker or ask in the forum or on the IRC channel.

Ubuntu 18.04 “Bionic Beaver”

The most recent LTS version of Ubuntu, 18.04 has been released a few weeks ago with recent software packages. Panda3D has been successfully built on this version and updated install packages are available for the 1.10 development builds.

February 2018 Development Update

Tuesday, March 13th, 2018 by rdb

We again bring you some of the highlights of the new developments in the past month. This is however not an exhaustive list of changes, which can be obtained from the commit logs in the GitHub repository.

Android developments

We’re happy to announce that the Android port has made great strides forward in the past weeks. Most importantly, there is now a complete Python interpreter added to the Panda3D app, so that Python applications can be run directly from the Android device. Many of the sample programs now run as well as they do on the desktop.

It is now even possible to compile Panda3D entirely on an Android device, using an app that provides a Linux-like terminal environment. One free and open-source example is termux, which provides a package manager that gives access to an impressive suite of software, including the compilers needed to compile Panda3D.

Furthermore, using a bash script that we provide, it is also possible to launch Panda3D from termux and pipe the output from the interpreter app back to the terminal, so that you can develop Panda apps on Android the same way as you would on the desktop.

Eventually, we intend to make it possible to use the new deploy-ng system to produce an Android package from any operating system, making it easy to deploy your application to both desktop and mobile platforms.

In a separate effort, a commercial port of Panda3D to Android has been released on the app store, called Cub3D. This is an impressively complete development environment for Panda3D apps, and can be used today to develop and run Panda apps on Android. (This software is developed by a third-party company that is not affiliated with the Panda3D team.)

Roaming Ralph running on an Android tablet

Roaming Ralph running on an Android tablet

Ball in Maze running on an Android watch with Cub3D

Ball in Maze running on an Android watch with Cub3D



CMake improvements

Behind the scenes, we have been working on adding support for the CMake build system on the cmake branch. CMake is a popular cross-platform build system that is rapidly becoming the de facto standard for open-source projects, and it is eventually intended to replace our own makepanda build script. This will make it easier to build Panda from source and to customize the build process. Last month, the CMake port saw some updates and improvements, bringing us closer to this goal.

Bullet thread safety

Users of the Bullet physics engine were previously encountering crashes when using Bullet in conjunction with the multithreaded render pipeline. This is caused by the fact that the Bullet library is not thread safe. To remedy this, we have added locking in the Panda3D wrapper for Bullet that protects the Bullet library from access by multiple threads, which makes it safe to use the Bullet integration in a multithreaded program.