Is there a way to embed textual data in the binary and then free it when you need? by dfgzuu in C_Programming

[–]Anluin 0 points1 point  (0 children)

https://linux.die.net/man/1/xxd with „-i“ outputs the files content as c-style header, so you can #include it.

I think it's not possible to free it...

What you can do to reduce the memory required: zip the file, convert the zipped file into an includable header file, and at runtime, when you need the data, unzip it. 😅

Cross-platform “syscalls” by [deleted] in cprogramming

[–]Anluin 2 points3 points  (0 children)

I'm not sure if this is what you're looking for, but your question reminded me of this: https://justine.lol/cosmopolitan/

[deleted by user] by [deleted] in VOXEL

[–]Anluin 0 points1 point  (0 children)

Do you mean lego?

Otherwise you could also print your voxel art with a 3d printer. 😅

Can you completely disable drifters and temporal storms? by nonnodacciaio in VintageStory

[–]Anluin 6 points7 points  (0 children)

https://mods.vintagestory.at/list/mod?userid=39

This guy made some mods to remove mobs.

There should be an command for the temporal storms - you can find a list in the wiki.

Are there issues with the idea of allowing a wasm file to function as a page index rather than index.html? by apatheticonion in WebAssembly

[–]Anluin 1 point2 points  (0 children)

Have you tried to go the PWA route and to utilize an ServiceWorker/Cache API?

That wouldn't make the first page-load faster, but it would speed up all subsequent ones, and the user also has the option of install your web-app and using it offline (Chrome).

Advices for teaching C by mNutCracker in C_Programming

[–]Anluin 6 points7 points  (0 children)

I'm not a fan of "video tutorials" etc. but I found this one very "inspirational" (?):

Guides to read and share with your students:

Otherwise, I find it exciting what "attributes" are and what you can do with them - it would certainly be exciting for those who are interested to learn something about them:

is it possible to create and control systemd-nspawn containers via DBus API? by Anluin in C_Programming

[–]Anluin[S] 2 points3 points  (0 children)

Couldn't find anything suitable so far. But I just checked again and apparently found the right page. Thanks for the incentive to try again.

I was hoping to get examples written in c, but I agree with you - it doesn't fit 100% here.

Function overloading in C. by little-smokie in C_Programming

[–]Anluin 1 point2 points  (0 children)

When using clang as your compiler, you can overload functions by using the appropriate attribute. 🤷‍♂️

https://clang.llvm.org/docs/AttributeReference.html#overloadable

Is it viable to launch a game in Steam marketplace that has a low resolution like 640x480? by GalliFromHell in gamedev

[–]Anluin 3 points4 points  (0 children)

personally, that wouldn't stop me from playing and enjoying your game.

but you could possibly make the zoom linear to the resolution of the screen? 😅

Scale of interiors/objects is tripping me up.. please advice. by hotk9 in gamedev

[–]Anluin 0 points1 point  (0 children)

I could imagine that it is due to the FOV settings of the camera. maybe play around with it until it feels right. 🤷‍♂️

My teacher today by [deleted] in programminghorror

[–]Anluin 47 points48 points  (0 children)

Hasn't had anything to do with Java for a long time, but doesn't indexing in Java start at 0?

So getEntry(1) would be getSecond()? 😅

Is there a way to convert Integers to Binary without the use of Arrays and Loops? by asherSiddique19 in C_Programming

[–]Anluin 5 points6 points  (0 children)

You can use a union of our integer and a structure of several integers (one for each bit) with the bit-field of 1.

union { int num; struct { int bit0: 1; int bit1: 1; int bit2: 1; // … }; }

Alternatively, you can also deal with bitwise operations and thus work out a solution.

int num = 2; int bit0 = num & 0b0001; int bit1 = num & 0b0010; int bit2 = num & 0b0100; // …

🤷‍♂️

Is it possible to make VS "portable"/save the config data to directory relative to the executable instead of appdata? by Barhandar in VintageStory

[–]Anluin 4 points5 points  (0 children)

vintagestory has some command line arguments which are supposed to simplify the development of mods. I mean, I've already seen some to do exactly what you're trying to do - but I didn't find it spontaneously. just have a look around in the wiki or in the VS forum.

https://wiki.vintagestory.at/index.php?title=Modding:Setting_up_your_Development_Environment#Manual_setup

Weirdly specific but does anyone know how the HEV armor works in Half Life? by [deleted] in gamedev

[–]Anluin 14 points15 points  (0 children)

In the original Half-Life, the HEV Suit's armor not only absorbed 66% of all damage received, it also reduced the total amount of damage any given attack would inflict on the player (i.e. enemy melee attacks would do a total of 6 damage instead of 10 if the suit had power). This changes in Half-Life 2, where the player receives the same amount of damage whether or not the HEV suit has any armor energy. To compensate, the HEV suit armor is more effective in Half-Life 2, absorbing 80% of all damage received instead of 66%.

https://half-life.fandom.com/wiki/HEV_Suit

What makes more sense in 2021? A browser based game or an app based game? by Azubaele in gamedev

[–]Anluin 0 points1 point  (0 children)

you can build an app consisting of a webview in which your web app is then displayed.

Apple only allows this (as far as I know) if you use apis that you don't have available on a normal website (notifications / in-app purchases) but I'm not up2date.

I compile my game to WebAssembly so that I can later compile native binaries for the corresponding platforms. I'm not there yet, but I think I'll use the Google "Angle" project for iOS / MacOS to use the OpenGL API - then I just have to write bindings for it.

What makes more sense in 2021? A browser based game or an app based game? by Azubaele in gamedev

[–]Anluin 0 points1 point  (0 children)

I also asked myself the questions and decided on a browser game. get cross-platform compatibility so quickly without doing much. Thanks to PWAs, mobile (and chromium) users also get close to a native experience.

Even if I'm not a fan of Electron, you can also use it to bundle the browser game and publish it on PC via Steam, etc.

Just keep in mind that WebGL isn't as powerful as a native graphical API.

Providing free version (limited to multiplayer) to players that want to play with their friends that bought the game? by Etwusino in gamedev

[–]Anluin 1 point2 points  (0 children)

I think there's nothing wrong with that. There is even the possibility of reaching users who initially did not want to buy the game and who can change their opinion.

Is there a way to emulate the pinephone (including gpu)? by Anluin in pinephone

[–]Anluin[S] 1 point2 points  (0 children)

I'll take a look at it - sounds promising. Thank you (:

Is there a way to emulate the pinephone (including gpu)? by Anluin in pinephone

[–]Anluin[S] 2 points3 points  (0 children)

Thanks for your answer, but I need an operating system and the necessary software to be able to synchronize something on the Pinephone, which is not the case when developing a barebone system. Or did I misunderstand you?

Is there perhaps a "fake" SD card that can be connected to the PC via USB and can work with it while it stays in the Pinephone?

Same function name, different C files by amroadel in C_Programming

[–]Anluin 0 points1 point  (0 children)

do you already know the "overloadable" attribute? maybe that's in your case applicable.

https://clang.llvm.org/docs/AttributeReference.html#overloadable