GithubHelp home page GithubHelp logo

stary2001 / godot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from godotengine/godot

355.0 21.0 25.0 1.18 GB

A port of Godot Engine to Nintendo Switch via homebrew tools.

Home Page: https://godotengine.org

License: MIT License

Python 1.30% C++ 89.60% Makefile 0.01% Shell 0.09% C# 2.50% Java 1.68% Objective-C++ 0.69% Objective-C 0.10% JavaScript 0.54% GLSL 0.91% CMake 0.01% PowerShell 0.01% C 2.36% AIDL 0.01% Kotlin 0.20%

godot's Introduction

Godot for Switch

It's a port of the Godot open source game engine to the Switch, via homebrew libraries provided by devkitPro/switchbrew. See the original README-original.md for info about Godot.

Releases

See the GitHub releases page for pre-built editors for Windows, macOS and Linux.

How do I export my game?

The editor builds above add a Switch exporter to the list - it will generate a .nro and a .pck file that can be transferred to your Switch. If additional debugging is required, sending the nro via nxlink (make sure to send it to the right place with the -p argument) will allow the output of the console to be viewed on PC.

How to build?

You shouldn't need to build the engine if you use a release as the templates should be included - these instructions are for development!

See the official docs for compilation instructions for every officially supported platform.

For Switch:

Install these packages from devkitPro pacman: switch-pkg-config switch-freetype switch-bulletphysics switch-libtheora switch-libpcre2 switch-mesa switch-opusfile switch-mbedtls switch-libwebp switch-libvpx switch-miniupnpc switch-libzstd switch-wslay then run scons platform=switch in the root of the repo. Add target=release to build for release instead of debug.

Then, to build an engine release for Switch, run ./scripts/create-switch-release.sh in the root of the repo.

Or to build an export template for the editor, run ./scripts/create-switch-template.sh in the root of the repo.

How can I get help?

Either make an issue on this repo, or join the Discord!

Credits

  • Thanks to devkitPro / switchbrew for producing devkitA64/libnx.
  • Extra special thanks to fincs from devkitPro - This port would have never been possible without their port of the open source nouveau graphics driver.
  • cpasjuste for help with development.
  • fhidalgosola/utnad for their port / help with development.

godot's People

Contributors

27thliz avatar aaronfranke avatar akien-mga avatar andreacatania avatar bastiaanolij avatar bojidar-bg avatar bruvzg avatar calinou avatar chaosus avatar clayjohn avatar djrm avatar faless avatar groud avatar hpvb avatar karroffel avatar kobewi avatar lawnjelly avatar leonkrause avatar madmiraal avatar marcelofg55 avatar mhilbrunner avatar neikeq avatar paulb23 avatar pouleyketchoupp avatar randomshaper avatar reduz avatar timothyqiu avatar vnen avatar volzhs avatar yeldhamdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godot's Issues

Unable to compile switch in Windows Linux subsystem.

Godot version:

3.2

OS/device including version:

Windows 10 WSL

Issue description:

Unable to compile for switch in Windows WSL. It just raise pkg-config not found error.

Steps to reproduce:

  1. Setup devkitPro in Windows WSL
  2. Compile godot for switch platfrom

Minimal reproduction project:

Meteorite has white flickering ingame

This causes massive flickering Not the actual issue
Test case: https://github.com/Bauxitedev/meteorite

1: #version 300 es
2: #define EXPOSURE_BEGIN
3: precision highp float;
4: precision highp int;
5: precision highp sampler2D;
6: precision highp samplerCube;
7: precision highp sampler2DArray;
8:
9: uniform highp sampler2D source_exposure; //texunit:0
10: /* clang-format on */
11:
12: #ifdef EXPOSURE_BEGIN
13:
14: uniform highp ivec2 source_render_size;
15: uniform highp ivec2 target_size;
16:
17: #endif
18:
19: #ifdef EXPOSURE_END
20:
21: uniform highp sampler2D prev_exposure; //texunit:1
22: uniform highp float exposure_adjust;
23: uniform highp float min_luminance;
24: uniform highp float max_luminance;
25:
26: #endif
27:
28: layout(location = 0) out highp float exposure;
29:
30: void main() {
31:
32: #ifdef EXPOSURE_BEGIN
33:
34:     ivec2 src_pos = ivec2(gl_FragCoord.xy) * source_render_size / target_size;
35:
36: #if 1
37:     //more precise and expensive, but less jittery
38:     ivec2 next_pos = ivec2(gl_FragCoord.xy + ivec2(1)) * source_render_size / target_size;
39:     next_pos = max(next_pos, src_pos + ivec2(1)); //so it at least reads one pixel
40:     highp vec3 source_color = vec3(0.0);
41:     for (int i = src_pos.x; i < next_pos.x; i++) {
42:             for (int j = src_pos.y; j < next_pos.y; j++) {
43:                     source_color += texelFetch(source_exposure, ivec2(i, j), 0).rgb;
44:             }
45:     }
46:
47:     source_color /= float((next_pos.x - src_pos.x) * (next_pos.y - src_pos.y));
48: #else
49:     highp vec3 source_color = texelFetch(source_exposure, src_pos, 0).rgb;
50:
51: #endif
52:
53:     exposure = max(source_color.r, max(source_color.g, source_color.b));
54:
55: #else
56:
57:     ivec2 coord = ivec2(gl_FragCoord.xy);
58:     exposure = texelFetch(source_exposure, coord * 3 + ivec2(0, 0), 0).r;
59:     exposure += texelFetch(source_exposure, coord * 3 + ivec2(1, 0), 0).r;
60:     exposure += texelFetch(source_exposure, coord * 3 + ivec2(2, 0), 0).r;
61:     exposure += texelFetch(source_exposure, coord * 3 + ivec2(0, 1), 0).r;
62:     exposure += texelFetch(source_exposure, coord * 3 + ivec2(1, 1), 0).r;
63:     exposure += texelFetch(source_exposure, coord * 3 + ivec2(2, 1), 0).r;
64:     exposure += texelFetch(source_exposure, coord * 3 + ivec2(0, 2), 0).r;
65:     exposure += texelFetch(source_exposure, coord * 3 + ivec2(1, 2), 0).r;
66:     exposure += texelFetch(source_exposure, coord * 3 + ivec2(2, 2), 0).r;
67:     exposure *= (1.0 / 9.0);
68:
69: #ifdef EXPOSURE_END
70:
71: #ifdef EXPOSURE_FORCE_SET
72:     //will stay as is
73: #else
74:     highp float prev_lum = texelFetch(prev_exposure, ivec2(0, 0), 0).r; //1 pixel previous exposure
75:     exposure = clamp(prev_lum + (exposure - prev_lum) * exposure_adjust, min_luminance, max_luminance);
76:
77: #endif //EXPOSURE_FORCE_SET
78:
79: #endif //EXPOSURE_END
80:
81: #endif //EXPOSURE_BEGIN
82: }
83:
**ERROR**: ExposureShaderGLES3: Fragment Program Compilation Failed:
0:38(25): error: could not implicitly convert operands to arithmetic operator
0:38(19): error: cannot construct `ivec2' from a non-numeric data type
0:38(19): error: operands to arithmetic operators must be numeric
0:38(19): error: operands to arithmetic operators must be numeric
0:39(17): warning: `next_pos' used uninitialized

   At: drivers/gles3/shader_gles3.cpp:164:_display_error_with_code() - ExposureShaderGLES3: Fragment Program Compilation Failed:
0:38(25): error: could not implicitly convert operands to arithmetic operator
0:38(19): error: cannot construct `ivec2' from a non-numeric data type
0:38(19): error: operands to arithmetic operators must be numeric
0:38(19): error: operands to arithmetic operators must be numeric
0:39(17): warning: `next_pos' used uninitialized

**ERROR**: ExposureShaderGLES3: Fragment Program Compilation Failed:
0:38(25): error: could not implicitly convert operands to arithmetic operator
0:38(19): error: cannot construct `ivec2' from a non-numeric data type
0:38(19): error: operands to arithmetic operators must be numeric
0:38(19): error: operands to arithmetic operators must be numeric
0:39(17): warning: `next_pos' used uninitialized

   At: drivers/gles3/shader_gles3.cpp:429:get_current_version() - ExposureShaderGLES3: Fragment Program Compilation Failed:
0:38(25): error: could not implicitly convert operands to arithmetic operator
0:38(19): error: cannot construct `ivec2' from a non-numeric data type
0:38(19): error: operands to arithmetic operators must be numeric
0:38(19): error: operands to arithmetic operators must be numeric
0:39(17): warning: `next_pos' used uninitialized

**ERROR**: Method/Function Failed, returning: __null
   At: drivers/gles3/shader_gles3.cpp:437:get_current_version() - Method/Function Failed, returning: __null
**ERROR**: Condition ' !version ' is true. returned: false
   At: drivers/gles3/shader_gles3.cpp:123:bind() - Condition ' !version ' is true. returned: false
**ERROR**: Condition ' !version ' is true. returned: -1
   At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1
**ERROR**: Condition ' !version ' is true. returned: -1
   At: drivers/gles3/shader_gles3.h:381:_get_uniform() - Condition ' !version ' is true. returned: -1
no savefile detected
fading from menu to meteorite

OS time functions not implemented

Godot version:
3.2.1-windows

Issue description:
OS functions like "OS.get_system_time_secs()"& "OS.get_system_time_secs()"
don't seem to be implemented. There might be more but I havn't tested it.

Temporary fix:
Cap fps and count the frames to get a sec.

python 2.7 - TypeError: __init__() got an unexpected keyword argument 'encoding'

bullet_version = subprocess.check_output(['aarch64-none-elf-pkg-config', 'bullet', '--modversion'], encoding='utf-8').strip()

OS: Ubuntu 18.04.3 (bionic) LTS
Python: 2.7.15+

When using trying to compile I get the following error:

user0@localhost:~/Downloads/godot-3.1.1-stable_switch$ ./go.sh 
scons: Reading SConscript files ...
TypeError: __init__() got an unexpected keyword argument 'encoding':
  File "/home/kubeuser0/Downloads/godot-3.1.1-stable_switch/SConstruct", line 321:
    detect.configure(env)
  File "./platform/switch/detect.py", line 168:
    bullet_version = subprocess.check_output(['aarch64-none-elf-pkg-config', 'bullet', '--modversion'], encoding='utf-8').strip()
  File "/usr/lib/python2.7/subprocess.py", line 216:
    process = Popen(stdout=PIPE, *popenargs, **kwargs)

Looking at the (python 2.7) docs for subprocess.check_output() reveals that it has no named argument called encoding. Removing that argument allows the compile to complete successfully when using python 2.7.

Please note, that this does not have to be done if using python 3.6 or newer.
https://docs.python.org/3/library/subprocess.html#subprocess.check_output

Problem compiling Export Template for Switch

When I attempt to compile the 3.1.1-stable_switch-export branch of your repo using this command:

scons platform=switch tools=no target=release bits=64

I get the following output:

scons: Reading SConscript files ...
OSError: [Errno 2] No such file or directory:
File "/home/nora/godot/SConstruct", line 321:
detect.configure(env)
File "./platform/switch/detect.py", line 162:
bullet_version = subprocess.check_output(['aarch64-none-elf-pkg-config', 'bullet', '--modversion']).strip()
File "/usr/lib/python2.7/subprocess.py", line 216:
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 394:
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047:
raise child_exception

I hope you can resolve this

Godot 4.x?

Howdy, I'm just wondering if there's any plans on having a Godot 4.x [like 4.1.1 at the time of writing] version of this engine? I understand it's a rather huge undertaking considering how different 3.x and 4.x are, but I was just curious. Would love to use Godot 4.x to export to Switch.

Vibration does not work

Godot version:

3.2.1

OS/device including version:

OSX | 10.0.1

Issue description:

Vibration does not work

Steps to reproduce:

for id in Input.get_connected_joypads():
	Input.start_joy_vibration(id, 1.0, 1.0, 1.0)
Input.start_joy_vibration(0, 1.0, 1.0, 1.0)
Input.vibrate_handheld(1.0)

Minimal reproduction project:

Not necessary

Adding things to the scene makes created .nro crash after godot logo

I managed to build the engine and and a .nro with a empty 3D scene that ran on my switch. But ass soon as I make a little more complex scene (I added a skinned character model as .dae with some .png textures) the .nro just closes back to the switch home screen after the GoDot logo (scene ofc runs fine when pressing play on PC). Is there any list of things that are save to add to the scene or a way to see why the .nro is closing?

Why not define `UNIX_ENABLED` as well?

Most of the changes outside of the platform directory seem to be adding || defined(HORIZON_ENABLED) to lines that already have defined(UNIX_ENABLED). Is there any reason you don't simply add the Unix define here to avoid most of those edits? Or is it just that Horizon isn't fully Unix-compatible?

Yuzu Emulator & C# support?

Hey there. I've been working on a game for a while in C#, and I'm wondering if C# support is implemented into this. I wouldn't think so, but I also don't have the tools to try at the moment.

Theres also the fact that Yuzu emulator seems to not work with these builds. Running a small test application causes the emulator to freeze and stop responding on Windows. Crash logs are at this link. https://hastebin.com/eqedojovud.cs It would be amazing to get these features properly working so we can have some amazing homebrew games!

Cannot compile in windows WSL

Godot version:
3.2
OS/device including version:
Windows 10 WSL
Issue description:
Cannot build for switch. Invalid target platform "switch".
The following platforms were detected:
server
This is not a duplicate of #15
Steps to reproduce:
Install Devkitpro
Set environment variables
Clone this git repository
Run scons platform=switch in the root of the repo

Mac Export

Godot version:
3.5.1
OS/device including version:
Mac OS Catalina
Issue description:
No nxlink and no build_romfs included in the download
Steps to reproduce:
Download the dmg and realise there is no nxlink and no build_romfs
Minimal reproduction project:
Realise there is no nxlink and no build_romfs

Second controller not working

Godot version:
3.3.4
OS/device including version:
Windows 11
Issue description:
Second Controller get's deactivated upon launch
Steps to reproduce:
Make a game with multiple controllers
Export it as an nro file
Setup 2 controllers
Start the game
See that the light on the second controller turns of

Stuff to fix before calling it fine

  • Fix some modules - make portlibs and configure godot to use them instead of broken in tree versions
    • webm => oops, libvpx is packaged now. fix configure.
    • websocket => ... libwebsockets is odd, depends on Linuxy stuff for no reason websocket/godot situation is a bit broken, would need to patch the tree version
    • upnp => link errors as it pulls in if_nametoindex / if_indextoname for ipv6 link local address stuff that can be stubbed without consequence on switch
  • Missing engine bits?
    • Gamepad status -> joycon status
    • Joycon rumble?
    • handle single joycons (#5)
  • Improve export experience
    • Host export template mirror for switch export template download? maybe? - editor/export_template_manager.cpp request_mirror->request("https://godotengine.org/mirrorlist/" + p_version + ".json");
    • Ship Switch elf as export template and also ship elf2nro/nacptool. (grab builds for win/mac/lin)
    • Build nro customisation tool for export
    • Make it actually work in the editor
  • #4 fix autoexposure

NRO name/author name being replaced by version number

Hey thanks for this, it's amazing! My quick test project (to see if video would play on Switch - it does) built and ran first time.

In hbmenu the .nro's name, author and version are all showing as "1.0", tho I have the Title and Author fields set appropriately in the Export dialog. Didn't see this mentioned in any other issues, am I doing something wrong? I can always hexedit the .nro if it comes to it, but hopefully there's a better answer!

switch-miniupnpc not found

Godot version:

OS/device including version:

Issue description:

Hi, I'm trying to compile your version of godot switch. But I'm stuck at the point where miniupnpc its used. As I don't find switch-miniupnpc package anywhere available, I try to compile the package myself from your git repository, but the compilation always fails cause incompatible versions of the package. Can You point me what repository if any is used to get the correct miniupnpc version needed to compile?. Can you make available the correct package? Thanks in advance.

Steps to reproduce:

Minimal reproduction project:

GDNativeLibrary resource support

While 'Switch' shows up as a preset in the 'Export' window, it does not show up as a platform in GDNativeLibrary resource files. Is there any plan to support this? How much work would be involved to make it work?

How to create an .nro file to port over to the Switch?

Hey, apologies if this isn't the place to ask such questions, but...
I managed to build this fork of godot, and I exported a random test game I grabbed from the templates section to a .pck file. Now, since I'm new to godot and porting games to the Switch, I'm not so sure what to do at this point; how to I create a binary (I presume an .nro file) to export to my Switch? I got devkitpro and all installed on my Ubuntu machine.
Thanks :)

Can this be used to make official game?

Once (and if) one become official Nintendo third party developer, can send the files that export gives to Nintendo to make it an official game? (I know that there are other stuff requsted like trailer ecc), i'm saying if the file from exporter are fine to become an official game or it will work only on modded (homebrew) console.
Thanks, and sorry if the question may sound stupid, i don't know much of the Switch publishing ecosystem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.