wolfenstein demo for sega genesis

Announce (tech) demos or games releases

Moderator: Mask of Destiny

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Jan 08, 2014 5:32 am

It needed a bit of optimization for running at full screen, which I didn't bother with. Most folks just made the screen smaller (which was part of my port). I'll probably optimize the next update a bit more. I've learned a lot since that first port.

inu
Very interested
Posts: 50
Joined: Thu May 09, 2013 10:12 am

Post by inu » Wed Jan 08, 2014 9:06 pm

Chilly Willy wrote:It needed a bit of optimization for running at full screen, which I didn't bother with. Most folks just made the screen smaller (which was part of my port). I'll probably optimize the next update a bit more. I've learned a lot since that first port.
Yeah, I usually did the opposite, the bigger the game area, the better. xD
Still, an astonishing accomplishment as it is nonetheless.

Oh, that's really good to hear, I'll be looking forward to that update as well!
Finally a perfect DOS port!!

gasega68k
Very interested
Posts: 141
Joined: Thu Aug 22, 2013 3:47 am
Location: Venezuela - Caracas
Contact:

Post by gasega68k » Wed Jan 08, 2014 11:30 pm

I have to apologize for my last post (for my bad English), so I'll correct it.
There's something I did in my demo to achieve better performance with sprites ( for better speed and save space in rom) is that I have reduced the size of the sprites, originally all sprites have a 64x64 size , but almost none used all space, for example the guard standing in front has a "size" of 22x48 , and the sprite key has a "size" of 27x11 , etc. . In my engine, for ysize only have two possible sizes 32 and 64, and the xsize can be almost any size (64, 62 , 60, 58 ... ) , but there must be a space at the beginning and end . For example for the guard who has a size of 22x48 , in my demo is 24x64 , and the key that has a size of 27x11 , in my demo is 32x32 .
For this, I have managed to reduce a good percentage of space in rom for sprites , for example in the static sprites , which are 48, would have 192KB ( 48 x 4096) , in my demo occupies a space of about 105kB and the obj guard having a total of 49 frames, would have 196KB ( 49 x 4096) , in my case has a space of about 88KB. :)
inu wrote:As a curiosity does the rom, as it is, run ~17% slower on PAL Mega Drives, or only the music is slower? Or both run at exactly the same speed, except the PAL version gets more FPS? And is it technically possible for the game to detect the difference and adapt the music speed?
I do not know if would be easier to make a PAL version, because there are several variables that depend on the frames per second that would have to change so that PAL has the same speed, eg movements (walking, running, etc).

gasega68k
Very interested
Posts: 141
Joined: Thu Aug 22, 2013 3:47 am
Location: Venezuela - Caracas
Contact:

Post by gasega68k » Sat Jan 11, 2014 4:16 am

New version of rom available. :)
In this version I've added all the music tracks that are in the 10 levels (6 music tracks), now the menus are nearly complete, you can enter the menu of options during the game by pressing Start + C and change what you want and return to the game by pressing B.
For these days did not have much time, so I did nothing more, I took more time than I thought to do the songs.
Here is the new version:
http://www.mediafire.com/download/lbwpw ... o_b5.5.rar

Orion_
Very interested
Posts: 52
Joined: Mon May 02, 2011 2:26 pm
Location: France
Contact:

Post by Orion_ » Wed Jan 15, 2014 2:20 pm

This is pretty impressive ! the speed is really fast, I didn't know we could do more dma transfer by disabling the display (even if the screen is smaller then)
I'm trying to make a raycaster too, but I have some approximation error when using fixed point math, I really don't know how to get around this :/
I use this tutorial http://www.permadi.com/tutorial/raycast/rayc7.html
and 8.8 fixed math, but sometimes I get overflow, and ray intersection error.
how did you get around this gasega68k ?

Image
Retro game programming !

gasega68k
Very interested
Posts: 141
Joined: Thu Aug 22, 2013 3:47 am
Location: Venezuela - Caracas
Contact:

Post by gasega68k » Wed Jan 15, 2014 9:26 pm

Orion_ wrote:This is pretty impressive ! the speed is really fast, I didn't know we could do more dma transfer by disabling the display (even if the screen is smaller then)
I'm trying to make a raycaster too, but I have some approximation error when using fixed point math, I really don't know how to get around this :/
I use this tutorial http://www.permadi.com/tutorial/raycast/rayc7.html
and 8.8 fixed math, but sometimes I get overflow, and ray intersection error.
how did you get around this gasega68k ?
Well, I tried many examples of raycast and that was one of them, but always got errors like you mentioned. :(
I suggest you try this: http://lodev.org/cgtutor/raycasting.html
it works differently to others and with no errors, it may seem complicated, but actually it is not so, you can greatly improve using various "LUT", especially in l "DeltaDistX" and DeltaDistY "I did a demo on sega genesis, using this source with several LUT, and worked a little faster than this demo of Wolf3D, but I could not use this source to Wolf3D demo, because I could not make it work the doors (visually).
Although you can also try the source of Wolf3D.

Orion_
Very interested
Posts: 52
Joined: Mon May 02, 2011 2:26 pm
Location: France
Contact:

Post by Orion_ » Thu Jan 16, 2014 3:43 pm

I finally got it working, thanks !
I already tried this tutorial before, but gave up because of the "plane/dir" variable which didn't used angle, and because I couldn't make this part work with fixed point.
Now finally I found a way to convert an angle to plane/dir value quite easily, plus an sqrt table and the "Bresenham" style ray casting which should make it quite faster !
Retro game programming !

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Jan 16, 2014 7:39 pm

If you realize that the square root calculation in raycasting is a distance calculation, you can use an approximation that is faster that works well enough for raycasting. Here's code I used in my SCD Wolf demo.

Code: Select all

static uint32_t approxDist(int32_t dx, int32_t dy)
{
    uint32_t min, max;

    if (dx < 0) dx = -dx;
    if (dy < 0) dy = -dy;

    if (dx < dy )
    {
        min = dx;
        max = dy;
    }
    else
    {
        min = dy;
        max = dx;
    }

    // coefficients equivalent to ( 123/128 * max ) and ( 51/128 * min )
    return ((max << 8) + (max << 3) - (max << 4) - (max << 1) +
             (min << 7) - (min << 5) + (min << 3) - (min << 1)) >> 8;
}

buricco
Interested
Posts: 10
Joined: Sat Jan 18, 2014 5:09 am

Post by buricco » Sat Jan 18, 2014 5:11 am

Signed up just to say I've been following this thread for a while and it's pretty epic.

Coming along nicely!

gasega68k
Very interested
Posts: 141
Joined: Thu Aug 22, 2013 3:47 am
Location: Venezuela - Caracas
Contact:

Post by gasega68k » Sat Feb 01, 2014 7:51 pm

Hi I'm here again with a new update of the rom.
Now all the movements of the guards are complete, shooting, walking, chasing, and can also kill the player, now it's a game!.
I have also fixed some errors, for example in the animation of the weapon/hands, by mistake, skipped the frame1 (passed from frame 0 to 2), is now corrected.
I also optimized a little sprite drawing routine, now is 38 cycles per column faster.
Here is the new version: :D
http://www.mediafire.com/download/j9a44 ... emo_b6.rar

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sat Feb 01, 2014 8:19 pm

Thanks a tons and congratulations ! You finally made it ! Because of your continuous optimizations the (almost) final is as fast if not faster from the original concept, awesome accomplishment gasega68k ! And you made it all along alone, you can be proud of it :)
The game is so close from the original in term of gameplay =) the IA, animations, everything is here, not cut here and there as almost every others console version ! Well done again !

gasega68k
Very interested
Posts: 141
Joined: Thu Aug 22, 2013 3:47 am
Location: Venezuela - Caracas
Contact:

Post by gasega68k » Sat Feb 01, 2014 8:39 pm

Thank you very much for your comments, Stef. Now to make the other enemies will be easier, since they share almost all the same routines: walking, shooting, chasing, etc. :D

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sat Feb 01, 2014 9:00 pm

gasega68k wrote:Thank you very much for your comments, Stef. Now to make the other enemies will be easier, since they share almost all the same routines: walking, shooting, chasing, etc. :D
Yeah, i guess it's almost a matter of sprites. Maybe some new action but definitely, you made the hard part !
I saw the red palette fade effect when you get hit is not yet done but that is some polish stuff you will probably do at end :)

haroldoop
Very interested
Posts: 160
Joined: Sun Apr 29, 2007 10:04 pm
Location: Belo Horizonte, MG, Brazil

Post by haroldoop » Sun Feb 02, 2014 12:08 am

Looking better and better... :)

ICEknight
Very interested
Posts: 51
Joined: Mon Apr 23, 2012 10:41 am

Post by ICEknight » Sun Feb 02, 2014 1:04 am

Wow, this feels more like an official port with each version, great work!

I'd only suggest moving the fire button to B, to make it easier to shoot while strafing. As a reference, the controls in Doom 32X were as follows:

Code: Select all

6-Button
========
A -> Run
B -> Fire
C -> Open / Strafe
X -> Scroll up weapons
Y -> Scroll down weapons
Z -> Automap
START -> Pause

3-Button
========
A -> Run
B -> Fire
C -> Open / Strafe
START -> Pause
START+A -> Scroll through weapons
START+C -> Automap
For the menus, I think pressing C to make a selection would be more "standard" than A, and just feel more natural since it's the closest button to the thumb.

Post Reply