Batterycheck - Remake of an old PC platformer

Discussion in 'Wii - Emulation and Homebrew' started by Archerite, Nov 14, 2018.

  1. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    I have been working on a homebrew project and I think it's far enough to show what I have and get some input from others. It's a remake of a 1998 promotional game to stimulate recycling batteries in the Netherlands. It's a fun and non-violent puzzle platformer that used the Jazz Jackrabbit game engine (more info about it on the jazz2online wiki)

    I wanted to write it for Wii at the start but the complexity of 2D games on 3D GPU's scared me so I started with reading the game files in Python on the PC. After a while I started on the DS Lite and while I did made progress the low resolution really bothered me..and swapping SD cards in and out was no fun either. I then moved on to the 3DS which was a little bigger and easier to develop and test new code on...and within a few weeks I had a playable demo. Since I still wanted a Wii version I decided to restart from scratch!

    The short story is that I combined the sprite examples from Devkitpro for the Gamecube, Wii and 3DS with a simple demo I wrote for OpenGL on Linux. This evolved into a "game engine" that now runs on Linux, Wii and 3DS...


    So to continue I have a few questions...

    1. My engine (which has no name yet) requires the game files on a filesystem like device and I am using the SD card on the Wii so far which works great. But this is also the reason I had to drop Gamecube support since I have not been able to generate a bootable ISO file yet. On the 3DS there is the option for a ROMFS but from what I found the Wii/Gamecube do not have this right? I hope someone could point me to instructions for creating a working ISO on linux. Or even windows if required...i do have it.

    2. I wanted to know the licence terms of the game - It s Creative Commons but not sure which version yet
    3. - I got the conversion to RGB5A3 working by looking at how gxtexconv and libogc handle this.

    I also would like to know what others think about my project and if there might be interest in a multi platform game engine or something.
     
    Last edited by Archerite, Dec 1, 2018
    migles, newo, Brawl345 and 4 others like this.
  2. Captain_N

    Captain_N GBAtemp Maniac

    Member
    6
    Mar 29, 2010
    United States
    I would not worry about if its ok to use the games files. Just dont post anything till its finished. Then release the final product. Once the product is out in the wild its stuck out there. Even if you get a letter to shut down the site it wont matter. the game is done and the genie is out of the bottle..
     
  3. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    I do not worry about using the game files since I got them directly from the original CD-ROM, and also because Stibat (the original organization that released the game) provided it as a free download on their own site many years ago. It's no longer available from them but some kind person at the jazz2online forums preserved it many years ago. Since the engine "could" also run Jazz Jackrabbit 2 levels I have plans for supporting it and i could just say: Buy the game at GOG (or get them from your original CD-ROM ofcourse)! Copy the files to your SD-Card here! Enjoy! .....but this is not possible for Batterycheck unfortunately.:mellow:

    In a way the original game could be considered freeware I think and since I made clear it's a remake it might be "fair use". From what I understand the rules here do not allow linking to those files is ... but maybe some screenshots of what I have working is acceptable.
     
  4. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    I found a Let's Play video in English and they play through the entire game to the end boss..so it has some spoilers ;)

    Just to be clear the download and video are NOT of my version of the game engine.

    I got encouraged in my other thread by Cyan to contact the company that made the game and ask them if sharing is allowed. After a bit of searching I found an old bit still active download page on a game company's website, so I send them an email explaining what I was working on and asked a few questions. And they have responded! :yay:

    They told me that the license for the game is Creative Commons which means I can talk about the game and refer to it but not use it for commercial purposes. The download page I found is old and not the official one and might be removed in the future but they will allow me to link to the page, so here it is:
    Download and install instructions for the original Windows game

    I do plan to make my version an almost perfect replica that will run natively on: ( Colors indicate current working status: Working, Needs work, Untested, Planned)
    - Linux
    - Wii

    - GameCube
    - 3DS

    - NDS

    - DSi
    - PlayStation 2
    - PlayStation Portable.

    While it might seem ambitious to support so many platforms but my main motivation for the project is to learn how to write games and software for them. In addition I wanted to something more than the standard "Hello World" and maybe contribute to the homebrew community with something as an example that will work on multiple platforms. I choose Batterycheck because it's fun puzzle platformer with good animations and game mechanics that still hold up today.
     
    Last edited by Archerite, Dec 1, 2018
    Cyan, newo, Brawl345 and 1 other person like this.
  5. niuus

    niuus GBAtemp Advanced Fan

    Member
    3
    Mar 4, 2016
    Venezuela
    Wow, i am totally interested in this. I really love homebrew games, specially on GCN/Wii. Any kind of tests you might need to, including PS2 and PSP, just ask.

    About the files, i wouldn't worry too much, since Stibat (the original distributors of Battery Check, for those that do not know) uploaded the CD themselves on Archive.

    Just curious, would your final "engine" also be able to play Jazz 2?

    BTW, not sure, but maybe this could help you with your homebrew disc for GCN?
     
    Last edited by niuus, Dec 2, 2018
  6. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    Thank you for your interest in my project, I still have a lot of work to do before a playable demo is ready from the new codebase...but I do have one for the 3DS but it requires all sprites pre-converted into 3DS format textures on the SD card. The new code does this at runtime in memory so you would only need the original game files. For the PS2 and PSP I only know there are GCC devkits for them and therefore the code should be able to compile. What I really need to get started is some examples of how to initialize and show some moving sprites. That is how I started on the current platforms with four squares in a rotating animation and then started to move things into common function names like 'jzGPU_Init()' and 'jzGPU_frameStart()' (The jz prefix is a reference to Jazz but it might change later when I come up with a proper name for the engine)

    I already have most objects visible in the level but skipped their parameters until a few days ago. Each object or event is stored as a little endian 32bit/4byte block. First byte (left to right) is the event number and the remaining three are parameters. Things like width and height for the water, length and speed of the belts. The format have been explained on jazz2online too and after figuring out there were 4 common bits before the actual co figuration, I got the right values. Except on the gamecube....since the PPC is big endian it swaps the bytes. I wrote 'swap functions' I use almost anywhere for the Wii/GC platforms but this time it did not work.
    The parameters are small bit fields in a struct and they seem to not match, so I need to look into that some more.

    My project would have been impossible without the detailed documentation from the jazz2online wiki and since the tileset and levels for Batterycheck are 98% the same format as Jazz2, it can be supported eventually. The biggest difference between the two games are the sprites,events and different characters and weapons. And the extension JJ2+ added scripting for custom levels so that would be a challenging option to support. While it is on my wishlist I first want to have batterycheck running on the platforms listed above before taking on that part. I do keep it in mind constantly so I try to keep the game specific things separate from the main engine where I can, but currently it's a bit of a mess to be honest. ;)

    Thanks for the link for the gamecube disc tutorial...that was one of the first things I tried but without explaining what it is or where to get one it requires a 'gbi.hdr' file. I found it in the source for Swiss but in the end I just got multiple errors and gave up on it...except for a few small things the Wii version should run on the gamecube just fine since I use libogc to access things like the GPU and Gamepads.
     
    Last edited by Archerite, Dec 2, 2018
    MaildroidX likes this.
  7. niuus

    niuus GBAtemp Advanced Fan

    Member
    3
    Mar 4, 2016
    Venezuela
    Sounds great, i'll be looking forward to your releases. It's great to have a nice new homebrew game, and even more if it could potentially run other commercial games. Take your time!
     
  8. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    Thanks, I might be able to upload a 'sneak preview' version or something like that in a few days. Just to show what works and what not. While you can only scroll through the level and control the HUD gauges... a debug feature ofcourse... There are already a few animations like the "hover/floating" of the batteries and elevators and the tileset animations work too...mostly. It has a bug I did not find important enough yet that skips frames and the delays/repeat settings. I'll try to fix that before the preview

    I also looked a bit further and found a similar tutorial for creating a gamecube disc on the gc-linux here that explains what the gci file is and how to create one. I will look into that maybe next week and see if I can get that to work and test it on real Gamecube hardware.
     
    MaildroidX likes this.
  9. niuus

    niuus GBAtemp Advanced Fan

    Member
    3
    Mar 4, 2016
    Venezuela
    Awesome! I'll definitely check it out.

    BTW, i've found an old resource i used some time ago to make a bootable GCN disc, hopefully it is useful to you?
    https://wiki.gbatemp.net/wiki/GC_Bootable_Disc_GUI
     
    Last edited by niuus, Dec 3, 2018
  10. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    The 3DS port got too far behind with testing because I recently reinstalled my PC to the latest Xubuntu 18.04 and had issues getting Citra to compile. I fixed that yesterday so now I can test it again in the emulator. It still needs PNG dumps of the textures from the Linux version but other than that loading the data is mostly the same. As I expected the 3DS is not affected by the endian issue that the wii and gamecube have. I have an idea on working around the issue but first I want the 3DS to load the textures the same as all the other ports...should not take that long I hope.
    Thanks for the suggestion but I am still hoping the cubetools package from gc-linux are the solution. From what I can see the GUI is simple enough to get started but I like to have Make do all the work like "make gc-iso" and have it generate a GameCube ISO from the latest source code and game files. I have similar short cuts for 'wii-emu', 'wii-debug', 'wii-load' and also for the 3DS. Having to use a GUI kind of interrupts that workflow a bit.
     
  11. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    I have finaly fixed the endian bug for Wii and Gamecube! I found some helpfull info explaining how bitfields work differently on big-endian machines. For some reason not only the bytes are swapped but also the packing/ordering of the bitfields! To give an idea of what that means...and what I needed to understand it myself...here is an example for one of the objects
    Code:
    #pragma pack(1)
    typedef struct {
      #ifndef GEKKO
        uint8_t   event_id:8;
        uint8_t       misc:4;
        uint8_t trigger_id:6;
         int8_t      speed:5;
        uint8_t     length:4;
        uint8_t   duration:5;
      #else
        uint8_t   duration:5;
        uint8_t     length:4;
         int8_t      speed:5;
        uint8_t trigger_id:6;
        uint8_t       misc:4;
        uint8_t   event_id:8;
      #endif
    } Event47;
    #pragma pack()
    
    Now that is solved I can continue digging into the 3DS texture loading and the animated tiles that skip frames and such. In the mean time I also started looking into what I need for adding PSP and PS2 ports so I installed both devkits with docker. Only need some examples to see how to initialize these systems and access the input, gpu and storage...sound comes later.

    EDIT: I changed my mind about sharing a preview version...

    Please be aware that this is a preview version and NOT a working game yet and contains unfinished objects and bugs. You can scroll around the entire level with the Wiimote in horizontal mode (fixed for now), Classic controller (SNES and NES classic confirmed to work) and a Gamecube controller. You can exit with the home button on the wiimote and return to the homebrew channel. It works in Dolphin 5.0 and on real hardware but requires the original game files to be placed on an SD card. Install the game on your computer (Windows, Linux with wine, Mac...can use wine too but is more work) and copy the files from "c:\Games\Battery\*" into the folder "/data/batcheck/*" on your SD card.

    Enjoy! ;)
     

    Attached Files:

    Last edited by Archerite, Dec 6, 2018 at 11:23 AM
    niuus and Brawl345 like this.
  12. niuus

    niuus GBAtemp Advanced Fan

    Member
    3
    Mar 4, 2016
    Venezuela
    Tested! I used a Wii U Pro Controller. The 2D art looks very nice on screen. Looks like a funny platformer to enjoy on the Wii.
     
    Archerite likes this.
  13. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    I know it's not the most easy installation procedure to follow through. Did you run it on a standard Wii or the WiiU that you could play with the WiiU pro controller? I had hoped that would work and it seems libogc has the 'driver' for it build in. I did nothing specifically to support it like I had to for the classic controllers. I am not supprised if thatis how the pro controller works actually.

    Thanks for testing and if you have any suggestions or comments please let me know

    EDIT: Just tested it on my own Wii with the pro controller and almost gave up since it did not want to connect....then I thought maybe it's using USB. Hahaha, and now it works over bluetooth which is a really cool trick! Thanks!
     
    Last edited by Archerite, Dec 7, 2018 at 6:54 AM
  14. souler92

    souler92 GBAtemp Fan

    Member
    4
    Jan 5, 2017
    Netherlands
    im from the netherlands and i had this game back in the days.

    i played Jazz for a lifetime! one of the best ever games
     
  15. niuus

    niuus GBAtemp Advanced Fan

    Member
    3
    Mar 4, 2016
    Venezuela
    Hahaha, i'm glad to know that you learned a pretty cool and convenient trick for us Wii users. And yep, standard Wii for testing, all the time (unless noted). Since libogc supported the Wii U Pro Controller (1.8.15, i think), it is treated the same as a classic controller.

    For now, i would suggest you to use your game data folder inside the app folder (apps/batterycheck) instead of the root. It is neater and cleaner for the sd folder structure, same as other homebrews already available on the system.
     
    Archerite likes this.
  16. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    Great to hear I am not the only one who played this game when it was released. Did you ever got to the boss level and send in the response card? I did send it but never won any prices through...except the honor of having completed the game. :D I hope you will try my Wii version once it's playable...or even look at the preview version that is out now.

    It's really awesome that they added Bluetooth support for it even if the initial pairing is over USB. I guess it's a good thing then that I added support for the classic controller from the start so now the Wii U Pro also works directly without me even knowing it did! I think I need to see if there is a newer HBC than 1.1.2 since it will not connect until my game boots.

    Thanks for your feedback, I have been /data for so many years now on my systems I did not even think about checking what the standard would be. I changed the data folder to "/apps/batterycheck/data/*" would that be alright? I have looked into how an actual homebrew channel item shows up and it seems to work for me, but I want to do some more changes before uploading a new preview...like fixing the tile animations and transparent "water"/"transparent-blue-rectangle" and maybe a few other things.
     
    Last edited by Archerite, Dec 7, 2018 at 9:38 PM
  17. niuus

    niuus GBAtemp Advanced Fan

    Member
    3
    Mar 4, 2016
    Venezuela
    Well, i've got some "gifts" for your convenience:

    First, you can pair your WUPC wirelessly! Just sync it like you would any of your Wiimotes (sync buttons on the console/pad, inside your regular Wii System Menu, or vWii). For obvious reasons it won't work there, but after that you can use it on any of your compatible homebrew apps.

    And last but not least, install this:
    https://github.com/FIX94/hbc/releases
    Open Homebrew Channel, a fork by FIX94. Wii U Gamepad and Wii U Pro Controller support, right from the get-go.
     
    Archerite likes this.
  18. newo

    newo GBAtemp Regular

    Member
    4
    Apr 7, 2011
    Jamaica
    Not sure if anyone asked this question already but why not make a whole new game? Instead of trying to port an old one.
     
  19. Archerite
    OP

    Archerite Member

    Newcomer
    1
    Sep 16, 2018
    Netherlands
    I tried multiple times but could not get it to sync using just the buttons...might have tried that only in the HBC though. Do you mean that the Wii U GamePad with the LCD can also work on the Wii? I guess only the buttons would work then since the video signal is sent over a proprietary 5Ghz WiFi connection. Just for fun I tried the Switch controller but that did not work unfortunately, would be fun if it would work on the Wii right?

    My "Development Wii" has been soft modded years ago so the HBC on it is old and I never actually updated anything. It has been in storage for at least 3 years and even had to buy a new power supply because I lost it during a move back then. And now I have three Wii's of which two are still un-modded but I had/have plans on using them for extra testing of multiplayer options to my game later. And also for some hardware mods I wanted to do...like a fanless Wii or something.

    It has been asked before but not on this forum and I will try to give my reason for not creating a whole new video game. Since I was little games and computers fascinated me and as long as I can remember I wanted to learn how it was done. You will need artists to create graphics and animations, musicians to create an atmosphere and sound effects and level designers to create fun and challenging puzzles to solve. And before any of these creative people can start you will need a story and a theme for the game. And these are exactly the four things I am not good at to put it mildly. There is one aspect of video games that I am good at which is writing code and combining bit's and pieces to make things work. I can spend weeks researching a topic like "how does jumping work"...and I did just that actually...to learn how that should be implemented. This is what I can understand and what I can do but the creative part of animation and graphics design and music is not. It has taken me over 15 years to get skilled enough to even attempt to recreate a game like this and Batterycheck looked like a good challenge to see how far I could go with this. I started this project somewhere around June this year and I learned so many new things to get where I am now if I had to do the creative part as well I might have given up months ago. This way I have an example to follow and can see exactly how something needs to work.

    In technical terms this is also not a port although I can understand someone might see it that way. I do not have the original source code to work with and that is my definition of porting...you need the original source to do that and that's why I prefered to call it a remake instead. I do have plans for additional remake's of other platform games and reusing their graphics to work with my game engine but if at some point I get inspired to learn how to animate things I might create a new game after all.

    I hope that answers your question a bit.
     
    Last edited by Archerite, Dec 8, 2018 at 11:17 AM
    MaildroidX and niuus like this.
  20. migles

    migles All my gbatemp friends are now mods, except for me

    Member
    13
    GBAtemp Patron
    migles is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Sep 19, 2013
    China
    Earth-chan
    weird as well, i was about to state that GBI means game boy interface and that extention might be a configurable file or something but that file doesn't exist in the gbi releases, so i dont know what it is..
    anyway, in looking for the GBI (the gameboy interface, not that weird file) there seems to be instructions how to make a bootable iso out of the game boy interface, you might grab that as an idea http://retrorgb.com/gameboyinterface.html they also provide in a link a windows iso maker http://wiki.gbatemp.net/wiki/GC_Bootable_Disc_GUI

    i would suggest to research how to make it as a DOL instead of a full iso, (dol is i believe an executable for the gamecube)

    i have a gamecube with SD media launcher, its an action replay disc with an sd gecko (sd gecko is a simple passive adapter to insert a sd card into the memory card slot) which i can load homebrew like swizz or gbi (game boy interface) trough an sd card (they are DOL files)
    SWISS then allows me to launch ISO files that are in the SD card
    if you require real testing, i can't write the discs because i am out of mini dvd-r discs and didn't find yet a mini dvd+-RW disc that works in my console
    BUT i can load them trough the sd card which shouldn't make a difference.

    but i believe if you want to test it you can simply use the dolphin emulator for that

    EDIT: found this as well which explains a bit what that weird file is:http://gc-linux.org/wiki/Building_a_Bootable_Disc
    EDIT2: well after reading the rest of the post (i wrote this post while half reading the thread so i wouldn't forget what i wanted to say lol) well i should read the thread before hitting the reply button more often because the links i shared, someone already shared :P
    but anyway like i said, have a real gamecube can test the game if ya need, send me a pm
     
    Last edited by migles, Dec 8, 2018 at 12:11 PM
Loading...