Snake

Use this forum to share and discuss Uzebox games and demos.
charliegreen
Posts: 22
Joined: Wed Jan 14, 2015 7:28 pm
Location: California, USA

Snake

Post by charliegreen »

A while ago, I made a clone of snake, but never posted it here. If you like, you can download releases from my GitHub.

It uses EEPROM block 19 for storing high scores, and you can use SR and SL to skip by 5 letters when entering text in the high score menu; everything else I think should be pretty self-explanatory. Also (at least for now), it doesn't speed up as your score gets higher, since I couldn't find a smooth speed increase curve that I liked.

Another thing: what license is the uzebox kernel released under? Normally I release all my code under the MIT license, but if uzebox is GPL, that might not be compatible? :? Let me know if it actually matters.

Updated 2022-02-15: Added picture and binaries (Thanks to Jubatian)

snakes-screenshot.png
snakes-screenshot.png (3.79 KiB) Viewed 1728 times
Attachments
snake.uze
(18.73 KiB) Downloaded 226 times
snake.hex
(51.31 KiB) Downloaded 227 times
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: Snake

Post by nicksen782 »

I was looking at your graphics conversion program. Seems to do the job. It's okay if you make your own thing. If it works with Uzebox then it works. I made my own too but I had the Uzebox gconvert code and my Javascript code side by side in my IDE. It is literally a port but the C functions replaced with JavaScript equivalents.

So, that's awesome by it self man. Good job on that. Your Github didn't have a binary up though. I'll compile it later tonight and take a look.

Love a new game!
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Snake

Post by Jubatian »

I couldn't build the game. It tries to use a Python script "tile_converter.py" within the Uzebox master repo which is just not there, and I can't remeber having something alike there at all. Couldn't it be a custom tool which you accidentally placed in the Uzebox tree?

For licensing you can release your part under the MIT license, which means other people may use the game code if they want by the conditions of MIT (which may be useful if they want to port it to a different system). We are doing such, usually with the Creative Commons licenses (alongside GPL, dual licensing) to license artwork assets of games. A bit of correction: MIT (actually Expat or X11 license) is compatible with GPL, so you are doing nothing wrong there as people who would like to use it by GPL can! :)

EDIT: I think I found the missing script:
https://gist.github.com/charliegreen/b4 ... 0e7272d48d
I will try to build the game using it in the evening.
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Snake

Post by Jubatian »

Still no luck. The python script terminates with an error: "ImportError: No module named 'png'".

As a suggestion you could include assets which require some extra third-party tools to generate so people can compile the game easier.
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Snake

Post by Jubatian »

I figured out that I would have to install pypng using pip, which I had to install as well. However going through this I am still getting the same error, so for now I got totally fed up with this, and took those four tiles and typed them up (just by visually coarsely matching colors) manually into the missing tileset. Not exact, but at last the game works...
Snake screenshot
Snake screenshot
screenshot.png (3.79 KiB) Viewed 7276 times
It is a nice minimalist Snake game though! :)
Attachments
snake.uze
Note: With manually typed up tileset
(18.73 KiB) Downloaded 467 times
snake.hex
Note: With manually typed up tileset
(51.31 KiB) Downloaded 451 times
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Snake

Post by D3thAdd3r »

Good job completing a game 8-) I noticed on the .hex and .uze just posted, I am getting a seg fault when I try to run it in CUzeBox on Ubuntu, anyone else experience that?
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Snake

Post by Jubatian »

D3thAdd3r wrote: Fri Dec 08, 2017 6:24 pm Good job completing a game 8-) I noticed on the .hex and .uze just posted, I am getting a seg fault when I try to run it in CUzeBox on Ubuntu, anyone else experience that?
How :shock: CUzeBox is not supposed to segfault on any input, this is definitely a serious flaw, however I can't reproduce it (2017.09.29 version, the same which I provided as binary download). Can you give me a scenario which produces this result?
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Snake

Post by D3thAdd3r »

Code: Select all

lee@lab-dell:~/uzebox.git/branches/uzebox-streaming-music/demos/Mikrorennen/default$ ./cuzebox snake.hex
UzeRom parser: Error: snake.hex is not a UzeRom file.
Hex parser: Succesfully loaded program from snake.hex
Starting emulator
Found: Makefile (3722 bytes)
Found: cuzebox (54916 bytes)
Found: uzem (102464 bytes)
Found: Mikrorennen.eep (13 bytes)
Found: uzeboxCore.o (25964 bytes)
Found: Mikrorennen.lss (362275 bytes)
Found: snake.hex (52541 bytes)
Found: Mikrorennen.o (62928 bytes)
Found: Mikrorennen.uze (45332 bytes)
Found: snake.uze (19184 bytes)
Found: m40demo.hex (38415 bytes)
Found: uzeboxSoundEngineCore.o (13160 bytes)
Found: uzeboxVideoEngine.o (45612 bytes)
Found: uzeboxSoundEngine.o (44680 bytes)
Found: eeprom.bin (2048 bytes)
Found: uzeboxVideoEngineCore.o (26360 bytes)
Found: Mikrorennen.map (55202 bytes)
Found: Mikrorennen.elf (118824 bytes)
Found: Mikrorennen.hex (126092 bytes)
CUzeBox: 100% 28.636MHz; 60Fps; Audio: 15.734KHz; Keys: SNES FrameMerge 
Segmentation fault (core dumped)
lee@lab-dell:~/uzebox.git/branches/uzebox-streaming-music/demos/Mikrorennen/default$ 
It could be my install I guess, but I have not done anything specifically to the OS itself(at least on purpose..). For me just running it causes a seg fault within about 1/4 a second(I can see the rendered screen for about that long). I will have to try it on a different machine to see if the behavior can be reproduced. I had 5 terminal windows open and a couple pointed to the same directory...I did "sudo -s" and the problem went away. Closed the terminals, opened new, ran as regular user and I can't reproduce the problem now. Meh, I am blaming sub-atomic particles crashing into my ram bits :lol:
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Snake

Post by Jubatian »

D3thAdd3r wrote: Fri Dec 08, 2017 6:54 pm(...) It could be my install I guess, but I have not done anything specifically to the OS itself(at least on purpose..). For me just running it causes a seg fault within about 1/4 a second(I can see the rendered screen for about that long). I will have to try it on a different machine to see if the behavior can be reproduced. I had 5 terminal windows open and a couple pointed to the same directory...I did "sudo -s" and the problem went away. Closed the terminals, opened new, ran as regular user and I can't reproduce the problem now. Meh, I am blaming sub-atomic particles crashing into my ram bits :lol:
I am tempted to blame some quirk between the windowing system and SDL2 or the audio system and SDL2, I had seen issues with both in rare combinations with various software (in WindowMaker usually I get some report when X barfs out, while the audio system honestly feels like a pile of steaming crap in certain setups, such as the environment necessary to get Rosegarden producing any sound. That mess brings the whole system to its knees). If you see the issue resurfacing, maybe try an SDL1 build (you can force it by the Make_config.mk file) to see whether the problem also appears then. It it doesn't, then I say blame the windowing system / SDL2 / sub-atomic particles / whatever.
charliegreen
Posts: 22
Joined: Wed Jan 14, 2015 7:28 pm
Location: California, USA

Re: Snake

Post by charliegreen »

Hey! Sorry you had trouble building, I forgot to mention my tile_converter.py script :oops: For all my projects since then I've used gconvert and I forgot about it..

Also, I've had binaries up on the releases page; I hope these work for people!

In the meantime, I probably won't switch it over to building with gconvert unless there's more demand for that, since I've been working on a roguelike and a new video mode, and those projects are a lot more interesting to me. Sorry for any inconvenience this causes :|
Post Reply