GithubHelp home page GithubHelp logo

spacemaniac / hamsandwich Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 15.0 84.9 MB

Source code and modding kit for Hamumu's Dr. Lunatic series.

Home Page: https://spacemaniac.itch.io/hamsandwich

License: MIT License

Makefile 0.02% Shell 0.32% C++ 94.10% C 4.60% Python 0.19% HTML 0.07% CSS 0.03% JavaScript 0.13% Batchfile 0.01% CMake 0.33% Java 0.17% Dockerfile 0.03%
2d-game game-development hamumu

hamsandwich's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hamsandwich's Issues

Add control to change Weapon Lock setting

A common feature request is a button to control Weapon Lock. There are two possibilities:

  1. Tap to toggle Weapon Lock state.
  2. Press and hold to temporarily toggle Weapon Lock state until released. I think I like this one more - like a "pick up" button if you usually play with Weapon Lock on.

Additionally:

  • The control should work on gamepads, likely the "X" button since "A" and "B" are fire and special.
  • Ideally it should be a rebindable key as well.
    • Warning: the current profile layout is only set up for 2 sets of 6 keys; this 7th key will have to be stored in another location.
    • There should be two reasonable default binds.
  • The control could be made available in the "Keypress" special trigger, to be an additional option for world builders.

Unable to use my assets

I tried to add my tileset to the game so I created a "tilegfx" folder with bmp-image in it:
File in directory
When I launch the game, there is my tileset in the editor list:
Tiles in menu
But when I try to load it, there is an error: ERROR: open_sdl(tilegfx/TestTiles.bmp): not found in any vfs

Here is console log:

[0/2] Re-checking globbed directories...
ninja: no work to do.
==== Running supreme (windows-x86_64-debug) ====
DEBUG: auto 0 required: @nsis@installers/supreme8_install.exe
DEBUG: auto 1 disabled: @zip@installers/all_supreme_worlds.zip
DEBUG: auto 2 disabled: @zip@installers/sup_GloomValleyRemastered.zip
DEBUG: auto assets: assets/supreme
DEBUG: auto appdata: appdata/supreme
INFO: audio format: freq=44100, channels=2, format=0x8010
INFO: window format: SDL_PIXELFORMAT_RGB888
INFO: renderer: direct3d
INFO:   flags: accelerated vsync ttex
INFO:   texture: (16384, 16384)
INFO:   formats (3):
INFO:     SDL_PIXELFORMAT_ARGB8888
INFO:     SDL_PIXELFORMAT_YV12
INFO:     SDL_PIXELFORMAT_IYUV
ERROR: open_stdio(hiscore.dat): not found in any vfs
ERROR: open_stdio(hitime.dat): not found in any vfs
ERROR: open_sdl(tilegfx/TestTiles.bmp): not found in any vfs

Same goes with custom sounds and graphics.

I learned about your project back in January 2022. I tried to modify the game in the old version, and everything worked for me. Now I decided to install a new one and ran into the above problem.

Thanks in advance for your reply.

[Sleepless Hollow] Crash corrupted my save file

Sleepless Hollow is an absurdly difficult game, and a crash in the Bones tomb while fighting the one flames miniboss when it killed me corrupted my save and deleted the Earsplitter from my inventory, rendering the game incompleteable as far as I can tell (this is my first real playthrough). I had beaten two other bosses prior. I was playing on the Linux build also.

Sounds not playing, severity of issue differs depending on game

There appears to be an issue with sounds. Many sounds will not play if there is multiple sound triggering events going on. Actually, certain games that shouldn't have that much going on ALSO suffer from severe sound drops, and it might be related to the sound distance stuff of the original code. Spooky Castle features some of the most severe sound drops, sometimes the game is just silent in spite of anything going on. This issue happens across all versions of the engine I've played, from the browser build, to the Linux build, and even the Windows build.

Also as an aside, if you have plans to revamp the sound engine or replace it, have you by chance looked into miniaudio (https://miniaud.io/)?

I started, then abandoned, an SDL/OpenGL port a while ago and thought maybe it would be useful

Yo!

A while ago I made a start on converting the Dr Lunatic code to use SDL/OpenGL for rendering. I didn't get that far, it literally just fades the Hamumu logo in and out again, but I did write a shader that draws images using a palette, which I thought might be useful. (It surprised me how simple it is to do that.)

Vertex shader:

#version 150
in vec3 aPosition;
in vec4 aColor;
in vec2 aUV;

out vec4 vColor;
out vec2 vUV;

uniform mat4 uProjectionMatrix;

void main() {
	gl_Position = uProjectionMatrix * vec4( aPosition.xyz, 1 );
	vColor = aColor;
	vUV = aUV;
}

Fragment shader:

#version 150

uniform sampler2D uTexture;
uniform sampler1D uPalette;

in vec4 vColor;
in vec2 vUV;

out vec4 fragColor;

void main() {
	int colorIndex = int(255.0 * texture(uTexture, vUV).r);
	vec4 texel = texelFetch(uPalette, colorIndex, 0);

	fragColor = vColor;
	fragColor *= texel;
}

The palette is sent by just telling opengl to load its memory as a 1D texture. Images are sent as-is to the GPU, as 2D, single-channel textures. It means you can still use the original palette-switching code, and 256-colour bitmaps, without changing them.

Theoretically using opengl would be faster than software-rendering, but I never got far enough to test that assumption, and rendering the game itself is obviously a lot more complicated than a flat image, and might require a decent amount of restructuring.

So yeah, I don't know how helpful this is, or whether that's even a direction you'd want to go in, but I thought it's better to actually share this than just leaving it rotting on my HDD. (Maybe you already know graphicsy stuff, so I really hope this doesn't seem patronising!) The whole repo is at https://bitbucket.org/AtkinsSJ/glunatic (Not github because it was private until just now and github doesn't have free private repos and I am cheap. Sorry.) Feel free to yell at me if you have any questions.

  • Atkins

Actual binaries

Is there a way to compile these games and have them as actual executables or do you have to use the run file?

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.