Original Post

Hello, I am a new member! I am going to put myself through an intensive five weeks of creating a VB game. If there is any advice you guys have to offer, it would be greatly appreciated. I will keep everyone up to date of the process and I will be happy with any feedback.

26 Replies

Do you currently have any ideas for the game you want to create?

Currently the idea is a on-rails platformer running game. To avoid obstacles the player would have to hop to platforms in either the foreground or the background. Like in Wario Land when you can jump to the background, but this will be a necessity to avoid objects. This idea will either be developed more or changed as time goes on. At the moment I am trying to get the compiler to work, but I am getting error messages.

FuriousJorge, what version of the compiler are you using? What errors are you getting?

I have recently got the compiler to work. I am using the GccVB CVS 06-20-05 version

FuriousJorge wrote:
Currently the idea is a on-rails platformer running game. To avoid obstacles the player would have to hop to platforms in either the foreground or the background. Like in Wario Land when you can jump to the background, but this will be a necessity to avoid objects.

This sounds extremely fun. Also, would be a game where the 3D is a distinguishing gameplay element. :thumpup:

Soooo, I am trying to create parallax scrolling for the background, but due to my poor programming skills I am having difficulty programming an image to scroll across the screen. I am also having difficulty figuring out how to create screen wrapping. Does anyone have any tips? I would greatly appreciate it! 🙂

FuriousJorge wrote:
Soooo, I am trying to create parallax scrolling for the background, but due to my poor programming skills I am having difficulty programming an image to scroll across the screen. I am also having difficulty figuring out how to create screen wrapping. Does anyone have any tips? I would greatly appreciate it! 🙂

Parallax scrolling is just scrolling two (or more) images at different speeds. Do you know how to scroll one image yet? That might be a good place to start 😉

The wiki and the available demo code are both good sources of info.

It might be handy to get a github account so you can share your code and other people can help you work on it (assuming you want people to help ;-)).

This does sound like a pretty fun game—to both play and program. I really want to help you get this project off the ground. I’ve already got some ideas for features that might add depth (no pun intended) to the game mechanic. PM me if you want to hear them.

OK, so I figured out how to scroll multiple images in different directions and speeds and created a screen wrap effect. Now I just need to create a background to scroll across the screen. Do you guys recommend using VIDE for art?

It has a somewhat steep learning curve, but I definitely recommend using gritVB and a standard paint program for graphics.

When you get it all set up, graphics changes are as simple as editing an image (I suggest using .PNGs) in a paint program (lots of free ones to choose from) and running “make” (or whatever build utility you use).

It’s basically a “compiler” (or maybe decompiler…) for images. It takes an image file, reduces it to the VB’s four grey scales (if needed), chops it into chars, and outputs the chars and bgmap(s) as either C, assembly, or raw binary.

I haven’t used it all that much, but I can help you figure it out. Of course, dasi’s the one who patched the original grit to make it, so he probably knows more about it than I do.

BTW, I’m still not sure what you mean by a “screen wrap effect.” Surely you want levels that are longer than one screen width, right? The VB can stick up to 8 bgmaps together as one, long horizontal (or vertical) strip. That’s 4096 pixels wide! (Of course, that’s not really needed for a scrolling level, but it helps).

Sooo, this project has shown me how atrocious my programming skills are 😛 Could someone give me an example of how to display two images in C? I am able to display and manipulate one loaded image, but I cannot get another one to work! Thanks!

FuriousJorge wrote:
Sooo, this project has shown me how atrocious my programming skills are 😛 Could someone give me an example of how to display two images in C? I am able to display and manipulate one loaded image, but I cannot get another one to work! Thanks!

It would be easier if we could see your code and just tell you what to add/change to get more pictures showing up.

You have no reason to be self-conscious about your code. We all have to be beginners at some point. Besides, if anyone bad-mouths your code, I’ll personally go to his/her house and rip the Internet cable out of the wall! 😉

This is the code I have so far. I am having trouble displaying two images.

#include “include/world.h”
#include “include/mem.h”
#include “charset.h”
#include “charmap.h”
#include “include/joypad.h”
#include “hi.h”
#include “h.h”

int main()
{
//Copy graphics to memory

//Stick figure picture (from demo2.c)
copymem((void*)CharSeg0, (void*)CHARSET, 19*16);
copymem((void*)BGMap(0), (void*)CHARMAP, 1024*8);

//Other picture
copymem((void*)CharSeg1, (void*)HI, 51*16);
copymem((void*)BGMap(1), (void*)H, 1024*8);

//This shows stickfigure picture
vbSetWorld(31, WRLD_ON, 0, 0, 0, 0, 0, 0, 32, 40);

//How to get it to show Other picture?
vbSetWorld(28, WRLD_ON|1, 200, 0, 120, 0, 0, 0, 40, 40);

vbSetWorld(5, WRLD_END, 0, 0, 0, 0, 0, 0, 0, 0);

//Initialize registers
vbDisplayOn();

//Set brightness registers
vbDisplayShow();

return 0;
}
//Main loop (Empty because we’re done but don’t want to reach the end)
for (;;);

See notes within the code.

#include "include/world.h"
#include "include/mem.h"
#include "charset.h"
#include "charmap.h"
#include "include/joypad.h"
#include "hi.h"
#include "h.h"


int main()
{
    //Copy graphics to memory

    //Stick figure picture (from demo2.c)
    copymem((void*)CharSeg0, (void*)CHARSET, 19*16);
    copymem((void*)BGMap(0), (void*)CHARMAP, 1024*8);

    //Other picture
    copymem((void*)CharSeg1, (void*)HI, 51*16);
    copymem((void*)BGMap(1), (void*)H, 1024*8);

    //This shows stickfigure picture
    vbSetWorld(31, WRLD_ON, 0, 0, 0, 0, 0, 0, 32, 40);

    //How to get it to show Other picture?
    vbSetWorld(30, WRLD_ON|1, 200, 0, 120, 0, 0, 0, 40, 40);

    // Assuming you're copying your data properly above,
    // that should work.

    // The second argument to vbSetWorld is the flags OR'ed with
    // the number of the BGMap segment to use.

    // Since it's not working, you need to make sure you're
    // putting the BGMap and char data in the right spots.

    // I can't really guide you without seeing hi.h and h.h, but
    // it probably has something to do with the chars.
    // if you used VIDE to make the bgmaps, they're all
    // pointing to the beginning of char memory (Alberto took
    // the "segments" idea far too seriously).

    // You'll have to fix your bgmap data somehow, but, again,
    // I can't tell you what needs fixing without seeing it.

    // Note: set the "end" world as close to the used
    // ones as possible, to save time and prevent random
    // garbage on the screen
    vbSetWorld(29, WRLD_END, 0, 0, 0, 0, 0, 0, 0, 0);

    // N.B. vbSetWorld() is deprecated;
    // it's faster to use the WA array of structs.
    // If your header(s) don't contain it, look for
    // the newest headers.

    //Initialize registers
    vbDisplayOn();

    //Set brightness registers
    vbDisplayShow();

    //Main loop (Empty because we're done but don't want to reach the end)
    for (;;);

    // Note: reaching the end of "main" is not a good idea
    // (unless you want a soft reset)
    return 0;
}

What do you recommend for creating the bgmaps? (I had assumed that VIDE was the way to go…) Any particular recommendations or other tools to use?

thanks!

  • This reply was modified 13 years, 3 months ago by jzagal.

jzagal wrote:
What do you recommend for creating the bgmaps? (I had assumed that VIDE was the way to go…) Any particular recommendations or other tools to use?

thanks!

Well… a few posts up I recommended using gritVB. :rolleyes 😛

I recommend using Pro Motion 6 by cosmigo http://www.cosmigo.com/promotion/index.php it is Deluxe Paint for the new millennium. It is strictly a pixel editor so you really are not going to be able to do modern image manipulating with it but for pixel editing it rocks. It’s set up specifically to do sprites and tilesets to make drawing theese kind of games a breeze. Unfortunately I haven’t bought it because I can’t spare the cash right now but I’ve used the demo and it is on my list of must haves!

jzagal wrote:
What do you recommend for creating the bgmaps? (I had assumed that VIDE was the way to go…)

You can still use VIDE for creating bgmaps that use other than the first charseg, you just have to replace the stock “export to *.h” plugin with this.

And there’s also this 😉

  • This reply was modified 13 years, 3 months ago by DanB.

Thanks guys! The problem was with the BGmap. I used DanB’s plugin to produce a proper one, and all is fine and dandy at the moment.

Does anyone have any suggestions for an efficient way to make a scrolling background? At the moment I am just working on showing multiple bgmaps one after another, but I feel there could be a more logical way to do this…

If you want to scroll a bgmap, you can scroll the “box” that gets clipped out (the MX, MY, and MP values of the World) across a bgmap (or a row of them, using the SCX/SCY values; up to 8 bgmaps wide/tall, like I said).

Think of the MX/MY/MP values as the camera position, and the GX/GY/GP values as the position of the TV screen (i.e. usually left at the same spot, just like most TVs).

Also, make sure to synchronize your World attribute changes to the screen refresh (there are threads about that, or look in the wiki; in fact, I think you should take a break from coding and do some in-depth studying on the wiki).

 

Write a reply

You must be logged in to reply to this topic.