"Heads Up Display" - Part 5 GameBoy programming - write your own Game Boy games

  Рет қаралды 19,822

GamingMonsters

GamingMonsters

Күн бұрын

Пікірлер: 85
@Woodythehobo
@Woodythehobo 5 жыл бұрын
I found another slightly less manual way to shift the Background map data when using Fonts: In the Map Builder tool in the Export To window (Location tab) set Tile Offset to 38 (or however many chars your font takes). Finally in code I also put my offset here: set_bkg_data(38, ... P.S. Your series is a fantastic resource! I'm new to C but not programming, and I'm finding the transition extremely easy, I really appreciate it. My end goal is to build either a simple RPG, Roguelike or Sandbox, i'd also like to investigate the link cable and memory bank switching if they are supported.
@GamingMonsters
@GamingMonsters 5 жыл бұрын
Please feel free to share you work and code here always helps me and others
@pyxelpub8251
@pyxelpub8251 5 жыл бұрын
Thank you so much for fixing that issue, and it also fixed the Z character disappearing! I'm curious tho, any idea why the first two tiles are always empty? I assume the first tile in the font loaded is empty, but why the second?
@Matheus-mf9nz
@Matheus-mf9nz 3 жыл бұрын
I cracked my knuckles, ready to write a cumbersome algorithm to automate the shifting for all my maps when I realized the offset feature was right there. I'm tired 😂🔫
@corbin_zip
@corbin_zip 9 ай бұрын
@@Matheus-mf9nz assuming that we need to shift from 0x00 to 0x25 on a 40 by 18 tile map: for (int i = 0; i < (40*18); i++) { Map_Space[i] += 0x25; // you could use the integer 37 if you prefer } set_bkg_data(0x25, 8, TILESETNAME);
@EricAbroad
@EricAbroad 3 жыл бұрын
Commenting to say that I for one am interested in a follow-up video that explains how to get the HUD working properly from the top of the screen. Thanks again for a great video!
@tsutinoko7170
@tsutinoko7170 2 жыл бұрын
In GBDK-2020 font.h locate in "gbdk/font.h", not "gb/font.h"
@woo-zh8fl
@woo-zh8fl 2 жыл бұрын
thank you
@emanuelprado26
@emanuelprado26 2 жыл бұрын
thank you!
@Juxtapose1984
@Juxtapose1984 2 жыл бұрын
@GamingMonsters This is a key update for anyone following this in 2020+. Without making this change in main.c, you'll likely get an error like the following when trying to run the make.bat main.c:4:21: fatal error: gb/font.h: No such file or directory compilation terminated. (Thanks for the videos!!)
@ILoveSweetWaterMelon-ti2sq
@ILoveSweetWaterMelon-ti2sq 4 ай бұрын
Thanks.
@GMaker0507
@GMaker0507 3 жыл бұрын
i'd definitely be interested in seeing the advanced version.
@EdwinJones1234
@EdwinJones1234 3 жыл бұрын
Thank you! I was trying to figure out how to load fonts without using the printf/puts functions - your videos are gold.
@ILoveSweetWaterMelon-ti2sq
@ILoveSweetWaterMelon-ti2sq 4 ай бұрын
This man is still using that older version of GBDK, which was released in 2000. That's why I'm getting errors again and again overtime lol. How, why aren't you getting "I/O error"? Everything is ok just like your video, but I'm still getting that error while compiling!
@andrewmemorycard
@andrewmemorycard 5 жыл бұрын
Could I put score(variable) in the window?
@pema257
@pema257 4 жыл бұрын
The editor for removing the squiggles didn't appear for me.
@RetroDX
@RetroDX 6 жыл бұрын
Hey buddy, I love this series so thank you for investing the time to make it. Sprite collission and setting the moving background map as a platform for a character to stand on would be great to see too. Keep up the good work!
@GamingMonsters
@GamingMonsters 6 жыл бұрын
Yes they are definitely on the list for upcoming episodes as ever thanks for the encouragement
@AlistairBrugsch
@AlistairBrugsch 4 жыл бұрын
Came for the Gameboy programming tutorial, stayed for the Amiga 500 RetroGamer special :)
@timcarley6330
@timcarley6330 5 жыл бұрын
I am absolutely interested in a more advanced tutorial on the window HUD. A link to one or one you made would be excellent? Keep up the awesome work! Real inspiring stuff!
@GamingMonsters
@GamingMonsters 5 жыл бұрын
Hopefully I will come back to the topic in future with a more advanced look. If you want to know more about drawing it at the top of the screen then look at gbdev.gg8.se/forums/viewtopic.php?id=459 for a start
@Ziebrand
@Ziebrand 6 жыл бұрын
Thanks for this video series! It inspires me, and now I am also writing my own game boy game. I hope you will do a video on adding sound/music to the game in the future.
@GamingMonsters
@GamingMonsters 6 жыл бұрын
Zie... brand! Hopefully sound is next weeks video, it’s a bit more complex but I’ll try and show the basics
@Ziebrand
@Ziebrand 6 жыл бұрын
GamingMonsters I’m looking forward to it.
@gamepopper101
@gamepopper101 7 ай бұрын
12:59 I know it's been years, but is there any chance on that code to render a HUD at the top of the screen? (Or at least the source code for it?)
@esotericsean
@esotericsean 6 жыл бұрын
This would be great for dialogue. Is it simple to modify the map to change the dialogue during a game? Or would you just need to load up a different map for each set of dialogue?
@GamingMonsters
@GamingMonsters 6 жыл бұрын
You are right you would just need a new map for each piece of dialogue or if you make each piece take the same number of bytes you just load the next part from the same map. I guess as long as you know what each value in the map is you could just work it out dynamically and change the map as you go. Sounds like a tutorial brewing here :-)
@RetroBreak
@RetroBreak 5 жыл бұрын
Great tutorials! Very easy to follow :) thanks!
@vriska222
@vriska222 5 жыл бұрын
i fixed the include thing but now I get squiggles under "SHOW_BKG" and "DISPLAY_ON"
@BrixVGM
@BrixVGM 3 жыл бұрын
is it possible to change a value of the map midgame? Im trying to get it to display a digit for how many lives you have (1-9) and im trying to do something like windowmap[2] = 0x05; (for example) but it doesnt seem to actually update the map / change the digit on screen, is there something else you have to do to get that effect? EDIT: figured it out; you have to re-run set_win_tiles after updating the map.
@jacobwerner8533
@jacobwerner8533 2 жыл бұрын
I've been programming the original gb in assembly using rgbds. Wondering if the window has to be 1024 bytes (32*32) like the background or can it be smaller
@user-wq5kt4qi8t
@user-wq5kt4qi8t Жыл бұрын
I just added "c:/gbdk/include/**" to the code, but the set_win_tiles function is not recognized. Please tell me the solution.
@sadovsf
@sadovsf 9 ай бұрын
Another small hint. You can draw text from font by simple doing: const char hello_world[] = "hello world"; set_win_based_tiles(0, 0, sizeof(hello_world)/sizeof(hello_world[0]), 1, hello_world, 170); For numbers offset is then 209
@nathan08085
@nathan08085 5 жыл бұрын
Hey man, ould you explain to me how I'd aadd dynamic data; like a score variable into the heads up display?
@GamingMonsters
@GamingMonsters 5 жыл бұрын
You would just update the part of the map array that is the position of the text you want to change and change the number at that position to the new characters index is your tile data array. Take a look at my video showing you how to have a keyboard type to see a similar effect
@MaxSedlmeier
@MaxSedlmeier 6 жыл бұрын
thank you for doing this! I'm still keeping up with your tutorials. Will there also be some physics like jumping of a 2D-character?
@GamingMonsters
@GamingMonsters 6 жыл бұрын
Max Sedlmeier I don’t as yet have an exact plan for future videos but jumping should be pretty doable in a short video as well as very basic collision detection between characters
@MaxSedlmeier
@MaxSedlmeier 6 жыл бұрын
@@GamingMonsters I'm looking forward to it!
@furball_vixie
@furball_vixie 5 жыл бұрын
is there a way to add newlines to that HUD? because i would like to have like pause elements in there and stuff
@GamingMonsters
@GamingMonsters 5 жыл бұрын
Like the background layer you can update the window layer whenever you want. Some games even using it to display dialog
@furball_vixie
@furball_vixie 5 жыл бұрын
@@GamingMonsters I know but i didnt yet figure out how to add a newline, everything that is more than 20 characters just goes offscreen, how can i put it in its own line?
@cyanrazorCel
@cyanrazorCel 4 жыл бұрын
Do you know how to make text progress (one letter appears after the other)?
@MrDenham
@MrDenham 4 жыл бұрын
Did you ever make a tutorial about putting the text at the top? Really enjoying these!
@GamingMonsters
@GamingMonsters 4 жыл бұрын
Sorry life has got in the way so I have done any for a while, hopefully will get back to it again
@MrDenham
@MrDenham 4 жыл бұрын
@@GamingMonsters they're really nice tutorials, look forward to their return if you do!
@GHeinz
@GHeinz 3 жыл бұрын
i'm getting two errors that i don't understand. the first three parts worked fine, and i'm using the exact same make.bat file as before. my code is identical to yours, but when i try and run make.bat, i get "error 102: too few parameters" and "can't find `main.o'". any ideas?
@GHeinz
@GHeinz 3 жыл бұрын
sorry, i replied to the wrong video, this is actually in reference to part 4, but i suppose they are related
@GHeinz
@GHeinz 3 жыл бұрын
nvm i guess, no idea what the problem was but just started from scratch and got it to work. thanks for the vids
@seasons8bit
@seasons8bit 5 жыл бұрын
Surely there is a better way than manually editing the map tile file?
@GamingMonsters
@GamingMonsters 5 жыл бұрын
seasons8bit probably but suspect much harder to explain
@ArvexYT
@ArvexYT 5 жыл бұрын
Honestly, this is one of those things where you need to plan ahead for. While going through the tutorials, had I known that fonts and BKG data occupied the same memory space, I would have planned my tilesets and maps around that. Just keep it in mind for the future. (I'm a novice at GB game coding, so maybe there is a better solution I'm not aware of yet?)
@andcervi
@andcervi 5 жыл бұрын
when you export from Gameboy Map Builder, in Export options, in the tab Location Format there is the option "Tile offset". Set it to 37 and you have the correct background map already shifted to left tiles for the font.
@rhododendr0ne
@rhododendr0ne 4 жыл бұрын
Hi. Is there a way to set the include path outside VSCode, i.e. when using N++ or other editor? I keep getting parse error whenever I declare UINT8 variable. I've tried playing with -I parameter to lcc.exe (-I"path"), but haven't figured it out. Thank you for this series!
@sjrnoodles5721
@sjrnoodles5721 4 жыл бұрын
how to make it display the score?
@pyxelpub8251
@pyxelpub8251 5 жыл бұрын
Okay, so I don't have an issue with running things from the GB library, but I don't have the autocomplete function when writing, but because I don't have the green lines, I can't edit include path, any advice here on how to add it? Also, after finishing the tutorial, I realize there's a bit of screen tearing while the background is scrolling, is that normal?
@GamingMonsters
@GamingMonsters 5 жыл бұрын
In the video look at the left of my screen where vscode shows the files. There is a folder shown called .vscode and in there a file called _cpp-properties.json that is the file where you add the include path. As for tearing I’d guess that’s just your emulator and won’t be seen in real hardware
@rorygleeson5656
@rorygleeson5656 4 жыл бұрын
@@GamingMonsters It's not there for me.
@sadovsf
@sadovsf 9 ай бұрын
Instead of replacing tile numbers check out function `set_bkg_based_tiles`
@thenukelore2space495
@thenukelore2space495 4 жыл бұрын
Everytime I type .\make.but it says it’s not recognized
@GamingMonsters
@GamingMonsters 4 жыл бұрын
Double check vs code has actually saved make.bat. Just creating the file and typing it’s contents won’t save it to disk
@thenukelore2space495
@thenukelore2space495 4 жыл бұрын
GamingMonsters It is saved it used to work is the thing but I took a break to learn c and programming just in general better but now it’s not working even though it is the exact same code as before and it’s still not working
@TumbleGamerTK
@TumbleGamerTK 5 жыл бұрын
wouldn't you put the text to the bottom of the window and them move it up
@GamingMonsters
@GamingMonsters 5 жыл бұрын
To get it to display at the top you mean? That is what I thought until I tried. Because of how the hardware draws the window layer it cannot be shifted up in the way you would expect only down. To get it at the top you have to use a scan line interupt which hopefully I’ll cover in the future
@TumbleGamerTK
@TumbleGamerTK 5 жыл бұрын
@@GamingMonsters I like how you're active in the comments.
@kubagurpl8130
@kubagurpl8130 5 жыл бұрын
If anyone sees this, then could someone help me with the tile data because now the tiles that I created overwrote the first 6 or so tiles. Please help!
@GamingMonsters
@GamingMonsters 5 жыл бұрын
There is a maximum number of tiles you can load at once (can’t remember exactly what and don’t have a good internet connection where I am) so perhaps you are loading more than this and therefore overwriting the beginning
@kubagurpl8130
@kubagurpl8130 5 жыл бұрын
I just figured it out. I was overwriting it by accident because set_bkg_data was at (0,7,...) while it should've been at (37,7,...). Thanks for replying, anyways!
@llawliet5434
@llawliet5434 5 жыл бұрын
Hey, sry to always ask you for stuff But i ran into a problem In my game, the hud is its own map. Everything works fine, it loads, its on the bottom, but it uses the palette of my background Do you have any idea on how to fix that? I should mention that i'm making a gameboy color game
@GamingMonsters
@GamingMonsters 5 жыл бұрын
Hi I’ve not even started looking at gbc and colour palettes yet sorry. I’d be happy to look at the code though perhaps I can learn something and fix something at the same time
@llawliet5434
@llawliet5434 5 жыл бұрын
GamingMonsters ok, i'll try to upload it to github If you want me to explain something, i'll try my best to do so Edit: github.com/ShadowTheReal/Botw2d
@GamingMonsters
@GamingMonsters 5 жыл бұрын
Hi I took at look (its looking nice). I would guess from looking at the VRAM screen in GBDK that the window shares the same palette as the background unfortunately. Ill take more of a look around to see if I can confirm that but the fact there is no set_win_palette method suggests this is the case
@llawliet5434
@llawliet5434 5 жыл бұрын
GamingMonsters yeah, thats what i was thinking as well But how to The zelda games for the gameboy color handle this, because they have the hud and the overworld and they have different palettes. Also, thanks for taking the time and looking into it
@GamingMonsters
@GamingMonsters 5 жыл бұрын
@@llawliet5434 Eventually found this which should explain it all www.devrs.com/gb/files/cgbdk.txt
@19Cypher87
@19Cypher87 5 жыл бұрын
You've kinda removed "Z" from the alphabet. Btw, love the series!
@GamingMonsters
@GamingMonsters 5 жыл бұрын
Deliberate of course. Stops any arguments about how people pronounce it wrong :-)
@IceMetalPunk
@IceMetalPunk 2 жыл бұрын
@@GamingMonsters From now on, whenever an off-by-one error catches me out, I'm just going to shrug and tell my colleagues, "Zedzee". No context, no explanation, just "zedzee" and internal enjoyment of their confusion.
@obscuredesign7913
@obscuredesign7913 5 жыл бұрын
for some reason my compiled rom didnt look right kzbin.info/www/bejne/gWnCiHmqfpeSmKs do you know whats going on on mine?
@GamingMonsters
@GamingMonsters 5 жыл бұрын
Can you share the code?
@obscuredesign7913
@obscuredesign7913 5 жыл бұрын
@@GamingMonsters nitro2k01 from gameboy development forum pointed out the glitch came from the move_win(); method. i had move_win(0, 136); causes the glitch. the window x position had to be 7 to position it to the window to left side of the screen. i guess x position 0 is outside the view and it causes the glitch.
@obscuredesign7913
@obscuredesign7913 5 жыл бұрын
thanks again. im sure u know about this also. :-)
@karter7704
@karter7704 3 жыл бұрын
Vous avez les dents bien blanches c'est excitant
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
Game Boy Graphics & How To Code Them
9:02
NesHacker
Рет қаралды 103 М.
"Sprites" Part 2 GameBoy programming - write your own Game Boy games
16:50
Making My Own Programming Language and Coding a Game in It
10:19
AstroSam
Рет қаралды 1,3 МЛН
5 Games Made in Godot - This Week in Godot
11:17
StayAtHomeDev
Рет қаралды 20 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 302 М.
EVERY GAME BOY COLLECTOR NEEDS THIS! | GBxCART PRO
13:27
Macho Nacho Productions
Рет қаралды 116 М.
Making Smallest Possible Linux Distro (x64)
27:43
Nir Lichtman
Рет қаралды 92 М.
Learn to code and write games on the Nintendo Game Boy  | MVG
17:25
Modern Vintage Gamer
Рет қаралды 266 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН