News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Xyphoe

Wolfenstein 3D on the CPC?

Started by Xyphoe, 19:26, 30 December 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sykobee (Briggsy)

I wish I had more than a few hours a month to spend on CPC related stuff, and that I actually spent that time doing things! Also I need to commit to a project idea, and get beyond having it on paper. I'm looking forward to norecess's IDE as that will make transforming graphics, tiles, etc a lot easier, which will give me some incentive to continue with work, SDCC, Z80, etc.


Two projects on paper with a little code - a dungeon crawler with a wolf3d style engine - maybe stylised a bit to simplify graphics and factor in my currently less-than-optimal Z80 attempts (want to try that POP/PUSH/EXX/SET/RES stuff from the other thread next), and an overhead Times Of Lore style game, but full screen with surge-scrolling (via hardware) because it will look more impressive and probably be more optimal than redrawing the entire play area. Don't bet on either of these anytime soon. I will be working from home more in the future due to changes at work so I'll be squeezing in some development that way!

TFM

Quote from: Executioner on 12:58, 14 February 11
My original ray casting Wolf3d demo did do the pixel rendering (half-byte) and also rendered the whole 128 scan lines rather than only 64. These are two quick optimisations which really would have improved the speed, but I didn't want to sacrifice the quality that much. It's a pity I never had the time to get back to it, 'cause there are a heap of improvements I've thought of over the last few years.

Well, optical yours did look way better. The other one is very nice too, but the pixels are jumping around as if they would have taken an ACID or an ASIC  ;) .


Compliment to both coders, but the first version still deserves the first place.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Optimus


QuoteSo if it is just to be a Demo, why only limit yourself to Wolf3D look alike ? you may find more artistic design or concepts.
I don't understand this. Well, because it's impressive. Isn't this what a demo is about?


QuoteSuch Game cannot realistically be good nor fun nor fast and furious...


This is something I am curious about as I will continue working on a game project with this engine. I wouldn't like it to be just a proof of concept of something technically impressive (then it WOULD make a sense for a demo but not for a game) but lack the playability. I'd still love the technical aspect of it, but could this be a good game that people would love to play?


When John Carmack from ID software wanted to make a doom franchise game on mobiles, he wasn't going like "wow, I will do doom for mobile phones and people will scream impressive" but his thought was what kind of game would be playable on mobiles. Real time fps probably not, not just because of the speed, but the controls. So he thought of the Doom RPG turn based concept with a still impressive engine. It was a good idea and it was actually quite playable. It was one of the few good mobile games I enjoyed.


So, one concept I had initially in my mind was that with a wolf3d engine it doesn't have to do wolfenstein action style. It can be a turn based maze RPG but with smoother transitions in movement, it can be other stuff too. Though, I am still thinking for my first game with this engine of a wolfenstein style realtime action. Because it's more challenging if a good game can be made with this. For mobile phones it was a no-no because of the stupid controls, but on CPC you have good controls, you only need speed. I am thinking of a hybrid action-adventure though.


Funny thing is I was talking I was fed up with demos, but there is a slight possibility I make a little demo for Forever party with this engine. In any way, the Forever deadline is a good motivation for me to speed up coding, because I will still need to finish the real time raycaster code for this demo idea (I don't want to fit another big animation), so I will also have progress with the engine for the planned game.


Anyway, with the project I spent a lot of time since my last preview to port the code from PhrozenC to SDCC and now I have a very good framework with a PC/CPC hybrid project, where I can also compile the PC project that emulates part of the CPC vram in an SDL window, so that I can write code and see results without always having to upload a binary on a dsk and starting the emulator. It totally speeds up developing! Yesterday I finally had the whole code working both on CPC and PC and it was "What you see on CPC, you see on PC" exact preview window too. Today I have finally started writting the raycasting code and hopefully I will have it working soon enough because I'd need to optimize it too for the CPC.

norecess

QuoteYesterday I finally had the whole code working both on CPC and PC and it was "What you see on CPC, you see on PC" exact preview window too.


I did that since Phat 1 days. I bet today this will become mainstream for every average CPC developer here in less than 5 years from now !

norecess

#29
QuoteI'm looking forward to norecess's IDE as that will make transforming graphics, tiles, etc a lot easier, which will give me some incentive to continue with work, SDCC, Z80, etc.
Sure, my IDE in its current state is 20-25% of what you said :)
*BUT* it's still not ready for prime-time. By example, graphic conversions are tied to MODE 0 (which I use for my own productions). To be publicly usable, it would necessit from me implementing also MODE 1 and MODE 2.. I also use the same CRTC configuration with all my prods - opening it to something more generic would require some changes graphic-side.
Still, I see interest in releasing the IDE one day publicly, it just need to be even more mature for universal usage! :)




But back to the thread, I love the direction Optimus took with its engine. Moving to SDCC was a safe bet from him ; for his game he has now access to all the power of Ansi C - which the original Doom has been developed with. I wish him all the best, I'm sure he will succeed in something great (personal message to Optimus that also want to create a demo with its engine : if you want to improve over the existing, make your demo INTERACTIVE, cf. Moody from Vanity is all-precalculated - even if they claimed on their forums it was realtime -, go a step further by giving interactivity to the demo-watcher!).

sigh

I think some sort of street racing game would be perfect for this. One type of car/Kart/bike with different colours and replacing the brick texture with office block windows. There would be less sprite data than making a 3D shooter.

Sykobee (Briggsy)


Quote from: sigh on 19:46, 20 February 11
I think some sort of street racing game would be perfect for this. One type of car/Kart/bike with different colours and replacing the brick texture with office block windows. There would be less sprite data than making a 3D shooter.


You could certainly have stacks of tyres and turn-left/right arrow signs, and thus save a little bit of time on the rendering as they would only need to stack up to eye level (whereas with the FPS they go up to ceiling level). I suspect the ray casting is going to the the time consuming part though, and an action 3D kart game really needs the FPS.

norecess

QuoteI think some sort of street racing game would be perfect for this.


Not really actually, I personally think MODE 7 technique is more adapted for racing games. Have a look at Nintendo's F-Zero (http://mo5.com/musee/jeuxvideo/images/snes/fzero/fzer10.jpg).
Perhaps the next Optimus's challenge after the raycast engine ? :)

sigh

Quote from: norecess on 20:53, 20 February 11

Not really actually, I personally think MODE 7 technique is more adapted for racing games. Have a look at Nintendo's F-Zero (http://mo5.com/musee/jeuxvideo/images/snes/fzero/fzer10.jpg).
Perhaps the next Optimus's challenge after the raycast engine ? :)

I see what you mean. It's slightly tilted upwards to give more view of the area on racing games. (I also didn't know that this was called mode 7.)
A first person shooter (Wolf style)or 3rd person (Vanquish style) does make better sense.

Optimus

Mode7 is the standard thing for mario kart style racing. I haven't coded this routine before but I had been thinking recently how would it work on CPC. I was even thinking if I could enhance the floor/ceiling with it in the wolf3d or if I should leave it as it is. I might try it soon enough.


I never thought the wolf3d engine would go for a racing game. You mean something like indoors racing? Lol! I think now of some levels in mario kart on GameCube or Wii. Why not?

Sykobee (Briggsy)

Texturing floors/ceilings is far harder as each pixel needs a ray cast, unlike the fast column rendering when you just do the walls.


However if are just going forward, and you switch to fast row rendering, you can have a racing game similar to F-Zero. However as you can see from the F-Zero screenshot it is redrawing around 2/3rds of the screen each frame at least which would be tough for an old arnold. But you don't need to ray cast - you know the distances already as you race along a 1D track with a fixed camera above it, you're not running around a 2D maze.


But how do you have a hill or a valley in the race track - well (one idea off the top of my head just now), think about ray casting fisheye - you need to divide the distance of the column by cos(angle) to correct the perspective... well, a hill would be kinda like fisheye. So you would need to divide the distance of the road by 'hillFactor' * cos(angle). A flat road has a hillFactor of 1. Increasing that creates a valley. Decreasing it creates a hill. Not a perfect hill, it's just an effect on the curvature of the road sides.

sigh


dragon

#37
QuoteMode7 is the standard thing for mario kart style racing.

mmm,not is exactly the case.Super mario kart not is made only with the mode7 of super nes.

Well,is true that uses mode 7,but it only works perfect because the cartridge of super mario kart uses de dsp-1 chip.(Math coproccesor for intensive floating point).

The mode 7 used in super mario kart,require a lot of power.Without dsp.snes can't move super mario kart.

And in f-zero,A bsx chip is used for potencier the mode 7.

arnoldemu

Quote from: Briggsy on 19:46, 22 February 11
Texturing floors/ceilings is far harder as each pixel needs a ray cast, unlike the fast column rendering when you just do the walls.
I disagree and especially in relation to SNES mode 7.

I am fairly certain it can be done with simple interpolation for each scanline.
You only need to know  the distance from the camera, and the x,y interpolation values for each line. Then you can calculate the address in the tilemap and interpolate the pixels to make each line.
Do this for every other scanline, do a byte a t a time, fill the ones in between and you're done.
It'd be blockey, but I think it could work.

Of course, no hills, but then did f-zero have this on SNES?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

einoeL

A new Alien-Adventure would be nice, Nostromo in 3D on CPC.

sigh

I'm still feeling a racing game despite it not being the appropriate viewing angle. Imagine the ground moving at the speed of supercycle, but the buildings/walls moving the speed that they are. This would give a fantastic illusion of distance with speed.

Optimus

#41
QuoteAny news on this?


Unfortunatelly the project is stalled at the moment. I was studying hard since two months for my master exams, which if I fail I don't get a third option. They end at the beginning of June so then I might get back to it.


So far, I have a very slow raycaster in C (lol) and another idea of an engine, with precalculation on the fly, which will work kinda faster if I optimize more and write this damn part in assembly (it's fun writting your CPC code in C and then you are too lazy to convert :) ), where the player could be at a center of a block and rotate around and then move to another center of near blocks, imagine something like eye of the beholder or bloodwych, but now the movement transition will be smooth and when you have stepped in another block you can freely look around 360 degrees but only move at angle of 90 degrees. When I realized this way, I dreamed of a cool RPG, so this will be another project. But I have to finish one first, too many things :)


The floor, I haven't considered putting one on my wolfenstein engine, but it would be nice to try. Yes, can be done with interpolation. On a straight raster line the increment step on the texture does not change. It changes on Z, moving on another raster line that is. So it's the same as rotozoomer but the increment step on each raster line is analogous to Z now (could be precalculated maybe). What I need to think is how to find an algorithm so that I render a floor that is not covered by the walls? I mean after rendering the walls, cover the empty remaining areas with the floor algorithm. Doom did this with some kind of flood fill algorithm. This could be tricky. Or would it be too much waste to do such an algorithm and faster anyway to just draw the entire floor and then the walls from above? With double buffering it won't be noticable and the area is small (64 * 64 bytes really). This could be selected from the options (among with other rendering options) if it prooves to be too slow for some players.

Gryzor

Good luck with the exams, mate... what field?

Optimus

It is computer graphics (no problem with that :) but also imaging and vision (some really hard subjects here)

sigh

#44
Sorry to bump this thread, but I wondering if there has been any advancements on the actual gaming elements of this amazing engine. I know that there was a demo released mid last year, but is there further work being developed on this for gaming use in 2013?

I was wondering if there were no more memory for sprites, ram could always be freed up by having the graphics in mode 2 instead.

Edit: I had accidently put mode 1!

Munchausen

#45
Just saw this and wanted to comment that I've seen a few ray casting games like this on Z80 based TI calculators (warning, these videos may hurt your eyes):



A 3D TI-83+ Game: Gemini



Elimination FPS Preview: Level 5


Though this calculator (TI-83) has a 6MHz Z80 it only has 32Kb RAM. But it's only 1 bit colour so textures are very small! And I know; seriously, it's a calculator, why?

Bryce

Quote from: Munchausen on 01:21, 11 January 13
And I know; seriously, it's a calculator, why?

Because you can.

Bryce.

beaker

Quote from: Munchausen on 01:21, 11 January 13
And I know; seriously, it's a calculator, why?

Well I know where I went wrong in my life now, I thought calculators were only good for typing rude words on  :D

sigh


fano

I'd be interested to know the screen resolution and memory layout of this machine.Btw, the source code may be very interesting.
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Powered by SMFPacks Menu Editor Mod