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

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ธ.ค. 2024

ความคิดเห็น • 85

  • @Woodythehobo
    @Woodythehobo 5 ปีที่แล้ว +27

    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 ปีที่แล้ว +8

      Please feel free to share you work and code here always helps me and others

    • @pyxelpub8251
      @pyxelpub8251 5 ปีที่แล้ว +2

      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 ปีที่แล้ว +6

      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 8 หลายเดือนก่อน +1

      @@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 ปีที่แล้ว +4

    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!

  • @GMaker0507
    @GMaker0507 3 ปีที่แล้ว +7

    i'd definitely be interested in seeing the advanced version.

  • @ILoveSweetWaterMelon-ti2sq
    @ILoveSweetWaterMelon-ti2sq 4 หลายเดือนก่อน +1

    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!

  • @EdwinJones1234
    @EdwinJones1234 3 ปีที่แล้ว +1

    Thank you! I was trying to figure out how to load fonts without using the printf/puts functions - your videos are gold.

  • @tsutinoko7170
    @tsutinoko7170 2 ปีที่แล้ว +11

    In GBDK-2020 font.h locate in "gbdk/font.h", not "gb/font.h"

    • @woo-zh8fl
      @woo-zh8fl 2 ปีที่แล้ว +1

      thank you

    • @emanuelprado26
      @emanuelprado26 2 ปีที่แล้ว +1

      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 หลายเดือนก่อน +1

      Thanks.

  • @RetroDX
    @RetroDX 6 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      Yes they are definitely on the list for upcoming episodes as ever thanks for the encouragement

  • @AlistairBrugsch
    @AlistairBrugsch 4 ปีที่แล้ว +1

    Came for the Gameboy programming tutorial, stayed for the Amiga 500 RetroGamer special :)

  • @timcarley6330
    @timcarley6330 5 ปีที่แล้ว +2

    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 ปีที่แล้ว +4

      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

  • @andrewmemorycard
    @andrewmemorycard 4 ปีที่แล้ว +3

    Could I put score(variable) in the window?

  • @Ziebrand
    @Ziebrand 6 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      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.

  • @pema257
    @pema257 4 ปีที่แล้ว +5

    The editor for removing the squiggles didn't appear for me.

  • @MaxSedlmeier
    @MaxSedlmeier 6 ปีที่แล้ว +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 ปีที่แล้ว +7

      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 ปีที่แล้ว +4

      @@GamingMonsters I'm looking forward to it!

  • @RetroBreak
    @RetroBreak 5 ปีที่แล้ว +1

    Great tutorials! Very easy to follow :) thanks!

  • @BrixVGM
    @BrixVGM 3 ปีที่แล้ว +1

    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.

  • @sadovsf
    @sadovsf 8 หลายเดือนก่อน

    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

  • @esotericsean
    @esotericsean 5 ปีที่แล้ว +2

    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  5 ปีที่แล้ว +2

      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 :-)

  • @nathan08085
    @nathan08085 5 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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

  • @MrDenham
    @MrDenham 4 ปีที่แล้ว

    Did you ever make a tutorial about putting the text at the top? Really enjoying these!

    • @GamingMonsters
      @GamingMonsters  4 ปีที่แล้ว +1

      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!

  • @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

  • @gamepopper101
    @gamepopper101 6 หลายเดือนก่อน

    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?)

  • @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.

  • @furball_vixie
    @furball_vixie 5 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      @@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?

  • @vriska222
    @vriska222 5 ปีที่แล้ว +1

    i fixed the include thing but now I get squiggles under "SHOW_BKG" and "DISPLAY_ON"

  • @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!

  • @cyanrazorCel
    @cyanrazorCel 4 ปีที่แล้ว

    Do you know how to make text progress (one letter appears after the other)?

  • @pyxelpub8251
    @pyxelpub8251 5 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      @@GamingMonsters It's not there for me.

  • @sadovsf
    @sadovsf 8 หลายเดือนก่อน

    Instead of replacing tile numbers check out function `set_bkg_based_tiles`

  • @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 ปีที่แล้ว +1

      nvm i guess, no idea what the problem was but just started from scratch and got it to work. thanks for the vids

  • @19Cypher87
    @19Cypher87 5 ปีที่แล้ว +5

    You've kinda removed "Z" from the alphabet. Btw, love the series!

    • @GamingMonsters
      @GamingMonsters  5 ปีที่แล้ว +13

      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.

  • @seasons8bit
    @seasons8bit 5 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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.

  • @llawliet5434
    @llawliet5434 5 ปีที่แล้ว +1

    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

  • @sjrnoodles5721
    @sjrnoodles5721 4 ปีที่แล้ว

    how to make it display the score?

  • @thenukelore2space495
    @thenukelore2space495 4 ปีที่แล้ว +1

    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

  • @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!

  • @TumbleGamerTK
    @TumbleGamerTK 5 ปีที่แล้ว

    wouldn't you put the text to the bottom of the window and them move it up

    • @GamingMonsters
      @GamingMonsters  5 ปีที่แล้ว +1

      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 ปีที่แล้ว +2

      @@GamingMonsters I like how you're active in the comments.

  • @obscuredesign7913
    @obscuredesign7913 5 ปีที่แล้ว

    for some reason my compiled rom didnt look right th-cam.com/video/K8_WFtI2_bI/w-d-xo.html do you know whats going on on mine?

    • @GamingMonsters
      @GamingMonsters  5 ปีที่แล้ว

      Can you share the code?

    • @obscuredesign7913
      @obscuredesign7913 5 ปีที่แล้ว +1

      @@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 ปีที่แล้ว +1

      thanks again. im sure u know about this also. :-)

  • @karter7704
    @karter7704 3 ปีที่แล้ว

    Vous avez les dents bien blanches c'est excitant