Original Post

How do I turn a C file into something to run in a Virtual Boy emulator? I was fiddling around with Notepad making a C file and I downloaded gccvb and VIDE, but I can’t find anything that would do this?

  • This topic was modified 15 years, 4 months ago by VirtualChris.
155 Replies

Thanks for the information. OK, so what does ‘seeding’ mean and how do I do it? Remember, I’m really new to C programming, and am figuring out a lot of stuff via examples.

First, I’d read a little here: http://en.wikipedia.org/wiki/Pseudorandom_number_generator and here: http://en.wikipedia.org/wiki/Random_seed .

From those, you should realize that the code you put in is a Pseudo-Random Number Generator (PRNG). What that means is that if you run this without a random seed, or initializing number, your results will be the same every time. With a different seed, the PRNG will create a different sequence, and therefore your octopus will move differently.

With a random seed, there will be no way to know which sequence is being generated, and will seem random (assuming you have enough bits for the seed). The more bits you have in your seed, the more possible sequences you can have (i.e. if you only have 1 bit for the seed, it will select one of two sequences).

Lets take a very simple example.

Random output = (current value * 3) + 1
current value = 0 at startup (or seeded with 0)
random sequence = {1, 4, 13, 40, …}
This will be the same sequence every time.

Now if you seed it with 2, it’ll be: {7, 22, 67, …}.

A PRNG is just a more complex equation, usually creating a more evenly distributed sequence.

So, if you have a variable that you constantly increment in your title screen loop, it’ll update so fast that the person won’t be able to press start at a precise enough time to select the same random sequence. That counter number will be your seed, and relatively random.

DogP

Here’s what the game looks like as of now. I removed the octopus, changed the sub shape and the walls back to coral. Try it out and let me know if there’s any bugs.

Attachments:

Is it possible to finish Level 22? I could not get through the top passage, no matter how often I tried.

Sorry I’ve been away for so long. I just got back in to the Virtual Boy again (it comes and goes), and this project is on my other computer. I’ve made some changes since the last time, and yes, some of the mazes are impossible, so I will get that fixed sometime this week.

I fixed and tested the levels so they should work fine. I had to get rid of a few that were unfixable, so now there’s 19 levels. I’ll be making more later this week.

Attachments:

Added one level and a few cool (IMO) features. Pressing Start during a game will pause it, and pressing Select during a game (while unpaused) will make it go back to the title screen. I am enjoying working on this, although it can be a bit frustrating at times, so excuse me if i sound overjoyed and hyper by adding lots of ROMs (this is the second one today, and probably the last one for today.)

Attachments:

Maybe you should consider getting a free account at http://github.com/

I have my own website, I’ve been putting the latest versions on it, I just put them on this one so people can download them easier, (but apparently nobody has so far.) Here’s the website for those who are interested: GoSub for Virtual Boy It’s not very pretty, but here it is in all its “glory.” I guess I should direct people to the website instead of posting ROMs on here, huh?

Well, the thing about github is that you can easily get all the source/binary files for a project, people can be given access to collaborate on a project, and people can “watch” a project; to find out when it has changed and how.

I didn’t mean you should stop posting your progress here. It was just a suggestion to maybe streamline the process a bit.

I added a very interesting but IMO difficult level (21). I hope it isn’t too hard, but if it is, please tell me.

Attachments:

I need help. I thought it would be nice for the sub to face the right direction, so I’ve added a second sprite that is the first sub sprite only horizontally flipped. Here’s my collision into the walls code:

// walls collision

	if (getBGMapChar(1, (xpos/8)+0, (ypos/8)+2)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+1, (ypos/8)+2)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+2, (ypos/8)+2)==512) j=1;
 	if (getBGMapChar(1, (xpos/8)+3, (ypos/8)+2)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+4, (ypos/8)+2)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+5, (ypos/8)+2)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+0, (ypos/8)+1)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+5, (ypos/8)+1)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+0, (ypos/8)+0)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+5, (ypos/8)+0)==512) j=1;
	if (horz==-1) goto horizontal_left_coll;
	if (horz==1) goto horizontal_right_coll;

horizontal_left_coll:
	if (getBGMapChar(1, (xpos/8)+1, (ypos/8)-2)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+1, (ypos/8)-3)==512) j=1;
	goto start_1a;

horizontal_right_coll:
	if (getBGMapChar(1, (xpos/8)+3, (ypos/8)-1)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+1, (ypos/8)-2)==512) j=1;
	if (getBGMapChar(1, (xpos/8)+1, (ypos/8)-3)==512) j=1;

Now, look at how it works in my current build. You’ll notice that it works fairly well when the sub is facing right, but it’s all screwed up facing left (level 1 is a good testing level). What is going on?

Attachments:

It seems to work fine for me no matter what direction it faces (except that the empty space behind the periscope collides ;-)). What’s wrong?

The empty space behind the periscope is registering as a hit even though it shouldn’t. You can see this in action in level 1 when the sub is facing right and you get the sub’s periscope past the first wall and press up. That shouldn’t happen, it’s acting like the periscope is hitting a non-existant wall.

I said to myself, “I’m going to work on this thing and I’m not going to get up out of this chair until the collision is the way I want it, darn it!” So after almost three hours of cussing at the computer, this is the result. I am quite happy with the way things have turned out, and now I can go on and make new levels for it.

Attachments:

Made minor changes to the collision detection and added a new level. (#25.)

Attachments:

Here’s my plans for ending the programming for this game:
I plan to fit 32 screens in it (for VR32), if there is enough space. Also, I will program a special screen if you complete all 32 levels from the beginning. This would only work if you started from level 1 and went all the way to level 32. If you started on level 2 or above, at the end, you’d go back to the title screen. Right now, there’s 27 levels. At the rate I’m going, I’d say this would be done by late December at the latest.

Attachments:

I’ve added level 28 now. I’ve also changed the file name from “gosubi” to just now “gosub”. I added the i a long time ago because there were different version titles I’ve used, (i.e. “gosuba”, “gosube”, etc.) But now I feel there doesn’t need to be a need to do that any more. Hopefully I can fit 5 or 6 more screens in 512K (4 levels, one with changing walls, and a congratulations screen.)

Attachments:

Added level 29. Only three more levels and a a congrats screen to go.

Attachments:

Maybe you should make a cool intro video for the game?
Maybe something that goes torwards the screen?
Just like the vb homebrew game tron has where you see the word tron move torwards the screen, kinda cool intro for a homebrew game 🙂

Maybe add sound?

Just saying, anyways nice game…have still not come past level 3 but one day I will win that game 😛

 

Write a reply

You must be logged in to reply to this topic.