We're using cookies to ensure you get the best experience on our website. More info
Understood
@danbRegistered September 3, 2003Active 4 years, 11 months ago
420 Replies made

VirtualChris wrote:
how would I display two seperate worlds using the same charmap?
[/code]

You are already doing exactly that with the sub and the octopus, right? Just cut from different parts of the map.

The back maze would fit below the front maze (at y:224) in your front maze map.

something like:

vbSetWorld(31, WRLD_ON|1, 0, 2, 8, 0, 0, 224, 384, 224);        // back mazes
vbSetWorld(26, WRLD_ON|1, 0, -2, 8, 0, 0, 0, 384, 224);        // front mazes 

VirtualChris wrote:
question: how do I fit two whole maps on one world?

You don’t. You still need to use two worlds, but you can have both of those worlds cut out their graphics from the same charmap, so you only need to load one charmap (and one charseg) for both worlds.

Are the white spots in the same place on every print, or is it random?

Here’s another pro tip 😉

You should be able to fit both the front and back mazes for each level over and under each other in the same map. That way you only need to use one map per level. (same technique as with the sub/octo/torpedo).

Then, have the back maze use a darker red coral than the front for an even better 3D effect.

Yeah, I have that border error in Firefox too (just didn’t mention it in my first post).

VirtualChris wrote:
Was playing with the title screen a little and was wondering if there was some type of programming that can do what I’ve tried to do for the title screen being in 3D.

When you have two different images that each should only be visible to one eye (the 3D logo in two different angles), you do like this:

Instead of using WRLD_ON, that displays the world to both eyes, do:

vbSetWorld(31, WRLD_LON, x, x, x, x, x, x, x, x); //image for left eye only
vbSetWorld(30, WRLD_RON, x, x, x, x, x, x, x, x); //image for right eye only

Place the two worlds right in front of each other, and you have your 3D effect.

Also, I think you should put back the scrolling wavy background in the levels. You can still have it even when the levels are 3D, just put it even further back, at depth 10 or so…

I tried it on the flashboy, and it works fine. Maybe just a little slower than in mednafen.

The 3D effect is alright, but here are some suggestions to make it better:

Draw a slightly smaller version of the sub that you switch to when it’s in the back layer. That will help with the illusion that it’s further away.

Right now you use depth 0 for the foreground and 2 for the background. Keep 2 for the background, but change the foreground to -2 for a deeper effect.

And put the world with the sub in between the maze worlds. Right now, when you pass behind a wall, it looks like you go in front of it.

  • This reply was modified 15 years ago by DanB.
Attachments:

VirtualChris wrote:
I got the sub moving again, and I have a question: How do I make two things share the same character? I mean, I type

	copymem((void*)CharSeg1, (void*)CORAL, 256*16);

for one, and

	copymem((void*)CharSeg2, (void*)CORAL, 256*16);

for the other. How would I make them share?

You make them share simply by ONLY copying the CORAL to Charseg1, and then you re-export the maps from VIDE, choosing “use charseg #1” for both of them.

VirtualChris wrote:
That worked for the foreground, but now the background level has no collision detection.

I see it now…
It’s because you’re using a different coral char for the background than the foreground (different charsegs containing identical graphics = waste!).

Fix it by either have both bgmap1 and bgmap2 use the same charseg (preferred, since it’s really the same graphic anyway), OR check for collision with char 1024 instead of 512 when the sub is in the background level.

Now, I know you’ve been picked on before for your coding style, but your code is still very hard to read (and thus it will take longer for us to help you find errors in it).

The worst thing is that you tend to repeat the same code over and over again, which is both redundant and inefficient.

For example, stuff like this:

// bottom front
if1 xpos=20, ypos=180, gamesubdir=0, lives=lives-1, b=1, torpedodir=0;
if2 xpos=20, ypos=180, gamesubdir=0, lives=lives-1, b=1, torpedodir=0;
if3 xpos=20, ypos=180, gamesubdir=0, lives=lives-1, b=1, torpedodir=0;
if4 xpos=20, ypos=180, gamesubdir=0, lives=lives-1, b=1, torpedodir=0;
if5 xpos=20, ypos=180, gamesubdir=0, lives=lives-1, b=1, torpedodir=0;

is a big no-no and should instead be written like:

// bottom front
if (d == 0) { 
  int i;
  for (i = 0; i < 5; i++) {
    if(getBGMapChar(1, (xpos/8)+i, (ypos/8)+2) == 512) {
      xpos = 20;
      ypos = 180;
      gamesubdir = 0;
      lives--;
      b = 1;
      torpedodir = 0;
      break;
    }
  }
}

which does the exact same thing but is alot cleaner to read. (And also faster for the poor VB to execute)

Please try to make changes like that :-(

Here’s your problem:

Change

HWORD getBGMapChar(bgmap, x, y)
{ 
    return (BGMM[(0x1000) + (y * 64) + x]&0x7FF);  
}

to

HWORD getBGMapChar(bgmap, x, y)
{ 
    return (BGMM[bgmap*(0x1000) + (y * 64) + x]&0x7FF);  
}

I don’t have exactly those, but one nice feature with mednafen (that Reality Boy doesn’t have) is that you can tweak the exact hues of red/blue RGB colors through the config file to match your glasses. Did you try that? It works pretty well for me.

That’s why the rest of your game is purple in mednafen. When there is no 3D, the red and blue images are identical, and red+blue combined equals purple 🙂

Get a pair of these:
http://www.dealextreme.com/details.dx/sku.41561

They look cool, works with mednafen and are only $2.50 including shipping 🙂

  • This reply was modified 15 years ago by DanB.

The scrolling background is a nice addition. :thumpup:
That is a perfect place to utilize one of the easiest VB 3D functions. Notice the 0 in vbSetWorld that I marked in bold/italic below? That controls the depth of that world. Simply change it to 2 or 3 to make the waves appear deeper into the screen than the rest of the graphics for a nice 3D effect! That’s all there is to it!

vbSetWorld(31, WRLD_ON, wavesX, 0, wavesY, 0, 0, 0, 384, 224);

Cool, glad to help! Just imagine all the extra features you now have room to add to the game 😀

Hint: You could even put the level graphics in the same charseg as well, and then still have different maps for the levels, but let all level maps use charseg 0 as well.

That’s easy!

When calling vbSetWorld to put for example the torpedo on screen, instead of doing this (from your code):

vbSetWorld(31, WRLD_ON|3, torpedox, 0, torpedoy, 0, 0, 0, 384, 224);

(that cuts the graphics from x:0, y:0 in the map)

do like this to call up the part of the map that contains the torpedo (at x: 0, y:24 in your new map ):

vbSetWorld(31, WRLD_ON, torpedox, 0, torpedoy, 0, 0, 24, 16, 8);

Here’s for the octopus (at x:32, y:0 in the map):

vbSetWorld(26, WRLD_ON, octox, 0, octoy, 32, 0, 0, 16, 32);

Also note that I changed the last parameters from 384,224 to the actual width and height of the graphic to get.

Here, I put together this little graphic to help understand the concept. If you do it like this, you only need to use one charseg! The other charsegs only need to be used when the first one is so shock full of graphics that you can’t possibly fit any more in it.

Attachments:

It seems to be coming along nicely, good job! Some friendly pointers though:

it goes away because I need that character segment for the torpedo.

Why would you need a whole new character segment just for the torpedo?

I’m pointing this out also because how you handled the graphics in tic-tac-toe in the same way. It seems you don’t yet fully understand how the whole chars/maps/worlds work together. There is no need to give every object in the game its own dedicated charseg for example. You can easily put both the sub, octopus and torpedo in the same charseg, even in the same charmap!

Then you just cut different parts from that same map to put in the different world layers. That way, you wouldn’t waste so much space in the rom, and you wouldn’t hit the roof of “only four objects on screen at once” that you often hit up until now.

I’m hard at work on my entry. I’m on a months vacation from work right now, so I’m giving it a little time almost every day.

I’m not going to reveal what it is just yet though, but it’s turning out to be pretty cool 😉

Why is this page broken like this? All other forum pages looks fine, so it must be something in this thread? Using Firefox 3.6.6:

Attachments:
  1. d==0) && (getBGMapChar(1, (xpos/8)+0, (ypos/8)+2)==512 []
  2. d==0) && (getBGMapChar(1, (xpos/8)+1, (ypos/8)+2)==512 []
  3. d==0) && (getBGMapChar(1, (xpos/8)+2, (ypos/8)+2)==512 []
  4. d==0) && (getBGMapChar(1, (xpos/8)+3, (ypos/8)+2)==512 []
  5. d==0) && (getBGMapChar(1, (xpos/8)+4, (ypos/8)+2)==512 []