You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#11
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/1 5:39
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (14 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Thanks for the comments... yeah, the player 3D effect isn't perfect on all characters because I'm using kart images from the SNES SMK, and to get the 3D effect I'm using images of a turn slightly off center on each eye, but the original images aren't necessarily good for stereoscopic viewing. I think it looked better than 2D cutouts like I originally was using though, and I plan on tweaking/redoing the graphics for the characters in the future.

The affine ground and parallax are probably not perfect, and I plan on checking over it again in the future, but especially when a map is rotated at intermediate angles there is inherently less precision in the affine tables. Of course imperfections are more visible with textured ground rather than plain ground, but tracks like the Ghost House are much cooler looking than the untextured track in Mario Circuit IMO.

Overall, the minor imperfections weren't worth spending too much time on though, since the idea is to be racing rather than staring at the track ;-). I thought it was more important (and fun) to add some interesting things like having Lakitu, background music, speech, sound effects, rotating camera, etc.

DogP
Top

#12
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/1 8:31
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (14 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Alright... for the people too lazy to burn this to a cart, or those without a cart, here's a video I posted of it on youtube: http://www.youtube.com/watch?v=k2FKFqO8Kpw .

Oh, and to answer the questions about controls... the right trigger is gas, B the is brake/reverse, the left trigger is jump, the left D-Pad turns, and the right D-Pad changes camera angle.

To get the boost at startup you have to do a burnout while waiting for the light to go "green". If you do a burnout too long it stalls... and to get the most boost, you want your engine to be at max rev, and you have to let off the brake the moment before the light changes (if you're holding the brake after the light changes, you spin the tires at the start). It's a little more complex than most Mario Kart games, but I find them to be too easy, and this way can give you a partial boost if you're close, but it's really tough to get the max boost.

DogP
Top

#13
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/1 17:07
Nintendoid!
Joined 2006/3/15
Ecuador
224 Posts
PVBCC 3rdCoderLong Time User (11 Years)
Hey DogP, I'm really curious about what kind of tricks are you putting off to made all those affine calculations.

I've changed the code provided in libgccvb to use always fixed point math:

typedef struct PDx_ST {
fix7_9 pa;
fix13_3 pb;
fix7_9 pc;
fix13_3 pd;
fix13_3 dx;
fix13_3 dy;
s16 paralax;
} PDx_ST ;

and using the following code to write the param table:


void affineSetAll(u16 param, PDx_ST * pdx, s16 max) {
s16 i ;
AFFINE_ST *affine;
affine = (AFFINE_ST*)PARAM(param);
CACHE_ENABLE;
for (i = 0; i < max; i++) {
fix13_3 iFix = ITOFIX13_3(i);
affine[i].pb_y = FIX13_3_MULT(iFix, pdx->pb) + pdx->dx;
affine[i].paralax = pdx->paralax;
affine[i].pd_y = FIX13_3_MULT(iFix , pdx->pd) + pdx->dy;
affine[i].pa = pdx->pa;
affine[i].pc = pdx->pc;
}
CACHE_DISABLE;
}


but I suspect it is still too slow, are you writing your functions in asm?

jorgeche
Top

#14
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/1 17:25
Nintendoid!
Joined 2007/8/8
Great Britain
201 Posts
CoderContributorHOTY09 EntryLong Time User (10 Years) App Coder
jorgeche, you might find some useful tips here:

http://www.coranac.com/tonc/text/mode7.htm
http://www.coranac.com/tonc/text/mode7ex.htm
Top

#15
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/1 17:29
Nintendoid!
Joined 2006/3/15
Ecuador
224 Posts
PVBCC 3rdCoderLong Time User (11 Years)
Thanks dasi.

jorgeche
Top

#16
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/2 3:03
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (14 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Nope... no ASM (yet). I'm not using the affineSetAll function though... I've rolled the initial calculations of the pa, pb, etc into the same loop, taking out parts that are constant throughout the calculation, and enabling cache over the entire loop (the pa, pb, etc calculations take the majority of the time since the affineSetAll stuff can be done w/ just bit shifts and a few additions). I actually have some other speed improvements that I took out while I was debugging some other stuff which I haven't put back in, since it was working fine, so I'll put them back soon and see what happens.

DogP
Top

#17
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/2 4:27
Nintendoid!
Joined 2006/3/15
Ecuador
224 Posts
PVBCC 3rdCoderLong Time User (11 Years)
Do you mean something like this?

void affineScale(u16 param, fix7_9 zoomX, fix7_9 zoomY,
ииииииииииииииииииииииииииииииииииииs16 bg_x, s16 bg_y, s16 fg_x, s16 fg_y) {
ииииииииPDx_ST pdx;

ииииииииCACHE_ENABLE;

ииииииииif(zoomX < 0){

ииииииииииииииииииfg_x *= (-1);
ииииииии}

ииииииииpdx.pa = FIX7_9_DIV(ITOFIX7_9(1), zoomX);
ииииииииpdx.pb = ITOFIX13_3(0);
ииииииииpdx.pc = ITOFIX7_9(0);
ииииииииpdx.pd = FIX7_9TOFIX13_3(FIX7_9_DIV(ITOFIX7_9(1), zoomY));

ииииииииpdx.dx = ITOFIX13_3(bg_x - (fg_x));
ииииииииpdx.dy = ITOFIX13_3(bg_y-(fg_y));

ииииииииpdx.paralax = 0x0000;

ииииииии{
ииииииииииииииииAFFINE_ST *affine = (AFFINE_ST*)PARAM(param);

ииииииииииииииииAFFINE_ST source = {
ииииииииииииииииииииииииииииииииpdx.dx,
ииииииииииииииииииииииииииииииииpdx.paralax,
ииииииииииииииииииииииииииииииииpdx.dy,
ииииииииииииииииииииииииииииииииpdx.pa,
ииииииииииииииииииииииииииииииииpdx.pc

иииииииииииииии};

ииииииииииииииииint max = FIX7_9TOI(FIX7_9_MULT(ITOFIX7_9(fg_y << 1), zoomY));

ииииииииииииииииint i = 1;
ииииииииииииииииaffine[0] = source;
ииииииииииииииииfor (; i < max; i++) {

ииииииииииииииииииииииииfix13_3 iFix = ITOFIX13_3(i);

ииииииииииииииииииииииииsource.pb_y = FIX13_3_MULT(iFix, pdx.pb) + pdx.dx;
ииииииииииииииииииииииииsource.pd_y = FIX13_3_MULT(iFix, pdx.pd) + pdx.dy;

ииииииииииииииииииииииииaffine[i] = source;
ииииииииииииииии}
ииииииии}
ииииииииCACHE_DISABLE;
}

jorgeche
Top

#18
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/2 4:57
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (14 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
Yeah, all in one function like that, and cache enabled around the whole thing. Of course I'm doing scaling, rotation, and a tilted view, so mine does a lot more computation than that, but I was able to break down all the variables and move some of the calculations outside of the loop and do minimal expensive calculations inside the loop.

DogP
Top

#19
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/2 5:10
Nintendoid!
Joined 2006/3/15
Ecuador
224 Posts
PVBCC 3rdCoderLong Time User (11 Years)
Cool thanks!, I plan to have different methods for rotating/scaling/skew, etc, to make my Sprite interface very simple:


void Sprite_scale(Sprite this);

void Sprite_rotate(Sprite this, int angle);

and doing the heavy stuff there.

jorgeche
Top

#20
Re: [ENTRY] Mario Kart Virtual Cup
Posted on: 2008/10/2 23:54
VUE(xpert)
Joined 2007/10/27
Sweden
400 Posts
ContributorLong Time User (10 Years) 40+ Game Ratings
good game, to bad all the levels are from snes and there are no unique vb levels but still very good

Hope the game will be made within a year, cant wait ;)
Top

 Top   Previous Topic   Next Topic


Register To Post