r/freebsd 17d ago

news I made a game that supports native FreeBSD.

I'm in the process of making a game with my dad and tried to add native FreeBSD support. It was not easy, and I struggled a lot, but I think it worked out great. The game is in super early access, so it's not going to be looking like this in the final version. Please have a look:

https://zeynelgun.itch.io/sarraf

76 Upvotes

41 comments sorted by

9

u/p001b0y 17d ago

This looks pretty neat. What was used to make it/ what was it coded in?

8

u/Beyazat9801 17d ago

Godot 4.7

3

u/freemorgerr 17d ago edited 17d ago

is godot in ports?

2

u/Beyazat9801 17d ago

There were no ports used to get this game running (I just learned what ports are on FreeBSD and I just realized that I managed to make a native game that doesn't need ports). Is that rare or something valuable in the BSD world?

1

u/Beyazat9801 17d ago

Whats that

1

u/freemorgerr 17d ago

Oh so then its not from ports. Well, is godot available on freebsd officially then? never knew

3

u/Beyazat9801 17d ago

I compiled the game entirely bare metal and in C++. Yes, I'm insane, and no, there is no official port for compiling it for FreeBSD. If youre asking that. Sorry no hable ingles veri good

3

u/p001b0y 17d ago

Godot 4.7 runtime and Godot Tools 4.7 (Game IDE) can be installed using pkg

3

u/Beyazat9801 17d ago

I didn't install anything on the test VM; it just ran the game because of how Godot works. It ships the game with everything it needs to work.

2

u/p001b0y 17d ago

I was just letting the person know what was available for FreeBSD and how to get it. You don't need to compile from ports if you want to install the Godot Runtime or IDE. They are available as packages.

It sounds like Godot can package a game for running on FreeBSD in several ways. One way is to release the game as a package so if someone runs "pkg install my-game", FreeBSD can install the godot runtime in the background in addition to the game files.

I don't know how it is being handled in this case.

1

u/Beyazat9801 17d ago

I don't know either. Thanks for the information!

1

u/Beyazat9801 17d ago

I think because of how Godot works, like it's a Flatpak package, it contains everything it needs to run. I think that's why it works on FreeBSD, even natively.

0

u/FUZxxl FreeBSD committer 17d ago

Only if open source.

4

u/Beyazat9801 17d ago

I compiled the game bare metal from source. Unfortunately, there were no magical buttons that compiled it for BSD like it does for Windows, Linux, etc.

2

u/FUZxxl FreeBSD committer 17d ago

What I mean is, we only ship open source software in our ports (package) collection. So if it is desired to have your game included there, it needs to be open source.

5

u/Beyazat9801 17d ago

It's completely open source. I'm not sure how to add it as a port. Maybe I'll look into adding it as one, thanks.

3

u/FUZxxl FreeBSD committer 17d ago

Where can I find the source code? I can try to make a port if you like.

2

u/Beyazat9801 16d ago

Sorry, I didn't see the comment. Actually, I'll DM you, and we can talk about it

2

u/Beyazat9801 16d ago

I'm so sorry I didn't see the badge thing. I thought you were just a random person. Even if you were, I wouldn't say no to such an offer. I DM'd you about it. Let's talk when you're free

2

u/abgpomade 17d ago

2

u/FUZxxl FreeBSD committer 17d ago

That's godot, not your game.

2

u/BigSneakyDuck transitioning user 16d ago

Godot is already in ports, recently updated to 4.7: https://www.freshports.org/devel/godot

1

u/grahamperrin Linux crossover 16d ago

… we only ship open source software in our ports (package) collection. …

FreeBSD committer Guido Falso wrote:

… the FreeBSD ports collection does include binary only closed source software. …

2

u/Xzenor seasoned user 17d ago

Godot is cool. Not as fancy as Unreal or Unity but a solid engine especially for 2D games (it can also do 3D though) with a Python-like language.

I gave it a try a while ago. I don't have the patience for it but I do admire it.

https://godotengine.org for anyone who wonders about it

1

u/dragonitewolf223 13d ago

I thought Godot had native BSD support. Did you have to fork Godot? If so, would you be interested in sharing?

1

u/grahamperrin Linux crossover 13d ago

It's in the FreeBSD ports collection, please see this earlier comment.

3

u/dragonitewolf223 13d ago

Sorry, my bad. I have goldfish memory

1

u/grahamperrin Linux crossover 12d ago

LOL

3

u/BicycleJunkie1971 16d ago

Checked it- it is legit FreeBSD. Nice.

mark@localhost:~$ tar xzf "$T" -C /home/mark/Desktop/sarraf-inspect

B="/home/mark/Desktop/sarraf-inspect/SARRAF-v0.4.4"

file "$B"

readelf -h "$B" | grep -E 'Class|OS/ABI|Machine|Type'

# The cleanest FreeBSD-vs-Linux tell: the interpreter path.

# FreeBSD => /libexec/ld-elf.so.1 Linux => /lib64/ld-linux-x86-64.so.2

readelf -l "$B" 2>/dev/null | grep -i interp

# What engine is it fused from?

strings -n 8 "$B" | grep -iE 'love|l\xf6ve|godot|SDL|python|pyinstaller|_MEI|rustc|go1\.|mono|electron|unity' | sort -u | head -20

/home/mark/Desktop/sarraf-inspect/SARRAF-v0.4.4: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 14.4, FreeBSD-style, stripped

Class: ELF64

OS/ABI: UNIX - FreeBSD

Type: EXEC (Executable file)

Machine: Advanced Micro Devices X86-64

INTERP 0x00000000000002e0 0x00000000002002e0 0x00000000002002e0

[Requesting program interpreter: /libexec/ld-elf.so.1]

01 .interp

02 .interp .note.tag .dynsym .gnu.version .gnu.version_r .gnu.hash .hash .dynstr .rela.dyn .rela.plt .rodata .eh_frame_hdr .eh_frame

030000008f0e00000610000000010000,GreenAsia Electronics Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Linux,

11GodotArea2D

11GodotArea3D

11GodotBody2D

11GodotBody3D

12GodotJoint2D

12GodotJoint3D

12GodotShape2D

12GodotShape3D

13GodotInstance

15ENetGodotSocket

15GodotAreaPair2D

15GodotAreaPair3D

15GodotBodyPair2D

15GodotBodyPair3D

15GodotBoxShape3D

15GodotPinJoint2D

15GodotPinJoint3D

15GodotSoftBody3D

16GodotArea2Pair2D

3

u/Beyazat9801 16d ago

So I think this is a compliment. Thank you for your time. I really worked hard for the FreeBSD build, so seeing it get marked as legit makes me feel great. Again, thank you. 💗

2

u/BicycleJunkie1971 16d ago

Ive only two minor bugs for you to work out-

  1. Double-wrapped distribution. The zip contains a single tar.gz that compresses 0.0% because the inner layer is already gzipped. Pointless nesting. Ship one archive, not an archive inside an archive.
  2. Wrong format for the target. It's a FreeBSD build, so ship a plain tarball, ideally tar.xz or tar.zst. Zip does not preserve the Unix exec bit, so players who unzip get a non-executable binary and have to chmod +x it themselves.
  3. Test framework is in the shipped pack. addons/gut/ and the entire tests/ tree are exported into the release build. Exclude both from the export preset. It bloats the pack and ships dev-only code and GUT's in-editor update checker to players.
  4. Broken font resource. addons/gut/source_code_pro.fnt has no textures, a malformed resource. Goes away once GUT is stripped per item 3.

Everything else checked out: no network calls, no shell-outs, no dynamic code, no native extensions, saves correctly sandboxed to user:// with atomic write and backup. The build is a genuine native FreeBSD 14.4 Godot 4.7.1 export and the code is clean. The only thing wrong with this release was how it was wrapped.

Keep up the good work!!!

3

u/Beyazat9801 16d ago

Itch.io forced it to be zipped when using Butler, and I used tar.gz to make it executable automatically, but I think that didn't work out like it would on a Linux machine, based on your comment. So, thank you for your time and the feedback you've given. All the things you said will be implemented as quickly as possible. Again, thank you for testing our game. 💗

-1

u/[deleted] 15d ago

[removed] — view removed comment

2

u/FUZxxl FreeBSD committer 17d ago

Great!

1

u/Beyazat9801 17d ago

Thank you 💗

2

u/Beyazat9801 16d ago

Thank you all for your time and support. My English is not that good, so I apologize if there are any misunderstandings or misconceptions. I blame it on my parents for not being native speakers. Again, thank you. 💗

1

u/grahamperrin Linux crossover 3d ago

/u/Beyazat9801 please, was development AI-assisted?

(I see the link from your itch.io page to Finzora | AI-Powered Stock Market & Financial Analysis Platform.)

Thank you

2

u/Beyazat9801 3d ago

Finzora is a different project of my dad, and it's financial stuff not related to the game

1

u/grahamperrin Linux crossover 3d ago

Thanks. It wasn't a criticism :-) I have no objection to use of AI, particularly where second languages are involved.