https://github.com/bernhardstrobl/Pico3D Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} bernhardstrobl / Pico3D Public * Notifications * Fork 11 * Star 212 Open World 3D Game Engine for the PicoSystem & RP2040 Microcontroller License MIT license 212 stars 11 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights bernhardstrobl/Pico3D This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 2 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/b] Use Git or checkout with SVN using the web URL. [gh repo clone bernha] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @bernhardstrobl bernhardstrobl Update README.md ... 75f429a Mar 19, 2023 Update README.md 75f429a Git stats * 20 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time Blender Update world.blend December 9, 2022 15:00 docs Additional documentation and fixes. December 7, 2022 15:54 engine Support large worlds February 13, 2023 14:52 game Support large worlds February 13, 2023 14:52 test_models Initial commit November 14, 2022 11:30 .gitignore Packed in textures for world .blend file November 14, 2022 12:09 CMakeLists.txt Significant performance boost by putting render_rasterize() function ... November 18, 2022 12:23 LICENSE.md Create LICENSE.md November 14, 2022 12:58 README.md Update README.md March 19, 2023 08:39 chunk_data.h Move lighting data to flash December 9, 2022 14:30 main.cpp Support large worlds February 13, 2023 14:52 View code [ ] Pico3D Open World 3D Game Engine for the Pimoroni PicoSystem & RP2040 Microcontroller Overview Getting Started Blender Tutorials F.A.Q. I don't have a PicoSystem?! How did this project come about? Where do I start? How big can the world be? How are the NPCs loaded in/out? What is the Gamescom version of the game? What were the inspirations for the game world? Why are there so many redundant functions in certain code areas like the zombie logic? README.md Pico3D Open World 3D Game Engine for the Pimoroni PicoSystem & RP2040 Microcontroller Pico3D preview Overview This engine basically utilizes the second core of the RP2040 as a dedicated rasterizer/GPU. It contains a small city as well as an outskirts featuring shootable zombies. Gameplay video Demo video Getting Started If all you want are .uf2 binaries, check the releases for the newest version. You will need the PicoSystem SDK (and the required Pico SDK). Copy the whole Pico3D folder as an example project into picosystem/ examples and add "add_subdirectory(pico3d)" entry into the CMakeLists.txt. The project needs multi-core support to compile: Add pico_multicore to the target_link_libraries in picosystem.cmake found in picosystem/libraries. You should now be able to compile all the examples including pico3d. Blender Tutorials * Creating and exporting a game world in Blender * Material, lights and textures in Blender * Exporting individual meshes F.A.Q. I don't have a PicoSystem?! Check out Daft's Emulator for RP2040. How did this project come about? Pico3D was created as part of a master's thesis at the Kempten University of Applied Sciences (Hochschule Kempten). It was designed to answer the question of whether a modern $1 microcontroller could run a complete open world 3D game. The thesis is available here and should answer most of the design decisions behind the engine. Where do I start? Check out the Blender tutorials on creating your own game worlds. The main.cpp file contains a general overview of the game and engine. The most important Pico3D feature is going to be the render_triangle() function. This function basically does all of the hard work of transforming a triangle (in world space) and pushing it into the renderer (no deep engine/graphics knowledge needed!). See the test models and the render_model_16bit functions for an example on how to put in your own meshes. How big can the world be? The included game has a grid size of 12x12 chunks (each chunk is 10x10m in size -> world size of 120x120m). Right now the chunk cache uses an 8 bit int for each direction limiting the world size to 256x256 chunks (2.56x2.56km). This can be extended if needed. Unless heavy use of repeat/procedurally generated chunks is made use of the binary is also likely to exceed 16MB. Plenty of creative procedural tricks are possible to get around this issue as well however if you want the next Daggerfall. How are the NPCs loaded in/out? Right now the game simply simulates all 50 NPCs and 50 zombies at the same time since that is pretty cheap compared to the actual rendering. It's also more realistic that way and uncovers any big issues in the self-made RNG ;). Rendering is optimized with distance and view frustum culling. What is the Gamescom version of the game? This version was used to demonstrate the engine at Gamescom and replaces the zombies with balloons to conform to USK ratings. It is left in the codebase to show how to make a possible variant of the game for developers. What were the inspirations for the game world? The city itself was inspired heavily by Cyberpunk 2077 and the Yakuza series of games. The outskirts have a Legend of Zelda: Breath of the Wild influence. Why are there so many redundant functions in certain code areas like the zombie logic? Divisions are relatively expensive on the RP2040 if performed in quick succession such as when interpolating vertices for mesh blending. Performance can be tested by changing the NPC or Zombie walk animations to a non power of 2 number such as 127, forcing the compiler to apply actual divisions instead of cheaper bit shifts. As the compiler does not know during compilation time if a variable will be a power of 2 or not, it will simply apply divisions regardless if the value is not fixed as it is now. There are likely ways to improve on this code redundancy but I have not taken the time to think of one yet (don't forget, function calls themselves are relatively expensive). About Open World 3D Game Engine for the PicoSystem & RP2040 Microcontroller Topics microcontroller 3d-game-engine rp2040 raspberry-pi-pico picosystem Resources Readme License MIT license Stars 212 stars Watchers 5 watching Forks 11 forks Report repository Releases 2 Stable Release Latest Dec 9, 2022 + 1 release Packages 0 No packages published Languages * C 77.1% * C++ 20.5% * Python 2.4% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.